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 |
|---|---|---|---|---|---|---|
C.Reg08 A forename must be given | @Test
public void testMissingForename() {
for (String forename : new String[]{"", null}) {
registerUser(username, password, password, email, email, forename, surname, null);
assertNull(userService.getUser(username));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void setFistName(String fname) {\n\t\tif (fname == null) {\r\n\t\t\tthrow new IllegalArgumentException(\"Null argument is not allowed\");\r\n\t\t}\r\n\t\tif (fname.equals(\"\")) {\r\n\t\t\tthrow new IllegalArgumentException(\"Empty argument is not allowed\");\r\n\t\t}\r\n\t\tthis.first_name = fname;\r\n\t}",
"private static boolean isValidRegattaName(String name) {\n\t\tif(name.length() == 0) {\n\t\t\tSystem.out.println(\"\\nRegatta names must be atleast one character!\"); \n\t\t\treturn false;\n\t\t}\n\n\t\tif(name.indexOf('.') == -1 && name.length() != 0) return true;\n\t\telse {\n\t\t\tSystem.out.println(\"\\nRegatta names cannot have \\'.\\' in them!\"); \n\t\t\treturn false;\n\t\t}\n\t}",
"public FirstName(String entryString){\n super(entryString);\n }",
"String fullName();",
"public abstract String fullName();",
"public abstract String fullName();",
"public void setFname(String fname) {\n\tthis.fname = fname;\n}",
"protected void validateFirstName(){\n Boolean firstName = Pattern.matches(\"[A-Z][a-z]{2,}\",getFirstName());\n System.out.println(nameResult(firstName));\n }",
"private static String getRegattaName() {\n\t\tString name = \"\";\n\n\t\tSystem.out.println(\"\\nPlease enter a name for the regatta...\");\n\t\tdo {\n\t\t\tSystem.out.print(\">>\\t\");\n\t\t\tname = keyboard.nextLine().trim();\n\t\t\tif(\"exit\".equals(name)) goodbye();\n\t\t} while(!isValidRegattaName(name) || name.length() == 0);\n\n\t\treturn name;\n\t}",
"String getFullName();",
"public static void main(String[] args) {\n\t\tString fname=\"shahin\",lname=\"Shahin \",fullname=fname+lname;\r\n\t\tString name=\"I live in india\";\r\n\t\tSystem.out.println(\"fname equals lname is \"+fname.equals(lname));\r\n\t\tSystem.out.println(\"fname equals lname is \"+fname.equalsIgnoreCase(lname));\r\n\t\tSystem.out.println(\"fname starts with \"+ \"'shah is'\"+fname.startsWith(\"shah\"));\r\n\t\tSystem.out.println(\"fname ends with \"+ \"'in is'\"+fname.endsWith(\"in\"));\r\n\t\tSystem.out.println(\"fname upper \"+ fname.toUpperCase());\r\n\t\tSystem.out.println(\"lname lower \"+ lname.toLowerCase());\r\n\t\tSystem.out.println(\"lname substring\"+ lname.substring(2));\r\n\t\tSystem.out.println(\"lname substring length\"+ lname.substring(2,3));\r\n\t\tSystem.out.println(\"Trim is \"+ lname.trim());\r\n\t\tSystem.out.println(\"fname equals lname is \"+fname.replace(\"a\", \"b\"));\r\n\t\tSystem.out.println(\"split \"+name.split(\" \")[2]);\r\n\t}",
"public String createFamily(String name);",
"boolean validateFirstName(String First_name) {\n\t\treturn true;\n\n\t}",
"abstract void lastNameValidity();",
"String getSurname();",
"private String extarctStudentName(String record) throws noStudentNameException{\n\t\tString name = record.substring(0, record.indexOf(':'));\n\t\tname = name.trim();\n\t\tcheckNameValidation(name);\n\t\treturn name;\n\t}",
"@When(\"enter customer firstname {string}\")\n\tpublic void enter_customer_firstname(String fname) {\n\t\tsearchCust = new searchCustomerPage(driver);\n\t\tsearchCust.setFirstName(fname);\n\t}",
"public String getFamilyName() throws PDFNetException {\n/* 550 */ return GetFamilyName(this.a);\n/* */ }",
"public static void main (String[] args){\n System.out.println(\"What is your name?\");\n Scanner console = new Scanner(System.in);\n String first = console.next();\n String subfirst = first.substring(1);\n String last = console.next();\n String sublast = last.substring(1);\n\n name(first, subfirst);\n name(last, sublast);\n\n\n }",
"public void setFirstName(String fname) {\n\t\t System.out.println(\"method setFirstName(String fname) called.\");\n\t\t}",
"public Farmakeio (String fn, String ln, String ad, String tl) {\n\t fname = fn;\n\t lname = ln;\n\t address = ad;\n\t telephone = tl;\n\t}",
"java.lang.String getSurname();",
"abstract void firstNameValidity();",
"private String resolveLabel(String aLabel){\n\t\t// Pre-condition\n\t\tif(aLabel == null) return aLabel;\n\t\t// Main code\n\t\tif (aLabel == \"univ\") return null;\n\t\tString actualName = aLabel.contains(\"this/\")?aLabel.substring(\"this/\".length()):aLabel;\n\t\treturn actualName;\n\t}",
"public void MakeCommonFnameBasis()\n\t{\n\t\t{\n\t\t\tfcommon = DDUtilFile.MakeFileNameWithDateTime();\n\t\t\t\n\t\t}\n\t\t\n\t}",
"public static void isValid(String fullname) \r\n\t throws FullnameException \r\n\t {\n\t if (fullname.matches(\".*\\\\d.*\")) { \r\n\t throw new FullnameException(1);\r\n\t } \r\n\t // to check special character\r\n\t if((fullname.contains(\"@\") || fullname.contains(\"#\") \r\n\t || fullname.contains(\"!\") || fullname.contains(\"~\") \r\n\t || fullname.contains(\"$\") || fullname.contains(\"%\") \r\n\t || fullname.contains(\"^\") || fullname.contains(\"&\") \r\n\t || fullname.contains(\"*\") || fullname.contains(\"(\") \r\n\t || fullname.contains(\")\") || fullname.contains(\"-\") \r\n\t || fullname.contains(\"+\") || fullname.contains(\"/\") \r\n\t || fullname.contains(\":\") || fullname.contains(\".\") \r\n\t || fullname.contains(\", \") || fullname.contains(\"<\") \r\n\t || fullname.contains(\">\") || fullname.contains(\"?\") \r\n\t || fullname.contains(\"|\"))) {\r\n\t \tthrow new FullnameException(2);\r\n\t }\r\n\t }",
"public void setFname(java.lang.String fname) {\n this.fname = fname;\n }",
"protected void validateLastName(){\n Boolean lastName = Pattern.matches(\"[A-Z][a-z]{2,}\",getLastName());\n System.out.println(nameResult(lastName));\n }",
"private String createName(String line) {\n line = line.replace(\"(L)\",\"\").replace(\"(D)\",\"\").replace(\"(R)\",\"\").replace(\"(I)\",\"\").replace(\"(\",\"\").replace(\")\",\"\");\n String firstName;\n String middleName = \"\";\n String lastName;\n String postNominal = \"\";\n\n firstName = line.split(\",\")[1].trim();\n if (firstName.contains(\" \")){\n middleName = firstName.split(\" \")[1];\n firstName = firstName.split(\" \")[0];\n }\n lastName = line.split(\",\")[0];\n if(lastName.split(\" \")[lastName.split(\" \").length-1].toLowerCase().equals(\"iii\")\n || lastName.split(\" \")[lastName.split(\" \").length-1].toLowerCase().equals(\"ii\")\n || lastName.split(\" \")[lastName.split(\" \").length-1].toLowerCase().equals(\"sr\")\n || lastName.split(\" \")[lastName.split(\" \").length-1].toLowerCase().equals(\"jr\")){\n postNominal = lastName.split(\" \")[1];\n lastName = lastName.split(\" \")[0];\n }\n\n return firstName.trim() + \",\" + middleName.trim() + \",\" + lastName.trim() + \",\" + postNominal.trim();\n }",
"private void updateForename() {\n String mySurname = this.surnameCombo.getSelectedItem().toString();\n //Clear the forename combo\n this.forenameCombo.removeAllItems();\n //Get the list of people\n List<String> forenames = pers.getForenamesforSurname(mySurname);\n for (String str : forenames) {\n this.forenameCombo.addItem(str);\n }\n this.updateText();\n }",
"public void enterAgentFirstName(String aFName) throws Exception {\n\n\t\twdriver.findElement(By.xpath(locators.enterAgentFN)).click();\n\t\twdriver.findElement(By.xpath(locators.enterAgentFN)).clear();\n\t\twdriver.findElement(By.xpath(locators.enterAgentFN)).sendKeys(aFName);\n\t}",
"public void setGivenname(String Givenname) {\n\t\tthis.given_name = Givenname;\n\t}",
"boolean validateLastName(String Last_name) {\n\t\treturn true;\n\n\t}",
"public void whoisRealname(String nick, String realname);",
"public static void main(String[] args) {\n\n String email=\"craig_federighi@apple.com\";\n\n String firstName=email.substring(0,email.indexOf('_')) ;\n String lastName=email.substring(email.indexOf('_')+1,email.indexOf('@'));\n\n String domain=email.substring(email.indexOf('@')+1,email.indexOf('.'));\n String topLevelDomain = email.substring(email.indexOf('.')+1);\n\n\n\n String ch=\"\"+firstName.charAt(0);\n ch=ch.toUpperCase();\n\n firstName=firstName.replaceFirst(firstName.charAt(0)+\"\", \"\");\n System.out.println(\"First name: \"+ch+firstName );\n\n\n String ch1=\"\"+lastName.charAt(0);\n ch1=ch1.toUpperCase();\n\n lastName=lastName.replaceFirst(lastName.charAt(0)+\"\", \"\");\n System.out.println(\"Last name: \"+ch1+lastName);\n\n\n\n System.out.println(\"Domain: \"+domain );\n System.out.println(\"Top-Level Domain: \"+topLevelDomain);\n\n\n\n\n\n\n\n\n }",
"public void setNameofRenter(String usrName) throws Exception{\n\n\t\t/*\n\t\t * Input is invalid if an empty String is passed in.\n\t\t */\n\t\tif(usrName.length() == 0){\n\t\t\tthrow new Exception();\n\t\t}\n\t\tnameofRenter = usrName;\n\t}",
"private void validationNom(String nameGroup) throws FormValidationException {\n\t\tif (nameGroup != null && nameGroup.length() < 3) {\n\t\t\tSystem.out\n\t\t\t\t\t.println(\"Le nom d'utilisateur doit contenir au moins 3 caractères.\");\n\t\t\tthrow new FormValidationException(\n\t\t\t\t\t\"Le nom d'utilisateur doit contenir au moins 3 caractères.\");\n\t\t}\n\n\t\t// TODO checker si le nom exist pas ds la bdd\n\t\t// else if (){\n\t\t//\n\t\t// }\n\t}",
"public void setFullname(String fullname) {\n this.fullname = fullname == null ? null : fullname.trim();\n }",
"private String fullName(){\n\t\tFullName=firstName+\" \"+lastName;\n\t\treturn (initial.toUpperCase()+\".\"+\" \"+firstName.toUpperCase()+\" \"+lastName.toUpperCase());\n\t}",
"private String getQualifiedFileName() {\n\n\t\tString result = \"\";\n\t\t\n\t\tScanner keyInput = new Scanner(System.in);\n\t\t\n\t\tSystem.out.print(\"\\n Enter the qualifed file name to process. Relatives are ok. Just hit enter to stop: \");\n\t\tresult = keyInput.nextLine();\n\t\t\n\t\t\n\t\treturn result;\n\t\t\n\t}",
"String family();",
"public void getLastName() {\n\n\t}",
"public void setSupEntRegname(String supEntRegname) {\n this.supEntRegname = supEntRegname == null ? null : supEntRegname.trim();\n }",
"String getLastName();",
"String getLastName();",
"public void setFname(String fname) {\n\t\tthis.fname = fname;\n\t}",
"public String getSiteNameReguex();",
"private String checkName(String filename,int start_off){\n String name=FilenameUtil.setForwardSlash(filename);\n\n // check that it is a possibility\n if(name==null || name.length()<=0) return null;\n if(name.indexOf(matchname)<0) \n if( name.indexOf( matchname1) < 0) return null;\n if(! name.endsWith(\".class\") ) return null;\n if(name.indexOf(\"$\")>name.lastIndexOf(\"/\")) return null;\n \n // chop off the class part\n name=name.substring(start_off,name.length()-6);\n name=name.replace('/','.');\n \n return name;\n }",
"public void setFamily( String f )\n {\n family = f.toLowerCase( Locale.ENGLISH );\n }",
"public void setFirstName(String fName){\n\t\t//If the user hits cancel a null is sent. Error message to let the user know they must enter a first name. \n\t\tif(fName == null){\n\t\t\tthrow new IllegalArgumentException(\"Sorry, but a first name must be entered.\");\n\t\t}\n\t\t\n\t\t//If the name is blank then an exception is thrown to inform the user.\n\t\tif(fName.trim().equals(\"\")){\n\t\t\tthrow new IllegalArgumentException(\"The first name cannot be blank\");\n\t\t}\n\t\t//If the name is not blank then the name is stored and a true is return.\n\t\telse{\n\t\t\t//Loop to check that all characters are letters and there are no digits.\n\t\t\tfor(int x = 0; x < fName.length(); x++){\n\t\t\t\tif(Character.isDigit(fName.charAt(x))){\n\t\t\t\t\tthrow new IllegalArgumentException(\"No digits are allowed in the name.\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.firstName = fName;\n\t\t}\n\t}",
"protected abstract String getRefName();",
"public void setRealname(String realname) {\r\n this.realname = realname;\r\n }",
"public void setName(String first, String last) {\r\n // Bouml preserved body begin 00040F02\r\n\t firstName = first;\r\n\t lastName = last;\r\n // Bouml preserved body end 00040F02\r\n }",
"String getFamily();",
"String getFamily();",
"public void setFullName(String fullName) { this.fullName = fullName; }",
"public void setFirstName(String fn)\n\t{\n\t\tfirstName = fn;\n\t}",
"public void setGivenName(java.lang.String GivenName) {\n this.GivenName = GivenName;\n }",
"private void addPersonName(StringBuffer sb, final String patName) {\n\t\tStringTokenizer stk = new StringTokenizer(patName, \"^\", true);\n\t\tfor (int i = 0; i < 6 && stk.hasMoreTokens(); ++i) {\n\t\t\tsb.append(stk.nextToken());\n\t\t}\n\t\tif (stk.hasMoreTokens()) {\n\t\t\tString prefix = stk.nextToken();\n\t\t\tif (stk.hasMoreTokens()) {\n\t\t\t\tstk.nextToken(); // skip delim\n\t\t\t\tif (stk.hasMoreTokens()) {\n\t\t\t\t\tsb.append(stk.nextToken()); // name suffix\n\t\t\t\t}\n\t\t\t}\n\t\t\tsb.append('^').append(prefix);\n\t\t}\n\t}",
"public String getRealname() {\r\n return realname;\r\n }",
"void validateFullName(String firstName, String lastName, String fullName) throws FirstName, LastName {\n\t\tif (fullName.trim().equalsIgnoreCase(firstName)) {\n\t\t\tthrow new FirstName(\"last name is blank\");\n\t\t} else if (fullName.trim().equalsIgnoreCase(lastName)) {\n\t\t\tthrow new LastName(\"first name is blank\");\n\n\t\t} else {\n\t\t\tSystem.out.println(\" employee fullName: \" + fullName);\n\t\t}\n\t}",
"String getSupName();",
"public void setFornavn(String fornavn) {\n this.fornavn = fornavn;\n }",
"public static void main(String[] args) {\n\t\t\n\t\tScanner input = new Scanner(System.in);\n\t\tSystem.out.println(\"Enter fullname:\");\n\t\tString name = input.nextLine();\n\t\tinput.close();\n\t\t\n\t\t//find the index of the space between first and last names\n\t\tint spaceIndex = name.indexOf(\" \");\n\t\t//Gives the value from index 0 until spaceIndex \n\t\tString firstName = name.substring(0, spaceIndex);\n\t\t//Gives the value from spaceIndex + 1 until the last index of lastName\n\t\tString lastName = name.substring(spaceIndex + 1);\n\t\t\n\t\t\n\t\ttheNameSong(firstName);\n\t\ttheNameSong(lastName);\n\t}",
"public void setFullName( String strFullName )\n {\n this._strFullName = strFullName;\n }",
"public static void processCreateEdit(String str){\n\n\t\tString fullMatch;\n\t\tString relation1;\n\t\tString relation2;\n\t\tString name1;\n\t\tString name2;\n\n\t\tPattern pattern = Pattern.compile(INPUT_REGEX_ADD_EDIT);\n\t\tMatcher matcher = pattern.matcher(str);\n\t\twhile (matcher.find()) {\n\n\t\t\tfullMatch = matcher.group(0);\n\t\t\trelation1 = matcher.group(1);\n \t\tname1 = matcher.group(2);\n \t\trelation2 = matcher.group(3);\n \t\tname2 = matcher.group(4);\n\n \t\tSystem.out.println(\"fullMatch\" + fullMatch);\n\t\t\tSystem.out.println(\"relation1: \" + relation1);\n \t\tSystem.out.println(\"name1: \" + name1);\n \t\tSystem.out.println(\"relation2: \" + relation2);\n \t\tSystem.out.println(\"name2: \" + name2);\n\n \tif(relation1.equalsIgnoreCase(Relationships.HUSBAND.name()) && relation2.equalsIgnoreCase(Relationships.WIFE.name())){\n\n \t\t\tPerson person1 = new Person(name1, Gender.MALE);\n \t\t\tPerson person2 = new Person(name2, Gender.FEMALE);\n \t\t\tCouple couple = new Couple(person1, person2);\n\n\t\t\t\tfamilyTree.setData(couple);\n\n\t\t\t\tSystem.out.println(familyTree.getData());\n \t}\n\n \telse if(relation1.equalsIgnoreCase(Relationships.MOTHER.name()) && relation2.equalsIgnoreCase(Relationships.SON.name())){\n \t\tPerson person1 = new Person(name1, Gender.FEMALE);\n\t\t\tPerson person2 = new Person(name2, Gender.MALE);\n\t\t\t\n\t\t\t\n\t\t\tCouple couple = new Couple(person2);\n\n\t\t\tfamilyTree.addChild(couple);\n\n\t\t\tSystem.out.println(familyTree.getData());\n\t\t\t\n\t\t\tSystem.out.println(\"name found: \" + familyTree.getDescendants(familyTree, \"name\"));\n \t}\n \telse{\n \t\tFamilyTreeNode huh = familyTree.getChildren().get(0);\n \t\t\n \t\tPerson person2 = new Person(\"name\", Gender.MALE);\n\t\t\t\n\t\t\tCouple couple = new Couple(person2);\n\t\t\t\n \t\thuh.addChild(couple);\n \t}\n\n}\n\n\n\t}",
"public SecName(FrillLoc loc) {\n MyLocation = loc;\n NameFont = new FontFinder(FontList.FONT_LABEL);\n }",
"public static String starwarsname(String first, String last, String cit, String frend){\n String name;\r\n int citlen = cit.length();\r\n int frendlen = frend.length();\r\n \r\n //creating first name, taking letters from city and first name\r\n String firstname = cit.substring(citlen - 3, citlen) + first.substring(0, 3);\r\n \r\n //capitalizing the first letter and un-capitalizing the fourth letter of first name\r\n char firone = firstname.charAt(0);\r\n char firmid = first.charAt(0);\r\n firstname = Character.toUpperCase(firone) + firstname.substring(1, 3) + \r\n Character.toLowerCase(firmid) + firstname.substring(4, firstname.length());\r\n \r\n //capitalizing the first letter and un-capitalizing the fourth letter of last name\r\n String lastname = frend.substring(frendlen - 3, frendlen) + last.substring(0, 4);\r\n char lasone = lastname.charAt(0);\r\n char lasmid = last.charAt(0);\r\n lastname = Character.toUpperCase(lasone) + lastname.substring(1, 3) + \r\n Character.toLowerCase(lasmid) + lastname.substring(4, lastname.length());\r\n \r\n //adding the apostrophe before the first consonant for first and last name\r\n firstname = insertApostrophe(firstname);\r\n lastname = insertApostrophe(lastname);\r\n \r\n name = firstname + \" \" + lastname;\r\n return name;\r\n }",
"private String entryName(String name) {\n name = name.replace(File.separatorChar, '/');\n String matchPath = \"\";\n /* Need to add code to consolidate paths\n for (String path : paths) {\n if (name.startsWith(path)\n && (path.length() > matchPath.length())) {\n matchPath = path;\n }\n }\n */\n name = name.substring(matchPath.length());\n \n if (name.startsWith(\"/\")) {\n name = name.substring(1);\n } else if (name.startsWith(\"./\")) {\n name = name.substring(2);\n }\n return name;\n }",
"java.lang.String getLastName();",
"java.lang.String getLastName();",
"public NameInfo(String inFirst)\n\t{\n\t\t//Set instance data.\n\t\tfirstName = inFirst;\n\n\t}",
"public void setStaff_surname(String staff_surname) {\n this.staff_surname = staff_surname;\n }",
"public void setRealname(String realname) {\n this.realname = realname;\n }",
"private String grabNameFile(String absPath)\n {\n \t\n \t// parse filename from absolute path\n \tString[] delimSlashes = absPath.split(\"/\");\n \tString fn = delimSlashes[delimSlashes.length - 1];\n \tif (fn.substring(0, 5).equals(\"files\"))\n \t{\n \t\tfn = fn.substring(5); // removes \"files\" from the beginning which is prepended by the Android Beam API\n \t}\n \t\n \t// split string based on underscores\n \tString[] result = fn.split(\"_\");\n \t\n \tif (result.length < 3)\n \t{\n \t\t//error, this means first/last name wasn't appended\n \t\treturn null;\n \t}\n \t\n \t// the order of the names is (last,first) when sent by the sender:\n \tmFirstName = result[1];\n \tmLastName = result[0];\n \t\n \treturn fn;\n }",
"void setFullName(String fullName);",
"@Test\n\t\tvoid givenLasrName_CheckForValidationForLName_ReturnTrue() {\n\t\t\tboolean result = ValidateUserDetails.validateLastName(\"More\");\n\t\t\tAssertions.assertTrue(result);\n\t\t}",
"public void testGetOrgnlName() {\r\n MarkAttendence ma = new MarkAttendence();\r\n String name = \"John_Cena\";\r\n String modifiedName = ma.getOrgnlName(name);\r\n assertEquals(modifiedName , \"John Cena\");\r\n }",
"AlphabetNameReference createAlphabetNameReference();",
"public static void main(String args[]) throws FileNotFoundException{\n\t\tFile file = new File(\"input.txt\");\r\n\t\tScanner scan = new Scanner(file);\r\n\t\twhile (scan.hasNext()) {\r\n\t\t\tString fName = scan.next();\r\n\t\t\tString lName = scan.next();\r\n\t\t\tSystem.out.println(\"Full name is: \" + fName + \" \" + lName);\r\n\t\t}\r\n\t\t\tscan.close();\r\n\t\t\r\n\t}",
"public void testSetFullName_fixture14_1()\n\t\tthrows Exception {\n\t\tFolder fixture = getFixture14();\n\t\tString fullName = \"0123456789\";\n\n\t\tfixture.setFullName(fullName);\n\n\t\t// add additional test code here\n\t}",
"static String getFirstName() {\n\t\tScanner s = new Scanner(System.in);\n\t\tSystem.out.print(\"Enter first name: \");\n\t\tString fn = s.nextLine();\n\t\treturn fn;\n\t}",
"public String provideFullName( )\r\n {\r\n return String.format( \"%s %s\",\r\n getFirstNm( ),\r\n getLastNm( ) );\r\n }",
"public void testSetFullName_fixture15_1()\n\t\tthrows Exception {\n\t\tFolder fixture = getFixture15();\n\t\tString fullName = \"0123456789\";\n\n\t\tfixture.setFullName(fullName);\n\n\t\t// add additional test code here\n\t}",
"public void testSetFullName_fixture7_1()\n\t\tthrows Exception {\n\t\tFolder fixture = getFixture7();\n\t\tString fullName = \"0123456789\";\n\n\t\tfixture.setFullName(fullName);\n\n\t\t// add additional test code here\n\t}",
"public static boolean checkFirstName(String firstName) throws UserRegistrationException {\n check = Pattern.compile(\"[A-Z]{1}[a-z]{2,}\").matcher(firstName).matches();\n if (check) {\n return true;\n } else {\n throw new UserRegistrationException(\"Enter Valid Firstname\");\n }\n }",
"public void setFirstName(String fname) {\n firstNameField.setText(fname);\n }",
"boolean hasSurname();",
"char[] getName();",
"private static Registrant makeNewRegistrantFromUserInput() {\n\t\tString input_name = getResponseTo(\"Enter registant's first and Last name: \");\r\n\t\tRegistrant new_Registrant = new Registrant(input_name);\r\n\t\treturn new_Registrant;\r\n\t}",
"java.lang.String getFirstName();",
"java.lang.String getFirstName();",
"public void testSetFullName_fixture28_1()\n\t\tthrows Exception {\n\t\tFolder fixture = getFixture28();\n\t\tString fullName = \"0123456789\";\n\n\t\tfixture.setFullName(fullName);\n\n\t\t// add additional test code here\n\t}",
"public String getRealname() {\n return realname;\n }",
"public String getRealname() {\n return realname;\n }",
"public void setFirstname(String firstname) {\r\n\t\tthis.firstname = firstname;\r\n\t}",
"public static String getName(String rfc) {\n\t\tString result = \"\";\n\t\ttry\n\t\t{\n\t\t\tstmt = conn.createStatement();\n\t\t\tquery = \"SELECT FNAME \" + \"FROM CREDIT.CUSTOMER \" + \"WHERE RFC='\" + rfc + \"'\";\n\t\t\trs = stmt.executeQuery(query);\n\t\t\t\n\t\t\twhile (rs.next())\n\t\t\t{\n\t\t\t\tresult = rs.getString(1);\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(getMethodName(1) + \"\\t\" + result);\n\t\t\t\n\t\t} catch (SQLException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn result;\n\t}",
"public void setFullName(String value) {\n setAttributeInternal(FULLNAME, value);\n }",
"public void testSetFullName_fixture21_1()\n\t\tthrows Exception {\n\t\tFolder fixture = getFixture21();\n\t\tString fullName = \"0123456789\";\n\n\t\tfixture.setFullName(fullName);\n\n\t\t// add additional test code here\n\t}",
"public void createNewLead(String fname,String testName) throws Throwable{\r\n\t\twdlib.selectOption(getSelbtn(),flib.getExcelData(\"Leads\", testName, \"Mr/Mrs\"));\r\n\t\tfirstName.sendKeys(fname);\r\n\t\tlastName.sendKeys(flib.getExcelData(\"Leads\", testName, \"LastName\")+JavaUtils.getRanDomData());\r\n\t\tcompany.sendKeys(flib.getExcelData(\"Leads\", testName, \"Company\")+JavaUtils.getRanDomData());\r\n\t\tsaveBtn.click();\r\n\t\t\r\n\t}"
] | [
"0.57361937",
"0.564881",
"0.55844253",
"0.55647904",
"0.5518714",
"0.5518714",
"0.5517703",
"0.55067146",
"0.54844904",
"0.54332787",
"0.541417",
"0.5395655",
"0.5383769",
"0.534217",
"0.53311294",
"0.531469",
"0.53049606",
"0.52786607",
"0.5272784",
"0.5272015",
"0.5241169",
"0.51895106",
"0.5165604",
"0.5164372",
"0.51525724",
"0.5148735",
"0.51416224",
"0.51411504",
"0.513921",
"0.5127679",
"0.5127564",
"0.5123888",
"0.5108587",
"0.5107808",
"0.5107687",
"0.51041764",
"0.5097173",
"0.50797915",
"0.50635546",
"0.5060861",
"0.50545615",
"0.504636",
"0.50421214",
"0.50331223",
"0.50331223",
"0.5029942",
"0.50206447",
"0.5016315",
"0.501416",
"0.50133175",
"0.5008712",
"0.5007386",
"0.50029993",
"0.50010216",
"0.50010216",
"0.4999262",
"0.49977517",
"0.49942505",
"0.49932566",
"0.49831256",
"0.49779615",
"0.49766126",
"0.49755865",
"0.4970203",
"0.4959129",
"0.49588296",
"0.49569714",
"0.49521038",
"0.4951788",
"0.49503866",
"0.49503866",
"0.493407",
"0.4921983",
"0.49174765",
"0.49118826",
"0.49103937",
"0.49065238",
"0.48992136",
"0.48944753",
"0.48937404",
"0.48923153",
"0.4890908",
"0.4886169",
"0.48827204",
"0.48820725",
"0.4864764",
"0.4860457",
"0.48572657",
"0.48330912",
"0.48330444",
"0.4826877",
"0.4826877",
"0.48246482",
"0.48238733",
"0.48238733",
"0.4817428",
"0.4811016",
"0.4808518",
"0.48079652",
"0.48054522"
] | 0.55029523 | 8 |
C.Reg09 A surname must be given | @Test
public void testMissingSurname() {
for (String surname : new String[]{"", null}) {
registerUser(username, password, password, email, email, forename, surname, null);
assertNull(userService.getUser(username));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"java.lang.String getSurname();",
"String getSurname();",
"boolean hasSurname();",
"protected void validateFirstName(){\n Boolean firstName = Pattern.matches(\"[A-Z][a-z]{2,}\",getFirstName());\n System.out.println(nameResult(firstName));\n }",
"protected void validateLastName(){\n Boolean lastName = Pattern.matches(\"[A-Z][a-z]{2,}\",getLastName());\n System.out.println(nameResult(lastName));\n }",
"abstract void lastNameValidity();",
"boolean validateLastName(String Last_name) {\n\t\treturn true;\n\n\t}",
"public void setSurname(String s) {\n this.surname = s;\n }",
"private void validationNom(String nameGroup) throws FormValidationException {\n\t\tif (nameGroup != null && nameGroup.length() < 3) {\n\t\t\tSystem.out\n\t\t\t\t\t.println(\"Le nom d'utilisateur doit contenir au moins 3 caractères.\");\n\t\t\tthrow new FormValidationException(\n\t\t\t\t\t\"Le nom d'utilisateur doit contenir au moins 3 caractères.\");\n\t\t}\n\n\t\t// TODO checker si le nom exist pas ds la bdd\n\t\t// else if (){\n\t\t//\n\t\t// }\n\t}",
"boolean validateFirstName(String First_name) {\n\t\treturn true;\n\n\t}",
"public Boolean comprovaSurname(String name) {\n\t\treturn (rv.validateName(name));\n\t}",
"public void setSurname(String aSurname) {\n surname = aSurname;\n }",
"abstract void firstNameValidity();",
"public void setSurname(String surname) {\n this.surname = surname;\n }",
"public void setSurname(String surname) {\n this.surname = surname;\n }",
"public void setSurname(String surname) {\n this.surname = surname;\n }",
"public void setSurname(String surname) {\n this.surname = surname;\n }",
"public boolean validateLastName() {\n if (lastName.length() == 0 ){\n return false;\n }\n return true;\n }",
"public Builder setSurname(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n surname_ = value;\n onChanged();\n return this;\n }",
"void lastNameValidity(M person) {\n // Valid data\n assignValidData(person);\n assertDoesNotThrow(person::checkDataValidity);\n\n // Invalid data: fiscal code\n person.setLastName(null);\n assertThrows(InvalidFieldException.class, person::checkDataValidity);\n person.setLastName(\"AA1\");\n assertThrows(InvalidFieldException.class, person::checkDataValidity);\n }",
"public String getSurname()\r\n {\r\n return surname;\r\n }",
"void setSurname(String surname);",
"@Test (dataProvider = \"userData\")\n\tpublic void canInputFirstAndLastName(userData John) {\n\t\tboolean expected = true;\n\t\t\n\t\tboolean actual = new AutomationPracticeFormPageObject(driver, baseUrl) \n\t\t.openAutomationWebPage()\n\t\t.inputFirstName(John.getFirstName())\n\t\t.inputLastName(John.getLastName())\n\t\t.isFirstNameAndLastNameFilled();\n\t\t\n\t\tAssert.assertEquals(actual, expected);\n\t}",
"public String getSurname()\n\t{\n\t\treturn surname;\n\t}",
"private void displaySurnameFields() {\n FieldRelatedLabel surnameLabel = new FieldRelatedLabel(\"Surname\", 350, 170);\n\n invalidSurnameLabel = new InvalidFormEntryLabel(\"Surname must only contain letters,\\nspaces, dots and apostrophes\", 510, 190, false);\n\n surnameTF = new TextField();\n surnameTF.relocate(350, 200);\n surnameTF.textProperty().addListener(e->FormValidatorPokeMongo.handleName(surnameTF, invalidSurnameLabel));\n\n sceneNodes.getChildren().add(surnameLabel);\n sceneNodes.getChildren().add(invalidSurnameLabel);\n sceneNodes.getChildren().add(surnameTF);\n }",
"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 boolean validateLastName() {\n\t\treturn this.getLastName().length() > 0 && this.getLastName().length() <= 20;\n\t}",
"private String getFirstName() {\n System.out.println(\"Enter Your Last Name Of First Letter In Capital \");\n return sc.next();\n }",
"public void setLastName(java.lang.CharSequence value) {\n this.last_name = value;\n }",
"public void setLastName(java.lang.CharSequence value) {\n this.lastName = value;\n }",
"public boolean validateFirstName() {\n\t\treturn this.getFirstName().length() > 0 && this.getFirstName().length() <= 20;\n\t}",
"public Builder setSurname(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n surname_ = value;\n onChanged();\n return this;\n }",
"@Test\n\t void testLastName() {\n\t\tString expected=\"Faizan\";\n\t\tString actual=user.getLastName();\n\t\tassertEquals(expected, actual);\n\t}",
"private void validationUsername( String name ) throws Exception {\n\t\t\t if ( name != null && name.trim().length() < 3 ) {\n\t\t\t throw new Exception( \"Le nom d'utilisateur doit contenir au moins 3 caractères.\" );\n\t\t\t }\n\t\t\t}",
"public String getSurname() {\n return surname;\n }",
"public String getSurname() {\n return surname;\n }",
"public String getSurname() {\n return surname;\n }",
"public String getSurname() {\n return surname;\n }",
"public String getSurname() {\n return surname;\n }",
"public String getSurname() {\n return surname;\n }",
"public String getSurname() {\n return surname;\n }",
"public String getSurname() {\n return surname;\n }",
"public String getSurname() {\n return surname;\n }",
"public String getSurname() {\n return surname;\n }",
"@Test(priority=1)\n\tpublic void checkFirstNameAndLastNameFieldValiditywithSpecialChars(){\n\t\tsignup.clearAllFields();\n\t\tsignup.enterId(\"jane@doe.com\");\n\t\tsignup.enterFirstName(\"%%&$&(^\");\n\t\tsignup.enterLastName(\"%%&$&(^\");\n\t\tsignup.clickSubmit();\n\t\tList<String> errors = signup.getErrors();\n\t\t// given page accepts special chars into the firstname and lastname fields\n\t\tAssert.assertFalse(TestHelper.isStringPresent(errors, \"Please enter your last name.\"));\n\t\tAssert.assertFalse(TestHelper.isStringPresent(errors, \"Please enter your first name.\"));\n\t}",
"private String createName(String line) {\n line = line.replace(\"(L)\",\"\").replace(\"(D)\",\"\").replace(\"(R)\",\"\").replace(\"(I)\",\"\").replace(\"(\",\"\").replace(\")\",\"\");\n String firstName;\n String middleName = \"\";\n String lastName;\n String postNominal = \"\";\n\n firstName = line.split(\",\")[1].trim();\n if (firstName.contains(\" \")){\n middleName = firstName.split(\" \")[1];\n firstName = firstName.split(\" \")[0];\n }\n lastName = line.split(\",\")[0];\n if(lastName.split(\" \")[lastName.split(\" \").length-1].toLowerCase().equals(\"iii\")\n || lastName.split(\" \")[lastName.split(\" \").length-1].toLowerCase().equals(\"ii\")\n || lastName.split(\" \")[lastName.split(\" \").length-1].toLowerCase().equals(\"sr\")\n || lastName.split(\" \")[lastName.split(\" \").length-1].toLowerCase().equals(\"jr\")){\n postNominal = lastName.split(\" \")[1];\n lastName = lastName.split(\" \")[0];\n }\n\n return firstName.trim() + \",\" + middleName.trim() + \",\" + lastName.trim() + \",\" + postNominal.trim();\n }",
"public void setSurname(String surname) {\n this.surname = surname == null ? null : surname.trim();\n }",
"private void validateFirstNameInput(String firstName) {\n\t\t\n\t\tif(Objects.isNull(firstName) || firstName.length() < 3) {\n\t\t\tthrow new FirstNameIsNotInExpectedFormat(firstName);\n\t\t}\n\t\t\n\t}",
"@Test\n\t\tvoid givenLasrName_CheckForValidationForLName_ReturnTrue() {\n\t\t\tboolean result = ValidateUserDetails.validateLastName(\"More\");\n\t\t\tAssertions.assertTrue(result);\n\t\t}",
"void validateFullName(String firstName, String lastName, String fullName) throws FirstName, LastName {\n\t\tif (fullName.trim().equalsIgnoreCase(firstName)) {\n\t\t\tthrow new FirstName(\"last name is blank\");\n\t\t} else if (fullName.trim().equalsIgnoreCase(lastName)) {\n\t\t\tthrow new LastName(\"first name is blank\");\n\n\t\t} else {\n\t\t\tSystem.out.println(\" employee fullName: \" + fullName);\n\t\t}\n\t}",
"public String getSurname() {\n return this.surname;\n }",
"public void getFirstAndLastName( String name ){//\r\n String nameNew = name.trim();\r\n String[] arr = nameNew.split(\"\\\\s\");\r\n firstName = arr[0];\r\n lastName = arr[1];\r\n }",
"java.lang.String getFirstName();",
"java.lang.String getFirstName();",
"private static String getRegattaName() {\n\t\tString name = \"\";\n\n\t\tSystem.out.println(\"\\nPlease enter a name for the regatta...\");\n\t\tdo {\n\t\t\tSystem.out.print(\">>\\t\");\n\t\t\tname = keyboard.nextLine().trim();\n\t\t\tif(\"exit\".equals(name)) goodbye();\n\t\t} while(!isValidRegattaName(name) || name.length() == 0);\n\n\t\treturn name;\n\t}",
"private String getLastName() {\n System.out.println(\"Enter Your Last Name Of First Letter In Capital \");\n return sc.next();\n }",
"public FirstName(String entryString){\n super(entryString);\n }",
"public static boolean checkLastName(String lastName) throws UserRegistrationException {\n check = Pattern.compile(\"[A-Z]{1}[a-z]{2,}\").matcher(lastName).matches();\n if (check) {\n return true;\n } else {\n throw new UserRegistrationException(\"Enter Valid Lastname\");\n }\n }",
"private static boolean isValidRegattaName(String name) {\n\t\tif(name.length() == 0) {\n\t\t\tSystem.out.println(\"\\nRegatta names must be atleast one character!\"); \n\t\t\treturn false;\n\t\t}\n\n\t\tif(name.indexOf('.') == -1 && name.length() != 0) return true;\n\t\telse {\n\t\t\tSystem.out.println(\"\\nRegatta names cannot have \\'.\\' in them!\"); \n\t\t\treturn false;\n\t\t}\n\t}",
"public static String getValidFirstName(String aFirstName) {\n\n while (isValidFirstName(aFirstName) == false) {\n aFirstName = JOptionPane.showInputDialog(\"Please Enter Valid First Name\");\n }\n return aFirstName;\n\n }",
"public static boolean checkFirstName(String firstName) throws UserRegistrationException {\n check = Pattern.compile(\"[A-Z]{1}[a-z]{2,}\").matcher(firstName).matches();\n if (check) {\n return true;\n } else {\n throw new UserRegistrationException(\"Enter Valid Firstname\");\n }\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}",
"public void setLast_name(String last_name);",
"static void displaySalutation(String lastName) {\n System.out.println(\"Dear Mr. or Ms. \" + lastName);\n }",
"@Test\n public void LastName_WhenValid_ShouldReturnTrue() {\n RegexTest valid = new RegexTest();\n boolean result = valid.lastName(\"JAMKHANDI\");\n Assert.assertEquals(true,result);\n }",
"@Test\n public void testLastNameMinLength()\n {\n owner.setLastName(\"L\");\n assertInvalid(owner, \"lastName\", \"Last name must be between 2 and 30 characters\", \"L\");\n }",
"public String setUserLastName(){\n String lastName = \"\";\n while(lastName.isBlank()) {\n System.out.print(\"Please Enter Last Name: \");\n lastName = supplyString.get();\n }\n return lastName.trim();\n }",
"public void setLastName(String lName){\n\t\t//If the user hits cancel a null is sent. Error message to let the user know they must enter a last name. \n\t\tif(lName == null){\n\t\t\tthrow new IllegalArgumentException(\"Sorry, but a last name must be entered.\");\n\t\t}\n\t\t\n\t\t//If the name is blank then an exception is thrown to inform the user.\n\t\tif(lName.trim().equals(\"\")){\n\t\t\tthrow new IllegalArgumentException(\"The last name cannot be blank\");\n\t\t}\n\t\t//If the name is not blank then the name is stored and a true is return.\n\t\telse{\n\t\t\t//Loop to check that all characters are letters and there are no digits.\n\t\t\tfor(int x = 0; x < lName.length(); x++){\n\t\t\t\tif(Character.isDigit(lName.charAt(x))){\n\t\t\t\t\tthrow new IllegalArgumentException(\"No digits are allowed in the name.\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.lastName = lName;\n\t\t}\n\t}",
"@Test\r\n\tpublic void TC_04_verify_lastName_Mandatory_Field() {\r\n\r\n\t\thomePgObj = new Page_Home(driver);\r\n\t\tregPgObj = homePgObj.click_RegistrationLink();\r\n\t\t\r\n\t\t// Step 1: Verify the registration page is displayed\r\n\t\t\r\n\t\tflag = regPgObj.registrationPgDisplay();\r\n\t\tAssert.assertTrue(flag, \"Registration page is displayed\");\r\n\t\t\r\n\t\t// Step 2: Enter valid/mandatory registration details except last name\r\n\t\t\r\n\t\tregPgObj.enterRegistrationDetails(\"firstName\", firstName);\r\n\t\tregPgObj.enterRegistrationDetails(\"lastName\", \"\");\r\n\t\tregPgObj.enterRegistrationDetails(\"email\", email);\r\n\t\tregPgObj.enterRegistrationDetails(\"password\", password);\r\n\t\tregPgObj.enterRegistrationDetails(\"confirmPassword\", confirmPassword);\r\n\t\t\r\n\t\t// Step 3: Click on Sign in button\r\n\t\t\r\n\t\tregPgObj.clickSignInButton();\r\n\t\t\r\n\t\t// Step 4: Verify user should NOT be able to proceed further with registration as proper validation message regarding last name\r\n\t\t// is displayed\r\n\t\terrMsg = Page_Registration.getMandatoryFieldErrMsg();\r\n\t\tAssert.assertEquals(errMsg, \"Please enter a value for Last Name\");\r\n\r\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}",
"private void checkNameValidation(String name) throws noStudentNameException{\n\t\tif (name.isEmpty()){\n\t\t\tthrow new noStudentNameException(\"Student Name Cannot be Empty!\");\n\t\t}\n\t}",
"public boolean hasSurname() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }",
"@Test\n public void testLastNameLowerBound()\n {\n owner.setLastName(repeatM(2));\n assertEquals(0, validator.validate(owner).size());\n }",
"public void setLastname(String lastname);",
"public void enterlastName(String lastName) {\n Reporter.addStepLog(\"Enter last name \" + lastName + \" to last name field\" + _lastNameField.toString());\n sendTextToElement(_lastNameField, lastName);\n log.info(\"Enter last name \" + lastName + \" to last name field\" + _lastNameField.toString());\n }",
"public static void main (String[] args){\n System.out.println(\"What is your name?\");\n Scanner console = new Scanner(System.in);\n String first = console.next();\n String subfirst = first.substring(1);\n String last = console.next();\n String sublast = last.substring(1);\n\n name(first, subfirst);\n name(last, sublast);\n\n\n }",
"public boolean hasSurname() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }",
"private String extarctStudentName(String record) throws noStudentNameException{\n\t\tString name = record.substring(0, record.indexOf(':'));\n\t\tname = name.trim();\n\t\tcheckNameValidation(name);\n\t\treturn name;\n\t}",
"public static String starwarsname(String first, String last, String cit, String frend){\n String name;\r\n int citlen = cit.length();\r\n int frendlen = frend.length();\r\n \r\n //creating first name, taking letters from city and first name\r\n String firstname = cit.substring(citlen - 3, citlen) + first.substring(0, 3);\r\n \r\n //capitalizing the first letter and un-capitalizing the fourth letter of first name\r\n char firone = firstname.charAt(0);\r\n char firmid = first.charAt(0);\r\n firstname = Character.toUpperCase(firone) + firstname.substring(1, 3) + \r\n Character.toLowerCase(firmid) + firstname.substring(4, firstname.length());\r\n \r\n //capitalizing the first letter and un-capitalizing the fourth letter of last name\r\n String lastname = frend.substring(frendlen - 3, frendlen) + last.substring(0, 4);\r\n char lasone = lastname.charAt(0);\r\n char lasmid = last.charAt(0);\r\n lastname = Character.toUpperCase(lasone) + lastname.substring(1, 3) + \r\n Character.toLowerCase(lasmid) + lastname.substring(4, lastname.length());\r\n \r\n //adding the apostrophe before the first consonant for first and last name\r\n firstname = insertApostrophe(firstname);\r\n lastname = insertApostrophe(lastname);\r\n \r\n name = firstname + \" \" + lastname;\r\n return name;\r\n }",
"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 randomSurname() {\n\n String surname = this.surnames.get(intRandom(surnames.size() - 1));\n return surname;\n }",
"public Name(String firstName, String middleName, String lastName){\t\t\n\t\tthis.firstName = firstName;\n\t if(this.firstName == null)\n\t \tthrow new NullPointerException(\"First Name\");\n\t this.middleName = middleName;\n\t this.lastName = lastName;\n\t}",
"@And(\"^user enters \\\"([^\\\"]*)\\\" as Company Name$\")\n\tpublic void user_enters_as_Company_Name(String arg1) throws Throwable {\n\t\ttry {\n\t\t SeleniumOperations.setText(\"//input[@name='name']\",arg1);\n\t\t HTMLReportGenerator.StepDetails(\"pass\", \"user enters CompanyName\", \"Expected:User should able to enter CompanyName,Actual:User enters CompanyName successfully \");\n\t\t \n\t\t// String op1=\"Expected:User should able to enter Company name:\"+arg1+\",Actual:User entered Company name Successfully,Exception:NA\";\n\t \t//System.out.println(op1);\n\t\t}\n\t\tcatch(Exception ex)\n\t\t{\n\t\t\t HTMLReportGenerator.StepDetails(\"Fail\", \"user enters CompanyName\", \"Expected:User should able to enter CompanyName,Actual:Fail to enters CompanyName\");\n\t\t\t// String op1=\"Expected:User should able to enter Company name:\"+arg1+\",Actual:Fail to enter Company name ,Exception:NA\"+ex.getMessage();\n\t\t //\tSystem.out.println(op1);\n\t\t \n\t\t}\n\t}",
"public boolean firstNameTwoCharactersLong(String fName){\n boolean message = true;\n //If(firstnameLength is < 2) print to error + \"first name must be atleast 2 characters\"\n if(fName.length() < 2){\n errorMessage = errorMessage + \"The first name must be at least 2 characters long.\\n\";\n //Then make False and return\n message = false;\n }\n return message;\n\n }",
"@When(\"^I type in \\\"([^\\\"]*)\\\" in the lastname textbox$\")\n\tpublic void i_type_in_in_the_lastname_textbox(String arg1) throws Throwable {\n\t // Write code here that turns the phrase above into concrete actions\n\t\t driver.findElement(By.name(\"lastname\")).clear();\n\t driver.findElement(By.name(\"lastname\")).sendKeys(arg1);\n\t}",
"public boolean validateFirstNameLength() {\n if (firstName.length() < 2) {\n return false;\n }\n return true;\n }",
"public void setLastName(String ln)\n\t{\n\t\tlastName = ln;\n\t}",
"public boolean validateLastNameLength() {\n if (lastName.length() < 2) {\n return false;\n }\n return true;\n }",
"@Override\r\n\tpublic void setSurName(String sname) {\n\t\tif (sname == null) {\r\n\t\t\tthrow new IllegalArgumentException(\"Null argument is not allowed\");\r\n\t\t}\r\n\t\tif (sname.equals(\"\")) {\r\n\t\t\tthrow new IllegalArgumentException(\"Empty argument is not allowed\");\r\n\t\t}\r\n\t\tthis.sur_name = sname;\r\n\t}",
"public String searchLastNameUI() {\n console.promptForPrintPrompt(\" +++++++++++++++++++++++++++++++++++++++\");\n console.promptForPrintPrompt(\" + PLEASE ENTER LAST NAME TO SEARCH BY +\");\n console.promptForPrintPrompt(\" +++++++++++++++++++++++++++++++++++++++\");\n console.promptForString(\"\");\n String lastName = console.promptForString(\" LAST NAME: \");\n return lastName;\n }",
"String getLastName();",
"String getLastName();",
"public void setFirstName(java.lang.CharSequence value) {\n this.first_name = value;\n }",
"public void setFirstName(String fName){\n\t\t//If the user hits cancel a null is sent. Error message to let the user know they must enter a first name. \n\t\tif(fName == null){\n\t\t\tthrow new IllegalArgumentException(\"Sorry, but a first name must be entered.\");\n\t\t}\n\t\t\n\t\t//If the name is blank then an exception is thrown to inform the user.\n\t\tif(fName.trim().equals(\"\")){\n\t\t\tthrow new IllegalArgumentException(\"The first name cannot be blank\");\n\t\t}\n\t\t//If the name is not blank then the name is stored and a true is return.\n\t\telse{\n\t\t\t//Loop to check that all characters are letters and there are no digits.\n\t\t\tfor(int x = 0; x < fName.length(); x++){\n\t\t\t\tif(Character.isDigit(fName.charAt(x))){\n\t\t\t\t\tthrow new IllegalArgumentException(\"No digits are allowed in the name.\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.firstName = fName;\n\t\t}\n\t}",
"public java.lang.String getSurname() {\n java.lang.Object ref = surname_;\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 surname_ = s;\n }\n return s;\n }\n }",
"@Test\n\t\tvoid givenTwoSmalls_CheckForValidationForLName_RetrunFalse() {\n\t\t\tboolean result = ValidateUserDetails.validateLastName(\"more\");\n\t\t\tAssertions.assertFalse(result);\n\t\t}",
"static void displaySalutation(String firstName, String lastName) {\n //for capital first character first/last name\n lastName = (lastName.substring(0, 1).toUpperCase()) + lastName.substring(1);\n firstName = (firstName.substring(0, 1).toUpperCase()) + firstName.substring(1);\n //call displaySalutation one parameter\n displaySalutation(lastName);\n System.out.println();\n System.out.printf(\"Greeting Dear %s %s Thank you for \\nproviding with a good suggestion for our problem.\\nSoon, your solution will be reviewed.\", firstName, lastName);\n System.out.println();\n\n }",
"public boolean verifyLastName(String LastName)\r\n {\r\n LastName = LastName.trim();\r\n\r\n if(LastName == null || LastName.isEmpty() || !LastName.matches(\"[a-zA-Z]*\"))\r\n {\r\n return false;\r\n }\r\n else\r\n {\r\n return true;\r\n }\r\n }",
"public java.lang.String getSurname() {\n java.lang.Object ref = surname_;\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 surname_ = s;\n }\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"String fullName();"
] | [
"0.7699305",
"0.7551685",
"0.73862314",
"0.7201791",
"0.7105597",
"0.70281345",
"0.7026656",
"0.68602645",
"0.6806313",
"0.6720622",
"0.6685814",
"0.6591604",
"0.65736717",
"0.65713406",
"0.65713406",
"0.65713406",
"0.65713406",
"0.65666753",
"0.6536755",
"0.6480519",
"0.6479024",
"0.6472043",
"0.63924617",
"0.6390555",
"0.63546145",
"0.6354146",
"0.6328229",
"0.6325448",
"0.6324051",
"0.63085973",
"0.6256818",
"0.6251698",
"0.6250917",
"0.62426525",
"0.6236068",
"0.6236068",
"0.6236068",
"0.6236068",
"0.6236068",
"0.6236068",
"0.6236068",
"0.6236068",
"0.6236068",
"0.6236068",
"0.62299216",
"0.6229698",
"0.622138",
"0.62119496",
"0.621004",
"0.62063247",
"0.61882734",
"0.6164365",
"0.61631644",
"0.61631644",
"0.61475945",
"0.6121694",
"0.61145085",
"0.61045605",
"0.61021614",
"0.6098431",
"0.60907435",
"0.60768276",
"0.60656494",
"0.60614973",
"0.60606915",
"0.60585433",
"0.6047018",
"0.60426253",
"0.6038355",
"0.60377014",
"0.6029864",
"0.6028417",
"0.601715",
"0.6004846",
"0.6000027",
"0.59983844",
"0.5995819",
"0.5994473",
"0.5988068",
"0.5988051",
"0.59868765",
"0.5972766",
"0.5959138",
"0.595505",
"0.5942733",
"0.5935175",
"0.5924231",
"0.5919416",
"0.59134203",
"0.5904692",
"0.58945906",
"0.58945906",
"0.5893508",
"0.58928835",
"0.5889874",
"0.58753973",
"0.5874859",
"0.58736724",
"0.5869091",
"0.58675474"
] | 0.62980044 | 30 |
C.Reg10 A user should be able to register denoting their birth date | @Test
public void testBirthDate() {
registerUser(username, password, password, email, email, forename, surname, "01/01/1990");
assertNotNull(userService.getUser(username));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Date getBirthDate();",
"abstract void birthDateValidity();",
"public Date getBirthDate();",
"@Test\n public void testInvalidBirthDate() {\n registerUser(username, password, password, email, email, forename, surname, \"01011990\");\n assertNull(userService.getUser(username));\n }",
"public void setBirthdate(String birthdate) {\r\n this.birthdate = birthdate;\r\n }",
"public void setBirth_date(java.lang.String birth_date) {\n this.birth_date = birth_date;\n }",
"public void setBirth(Date birth) {\r\n this.birth = birth;\r\n }",
"public void setBirth_date(Date birth_date) {\n this.birth_date = birth_date;\n }",
"public void setBirth_date(Date birth_date) {\n this.birth_date = birth_date;\n }",
"public Date getBirthday();",
"public Date getBirth_date() {\n return birth_date;\n }",
"public void setBirth(Date birth) {\n this.birth = birth;\n }",
"public void setBirth(Date birth) {\n this.birth = birth;\n }",
"public void setBirthdate(Date birthdate) {\r\n this.birthdate = birthdate;\r\n }",
"LocalDate getDateOfBirth();",
"void setBirthDate(Date birthDate);",
"public String getBirthdate() {\r\n return birthdate;\r\n }",
"public void setBirthday() { this.birthday = birthday; }",
"public void setBirthDate(Date inBirthDate)\n {\n birthdate = inBirthDate;\n }",
"public void setBirthdate(Date birthdate)\n {\n this.birthdate = birthdate;\n }",
"public void setBirth(Date birth) {\n\t\tthis.birth = birth;\n\t}",
"public Date getBirthdate() {\r\n return birthdate;\r\n }",
"public void setDate_of_birth(String date_of_birth) {\n this.date_of_birth = date_of_birth;\n }",
"public Date getBirth() {\r\n return birth;\r\n }",
"public void setBirthDate(Date birthDate);",
"public void setBirth(String birth) {\n this.birth = birth;\n }",
"public String getBirthdate() {\n return birthdate;\n }",
"public Date getBirth() {\n\t\treturn birth;\n\t}",
"@Test\n public void testMissingBirthDate() {\n registerUser(username, password, password, email, email, forename, surname, null);\n assertNotNull(userService.getUser(username));\n }",
"public void setBirthdate(Date birthdate) {\n this.birthdate = birthdate;\n }",
"public void validate_the_Date_of_Birth_of_Security_in_Customer_Tab(String DateofBirth)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_Security.replaceAll(\"M_Header\", \"Security\").replaceAll(\"M_Category\", \"Date of Birth\").replaceAll(\"M_InnerText\", DateofBirth), \"Date of Birth - \"+DateofBirth, false);\n\t}",
"public Date getBirthdate()\n {\n return birthdate;\n }",
"@Override\n public String getDateofBirth() {\n return this.DateofBirth;\n\n }",
"public void fillDateOfBirth(String value) {\n // Only sets main dob for testing results -- Not sufficient to test dob UI itself\n dateOfBirth.sendKeys(value);\n }",
"@And(\"^Complete user data birthday and gender$\")\t\t\t\t\t\n public void Complete_user_data_birthday_and_gender() throws Throwable \t\t\t\t\t\t\t\n { \n \tdriver.findElement(By.id(\"day\")).sendKeys(\"19\");\n driver.findElement(By.xpath(\"//*[@id='month']/option[9]\")).click();\n driver.findElement(By.id(\"year\")).sendKeys(\"1994\");\n driver.findElement(By.xpath(\"//*[@id='gender']/option[2]\")).click();\n driver.findElement(By.xpath(\"//*[@id='personalDetailsNext']/content/span\")).click();\n driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\t\t\t\n }",
"public Date getBirth() {\n return birth;\n }",
"public Date getBirth() {\n return birth;\n }",
"public void setBirthday(Date birthday);",
"public Date getBirthdate() {\n return birthdate;\n }",
"public String getBirthDate() {\n\t\treturn birthDate;\n\t}",
"public Date getBirthDate() {\n\t\treturn birthDate;\n\t}",
"public Date getBirthday() { return birthday; }",
"public String getBirth()\n\t{\n\t\treturn birth;\n\t}",
"public void setBirthDate(java.util.Calendar birthDate) {\r\n this.birthDate = birthDate;\r\n }",
"public java.lang.String getBirth_date() {\n return birth_date;\n }",
"public Date getBirthdate()\n {\n return birthdate;\n }",
"public String getDateOfBirth(){\n\t\treturn dateOfBirth;\n\t}",
"@Override\n\tpublic java.util.Date getDateOfBirth() {\n\t\treturn _candidate.getDateOfBirth();\n\t}",
"public Date getDateOfBirth() {\n return dateOfBirth;\n }",
"public String getDate_of_Birth() {\n\t\treturn Date_of_Birth;\n\t}",
"public String getBirth() {\n return birth;\n }",
"public String getBirth() {\n return birth;\n }",
"public void setBirthDate(Date birthDate) {\n\t\tthis.birthDate = birthDate;\n\t}",
"public Date getBirthday() {\r\n return birthday;\r\n }",
"public Date getBirthday() {\r\n return birthday;\r\n }",
"public String getDateOfBirth(){\n return(this.dateOfBirth);\n }",
"public void setBirthdate(java.util.Calendar birthdate) {\n this.birthdate = birthdate;\n }",
"public String getBirthday(){\n return birthday;\n\t}",
"public void setDOB(String strdateofbirth){\n\t\tdriver.findElement(dateofbirth).sendKeys(strdateofbirth);;\n\t}",
"public void setBirthDate(String birthday) {\n\t\tbirthDate = birthday;\n\t}",
"@SuppressWarnings(\"static-access\")\r\n\tpublic boolean isBirthday()\r\n\t{\r\n\t\tGregorianCalendar now = new GregorianCalendar();\r\n\t\tboolean isBirthday = false;\r\n\t\tif (now.MONTH == bDate.MONTH && now.DATE == bDate.DATE)\r\n\t\t{\r\n\t\t\tisBirthday = true;\r\n\t\t}\r\n\t\treturn isBirthday;\r\n\t}",
"void birthDateValidity(M person) {\n // Valid data\n assignValidData(person);\n assertDoesNotThrow(person::checkDataValidity);\n\n // Invalid data\n person.setBirthdate(null);\n assertThrows(InvalidFieldException.class, person::checkDataValidity);\n }",
"public Date getDateOfBirth() {\n\t\treturn dateOfBirth;\n\t}",
"public void setBirthday(Date birthday) {\r\n this.birthday = birthday;\r\n }",
"public void setBirthday(Date birthday) {\r\n this.birthday = birthday;\r\n }",
"@Override\n\tpublic void UpdateDateOfBirth(Gamers gamer) {\n\t\tSystem.out.println(\"Lütfen yeni doğum gününüzü giriniz\");\n\t\tint NewDateOfBirth;\n\t\tNewDateOfBirth=sc.nextInt();\n\t\tsc.nextLine();\n\t\tgamer.setDateOfBirth(NewDateOfBirth);\n\t\tdbserviceadaptors.Save(gamer);\n\t\tSystem.out.println(\"Yeni doğum gününüz \"+NewDateOfBirth+\" olarak güncellendi.\");\n\t\t\n\t}",
"public Date geteBirthday() {\n return eBirthday;\n }",
"public Date getBirthday() {\n return birthday;\n }",
"public Date getBirthday() {\n return birthday;\n }",
"public Date getBirthday() {\n return birthday;\n }",
"public Date getBirthday() {\n return birthday;\n }",
"public String getBirthDate()\r\n\t{\r\n\t\treturn (bDate.MONTH + 1) + \"/\" + bDate.DATE + \"/\" + bDate.YEAR;\r\n\t}",
"public String getDateOfBirth() {\r\n\t\tString year = Integer.toString(datePicker.getModel().getYear());\r\n\t\tString month = Integer.toString(datePicker.getModel().getMonth()+1);\r\n\t\tString day = Integer.toString(datePicker.getModel().getDay());\r\n\t\tString date = year+\"-\"+month+\"-\"+day;\r\n\t\treturn date;\r\n\t}",
"public Date getDateOfBirth() {\n return getDate(DATE_OF_BIRTH);\n }",
"Calendar getBirth() {\n\t\treturn customer.getBirth();\n\t}",
"private void displayBirthdayFields() {\n FieldRelatedLabel passwordLabel = new FieldRelatedLabel(\"Birthday\", 350, 470);\n\n invalidBirthdayLabel = new InvalidFormEntryLabel(\"Birthday must not be\\na day in the future\", 540, 490, true);\n\n birthdayDP = new DatePicker();\n birthdayDP.relocate(350, 500);\n birthdayDP.setOnAction(e->FormValidatorPokeMongo.handleBirthday(birthdayDP, invalidBirthdayLabel));\n\n sceneNodes.getChildren().addAll(passwordLabel, invalidBirthdayLabel, birthdayDP);\n }",
"public String getBirthDate() {\r\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\r\n\t\tif (jPanelFormClient.birthdayDateChooser.getDate() != null)\r\n\t\t\treturn sdf.format(jPanelFormClient.birthdayDateChooser.getDate());\r\n\t\treturn null;\r\n\t}",
"public static void setDOB(String dob){\n setUserProperty(Constants.ZeTarget_keyForUserPropertyDOB,dob);\n int year = Integer.valueOf(dob.substring(0,4));\n int month = Integer.valueOf(dob.substring(4,6));\n int day = Integer.valueOf(dob.substring(6,8));\n Calendar cal =Calendar.getInstance();\n int currentYear = cal.get(Calendar.YEAR);\n int currentMonth = cal.get(Calendar.MONTH);\n int currentDay = cal.get(Calendar.DAY_OF_MONTH);\n int age = currentYear - year;\n if(month<currentMonth||(month==currentMonth&&day<currentDay)){\n age--;\n }\n setAge(age + \"\");\n }",
"public java.util.Date getPatientBirthDate(){\n\t\treturn patientBirthDate;\n\t}",
"public void setBirthday(Date birthday) {\n this.birthday = birthday;\n }",
"public void setBirthday(Date birthday) {\n this.birthday = birthday;\n }",
"public void setBirthday(Date birthday) {\n this.birthday = birthday;\n }",
"public Date getBirthDay() {\n\t\treturn birthDay;\n\t}",
"public String getBirthday() {\n return birthday;\n }",
"public java.util.Calendar getBirthDate() {\r\n return birthDate;\r\n }",
"public void setBirthday(String birthday) {\n if(birthday.length()==10)\n this.birthday = birthday;\n else this.birthday =\"undefined\";\n\n }",
"private Patient setPatientDOB(Date date, Patient patient){\n\t\tint year=date.getYear()+1900;\n\t\tint age=patient.getAge();\n\t\tif(age>60){\t//If patient age above 60 years then randomize the year also\n\t\t\tyear=randBetween(1990,2010);\n\t\t}\n\t\tint dayOfMonth = randBetween(1, 31);\n\t\tint month = randBetween(0, 11);\n\t\tDate d = new Date(year-1900, month, dayOfMonth); //Random date\n\t\tpatient.setBirthdate(d);\n\t\treturn patient;\n\t}",
"public Person(String inName, int inAge, Gender inGender)\n {\n name = inName;\n age = inAge;\n gender = inGender;\n\n Calendar c = Calendar.getInstance();\n c.set(Calendar.YEAR, c.get(Calendar.YEAR) - age);\n birthdate = c.getTime();\n }",
"Employee setBirthdate(Date birthdate);",
"public void setBirthDate(GregorianCalendar newBirthDate)\r\n\t{\r\n\t\tbDate = newBirthDate;\r\n\t}",
"public User(String firstName, String lastName, String username, String email, String password, String city, String country, String gender,Date birthdate, int age, int imgUser, Date last_access, Date registration_date) {\n this.firstName = firstName;\n this.lastName = lastName;\n this.username = username;\n this.email = email;\n this.password = password;\n this.city = city;\n this.country = country;\n this.gender = gender;\n this.birthdate = birthdate;\n this.age = age;\n this.imgUser = imgUser;\n this.last_access = last_access;\n this.registration_date = registration_date;\n }",
"public Date getBirthday() {\n\t\treturn birthday;\n\t}",
"public Timestamp getBirthdate() {\n return birthdate;\n }",
"void setDateOfBirth(LocalDate dateOfBirth);",
"public int birthday(int age) {//reference type\n\t\t// grow old by a year\n\t\tage = age + 1;\n\t\t\n\t\treturn age;\n\t}",
"public void setBirthDate(Timestamp birthDate) {\n this.birthDate = birthDate;\n }",
"public void setDateOfBirth(Date dateOfBirth) {\n\t\tthis.dateOfBirth = dateOfBirth;\n\t}",
"public Timestamp getBirthDate() {\n return birthDate;\n }",
"public static String getBirthDate(final String personalIdentityNumber) {\n final Integer day = Integer.parseInt(personalIdentityNumber.substring(6, 8));\n return String.format(\"%s-%s-%02d\", personalIdentityNumber.substring(0, 4), personalIdentityNumber.substring(4, 6),\n day > 60 ? day - 60 : day);\n }",
"Person(String fullName, LocalDate birthdate) throws IllegalArgumentException{\n this.fullName = fullName;\n this.setBirthdate(birthdate);\n }"
] | [
"0.7068159",
"0.69445086",
"0.6881475",
"0.68718827",
"0.68335617",
"0.68228996",
"0.67085314",
"0.6700526",
"0.6700526",
"0.663311",
"0.66238725",
"0.661786",
"0.661786",
"0.66101336",
"0.65965",
"0.65878725",
"0.65874773",
"0.6570848",
"0.65648955",
"0.6564494",
"0.6563909",
"0.65601397",
"0.6557756",
"0.65562713",
"0.6548062",
"0.65129536",
"0.6506814",
"0.6501074",
"0.6498357",
"0.6494193",
"0.64832675",
"0.64722055",
"0.6465131",
"0.6462973",
"0.6459538",
"0.642797",
"0.642797",
"0.6425613",
"0.64108473",
"0.64022636",
"0.63997793",
"0.63794124",
"0.6378294",
"0.6373267",
"0.63615423",
"0.6358292",
"0.6354054",
"0.63500285",
"0.632394",
"0.6323471",
"0.6320252",
"0.6320252",
"0.62757677",
"0.6274836",
"0.6274836",
"0.6240754",
"0.62382066",
"0.6226649",
"0.62244666",
"0.62123454",
"0.6208082",
"0.62048143",
"0.6191886",
"0.618171",
"0.618171",
"0.6178792",
"0.61531585",
"0.61432654",
"0.61432654",
"0.61432654",
"0.61432654",
"0.6143199",
"0.6126121",
"0.6122044",
"0.61045074",
"0.60987836",
"0.60711396",
"0.6061998",
"0.60555065",
"0.60492975",
"0.60492975",
"0.60492975",
"0.6040723",
"0.6033445",
"0.60324305",
"0.6029638",
"0.6023562",
"0.6015311",
"0.6010969",
"0.59919506",
"0.59893703",
"0.5988046",
"0.59805954",
"0.5961779",
"0.5960717",
"0.59570295",
"0.59454626",
"0.59423804",
"0.5933814",
"0.5932403"
] | 0.72148424 | 0 |
C.Reg11 A user should be able to register not denoting their birth date | @Test
public void testMissingBirthDate() {
registerUser(username, password, password, email, email, forename, surname, null);
assertNotNull(userService.getUser(username));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void testInvalidBirthDate() {\n registerUser(username, password, password, email, email, forename, surname, \"01011990\");\n assertNull(userService.getUser(username));\n }",
"abstract void birthDateValidity();",
"@Test\n public void testBirthDate() {\n registerUser(username, password, password, email, email, forename, surname, \"01/01/1990\");\n assertNotNull(userService.getUser(username));\n }",
"public void validate_the_Date_of_Birth_of_Security_in_Customer_Tab(String DateofBirth)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_Security.replaceAll(\"M_Header\", \"Security\").replaceAll(\"M_Category\", \"Date of Birth\").replaceAll(\"M_InnerText\", DateofBirth), \"Date of Birth - \"+DateofBirth, false);\n\t}",
"public void setBirth_date(java.lang.String birth_date) {\n this.birth_date = birth_date;\n }",
"public void setBirthdate(String birthdate) {\r\n this.birthdate = birthdate;\r\n }",
"Date getBirthDate();",
"@And(\"^Complete user data birthday and gender$\")\t\t\t\t\t\n public void Complete_user_data_birthday_and_gender() throws Throwable \t\t\t\t\t\t\t\n { \n \tdriver.findElement(By.id(\"day\")).sendKeys(\"19\");\n driver.findElement(By.xpath(\"//*[@id='month']/option[9]\")).click();\n driver.findElement(By.id(\"year\")).sendKeys(\"1994\");\n driver.findElement(By.xpath(\"//*[@id='gender']/option[2]\")).click();\n driver.findElement(By.xpath(\"//*[@id='personalDetailsNext']/content/span\")).click();\n driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\t\t\t\n }",
"void birthDateValidity(M person) {\n // Valid data\n assignValidData(person);\n assertDoesNotThrow(person::checkDataValidity);\n\n // Invalid data\n person.setBirthdate(null);\n assertThrows(InvalidFieldException.class, person::checkDataValidity);\n }",
"public void setBirth_date(Date birth_date) {\n this.birth_date = birth_date;\n }",
"public void setBirth_date(Date birth_date) {\n this.birth_date = birth_date;\n }",
"public void setBirth(Date birth) {\r\n this.birth = birth;\r\n }",
"public Date getBirthDate();",
"public void setBirthday() { this.birthday = birthday; }",
"public void setBirthDate(Date birthDate);",
"void setBirthDate(Date birthDate);",
"public void setBirth(String birth) {\n this.birth = birth;\n }",
"public void setBirth(Date birth) {\n this.birth = birth;\n }",
"public void setBirth(Date birth) {\n this.birth = birth;\n }",
"public void setDate_of_birth(String date_of_birth) {\n this.date_of_birth = date_of_birth;\n }",
"public void setBirthdate(Date birthdate) {\r\n this.birthdate = birthdate;\r\n }",
"public void setBirth(Date birth) {\n\t\tthis.birth = birth;\n\t}",
"public void setBirthdate(Date birthdate)\n {\n this.birthdate = birthdate;\n }",
"public void setBirthDate(Date inBirthDate)\n {\n birthdate = inBirthDate;\n }",
"public void fillDateOfBirth(String value) {\n // Only sets main dob for testing results -- Not sufficient to test dob UI itself\n dateOfBirth.sendKeys(value);\n }",
"public void setBirthdate(Date birthdate) {\n this.birthdate = birthdate;\n }",
"LocalDate getDateOfBirth();",
"public void setRegisterDateTime(Date dateTime) { this.registerDateTime = dateTime; }",
"public Date getBirthday();",
"public void setBirthday(Date birthday);",
"public Date getBirth_date() {\n return birth_date;\n }",
"@SuppressWarnings(\"static-access\")\r\n\tpublic boolean isBirthday()\r\n\t{\r\n\t\tGregorianCalendar now = new GregorianCalendar();\r\n\t\tboolean isBirthday = false;\r\n\t\tif (now.MONTH == bDate.MONTH && now.DATE == bDate.DATE)\r\n\t\t{\r\n\t\t\tisBirthday = true;\r\n\t\t}\r\n\t\treturn isBirthday;\r\n\t}",
"@Override\n public Date getRegistrationDate() {\n return null;\n }",
"public String getBirthdate() {\r\n return birthdate;\r\n }",
"@Override\n public String getDateofBirth() {\n return this.DateofBirth;\n\n }",
"public void setDOB(String strdateofbirth){\n\t\tdriver.findElement(dateofbirth).sendKeys(strdateofbirth);;\n\t}",
"public Date getBirth() {\r\n return birth;\r\n }",
"public String getBirthdate() {\n return birthdate;\n }",
"public Date getBirthdate() {\r\n return birthdate;\r\n }",
"public void setBirthday(String birthday) {\n if(birthday.length()==10)\n this.birthday = birthday;\n else this.birthday =\"undefined\";\n\n }",
"public User(String un, String pw, String fn, String c, String g, Date dob, Date acsd){\n this.username = un;\n this.password = pw;\n this.fullName = fn;\n this.country = c;\n this.gender = g;\n this.dob = dob;\n this.accessDate = acsd;\n }",
"public Boolean validateDate(String date_of_birth) {\n DateFormat format = new SimpleDateFormat(\"yyyy-MM-dd\");\n try {\n format.parse(date_of_birth);\n } catch (ParseException exception) {\n System.out.println(\"Invalid Input!\");\n return true;\n }\n return false;\n }",
"public static void setDOB(String dob){\n setUserProperty(Constants.ZeTarget_keyForUserPropertyDOB,dob);\n int year = Integer.valueOf(dob.substring(0,4));\n int month = Integer.valueOf(dob.substring(4,6));\n int day = Integer.valueOf(dob.substring(6,8));\n Calendar cal =Calendar.getInstance();\n int currentYear = cal.get(Calendar.YEAR);\n int currentMonth = cal.get(Calendar.MONTH);\n int currentDay = cal.get(Calendar.DAY_OF_MONTH);\n int age = currentYear - year;\n if(month<currentMonth||(month==currentMonth&&day<currentDay)){\n age--;\n }\n setAge(age + \"\");\n }",
"public void setBirthDate(java.util.Calendar birthDate) {\r\n this.birthDate = birthDate;\r\n }",
"public Timestamp getBPJSRegistrationDate();",
"Person(String fullName, LocalDate birthdate) throws IllegalArgumentException{\n this.fullName = fullName;\n this.setBirthdate(birthdate);\n }",
"public User(String firstName, String lastName, String username, String email, String password, String city, String country, String gender,Date birthdate, int age, int imgUser, Date last_access, Date registration_date) {\n this.firstName = firstName;\n this.lastName = lastName;\n this.username = username;\n this.email = email;\n this.password = password;\n this.city = city;\n this.country = country;\n this.gender = gender;\n this.birthdate = birthdate;\n this.age = age;\n this.imgUser = imgUser;\n this.last_access = last_access;\n this.registration_date = registration_date;\n }",
"public Date getBirthdate()\n {\n return birthdate;\n }",
"public void setBirthDate(Date birthDate) {\n\t\tthis.birthDate = birthDate;\n\t}",
"public static boolean isValidDOB(String userInput) {\n \n return Pattern.matches(Constants.DATE_VALIDATION, userInput);\n }",
"public BirthInfo() {}",
"public String getBirth()\n\t{\n\t\treturn birth;\n\t}",
"@Override\r\n\tpublic boolean register(String email, String id, String pw) {\n\t\treturn jdbcTemplate.update(\"insert into s_member values(?,?,?,\"\r\n\t\t\t\t+ \"'normal',sysdate)\",email,id,pw)>0;\r\n\t}",
"public Date getBirth() {\n\t\treturn birth;\n\t}",
"public Date getBirth() {\n return birth;\n }",
"public Date getBirth() {\n return birth;\n }",
"private static boolean validateAge(String age) {\n return true;\n\n }",
"abstract void firstNameValidity();",
"public Date getBirthday() { return birthday; }",
"public static void regPerson(){\n\t\tSystem.out.println(\"Skriv inn navnet, trykk enter, skriv så inn alder, trykk enter, og til slutt skriv inn bosted og trykk enter!\");\n\t}",
"public void setBirthday(java.lang.String param) {\r\n localBirthdayTracker = param != null;\r\n\r\n this.localBirthday = param;\r\n }",
"public Date getBirthdate()\n {\n return birthdate;\n }",
"@Override\n\tpublic java.util.Date getDateOfBirth() {\n\t\treturn _candidate.getDateOfBirth();\n\t}",
"public void setBirthdate(java.util.Calendar birthdate) {\n this.birthdate = birthdate;\n }",
"public Date getBirthdate() {\n return birthdate;\n }",
"public void TypeBirthdayDate4(String TypeBirthdayDate4) {\r\n\t\tbirthdaydate4.clear();\r\n\t\tbirthdaydate4.sendKeys(TypeBirthdayDate4);\r\n\t\t\tLog(\"Entered Birthday (MM/DD) 4: \" + TypeBirthdayDate4);\r\n\t}",
"public void validateRegistration(RegistrationModel register) {\n\t\tif (registerDao.checkAccountNoIfExist(register.getAccount_no(), register.getJai())) {\n\t\t\t// Checks if account if not Existing and not Verified \n\t\t\tif (!registerDao.checkCustomerLinkIfExist(register.getAccount_no())) {\n\t\t\t\t\tgenerateCustomerRecord(register);\n\t\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t// Account already registered.\n\t\t\t\tVerificationModel verify = new VerificationModel();\n\t\t\t\tverify.setAccount_no(register.getAccount_no());\n\t\t\t\t\n\t\t\t\tTimestamp todayTimeStamp = new Timestamp(System.currentTimeMillis());\n\t\t\t\tTimestamp regTimeStamp = verifyDao.retireveReg_date(verify); \n\t\t\t\tlong diffHours = (regTimeStamp.getTime()-todayTimeStamp.getTime()) / (60 * 60 * 1000);\n\t\t\t\t\n\t\t\t\tif (diffHours>24) {\n\t\t\t\t\tgenerateCustomerRecord(register);\n\t\t\t\t} else {\n\t\t\t\t\t// Account already registered. Please verify your registration\n\t\t\t\t\tsetRegistrationError(\"R02\"); \n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Customer not allowed to access online service of OBS!\n\t\t\tsetRegistrationError(\"R01\"); \n\t\t}\n\t}",
"public String getDateOfBirth(){\n\t\treturn dateOfBirth;\n\t}",
"public static void isValidCreditCardExpirationDate(String userInput) {\n\t\tDateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"MM/yy\");\n\t\ttry {\n\t\t\t// Try to parse a YearMonth from the input, then check to make sure it is not in\n\t\t\t// the past.\n\t\t\tif (YearMonth.parse(userInput, formatter).isBefore(YearMonth.now())) {\n\t\t\t\tthrow new IllegalArgumentException(\"Expiration date must be in the future! Please try again:\");\n\t\t\t}\n\t\t} catch (DateTimeException dte) {\n\t\t\tthrow new IllegalArgumentException(\"Expiration date format must be mm/yy. Please try again:\");\n\t\t}\n\n\t}",
"public String getBirth() {\n return birth;\n }",
"public String getBirth() {\n return birth;\n }",
"private Patient setPatientDOB(Date date, Patient patient){\n\t\tint year=date.getYear()+1900;\n\t\tint age=patient.getAge();\n\t\tif(age>60){\t//If patient age above 60 years then randomize the year also\n\t\t\tyear=randBetween(1990,2010);\n\t\t}\n\t\tint dayOfMonth = randBetween(1, 31);\n\t\tint month = randBetween(0, 11);\n\t\tDate d = new Date(year-1900, month, dayOfMonth); //Random date\n\t\tpatient.setBirthdate(d);\n\t\treturn patient;\n\t}",
"public boolean checkBirthDay(java.util.Date birthdate) {\r\n\r\n Calendar calendar = GregorianCalendar.getInstance();\r\n calendar.setTime(new java.util.Date());\r\n int currentYear = calendar.get(Calendar.YEAR);\r\n\r\n calendar.setTime(birthdate);\r\n int birthYear = calendar.get(Calendar.YEAR);\r\n if ((currentYear - birthYear) < 18) {\r\n return false;\r\n }\r\n return true;\r\n\r\n }",
"long getContactRegistrationDate();",
"public String getBirthDate() {\n\t\treturn birthDate;\n\t}",
"public java.lang.String getBirth_date() {\n return birth_date;\n }",
"public void setBPJSRegistrationDate (Timestamp BPJSRegistrationDate);",
"public void setBirthDate(String birthday) {\n\t\tbirthDate = birthday;\n\t}",
"public String getBirthday(){\n return birthday;\n\t}",
"public String getDate_of_Birth() {\n\t\treturn Date_of_Birth;\n\t}",
"public void setBirthday(Date birthday) {\r\n this.birthday = birthday;\r\n }",
"public void setBirthday(Date birthday) {\r\n this.birthday = birthday;\r\n }",
"public Date getBirthDate() {\n\t\treturn birthDate;\n\t}",
"void setDateOfBirth(LocalDate dateOfBirth);",
"public LicenseExpiryDateValidator(DriverRegistration registration) {\n super(registration);\n }",
"public String getDateOfBirth(){\n return(this.dateOfBirth);\n }",
"@Override\n\tpublic void UpdateDateOfBirth(Gamers gamer) {\n\t\tSystem.out.println(\"Lütfen yeni doğum gününüzü giriniz\");\n\t\tint NewDateOfBirth;\n\t\tNewDateOfBirth=sc.nextInt();\n\t\tsc.nextLine();\n\t\tgamer.setDateOfBirth(NewDateOfBirth);\n\t\tdbserviceadaptors.Save(gamer);\n\t\tSystem.out.println(\"Yeni doğum gününüz \"+NewDateOfBirth+\" olarak güncellendi.\");\n\t\t\n\t}",
"public void setBirth(String a)\n\t{\n\t\ttry\n\t\t{\n\t\t\thuman = hf.parse(a);\n\t\t\tbirth = df.format(human);\n\t\t}\n\t\tcatch (java.text.ParseException e)\n\t\t{\n\t\t}\n\t}",
"abstract void lastNameValidity();",
"@Test\r\n\t public void register1() {\n\t\t \tthis.admin.createClass(\"ecs60\",2017,\"sean\",50);\r\n\t \t\r\n\t assertFalse(this.student.isRegisteredFor(\"gurender\", \"ecs60\", 2017));\r\n\t \r\n\t }",
"Employee setBirthdate(Date birthdate);",
"public void TypeBirthdayDate2(String TypeBirthdayDate2) {\r\n\t\tbirthdaydate2.clear();\r\n\t\tbirthdaydate2.sendKeys(TypeBirthdayDate2);\r\n\t\t\tLog(\"Entered Birthday (MM/DD) 2: \" + TypeBirthdayDate2);\r\n\t}",
"public void TypeBirthdayDate1(String TypeBirthdayDate1) {\r\n\t\tbirthdaydate1.clear();\r\n\t\tbirthdaydate1.sendKeys(TypeBirthdayDate1);\r\n\t\t\tLog(\"Entered Birthday (MM/DD) 1: \" + TypeBirthdayDate1);\r\n\t}",
"public Date getDateOfBirth() {\n return dateOfBirth;\n }",
"public PassengerPersonalInfo(){\n \t// TODO Auto-generated constructor stub\n Scanner cin = new Scanner(System.in);\n String tempAge;\n System.out.print(\"FIRST NAME: \");\n firstName = cin.nextLine();\n System.out.print(\"LAST NAME: \");\n lastName = cin.nextLine();\n while(true) {\n System.out.print(\"AGE: \");\n tempAge = cin.nextLine();\n try {\n age = Integer.parseInt(tempAge);\n if(age < 0 || age > 150) {\n throw new Exception();\n }\n break;\n }\n catch(Exception e){\n System.err.println(\"ERROR: Invalid Age!\");\n } \n } \n SimpleDateFormat sdt = new SimpleDateFormat(\"MM-dd-yyyy\");\n while(true) {\n System.out.print(\"DATE OF BIRTH(mm-dd-yyyy): \");\n String tempDateOfBirth = cin.nextLine();\n try { \n this.dateOfBirth= sdt.parse(tempDateOfBirth);\n break;\n } \n catch (ParseException e) { \n System.err.println(\"ERROR: Invalid Date Format!\"); \n }\n }\n //String ch = cin.nextLine();\n System.out.print(\"ADDRESS: \");\n address = cin.nextLine();\n System.out.print(\"NATIONALITY: \");\n nationality = cin.nextLine();\n while(true) {\n System.out.print(\"CONTACT NUMBER: \");\n String tempContactNumber = cin.nextLine();\n try {\n \tcontact = Long.parseLong(tempContactNumber);\n if(tempContactNumber.length() != 11)\n throw new Exception();\n break;\n }\n catch(Exception e){\n System.err.println(\"ERROR: Invalid Contact Number!\");\n } \n } \n }",
"public Date getBirthday() {\r\n return birthday;\r\n }",
"public Date getBirthday() {\r\n return birthday;\r\n }",
"void setCreationDate( String username, Date creationDate ) throws UserNotFoundException;",
"private void displayBirthdayFields() {\n FieldRelatedLabel passwordLabel = new FieldRelatedLabel(\"Birthday\", 350, 470);\n\n invalidBirthdayLabel = new InvalidFormEntryLabel(\"Birthday must not be\\na day in the future\", 540, 490, true);\n\n birthdayDP = new DatePicker();\n birthdayDP.relocate(350, 500);\n birthdayDP.setOnAction(e->FormValidatorPokeMongo.handleBirthday(birthdayDP, invalidBirthdayLabel));\n\n sceneNodes.getChildren().addAll(passwordLabel, invalidBirthdayLabel, birthdayDP);\n }",
"public static User register(Scanner scanner) throws ParseException, ClassNotFoundException, SQLException, Exception{\n System.out.print(\"Full name: \");\n String fn = scanner.nextLine();\n System.out.print(\"Username: \"); //Tai len tu csdl xem co trung hay khong?\n String us = scanner.nextLine();\n System.out.print(\"Password: \");\n String pw = scanner.nextLine();\n System.out.print(\"Gender: \");\n String g = scanner.nextLine();\n System.out.print(\"Date of birth(dd-mm-yyyy): \");\n String dob = scanner.nextLine();\n SimpleDateFormat f = new SimpleDateFormat(\"dd-MM-yyyy\");\n System.out.print(\"Country: \");\n String c = scanner.nextLine();\n System.out.println();\n \n Connection conn = Tester.getConnection();\n Statement stm = conn.createStatement();\n ResultSet rs = stm.executeQuery(\"SELECT * FROM user\");\n while(rs.next()){\n if(us.toLowerCase().equals(rs.getString(\"username\").toLowerCase()))\n throw new Exception(\"Username \" + us + \" is not available.\"); \n }\n SimpleDateFormat f1 = new SimpleDateFormat(\"yyyy-MM-dd\");\n String sql = \"INSERT INTO user(fullname, username,\"\n + \" password, gender, dateofbirth, country, dateofstart)\"\n + \" VALUES(?, ?, ?, ?, ?, ?, ?)\";\n PreparedStatement pre = conn.prepareStatement(sql);\n pre.setString(1, fn);\n pre.setString(2, us);\n pre.setString(3, pw);\n pre.setString(4, g);\n pre.setString(5, f1.format(f.parse(dob)));\n pre.setString(6, c);\n pre.setString(7, f1.format(new Date()));\n pre.executeUpdate();\n\n pre.close();\n rs.close();\n \n conn.close();\n stm.close();\n return new User(us, pw, fn, c, g, f.parse(dob), new Date());\n }"
] | [
"0.68710285",
"0.67700976",
"0.66741127",
"0.6308438",
"0.6205644",
"0.6202979",
"0.62012273",
"0.61948794",
"0.6060673",
"0.6059544",
"0.6059544",
"0.6047423",
"0.60411644",
"0.601347",
"0.5994121",
"0.59933686",
"0.5983555",
"0.5956615",
"0.5956615",
"0.5944767",
"0.59382904",
"0.59276265",
"0.5923451",
"0.59018475",
"0.5884753",
"0.58243746",
"0.5813657",
"0.58087814",
"0.5805937",
"0.5802397",
"0.5779016",
"0.5772151",
"0.57689244",
"0.5748452",
"0.57365054",
"0.5710536",
"0.57041705",
"0.56927603",
"0.5688279",
"0.5687287",
"0.56816053",
"0.5668969",
"0.5663202",
"0.56623703",
"0.56622106",
"0.56506777",
"0.56472725",
"0.5631682",
"0.5617438",
"0.5605589",
"0.5598374",
"0.5598075",
"0.5589271",
"0.55789495",
"0.55742615",
"0.55742615",
"0.55738145",
"0.5558811",
"0.5557351",
"0.55572116",
"0.5548896",
"0.5543886",
"0.554151",
"0.55409396",
"0.55404675",
"0.5529935",
"0.55267644",
"0.5525591",
"0.5524259",
"0.5520561",
"0.5520561",
"0.55203015",
"0.5515684",
"0.5505262",
"0.5504602",
"0.5502464",
"0.54896706",
"0.5480992",
"0.5478558",
"0.5469702",
"0.5461606",
"0.5461606",
"0.5453871",
"0.5450615",
"0.5441277",
"0.5441023",
"0.54267055",
"0.542381",
"0.5417998",
"0.5412432",
"0.54102993",
"0.5396553",
"0.5396423",
"0.53923965",
"0.5388458",
"0.5381593",
"0.5381593",
"0.53814685",
"0.5375886",
"0.5372776"
] | 0.64929473 | 3 |
C.Reg12 A birth date must be a valid date | @Test
public void testInvalidBirthDate() {
registerUser(username, password, password, email, email, forename, surname, "01011990");
assertNull(userService.getUser(username));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Boolean validateDate(String date_of_birth) {\n DateFormat format = new SimpleDateFormat(\"yyyy-MM-dd\");\n try {\n format.parse(date_of_birth);\n } catch (ParseException exception) {\n System.out.println(\"Invalid Input!\");\n return true;\n }\n return false;\n }",
"abstract void birthDateValidity();",
"void birthDateValidity(M person) {\n // Valid data\n assignValidData(person);\n assertDoesNotThrow(person::checkDataValidity);\n\n // Invalid data\n person.setBirthdate(null);\n assertThrows(InvalidFieldException.class, person::checkDataValidity);\n }",
"public static boolean isValidBirthdate (String test) {\n try {\n LocalDate.parse(test);\n return isValidBirthdate(LocalDate.parse(test));\n } catch (DateTimeParseException e) {\n return false;\n }\n }",
"public static void birthdateValidation(Date birthdate) throws Exception {\n if (birthdate.after(new Date())) {\n throw new Exception(\"Your birth date cannot be in the future\");\n }\n }",
"@Test\n public void testconvertDateYearsLongueurPasValide() {\n FieldVerifier projet = new FieldVerifier();\n boolean longueurInvalideTest = projet.isValidDate(\"01/05/102\");\n assertEquals(false, longueurInvalideTest);\n }",
"private boolean isDOBValid(String DOB) {\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"dd/MM/yyyy\");\n dateFormat.setLenient(false);\n try {\n dateFormat.parse(DOB.trim());\n } catch (ParseException pe) {\n return false;\n }\n return true;\n }",
"public static boolean isValidDOB(String userInput) {\n \n return Pattern.matches(Constants.DATE_VALIDATION, userInput);\n }",
"public boolean checkBirthDay(java.util.Date birthdate) {\r\n\r\n Calendar calendar = GregorianCalendar.getInstance();\r\n calendar.setTime(new java.util.Date());\r\n int currentYear = calendar.get(Calendar.YEAR);\r\n\r\n calendar.setTime(birthdate);\r\n int birthYear = calendar.get(Calendar.YEAR);\r\n if ((currentYear - birthYear) < 18) {\r\n return false;\r\n }\r\n return true;\r\n\r\n }",
"public void validate_the_Date_of_Birth_of_Security_in_Customer_Tab(String DateofBirth)throws Exception {\n\t\tVerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_Security.replaceAll(\"M_Header\", \"Security\").replaceAll(\"M_Category\", \"Date of Birth\").replaceAll(\"M_InnerText\", DateofBirth), \"Date of Birth - \"+DateofBirth, false);\n\t}",
"boolean checkNumberFormat (String birthDate){\r\n for (int i = 0; i < birthDate.length(); i++) {\r\n if ((birthDate.charAt(i) < 48 && birthDate.charAt(i) != 32 \r\n && birthDate.charAt(i) != 10) \r\n || birthDate.charAt(i) > 57){\r\n return false;\r\n }\r\n }\r\n return true;\r\n }",
"@Test\n public void testBirthDate() {\n registerUser(username, password, password, email, email, forename, surname, \"01/01/1990\");\n assertNotNull(userService.getUser(username));\n }",
"public BirthDate(String date) throws InvalidDateException {\n this.date = stringToDate(date);\n checkDate();\n }",
"private boolean dateValidation(String userDate){\n SimpleDateFormat sdf = new SimpleDateFormat(\"dd/MM/yyyy\");\n sdf.setLenient(false);\n\n try {\n\n //if not valid, it will throw ParseException\n Date date = sdf.parse(userDate);\n System.out.println(date);\n\n } catch (ParseException e) {\n\n e.printStackTrace();\n return false;\n }\n\n return true;\n }",
"private boolean checkValidDate(String inputDate) {\n SimpleDateFormat date = new SimpleDateFormat(\"ddMMyy\");\n date.setLenient(false);\n try {\n date.parse(inputDate);\n return true;\n } catch (ParseException e) {\n return false;\n }\n }",
"boolean isValidDate(String datestr)\n {\n String validch = \"1234567890/\";\n String month, day, year;\n Integer I;\n int m, d, y;\n int slash1, slash2;\n\n datestr.trim();\n if (datestr.length() == 0)\n return false;\n\n if (!checkchars(datestr, validch, false)) {\n // Invalid date entry\n return false;\n }\n\n\n slash1 = datestr.indexOf(\"/\");\n slash2 = datestr.indexOf(\"/\",slash1+1);\n if (slash1 <= 0 || slash2 <= 0)\n {\n // Invalid Entry\n return false;\n }\n\n month = datestr.substring(0,slash1);\n day = datestr.substring(slash1+1,slash2);\n year = datestr.substring(slash2+1,datestr.length());\n if ((month.length()<1 || month.length()>2) ||\n (day.length()<1 || day.length()>2) || (year.length()!=4))\n {\n // Invalid Date\n return false;\n }\n\n I = new Integer(month);\n m = I.intValue();\n I = new Integer(day);\n d = I.intValue();\n I = new Integer(year);\n y = I.intValue();\n //basic error checking\n if (m<1 || m>12 || d<1 || d>31 || y<0 || y>9999)\n return false;\n\n // months with 30 days\n if (d==31 && (m==4 || m==6 || m==9 || m==11)){\n return false;\n }\n\n // february, leap year\n if (m==2 && d>28){\n if (d > 29)\n return false;\n if ((y%4 == 0) || ((y%400==0) && (y%100!=0)))\n return false;\n }\n\n return true;\n }",
"private static boolean validDate(String date) {\n\t\t SimpleDateFormat formatter = new SimpleDateFormat(\"MM/dd/yy\");\n\t\tformatter.setLenient(false);\n\t\tDate tryDate = null; \n\t\t\ttry\n\t\t{\n\t\t\ttryDate = formatter.parse(date);\n\t\t}catch (ParseException e) {\n\t\t\treturn false;\n\t\t}\n\t\tformatDate(tryDate);\n\t\treturn true; \n\t\t\n\t}",
"@Test\n @Disabled\n public void testValidateFecha() {\n assertTrue(RegExprMain.validateFecha(\"10/06/2022\"));\n assertTrue(RegExprMain.validateFecha(\"10/06/2011\"));\n assertTrue(RegExprMain.validateFecha(\"10/06/2015\"));\n assertTrue(RegExprMain.validateFecha(\"10/06/2016\"));\n assertTrue(RegExprMain.validateFecha(\"10/06/2021\"));\n assertTrue(RegExprMain.validateFecha(\"10/06/1999\"));\n assertTrue(RegExprMain.validateFecha(\"10/06/2007\"));\n assertTrue(RegExprMain.validateFecha(\"10/06/2000\"));\n assertTrue(RegExprMain.validateFecha(\"10/06/2002\"));\n assertFalse(RegExprMain.validateFecha(\"38/06/2009\"));\n assertFalse(RegExprMain.validateFecha(\"10/20/2010\"));\n \n \n\n }",
"public void makeValidDate() {\n\t\tdouble jd = swe_julday(this.year, this.month, this.day, this.hour, SE_GREG_CAL);\n\t\tIDate dt = swe_revjul(jd, SE_GREG_CAL);\n\t\tthis.year = dt.year;\n\t\tthis.month = dt.month;\n\t\tthis.day = dt.day;\n\t\tthis.hour = dt.hour;\n\t}",
"public static boolean isValidDate(String test) {\n if (test.matches(VALIDATION_REGEX)) {\n try {\n DateTimeFormatter format = DateTimeFormatter.ofPattern(\"dd-MM-yyyy\");\n LocalDate date = LocalDate.parse(test, format);\n if (date.format(format).equals(test)) {\n return true;\n }\n return false;\n } catch (DateTimeParseException e) {\n return false;\n }\n }\n return false;\n }",
"public Boolean validarFecha(LocalDate fechaIngresada);",
"public Date checkDate() {\n // Create new sdf with format is dd/MM/yyyy\n SimpleDateFormat sdf = new SimpleDateFormat(\"dd/MM/yyyy\");\n sdf.setLenient(false); // Check special day\n Date date = null; // Create date\n boolean isOK = true; // Condition loop\n\n while (isOK) {\n try {\n String dateStr = checkEmpty(\"DOB\"); // Call method to check input of dob\n date = sdf.parse(dateStr); // Convert string to date\n return date;\n\n } catch (ParseException e) {\n // Print error if date is invalid\n System.out.println(\"Date is invalid !\");\n System.out.print(\"Enter again (dd/MM/yyyy): \");\n }\n }\n return date; // Return date\n }",
"LocalDate getDateOfBirth();",
"public static void isValidCreditCardExpirationDate(String userInput) {\n\t\tDateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"MM/yy\");\n\t\ttry {\n\t\t\t// Try to parse a YearMonth from the input, then check to make sure it is not in\n\t\t\t// the past.\n\t\t\tif (YearMonth.parse(userInput, formatter).isBefore(YearMonth.now())) {\n\t\t\t\tthrow new IllegalArgumentException(\"Expiration date must be in the future! Please try again:\");\n\t\t\t}\n\t\t} catch (DateTimeException dte) {\n\t\t\tthrow new IllegalArgumentException(\"Expiration date format must be mm/yy. Please try again:\");\n\t\t}\n\n\t}",
"private static boolean validateAge(String age) {\n return true;\n\n }",
"Date getBirthDate();",
"@Test\n public void isValidFormat() {\n assertFalse(Deadline.isValidFormat(VALID_DAY_1));\n\n // Deadline with day and month dd/mm -> true\n assertTrue(Deadline.isValidFormat(VALID_1ST_JAN_WITHOUT_YEAR.toString()));\n\n // Deadline with all 3 fields dd/mm/yyyy -> true\n assertTrue(Deadline.isValidFormat(VALID_1ST_JAN_2018.toString()));\n }",
"Person(String fullName, LocalDate birthdate) throws IllegalArgumentException{\n this.fullName = fullName;\n this.setBirthdate(birthdate);\n }",
"protected final boolean ok_date (int year, int month, int day)\n {\n return ((year >= FIRST_YEAR) &&\n (1 <= month && month <= getLastMonthOfYear(year)) &&\n (1 <= day && day <= getLengthOfMonth (year, month)));\n }",
"private boolean checkDeadline(String d)\n\t{\n\t\t//yyyy/mm/dd\n\t\treturn Pattern.matches(\"[0-9][0-9][0-9][0-9]/[0-1][0-9]/[0-3][0-9]\", d);\n\t}",
"public void setBirth_date(java.lang.String birth_date) {\n this.birth_date = birth_date;\n }",
"boolean isValidFor (@Nonnull DATATYPE aDate);",
"private void checkDate(String strDate, LocalDate localDate) {\n if (Integer.parseInt(strDate.substring(0, 4)) != localDate.getYear()\n || Integer.parseInt(strDate.substring(5, 7)) != localDate.getMonthValue()\n || Integer.parseInt(strDate.substring(8,10)) != localDate.getDayOfMonth()) {\n throw new IllegalArgumentException(\"Illegal date: date dose not exist.\");\n }\n }",
"@Test(expected = IllegalArgumentException.class)\r\n public void testIncorrectYear() {\r\n SimpleDate d1 = new SimpleDate(\"3/1/1700\");\r\n }",
"@Test\n public void testSsnvalidatorFalse(){\n assertFalse(register.ssnValidator(\"70091212345\")); // a date can`t start with 70\n }",
"@Test\n public void testMissingBirthDate() {\n registerUser(username, password, password, email, email, forename, surname, null);\n assertNotNull(userService.getUser(username));\n }",
"public void setDate_of_birth(String date_of_birth) {\n this.date_of_birth = date_of_birth;\n }",
"private void validateDate() {\n if (dtpSightingDate.isEmpty()) {\n dtpSightingDate.setErrorMessage(\"This field cannot be left empty.\");\n dtpSightingDate.setInvalid(true);\n removeValidity();\n }\n // Check that the selected date is after research began (range check)\n else if (!validator.checkDateAfterMin(dtpSightingDate.getValue())) {\n dtpSightingDate.setErrorMessage(\"Please enter from \" + researchDetails.MIN_DATE + \" and afterwards. This is when the research period began.\");\n dtpSightingDate.setInvalid(true);\n removeValidity();\n }\n // Check that the selected date is not in the future (range check / logic check)\n else if (!validator.checkDateNotInFuture(dtpSightingDate.getValue())) {\n dtpSightingDate.setErrorMessage(\"Please enter a date from today or before. Sighting date cannot be in the future.\");\n dtpSightingDate.setInvalid(true);\n removeValidity();\n }\n }",
"@Override\n public boolean isInputDateValid(String dateStr) {\n DateFormat sdf = new SimpleDateFormat(this.date);\n sdf.setLenient(false);\n try {\n sdf.parse(dateStr);\n } catch (ParseException e) {\n return false;\n }\n return true;\n }",
"public static boolean dateFormatCheck(String date)\r\n\t{\r\n\t\treturn date.matches(\"(0?[1-9]|[12][0-9]|3[01])-(0?[1-9]|1[012])-((19|20)\\\\d\\\\d)\");\t\r\n\t}",
"private boolean isValidDate(String date){\n Date inputDate = new Date(date);\n boolean isValid = false;\n\n if (inputDate.isValid()) {\n isValid = true;\n }else{\n generalTextArea.appendText(date + \" is not a valid date!\\n\");\n }\n return isValid;\n }",
"public boolean validateDate() {\r\n\t\tDate now = new Date();\r\n\t\t// expire date should be in the future\r\n\t\tif (now.compareTo(getExpireDate()) != -1)\r\n\t\t\treturn false;\r\n\t\treturn true;\r\n\t}",
"public void setBirthdate(String birthdate) {\r\n this.birthdate = birthdate;\r\n }",
"public DateValidator(Integer Day,Integer Month,Integer Year) throws InvalidDateException\n\t{\n\t\t\n\t\t\tiDay = Day;\n\t\t\tiMonth = Month;\n\t\t\tiYear = Year;\n\t\t\t//create Calendar object for current date\n\t\t\tCalendar now = Calendar.getInstance ( );\n\t\t\t//create Calendar Object to test\n\t\t\tCalendar test = Calendar.getInstance( );\n\t\t\t//set the attributes of test Calendar\n\t\t\ttest.set (iYear,iMonth,iDay);\n\t\t\t\n\t\t\tboolean leap = true;//holds the boolean value of leap year \n\t\t\t\n\t\t\t/* test year for proper input*/\n\t\t\tif (iYear + 120 < now.get (Calendar.YEAR) || now.before (test))\n\t\t\t{\t\n\t\t\t\tthrow new InvalidDateException(\"year\");\n\t\t\t}\n\t\t\t/* Test the month for proper input*/\n\t\t\tif (iMonth < 0 || iMonth > 12)\n\t\t\t{\t\n\t\t\t\tthrow new InvalidDateException(\"month\");\n\t\t\t}\n\t\t\t\n\t\t\t//algorithm to determine if it is a leap year\n\t\t\tif (iYear % 400 == 0)\n\t\t\t\tleap = true;\n\t\t\telse if (iYear % 100 == 0)\n\t\t\t\tleap = false;\n\t\t\telse if (iYear % 4 == 0)\n\t\t\t\tleap = true;\n\t\t\telse\n\t\t\t\tleap = false;\n\t\t\t\n\t\t\t/*Test to see if user has entered a\n\t\t\t * valid day for that particular month\n\t\t\t */\n\t\t\t\n\t\t\t//if the day entered for February is greater then 29 in a leap year it is invalid\n\t\t\tif ( leap == true && iMonth == 2)\n\t\t\t{\n\t\t\t\tif ( iDay < 0 || iDay > 29 )\n\t\t\t\t{\t\n\t\t\t\t\tthrow new InvalidDateException(\"day\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//if the day entered for February is greater then 28 in a non leap year it is invalid\n\t\t\tif ( leap == false && iMonth == 2)\n\t\t\t{\n\t\t\t\tif ( iDay < 0 || iDay > 28)\n\t\t\t\t{\t\n\t\t\t\t\tthrow new InvalidDateException(\"day\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//in the months of Apr, Jun, Sep, or Nov a day greater then 30 is invalid\n\t\t\tif( iMonth == 4 ||\n\t\t\t\tiMonth == 6 ||\n\t\t\t\tiMonth == 9 ||\n\t\t\t\tiMonth == 11 )\n\t\t\t{\n\t\t\t\tif( iDay < 0 || iDay > 30)\n\t\t\t\t{\t\n\t\t\t\t\tthrow new InvalidDateException(\"day\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//in the remaining months a day greater than 31 is invalid\n\t\t\tif (iDay < 0 || iDay > 31)\n\t\t\t{\t\n\t\t\t\tthrow new InvalidDateException(\"day\");\n\t\t\t}\n\t}",
"@Test public void Month_name_0__day__year__bad_day()\t\t\t{tst_date_(\"Mar 32 2001\"\t\t\t, \"Invalid day: 32\");}",
"public void setBirth_date(Date birth_date) {\n this.birth_date = birth_date;\n }",
"public void setBirth_date(Date birth_date) {\n this.birth_date = birth_date;\n }",
"public boolean isValidDate(String valD) { //Checks if date is in proper format\n String valDWithoutSpace = valD.replaceAll(\"\\\\s\", \"\");\n return valDWithoutSpace.length() == 8;\n}",
"public CpFldValidDate() { super(10018, 1); }",
"public void setBirthdate(LocalDate birthdate) throws IllegalArgumentException {\n LocalDate todayDate = LocalDate.now();\n\n if(birthdate.isAfter(todayDate) || birthdate.isEqual(todayDate)) {\n throw new IllegalArgumentException(\"Birthdate cannot be later than today's date\");\n } else {\n this.birthdate = birthdate;\n this.age = birthdate.until(todayDate).getYears(); // we set the age, if the birthdate is correct\n }\n }",
"@Test\n public void testIsValidarFecha() {\n System.out.println(\"isValidarFecha\");\n String fecha = \"06/09/2018\";\n boolean expResult = true;\n boolean result = Entradas.isValidarFecha(fecha);\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n \n }",
"public Date getBirthDate();",
"public boolean isValid() {\n if (this.month >= 1 && this.month <= 12 && this.day >= 1 && this.day < 32) {\n\n if ((this.month == 1 || this.month == 3 || this.month == 5 || this.month == 7 || this.month == 8\n || this.month == 10 || this.month == 12) && this.day > 30) {\n return false;\n } else if (this.month == 2 && this.day > 29) {\n return false;\n } else if (this.month == 2 && this.day > 28 && !isLeap(this.year)) {\n return false;\n } else {\n return true;\n }\n\n } else {\n return false;\n }\n }",
"private boolean checkDate(String date) {\n return date.matches(regexDate);\n }",
"public boolean validarFechaNac() {\n\t\treturn fecha_nac != null;\n\t}",
"public void fillDateOfBirth(String value) {\n // Only sets main dob for testing results -- Not sufficient to test dob UI itself\n dateOfBirth.sendKeys(value);\n }",
"public void setBirthDate(Date birthDate);",
"void setBirthDate(Date birthDate);",
"public void setBirthDate(Date inBirthDate)\n {\n birthdate = inBirthDate;\n }",
"@SuppressWarnings(\"static-access\")\r\n\tpublic boolean isBirthday()\r\n\t{\r\n\t\tGregorianCalendar now = new GregorianCalendar();\r\n\t\tboolean isBirthday = false;\r\n\t\tif (now.MONTH == bDate.MONTH && now.DATE == bDate.DATE)\r\n\t\t{\r\n\t\t\tisBirthday = true;\r\n\t\t}\r\n\t\treturn isBirthday;\r\n\t}",
"@Test\n public void testSsnvalidatorNull(){\n assertFalse(register.ssnValidator(\"\")); // a date can`t start with 70\n }",
"private boolean isValidDate(String date) {\n\t Date d = null;\n\t try {\n\t\t\td = format.parse(date);\t\t\t\n\t\t\treturn d != null;\n\t\t} catch (java.text.ParseException e) {\n\t\t\treturn false;\n\t\t}\n\t}",
"public void setBirthdate(Date birthdate) {\r\n this.birthdate = birthdate;\r\n }",
"@Test\n public void testClaimAdmDate() {\n new ClaimFieldTester()\n .verifyDateStringFieldTransformedCorrectly(\n FissClaim.Builder::setAdmDateCymd,\n RdaFissClaim::getAdmDate,\n RdaFissClaim.Fields.admDate);\n }",
"public static void validateDate(String date) throws CustomExceptionHandler {\n SimpleDateFormat formatter = new SimpleDateFormat(\"dd.MM.yyyy\");\n formatter.setLenient(false);\n Date parsedDate;\n\n //Throw Exception if string is blank\n if(date.isBlank()||date.isEmpty())\n throw new CustomExceptionHandler(\"Date NOT Specified\");\n\n\n\n //Throw exception if date is not formatted correctly\n try\n {\n parsedDate = formatter.parse(date);\n\n }\n catch (Exception e)\n {\n throw new CustomExceptionHandler(\"The date format is not correct\");\n }\n }",
"public interface DateValidator {\n\n boolean isDateValid(String date);\n}",
"public void setBirthdate(Date birthdate)\n {\n this.birthdate = birthdate;\n }",
"@Test\n public void testGetDateCreated() throws ParseException {\n System.out.println(\"getDateCreated Test (Passing value)\");\n Date expResult = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\").parse(\"1955-11-05 06:00:00\");\n Date result = user.getDateCreated();\n // Check for and print any violations of validation annotations\n Set<ConstraintViolation<User>> violations = validator.validate(user);\n String message =\n violations.iterator().hasNext() ? violations.iterator().next().getMessage() : \"\";\n if (!violations.isEmpty()) {\n System.out.println(\"Violation caught: \" + message);\n }\n // Test method\n assertEquals(expResult, result);\n }",
"private static boolean isValid(int m, int d, int y) {\r\n\t\tif (m < 1 || m > 12)\r\n\t\t\treturn false;\r\n\t\tif (d < 1 || d > DAYS[m])\r\n\t\t\treturn false;\r\n\t\tif (m == 2 && d == 29 && !isLeapYear(y))\r\n\t\t\treturn false;\r\n\t\treturn true;\r\n\t}",
"public boolean validarFecha(Date fecha) {\n\t\tif(!fecha.before(Calendar.getInstance().getTime())) {\n\t\t\tJOptionPane.showMessageDialog(null, \"La fecha introducida es invalida\",\"Fecha invalida\", JOptionPane.INFORMATION_MESSAGE);\n\t\t\treturn false;\n\t\t}else return true; \n\t}",
"public static boolean isReservationDateValid(String date, String date_format) {\r\n try {\r\n DateFormat df = new SimpleDateFormat(date_format);\r\n df.setLenient(false);\r\n df.parse(date);\r\n return true;\r\n } catch (ParseException e) {\r\n return false;\r\n }\r\n }",
"public void setDOB(String strdateofbirth){\n\t\tdriver.findElement(dateofbirth).sendKeys(strdateofbirth);;\n\t}",
"boolean validDate(String dateString){\r\n\t\t\r\n\t\tif(DateUtil.parse(dateString) != null){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"@Test\n public void isValidDeadline() {\n assertFalse(Deadline.isValidDeadline(INVALID_0_JAN_2018.toString()));\n assertFalse(Deadline.isValidDeadline(INVALID_1ST_0_2018.toString()));\n\n // Valid deadline -> returns true\n assertTrue(Deadline.isValidDeadline(VALID_1ST_JAN_2018.toString()));\n\n // Valid deadline for february -> returns true\n assertTrue(Deadline.isValidDeadline(VALID_28TH_FEB_2018.toString()));\n\n // Invalid deadline for february in common year -> returns false\n assertFalse(Deadline.isValidDeadline(INVALID_29TH_FEB_2018.toString()));\n\n // Valid deadline for february during leap year -> returns true\n assertTrue(Deadline.isValidDeadline(VALID_29TH_FEB_2020.toString()));\n\n // Invalid deadline for february during leap year -> returns false\n assertFalse(Deadline.isValidDeadline(INVALID_30TH_FEB_2020.toString()));\n\n // Valid deadline for months with 30 days -> returns true\n assertTrue(Deadline.isValidDeadline(VALID_30TH_APR_2018.toString()));\n\n // Invalid deadline for months with 30 days -> returns false\n assertFalse(Deadline.isValidDeadline(INVALID_31ST_APR_2018.toString()));\n\n // Valid deadline for months with 31 days -> returns true\n assertTrue(Deadline.isValidDeadline(VALID_31ST_JAN_2018.toString()));\n\n // Invalid deadline for months with 31 days -> returns false\n assertFalse(Deadline.isValidDeadline(INVALID_32ND_JAN_2018.toString()));\n\n // Invalid month -> returns false\n assertFalse(Deadline.isValidDeadline(INVALID_1ST_0_2018.toString()));\n assertFalse(Deadline.isValidDeadline(INVALID_1ST_13_2018.toString()));\n\n // Valid month -> returns true\n assertTrue(Deadline.isValidDeadline(VALID_1ST_APR_2018.toString()));\n\n // Valid year -> returns true\n assertTrue(Deadline.isValidDeadline(VALID_1ST_JAN_9999.toString()));\n\n // Invalid year -> returns false\n assertFalse(Deadline.isValidDeadline(INVALID_1ST_JAN_2017.toString()));\n assertFalse(Deadline.isValidDeadline(INVALID_1ST_JAN_10000.toString()));\n\n // Valid date without year -> returns true\n assertTrue(Deadline.isValidDeadline(VALID_1ST_JAN_WITHOUT_YEAR.toString()));\n\n // Invalid date without year -> returns false\n assertFalse(Deadline.isValidDeadline(INVALID_32ND_JAN_WITHOUT_YEAR.toString()));\n }",
"@Test\n public void testRegisterPatientInvalidDate(){\n assertThrows(IllegalArgumentException.class,\n () -> { register.registerPatient(\"Donald\", \"Trump\", \"00019112345\", \"Doctor Proctor\");});\n }",
"public static boolean validarFecha(String fecha) {\n return validar(\"[0-9]{4}[-/][0-9]{2}[-/][0-9]{2}|[0-9]{2}[-/][0-9]{2}[-/][0-9]{4}\", fecha);\n }",
"public void setBirthdate(Date birthdate) {\n this.birthdate = birthdate;\n }",
"@Test\n public void test0() {\n chkDate(\"> '2013'\", true);\n\n }",
"@Test(expected = IllegalArgumentException.class)\r\n public void testIncorrectLeapYear() {\r\n SimpleDate d1 = new SimpleDate(\"2/29/2000\");\r\n }",
"public static boolean validarFecha(String fecha)\n\t{\n\t\tCalendar calendario = Calendar.getInstance();\n\t \tint hora,minutos,segundos,dia,mes,ano;\n\t \thora =calendario.get(Calendar.HOUR_OF_DAY);\n\t \tminutos = calendario.get(Calendar.MINUTE);\n\t \tsegundos = calendario.get(Calendar.SECOND);\t \t\n\t \t\n\t \tdia = calendario.get(Calendar.DAY_OF_MONTH);\n\t \tmes = calendario.get(Calendar.MONTH);\n\t \tmes=mes+1;\n\t\tano = calendario.get(Calendar.YEAR);\t\t\n\t\tString diaFecha;\n\t\tString mesFecha;\n\t\tString anoFecha = null;\n\t\t\n\t\tint pos = 0;\n\t\tpos = fecha.indexOf('/');\n\t\tSystem.out.println(\"la posicion del primer slash es: \"+pos);\n\t\tdiaFecha = fecha.substring(0,pos);\n\t\tString resto = fecha.substring(pos+1,fecha.length());\n\t\tint pos2 = 0;\n\t\tpos2 = resto.indexOf('/');\n\t\tmesFecha = resto.substring(0,pos2);\n\t\tString resto2 = resto.substring(pos2+1,resto.length());//resto 3 es el ano\t\t\n\t\tSystem.out.println(\"la fecha es:\"+diaFecha+\",\"+mesFecha+\",\"+resto2);\t\t\n\t\tint diaInt,mesInt,anoInt;\n\t\tdiaInt=Integer.parseInt(diaFecha);\n\t\tmesInt=Integer.parseInt(mesFecha);\n\t\tanoInt=Integer.parseInt(resto2);\t\t\n\t\tSystem.out.println(\"fechaSistema:\"+dia+\"/\"+mes+\"/\"+ano);\n\t\tSystem.out.println(\"fechaEntrada:\"+diaInt+\"/\"+mesInt+\"/\"+anoInt);\n\t\tif ((anoInt<ano))\n\t\t{\n\t\t\tSystem.out.println(\"fecha de entrada es menor\");\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (mesInt<mes)\n\t\t\t{\t\t\t\t\n\t\t\t\tSystem.out.println(\"fecha de entrada es menor\");\n\t\t\t\treturn true;\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (diaInt < dia)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"fecha de entrada es menor\");\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n \t\n\t}",
"public void setBirthday(Date birthday);",
"private static boolean isValid(int m, int d, int y) {\n\t\t\tif (m < 1 || m > 12) return false;\n\t\t\tif (d < 1 || d > DAYS[m]) return false;\n\t\t\tif (m == 2 && d == 29 && !isLeapYear(y)) return false;\n\t\t\treturn true;\n\t\t}",
"private static boolean isValid(int m, int d, int y) {\n if (m < 1 || m > 12) return false;\n if (d < 1 || d > DAYS[m]) return false;\n if (m == 2 && d == 29 && !isLeapYear(y)) return false;\n return true;\n }",
"public static boolean validateJavaDate(String strDate)\r\n {\r\n\tif (strDate.trim().equals(\"\"))\r\n\t{\r\n\t\tSystem.out.println(strDate+\" is Invalid Date format\");\r\n\t return false;\r\n\t \r\n\t}\r\n\t/* Date is not 'null' */\r\n\telse\r\n\t{\r\n\t /*\r\n\t * Set preferred date format,\r\n\t * For example MM-dd-yyyy, MM.dd.yyyy,dd.MM.yyyy etc.*/\r\n\t SimpleDateFormat sdfrmt = new SimpleDateFormat(\"yyyy-MM-dd\");\r\n\t sdfrmt.setLenient(false);\r\n\t /* Create Date object\r\n\t * parse the string into date \r\n */\r\n\t try\r\n\t {\r\n\t Date javaDate = sdfrmt.parse(strDate); \r\n\t System.out.println(strDate+\" is valid date format\");\r\n\t }\r\n\t /* Date format is invalid */\r\n\t catch (ParseException e)\r\n\t {\r\n\t System.out.println(strDate+\" is Invalid Date format\");\r\n\t return false;\r\n\t }\r\n\t \r\n\t return true;\r\n\t}\r\n }",
"public void setBirth(Date birth) {\r\n this.birth = birth;\r\n }",
"public boolean DateValidation(String date, String startTime, String currentTime) {\n\n boolean state = false;\n\n //String x = dateChooser.getDate().toString();\n String Hyear = date.substring(24, 28); // get user input date\n String Hmonth = monthToCompare(date);\n String Hdate = date.substring(8, 10);\n String stHr = startTime.substring(0, 2);\n String stMin = startTime.substring(3, 5);\n\n int userYr, userMnth, userDate, userHour, userMin = 0;\n userYr = Integer.parseInt(Hyear); // conversion of user entered year to int\n userMnth = Integer.parseInt(Hmonth);\n userDate = Integer.parseInt(Hdate);\n userHour = Integer.parseInt(stHr);\n userMin = Integer.parseInt(stMin);\n\n String yyr = currentTime.substring(0, 4); // get currrent year from the string f\n String mmnth = currentTime.substring(5, 7);\n String ddt = currentTime.substring(8, 10); // get current date from the string f\n String hours = currentTime.substring(11, 13);\n String mins = currentTime.substring(14, 16);\n\n int yr, mnth, dt, shr, smin = 0;\n yr = Integer.parseInt(yyr); // convert current year from string to int\n mnth = Integer.parseInt(mmnth);\n dt = Integer.parseInt(ddt);\n shr = Integer.parseInt(hours);\n smin = Integer.parseInt(mins);\n\n if ((userYr == yr) || (userYr > yr)) { // if user entered year is the current year or future year, ok \n if (((userYr == yr) && (userMnth >= mnth)) || ((userYr > yr) && (userMnth >= mnth)) || ((userYr > yr) && (userMnth < mnth))) {\n if (((userYr == yr) && (userMnth >= mnth) && (userDate >= dt)) || ((userYr == yr) && (userMnth > mnth) && (userDate < dt)) || ((userYr == yr) && (userMnth > mnth) && (userDate >= dt))\n || ((userYr > yr) && (userMnth >= mnth) && (userDate >= dt)) || ((userYr > yr) && (userMnth >= mnth) && (userDate < dt))\n || ((userYr > yr) && (userMnth < mnth) && (userDate >= dt)) || ((userYr > yr) && (userMnth < mnth) && (userDate < dt))) {\n if (((userYr == yr) && (userMnth == mnth) && (userDate >= dt) && (userHour >= shr)) || ((userYr == yr) && (userMnth == mnth) && (userDate > dt) && (userHour < shr))\n || ((userYr == yr) && (userMnth > mnth) && (userDate > dt) && (userHour >= shr)) || ((userYr == yr) && (userMnth > mnth) && (userDate < dt) && (userHour >= shr))\n || ((userYr == yr) && (userMnth > mnth) && (userDate < dt) && (userHour < shr)) || ((userYr == yr) && (userMnth > mnth) && (userDate > dt) && (userHour < shr))\n || ((userYr > yr) && (userMnth < mnth) && (userDate >= dt) && (userHour >= shr)) || ((userYr > yr) && (userMnth < mnth) && (userDate < dt) && (userHour >= shr))\n || ((userYr > yr) && (userMnth >= mnth) && (userDate >= dt) && (userHour >= shr)) || ((userYr > yr) && (userMnth >= mnth) && (userDate < dt) && (userHour >= shr))\n || ((userYr > yr) && (userMnth < mnth) && (userDate >= dt) && (userHour < shr)) || ((userYr > yr) && (userMnth >= mnth) && (userDate >= dt) && (userHour < shr))\n || ((userYr > yr) && (userMnth >= mnth) && (userDate < dt) && (userHour < shr)) || ((userYr > yr) && (userMnth < mnth) && (userDate < dt) && (userHour < shr))) {\n if (((userYr == yr) && (userMnth == mnth) && (userDate == dt) && (userHour == shr) && (userMin >= smin)) || ((userYr == yr) && (userMnth == mnth) && (userDate == dt) && (userHour >= shr) && (userMin >= smin))\n || ((userYr == yr) && (userMnth == mnth) && (userDate == dt) && (userHour > shr) && (userMin < smin)) || ((userYr == yr) && (userMnth == mnth) && (userDate > dt) && (userHour >= shr) && (userMin >= smin))\n || ((userYr == yr) && (userMnth == mnth) && (userDate > dt) && (userHour < shr) && (userMin >= smin)) || ((userYr == yr) && (userMnth == mnth) && (userDate > dt) && (userHour >= shr) && (userMin < smin))\n || ((userYr == yr) && (userMnth == mnth) && (userDate > dt) && (userHour < shr) && (userMin < smin)) || ((userYr == yr) && (userMnth > mnth) && (userDate > dt) && (userHour >= shr) && (userMin >= smin))\n || ((userYr == yr) && (userMnth > mnth) && (userDate > dt) && (userHour >= shr) && (userMin < smin)) || ((userYr == yr) && (userMnth > mnth) && (userDate > dt) && (userHour < shr) && (userMin >= smin))\n || ((userYr == yr) && (userMnth > mnth) && (userDate < dt) && (userHour >= shr) && (userMin >= smin)) || ((userYr == yr) && (userMnth > mnth) && (userDate < dt) && (userHour >= shr) && (userMin < smin))\n || ((userYr == yr) && (userMnth > mnth) && (userDate < dt) && (userHour < shr) && (userMin >= smin)) || ((userYr == yr) && (userMnth > mnth) && (userDate < dt) && (userHour < shr) && (userMin < smin))\n || ((userYr == yr) && (userMnth > mnth) && (userDate > dt) && (userHour < shr) && (userMin < smin)) || ((userYr > yr) && (userMnth >= mnth) && (userDate >= dt) && (userHour >= shr) && (userMin >= smin))\n || ((userYr > yr) && (userMnth >= mnth) && (userDate >= dt) && (userHour >= shr) && (userMin < smin)) || ((userYr > yr) && (userMnth >= mnth) && (userDate >= dt) && (userHour < shr) && (userMin >= smin))\n || ((userYr > yr) && (userMnth >= mnth) && (userDate >= dt) && (userHour < shr) && (userMin < smin)) || ((userYr > yr) && (userMnth >= mnth) && (userDate < dt) && (userHour >= shr) && (userMin >= smin))\n || ((userYr > yr) && (userMnth >= mnth) && (userDate < dt) && (userHour >= shr) && (userMin < smin)) || ((userYr > yr) && (userMnth >= mnth) && (userDate < dt) && (userHour < shr) && (userMin >= smin))\n || ((userYr > yr) && (userMnth >= mnth) && (userDate < dt) && (userHour < shr) && (userMin < smin)) || ((userYr > yr) && (userMnth < mnth) && (userDate >= dt) && (userHour >= shr) && (userMin >= smin))\n || ((userYr > yr) && (userMnth < mnth) && (userDate >= dt) && (userHour >= shr) && (userMin < smin)) || ((userYr > yr) && (userMnth < mnth) && (userDate >= dt) && (userHour < shr) && (userMin >= smin))\n || ((userYr > yr) && (userMnth < mnth) && (userDate >= dt) && (userHour < shr) && (userMin < smin)) || ((userYr > yr) && (userMnth < mnth) && (userDate < dt) && (userHour >= shr) && (userMin >= smin))\n || ((userYr > yr) && (userMnth < mnth) && (userDate < dt) && (userHour >= shr) && (userMin < smin)) || ((userYr > yr) && (userMnth < mnth) && (userDate < dt) && (userHour < shr) && (userMin >= smin))\n || ((userYr > yr) && (userMnth < mnth) && (userDate < dt) && (userHour < shr) && (userMin < smin))) {\n state = true;\n } else {\n JOptionPane.showMessageDialog(null, \"Invalid time!\");\n state = false;\n }\n\n } else {\n JOptionPane.showMessageDialog(null, \"Invalid time!\");\n state = false;\n }\n\n } else {\n JOptionPane.showMessageDialog(null, \"Invalid day!\");\n state = false;\n }\n\n } else {\n JOptionPane.showMessageDialog(null, \"Invalid month!\");\n state = false;\n }\n } else {// if the user entered year is already passed\n JOptionPane.showMessageDialog(null, \"Invalid year\");\n state = false;\n }\n return state;\n }",
"public DateInputVerifier(String df)\n {\n super();\n sdf = new SimpleDateFormat(df);\n errmsg = new String();\n dfstr = df;\n }",
"public static boolean checkExpDate(String cS_exp_date) {\n\t\t\n\t\t\n\t\treturn true;\n\t}",
"public boolean checkDate() {\n\t\tboolean cd = checkDate(this.year, this.month, this.day, this.hour);\n\t\treturn cd;\n\t}",
"public static boolean isValidDate(String input) {\n try {\n LocalDate.parse(input);\n return true;\n } catch (DateTimeParseException e) {\n return false;\n }\n }",
"@SuppressWarnings(\"unchecked\")\n @Test\n public void nonParsableDate() throws ServletException, IOException {\n final String finalDate = \"asd\";\n final String requestId = \"1\";\n initialize(finalDate, requestId);\n servlet.doPost(request, response);\n assertEquals(\"Invalid date!\", ((Map<String, Object>) request.getAttribute(\"viewModel\")).get(\"errorMessage\"));\n }",
"public Date getBirthday();",
"public void dateOfBirthDropDownTest() {\r\n\t\tif(Step.Wait.forElementVisible(QuoteForm_ComponentObject.birthMonthDropDownLocator, \"Birth month drop-down\", 5)) {\r\n\t\t\tdropDownTest(QuoteForm_ComponentObject.birthMonthDropDownLocator,QuoteForm_ComponentObject.birthMonthDefaultLocator,\r\n\t\t\t\t\tQuoteForm_ComponentObject.birthMonthValidSelectionLocator, QuoteForm_ComponentObject.birthMonthInvalidSelectionLocator, \"MM\", \"June\");\r\n\t\t}\r\n\t\tif(Step.Wait.forElementVisible(QuoteForm_ComponentObject.birthDayDropDownLocator, \"Birth day drop-down\", 5)) {\r\n\t\t\tdropDownTest(QuoteForm_ComponentObject.birthDayDropDownLocator, QuoteForm_ComponentObject.birthDayDefaultLocator,\r\n\t\t\t\t\tQuoteForm_ComponentObject.birthDayValidSelectionLocator,QuoteForm_ComponentObject.birthDayInvalidSelectionLocator, \"DD\", \"14\");\r\n\t\t}\r\n\t\tif(Step.Wait.forElementVisible(QuoteForm_ComponentObject.birthYearDropDownLocator, \"Birth year drop-down\", 5)) {\r\n\t\t\tdropDownTest(QuoteForm_ComponentObject.birthYearDropDownLocator, QuoteForm_ComponentObject.birthYearDefaultLocator,\r\n\t\t\t\t\tQuoteForm_ComponentObject.birthYearValidSelectionLocator, QuoteForm_ComponentObject.birthYearInvalidSelectionLocator, \"YYYY\", \"1990\");\r\n\t\t}\r\n\t}",
"public boolean isValidDate(String s) {\n try {\n LocalDate.parse(s);\n return true;\n } catch (DateTimeParseException e) {\n return false;\n }\n }",
"public static String verifyHireDate(Scanner input, String tempDate){\n \n //String used for regex verification of input date\n String theRegex = \"[0-1][0-9][/][0-3][0-9][/][1-2][0-9][0-9][0-9]\";\n \n //While tempDate does not match theRegex\n while(!tempDate.matches(theRegex)){\n System.out.print(\"The employee's hire date you entered was invalid.\\nMake sure the date you enter matches IX/JX/KXXX including the slashes\"\n + \"\\nwhere I is a 0 or 1, J is 0-3, K is a 1 or 2, and X is a digit 0-9: \");\n tempDate = input.nextLine();\n }\n return tempDate; \n }",
"void fiscalCodeValidity(M person) {\n // Valid data\n assignValidData(person);\n assertDoesNotThrow(person::checkDataValidity);\n\n // Invalid data\n person.setFiscalCode(null);\n assertThrows(InvalidFieldException.class, person::checkDataValidity);\n person.setFiscalCode(\"A\");\n assertThrows(InvalidFieldException.class, person::checkDataValidity);\n }",
"public void setBirth(Date birth) {\n this.birth = birth;\n }",
"public void setBirth(Date birth) {\n this.birth = birth;\n }",
"private static void checkDate(String date) {\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"yyyy-MM-dd\");\n if (!date.matches(RegexPattern.DATE_PATTERN)) {\n throw new DaoException(ExceptionMessage.getMessage(ExceptionMessage.DATE_PATTERN_ERROR));\n }\n try {\n Date formatDate = simpleDateFormat.parse(date);\n if (formatDate.getTime() + TIME_IN_DAY < new Date().getTime()) {\n throw new DaoException(\"Date must be in Future\");\n }\n } catch (ParseException ex) {\n throw new DaoException(ex.getMessage());\n }\n }",
"public boolean verifyReturnDate(Date date){\n\t\tLocale en = new Locale(\"en\");\n\t\tString rDate = String.format(en, \"%1$ta, %1$tb %1$te, %1$tY\", date);\n\t\treturn returnDate.getText().equals(rDate);\n\t}"
] | [
"0.7858245",
"0.7727952",
"0.73495835",
"0.728637",
"0.71810526",
"0.71513844",
"0.71263725",
"0.7009319",
"0.6803831",
"0.6772367",
"0.6754594",
"0.6748183",
"0.6744418",
"0.6641726",
"0.65704626",
"0.6531393",
"0.65220606",
"0.6517144",
"0.64992577",
"0.64968795",
"0.64790136",
"0.6429956",
"0.6399555",
"0.63897246",
"0.63866866",
"0.6362587",
"0.63573724",
"0.62933874",
"0.6288598",
"0.62864065",
"0.62791264",
"0.6253277",
"0.62478673",
"0.62335616",
"0.6231183",
"0.622779",
"0.6223859",
"0.6195266",
"0.61946285",
"0.6164214",
"0.6158067",
"0.6137154",
"0.613647",
"0.6131015",
"0.61224294",
"0.61157936",
"0.61157936",
"0.6113581",
"0.6110059",
"0.6102643",
"0.6099423",
"0.6096865",
"0.606236",
"0.604983",
"0.6049447",
"0.60442126",
"0.60436344",
"0.6036383",
"0.6032152",
"0.6031465",
"0.60308135",
"0.6021985",
"0.60206646",
"0.60158926",
"0.6015255",
"0.6001819",
"0.59998417",
"0.59927416",
"0.597275",
"0.59695756",
"0.5963138",
"0.5960254",
"0.59599245",
"0.5943893",
"0.59377825",
"0.59337705",
"0.5932489",
"0.5931868",
"0.5930319",
"0.59111726",
"0.5898713",
"0.5893861",
"0.5890335",
"0.58806676",
"0.58741796",
"0.586676",
"0.5859036",
"0.5843954",
"0.58408636",
"0.5834191",
"0.58330506",
"0.58305335",
"0.5824989",
"0.5821951",
"0.5819317",
"0.58163565",
"0.581546",
"0.581546",
"0.5797787",
"0.57899296"
] | 0.70030046 | 8 |
C.Reg14 The user should be notified if their registration has been successfully submitted | @Test
public void testUserNotifiedOnRegistrationSubmission() throws Exception {
ResponseEntity<String> response = registerUser(username, password);
assertNotNull(userService.getUser(username));
assertEquals(successUrl, response.getHeaders().get("Location").get(0));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void confirmRegistration(RegistrationData d) {}",
"private void registration() {\n\t\tif (ur_name.getText().length() > 0 && email.getText().length() > 0\r\n\t\t\t\t&& pass.getText().length() > 0\r\n\t\t\t\t&& re_pass.getText().length() > 0) {\r\n\t\t\tif (pass.getText().toString()\r\n\t\t\t\t\t.equalsIgnoreCase(re_pass.getText().toString())) {\r\n\t\t\t\tString postEntity = \"user_name=\" + ur_name.getText().toString()\r\n\t\t\t\t\t\t+ \"&email=\" + email.getText().toString() + \"&password=\"\r\n\t\t\t\t\t\t+ pass.getText().toString() + \"&gcm_id=\"\r\n\t\t\t\t\t\t+ GlobalDeclares.getGcmId();\r\n\t\t\t\tnew ServerUtilities(getApplicationContext(),\r\n\t\t\t\t\t\tGlobalDeclares.NEW_REGISTRATION, postEntity, delegate);\r\n\r\n\t\t\t} else {\r\n\t\t\t\tToast.makeText(getApplicationContext(),\r\n\t\t\t\t\t\t\"Password does not match!\", Toast.LENGTH_LONG).show();\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\tToast.makeText(getApplicationContext(),\r\n\t\t\t\t\t\"You need to fill all the fields!\", Toast.LENGTH_LONG)\r\n\t\t\t\t\t.show();\r\n\t\t}\r\n\r\n\t}",
"@Override\n protected void onSubmit()\n {\n final ApplicationUser appUser = (ApplicationUser) getModelObject();\n UserRegistration userRegistration = new UserRegistration(appUser.getBusinessUser());\n paramUserId = userRegistration.getUserId();\n //paramDateTime = userRegistration.getRequestTimeAsString();\n //paramToken = userRegistration.getMailToken();\n\n // Note: Dccd does not use a validation Page!\n\n\t\t\t// Construct the url for the activation of member and/or organisation\n\t\t\tMap<String, String> parameterMap = new HashMap<String, String>();\n\t\t\tparameterMap.put(\"userId\", paramUserId);\n\t\t\tparameterMap.put(\"inEditMode\", \"0\"); // activation button is placed on non-edit page!\n\t\t\tparameterMap.put(\"enableModeSwitch\", \"1\");\n\t\t\tfinal String activationUrl = createPageURL(MemberPage.class, parameterMap);\n\t\t\tuserRegistration.setActivationUrl(activationUrl);\n\t\t\tlogger.debug(\"activationUrl: \" + activationUrl);\n\n if (isOrganisationEdit())\n {\n \tlogger.debug(\"new Organisation must now be registered\");\n \tassert(null != newOrganisation);\n \t// Also register the new organisation\n \tlogger.debug(\"New organistation: \" + newOrganisation.getId());\n \tOrganisationRegistration organisationRegistration =\n \t\tnew OrganisationRegistration(newOrganisation);\n\n \tuserRegistration.setOrganisation(newOrganisation);\n \tDccdUserService.getService().handleRegistrationRequest(userRegistration, organisationRegistration);\n\n \tif (!organisationRegistration.isCompleted())\n \t{\n \t\t// something went wrong!\n \tlogger.debug(\"Could not complete organisation registration\");\n for (String stateKey : organisationRegistration.getAccumulatedStateKeys())\n {\n //error(getString(stateKey));\n \t// allow for substitution\n error(getString(stateKey, new Model(organisationRegistration)));\n }\n \t}\n }\n else\n {\n \tuserRegistration.setOrganisation(selectedOrganisation);\n \tuserRegistration = DccdUserService.getService().handleRegistrationRequest(userRegistration);\n }\n\n if (userRegistration.isCompleted())\n {\n disableForm(new String[] {});\n info(getString(\"missionAccomplished\", new Model(appUser)));\n //setResponsePage(new InfoPage(getString(\"registrationpage.header\")));\n // use specific page for the confirmation\n setResponsePage(new RegistrationConfirmPage(appUser));\n }\n else\n {\n \tlogger.debug(\"Could not complete user registration\");\n for (String stateKey : userRegistration.getAccumulatedStateKeys())\n {\n error(getString(stateKey));\n }\n }\n logger.debug(\"End onSubmit: \" + userRegistration.toString());\n }",
"public void v_GuestRegistration(){\n\t\tResult=\"Pass\";\n\t\tLF.AddActualResult(Result);\n\t}",
"public void processRegistration() {\n try {\n System.out.println(\"Processing Registration\");\n FacesContext c = FacesContext.getCurrentInstance();\n c.getApplication().getNavigationHandler().handleNavigation(c, null, \"register.xhtml\");\n } catch (Exception ex) {\n System.out.println(ex.getMessage());\n }\n }",
"void onSignUpEmailRegistered();",
"@Test(priority = 1, alwaysRun = true)\n\n\tpublic void usercanregistersuccessfully() {\n\t\thomeobject = new HomePage(driver);\n\t\thomeobject.openregisterpage();\n\t\t// take object mn el method elmowgoda fy home page\n\t\tregistrationobject = new UserRegisteration(driver);\n\t\tregistrationobject.userregisteration( firstname, lastname, email, password);\n\n\t\t// validate the scenario\n\t\tAssert.assertTrue(registrationobject.successmessage.getText().contains(\"Your registration completed\"));\n\t}",
"public void RegisterUser() {\n try {\n reg = new Registration();\n reg.setFirstName(FName);\n reg.setLastName(LName);\n reg.setCompanyName(CompanyName);\n reg.setEmail(Email);\n reg.setMobile(mobile);\n ValidateRegistration validator = new ValidateRegistration();\n boolean legitmail = validator.validateEmail(reg);\n if ( legitmail == false ) {\n System.out.println(\"Not a legitimate Email\");\n FacesContext c = FacesContext.getCurrentInstance();\n FacesMessage m = new FacesMessage(\"Invalid Email\", \"The email provided is not correct\");\n c.addMessage(null, m);\n } else {\n FacesContext c = FacesContext.getCurrentInstance();\n c.getApplication().getNavigationHandler().handleNavigation(c, null, \"mainpage.xhtml\");\n }\n } catch (Exception ex) {\n System.out.println(ex.getMessage());\n }\n }",
"@Override\n public void onRegistrationSuccess(RegistrationResponse response) {\n if (response.isStatus()) {\n\n startActivityForResult(new Intent(this,VerifyEmailActivity.class)\n .putExtra(getString(R.string.from_sign_up_key),true)\n .putExtra(getString(R.string.email_id_key),model.getEmail().getValue()),VERIFY_EMAIL_REQUEST_CODE);\n\n\n } else {\n StringBuilder errorMsg = new StringBuilder();\n if (null != response.getErrors()) {\n for (Error e : response.getErrors()) {\n if (e.getCode().equalsIgnoreCase(\"REG005\")) {\n signUpBinding.txtEmailId.setErrorEnabled(true);\n signUpBinding.txtEmailId.setError(e.getMessage());\n } else {\n errorMsg.append(e.getMessage()).append(\"\\n\");\n }\n }\n } else {\n errorMsg.append(getString(R.string.server_error));\n }\n signUpBinding.txtError.setText(errorMsg);\n signUpBinding.txtError.setVisibility(View.VISIBLE);\n }\n }",
"@Override\n public void onRegistrationSuccess() {\n listener.onUsernameAvailabilityChecked(false);\n }",
"public void userShouldBeAbleToRegisterSuccessfully() {\n clickElement(reg_link);\n //Select gender\n clickElement(gender);\n //Enter Firstname\n enterText(firstName, readTestDataFile(\"FirstName\"));\n //Enter Lastname\n enterText(lastName, readTestDataFile(\"LastName\"));\n //Select date of birth\n int num=Integer.valueOf(readTestDataFile(\"DateDay\"));\n selectByIndex(dateDay,num);\n //Select date of month\n selectbyVisibleText(month, readTestDataFile(\"Month\"));\n //Select date of Year\n selectByValue(year, readTestDataFile(\"Year\"));\n //Enter Email\n enterText(email, readTestDataFile(\"Email\")+dateStamp()+\"@test.com\");\n //Enter Company name\n enterText(company, readTestDataFile(\"Company\"));\n //Enter Newsletter option\n driver.findElement(newsletter).isSelected();\n //Enter Password\n enterText(password, readTestDataFile(\"Password\"));\n //Enter ConfirmPassword\n enterText(confirmPassword, readTestDataFile(\"ConfirmPassword\"));\n //Click Register button\n clickElement(registerButton);\n //Expected Result\n String expectedRegisterSuccessMessage = \"Your registration completed\";\n String actualRegisterSuccessMessage=getText(actualMessage);\n //assert use to compare expected and actual result are same or not\n softAssert.assertEquals(expectedRegisterSuccessMessage,actualRegisterSuccessMessage,\"Registration Fail\");\n softAssert.assertAll();\n //Click logout button\n clickElement(logOut);\n }",
"boolean hasRegistrationRequest();",
"UserRegistrationResponse registrationPost(RegistrationForm registrationForm);",
"private void registerEmailAddr() {\r\n\t\t\t\tWindow.setTitle(Common.APPNAME);\r\n\t\t\t\tmanualRegisterBtn.setEnabled(false);\r\n\t\t\t\tfinal String emailAddrProvided = emailAddrField.getText();\r\n\t\t\t\tserverResponseLabel.setText(\"\");\r\n\t\t\t\tregisterService.manualRegister(emailAddrProvided,\r\n\t\t\t\t\tnew AsyncCallback<String>() {\r\n\t\t\t\t\t\tpublic void onFailure(Throwable caught) {\r\n\t\t\t\t\t\t\t// Show the RPC error message to the user\r\n\t\t\t\t\t\t\tdialogBox.setText(\"Email Address Registration - Failure\");\r\n\t\t\t\t\t\t\tdialogBox.center();\r\n\t\t\t\t\t\t\tcloseButton.setFocus(true);\r\n\t\t\t\t\t\t\tdialogBox.show();\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tpublic void onSuccess(String result) {\r\n\t\t\t\t\t\t\tif (\"Verified\".equalsIgnoreCase(result)) {\r\n\t\t\t\t\t\t\t\tString registerReturnUri = GWT.getHostPageBaseURL() + REGISTER_RETURN_URI;\r\n\t\t\t\t\t\t\t\tWindow.open(registerReturnUri, \"_self\", \"\"); \r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\temailAddrField.setText(\"\");\r\n\t\t\t\t\t\t\t\t/*\r\n\t\t\t\t\t\t\t\tWindow.alert(result);\r\n\t\t\t\t\t\t\t\t*/\r\n\t\t\t\t\t\t\t\tdialogBox.center();\r\n\t\t\t\t\t\t\t\tdialogBox.setAnimationEnabled(true);\r\n\t\t\t\t\t\t\t\tdialogBox.setWidth(\"320px\");\r\n\t\t\t\t\t\t\t\tdialogBox.setText(result);\r\n\t\t\t\t\t\t\t\tcloseButton.setFocus(true);\r\n\t\t\t\t\t\t\t\t/*\r\n\t\t\t\t\t\t\t\tmanualRegisterBtn.setEnabled(true);\r\n\t\t\t\t\t\t\t\t*/\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t);\r\n\t\t\t}",
"boolean hasRegistrationResponse();",
"private void registrationProcessFireStore() {\n\n Log.i(\"checkk UserReg: \", \"registrationprocess\");\n presenter.checkUserDoc(userName,userPhone,adminName,adminPhone);\n Log.i(\"checkk UserReg: \", \"registrationprocess AFTER\");\n\n\n\n }",
"void register() {\n if (registerView.getFirstName().length() == 0 || registerView.getLastName().length() == 0 || registerView.getUsername().length() == 0 || registerView.getPassword().length() == 0) {\n IDialog invalidRegistrationDialog\n = dialogFactory.createDialog(DialogFactoryOptions.dialogNames.MESSAGE, new HashMap<String, Object>() {\n {\n put(\"message\", \"Unable to register: Fields must be non-empty!\");\n put(\"title\", \"Authentication Error\");\n put(\"messageType\", DialogFactoryOptions.dialogType.ERROR);\n }\n });\n\n invalidRegistrationDialog.run();\n } else {\n if (userController.registerUser(registerView.getFirstName(), registerView.getLastName(), registerView.getUsername(), registerView.getPassword()) != null) {\n mainFrame.setPanel(panelFactory.createPanel(PanelFactoryOptions.panelNames.MAIN_MENU));\n } else {\n IDialog invalidRegistrationDialog = dialogFactory.createDialog(DialogFactoryOptions.dialogNames.MESSAGE, new HashMap<String, Object>() {\n {\n put(\"message\", \"Unable to register: Username is already taken\");\n put(\"title\", \"Authentication Error\");\n put(\"messageType\", DialogFactoryOptions.dialogType.ERROR);\n }\n });\n\n invalidRegistrationDialog.run();\n }\n }\n }",
"private void submitForm() {\n Toast.makeText(this, \"Registering...\", Toast.LENGTH_LONG).show();\n }",
"private void registrationView() {\n String login;\n String email;\n String password;\n\n try {\n while (true) {\n printLine();\n print(\"\\tВведите логин\\n\");\n print(\"\\t>>>>> \");\n login = readStringFromConsole();\n\n print(\"\\tВведите email\\n\");\n print(\"\\t>>>>> \");\n try {\n email = valid.emailValidation(readStringFromConsole());\n } catch (NotValidDataException e) {\n printErr(\"\\tнекорректный email\");\n continue;\n }\n\n print(\"\\tВведите пароль\\n\");\n print(\"\\t>>>>> \");\n try {\n password = valid.passwordValidation(readStringFromConsole());\n } catch (NotValidDataException e) {\n printErr(\"\\tнекорректный password\");\n continue;\n }\n break;\n }\n\n try {\n\n serviceAuthorizationService.registration(new UserDto()\n .withUsername(login)\n .withEmail(email)\n .withPassword(password));\n setStatus(REGISTERED);\n printLine();\n print(\"\\tВы успешно зарегистрировались\");\n } catch (AlreadyExistsException e) {\n e.showMessage();\n registrationView();\n }\n } catch (IOException e) {\n registrationView();\n }\n }",
"@When(\"^I check whether to show a notification for rego$\")\n public void i_check_whether_to_show_a_notification_for_rego() throws Throwable {\n result = car.showRegistrationNotification();\n }",
"public void validateRegistration(RegistrationModel register) {\n\t\tif (registerDao.checkAccountNoIfExist(register.getAccount_no(), register.getJai())) {\n\t\t\t// Checks if account if not Existing and not Verified \n\t\t\tif (!registerDao.checkCustomerLinkIfExist(register.getAccount_no())) {\n\t\t\t\t\tgenerateCustomerRecord(register);\n\t\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t// Account already registered.\n\t\t\t\tVerificationModel verify = new VerificationModel();\n\t\t\t\tverify.setAccount_no(register.getAccount_no());\n\t\t\t\t\n\t\t\t\tTimestamp todayTimeStamp = new Timestamp(System.currentTimeMillis());\n\t\t\t\tTimestamp regTimeStamp = verifyDao.retireveReg_date(verify); \n\t\t\t\tlong diffHours = (regTimeStamp.getTime()-todayTimeStamp.getTime()) / (60 * 60 * 1000);\n\t\t\t\t\n\t\t\t\tif (diffHours>24) {\n\t\t\t\t\tgenerateCustomerRecord(register);\n\t\t\t\t} else {\n\t\t\t\t\t// Account already registered. Please verify your registration\n\t\t\t\t\tsetRegistrationError(\"R02\"); \n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Customer not allowed to access online service of OBS!\n\t\t\tsetRegistrationError(\"R01\"); \n\t\t}\n\t}",
"private void sendRegistrationRequestToServer() {\r\n\t\tnew ServerAsyncTask(ApplicationConstant.appurl\r\n\t\t\t\t+ ApplicationConstant.registrationRequestType + \"&userid=62\"\r\n\t\t\t\t+ \"&email=\" + emailAddress.getText().toString().trim()\r\n\t\t\t\t+ \"&firstname=\" + firstName.getText().toString().trim()\r\n\t\t\t\t+ \"&lastname=\" + lastName.getText().toString().trim()\r\n\t\t\t\t+ \"&password=\" + password.getText().toString().trim()\r\n\t\t\t\t+ \"&roles=1\" + \"access=20\", context, new ResponseCallback() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onSuccessRecieve(Object object) {\r\n\r\n\t\t\t\tloadingProgress.setVisibility(View.GONE);\r\n\t\t\t\tshowToastMessage(\"Successfully register on app\");\r\n\t\t\t\tfinish();\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onErrorRecieve(Object object) {\r\n\r\n\t\t\t\tloadingProgress.setVisibility(View.GONE);\r\n\t\t\t\tshowToastMessage((String) object);\r\n\t\t\t}\r\n\t\t}, ApplicationConstant.registrationRequestType).execute();\r\n\r\n\t}",
"public void registrationPost(String regID){\n String type = \"android\";\n String name = LoginActivity.username;\n Callback<Events> callback = new Callback<Events>() {\n\n @Override\n public void success(Events serverResponse, Response response2) {\n if(serverResponse.getResponseCode() == 0){\n BusProvider.getInstance().post(produceEventServerResponse(serverResponse));\n }else{\n BusProvider.getInstance().post(produceErrorEvent(serverResponse.getResponseCode(),\n serverResponse.getMessage()));\n }\n }\n\n @Override\n public void failure(RetrofitError error) {\n if(error != null ){\n Log.e(TAG, error.getMessage());\n error.printStackTrace();\n }\n BusProvider.getInstance().post(produceErrorEvent(-200,error.getMessage()));\n }\n };\n communicatorInterface.postRegistration(regID, type, name, callback);\n }",
"private void signUpEvt() {\n String emailRegex = \"(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\\\"(?:[\\\\x01-\\\\x08\\\\x0b\\\\x0c\\\\x0e-\\\\x1f\\\\x21\\\\x23-\\\\x5b\\\\x5d-\\\\x7f]|\\\\\\\\[\\\\x01-\\\\x09\\\\x0b\\\\x0c\\\\x0e-\\\\x7f])*\\\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\\\x01-\\\\x08\\\\x0b\\\\x0c\\\\x0e-\\\\x1f\\\\x21-\\\\x5a\\\\x53-\\\\x7f]|\\\\\\\\[\\\\x01-\\\\x09\\\\x0b\\\\x0c\\\\x0e-\\\\x7f])+)\\\\])\";\n // Get User Details\n String fullname = this.view.getWelcomePanel().getSignUpPanel().getFullnameText().getText().trim();\n String email = this.view.getWelcomePanel().getSignUpPanel().getEmailText().getText().trim();\n String password = new String(this.view.getWelcomePanel().getSignUpPanel().getPasswordText().getPassword()).trim();\n\n if (!fullname.equals(\"\") && !email.equals(\"\") && !password.equals(\"\")) {\n if (email.matches(emailRegex)) {\n if (model.getSudokuDB().registerUser(fullname, email, password)) {\n view.getWelcomePanel().getCardLayoutManager().next(view.getWelcomePanel().getSlider());\n // Clear Fields\n view.getWelcomePanel().getSignUpPanel().clear();\n Object[] options = {\"OK\"};\n JOptionPane.showOptionDialog(this, \"Your registration was successful!\\n You can now sign in to your account.\", \"Successful Registration\", JOptionPane.OK_OPTION, JOptionPane.INFORMATION_MESSAGE, null, options, null);\n } else {\n Object[] options = {\"Let me try again\"};\n JOptionPane.showOptionDialog(this, \"Your registration was unsuccessful!\\nBe sure not to create a duplicate account.\", \"Unsuccessful Registration\", JOptionPane.OK_OPTION, JOptionPane.ERROR_MESSAGE, null, options, null);\n }\n } else {\n // Email doesn't meet requirement\n Object[] options = {\"I will correct that\"};\n JOptionPane.showOptionDialog(this, \"You must provide a valid email address.\", \"Invalid Email Address\", JOptionPane.OK_OPTION, JOptionPane.INFORMATION_MESSAGE, null, options, null);\n }\n } else {\n // Empty Fields\n Object[] options = {\"Alright\"};\n JOptionPane.showOptionDialog(this, \"In order to register, all fields must be filled out.\", \"Empty Fields\", JOptionPane.OK_OPTION, JOptionPane.INFORMATION_MESSAGE, null, options, null);\n }\n }",
"private void sendToServer(User register) {\r\n RegisterServiceAsync registerServiceAsync = GWT.create(RegisterService.class);\r\n AsyncCallback<String> asyncCallback = new AsyncCallback<String>() {\r\n public void onSuccess(String result) {\r\n if (result != null) {\r\n String[] tmp = result.split(\"_\");\r\n \r\n int value = Integer.parseInt(tmp[0]);\r\n if (value == User.OK) {\r\n RootPanel.get(\"content\").clear();\r\n String[] href = Window.Location.getHref().split(\"#\");\r\n String linker = href[0].contains(\"?\") ? \"&\" : \"?\";\r\n getEntry().showDialogBox(\"ActivationLink\", href[0] + linker + \"activationCode=\" + tmp[1]);\r\n History.newItem(\"welcome\");\r\n } else {\r\n if (value >= User.PASSWORD_FAULT) {\r\n value -= User.PASSWORD_FAULT;\r\n }\r\n if (value >= User.USERNAME_FAULT) {\r\n value -= User.USERNAME_FAULT; \r\n registerInvalid(User.USERNAME_FAULT);\r\n }\r\n if (value >= User.EMAIL_FORMAT) {\r\n value -= User.EMAIL_FORMAT;\r\n registerInvalid(User.EMAIL_FORMAT);\r\n }\r\n if (value >= User.GEBURTSTAG_AGE) {\r\n value -= User.GEBURTSTAG_AGE;\r\n registerInvalid(User.GEBURTSTAG_AGE);\r\n }\r\n if (value >= User.GEBURTSTAG_FORMAT) {\r\n value -= User.GEBURTSTAG_FORMAT;\r\n registerInvalid(User.GEBURTSTAG_FORMAT);\r\n }\r\n if (value >= User.GEBURTSTAG_FAULT) {\r\n value -= User.GEBURTSTAG_FAULT;\r\n registerInvalid(User.GEBURTSTAG_FAULT);\r\n }\r\n submit.setEnabled(true);\r\n }\r\n } else {\r\n submit.setEnabled(true);\r\n }\r\n }\r\n \r\n public void onFailure(Throwable caught) {\r\n registerInvalid(0);\r\n System.out.println(caught);\r\n }\r\n };\r\n registerServiceAsync.register(register, asyncCallback);\r\n }",
"public void handleRegister() {\n\t\tmainApp.showRegistrationPage();\n\t}",
"public void sendMail(RegistrationData d) {}",
"void onNewRegistrationId(String registrationId);",
"private void sendRegistrationIdToBackend()\n {\n\tLog.d(Globals.TAG, \"REGISTER USERID: \" + regid);\n\tString name = ((EditText)findViewById(R.id.name_edittext)).getText().toString();\n\tnew AsyncTask<String, Void, String>()\n\t{\n\t @Override\n\t protected String doInBackground(String... params)\n\t {\n\t\tString msg = \"\";\n\t\ttry\n\t\t{\n\t\t Bundle data = new Bundle();\n\t\t data.putString(\"name\", params[0]);\n\t\t data.putString(\"action\", \"com.antoinecampbell.gcmdemo.REGISTER\");\n\t\t String id = Integer.toString(msgId.incrementAndGet());\n\t\t gcm.send(Globals.GCM_SENDER_ID + \"@gcm.googleapis.com\", id, Globals.GCM_TIME_TO_LIVE, data);\n\t\t msg = \"Sent registration\";\n\t\t}\n\t\tcatch (IOException ex)\n\t\t{\n\t\t msg = \"Error :\" + ex.getMessage();\n\t\t}\n\t\treturn msg;\n\t }\n\n\t @Override\n\t protected void onPostExecute(String msg)\n\t {\n\t\tToast.makeText(context, msg, Toast.LENGTH_SHORT).show();\n\t }\n\t}.execute(name);\n }",
"private void registerUser()\n {\n /*AuthService.createAccount takes a Consumer<Boolean> where the result will be true if the user successfully logged in, or false otherwise*/\n authService.createAccount(entryService.extractText(namedFields), result -> {\n if (result.isEmpty()) {\n startActivity(new Intent(this, DashboardActivity.class));\n } else {\n makeToast(result);\n formContainer.setAlpha(1f);\n progressContainer.setVisibility(View.GONE);\n progressContainer.setOnClickListener(null);\n }\n });\n }",
"private final static void onRegister(TextField username, TextField email, PasswordField password, PasswordField passwordAgain)\n\t{\n\t\t// TODO no password = passwordAgain check\n\t\t// TODO check if username exists\n\t\t// TODO check if email exists\n\n\t\tint id = ProfileManipulation.getHighestId(\"Profile\", true);\n\t\tProfileManipulation.registerUser(id, username.getText(), email.getText(),\n\t\t\t\tpassword.getText());\n\t\tPartylize.setUsername(username.getText());\n\t\tPartylize.showMainScene();\n\t}",
"public void register(RegistrationData d) {}",
"public static void signUp(String username, String password, String alternativeEmail, String firstName, String lastName) {\n click(REGISTRATION_LINK);\n type(REG_FLOW_USERNAME_FIELD, username);\n click(REG_FLOW_CHECK_BUTTON);\n// if (!REG_FLOW_USERNAME_FREE_MESSAGE.toString().contains(\"Потребителското име е свободно\")) {\n// System.out.println(\"Try another username - the entered one is already in use\");\n// }\n type(REG_FLOW_PASSWORD_FIELD, password);\n type(REG_FLOW_PASSWORD_REENTER_FIELD, password);\n WebElement phoneCheckbox = Browser.driver.findElement(REG_FLOW_PHONE_CHECKBOX);\n if (phoneCheckbox.isEnabled()) {\n phoneCheckbox.click(); //that's how we disable it\n }\n type(REG_FLOW_ALTERNATIVE_EMAIL_FIELD, alternativeEmail);\n type(REG_FLOW_QUESTION_FIELD, \"To be or not to be?\");\n type(REG_FLOW_ANSWER_FIELD, \"To beeee.\");\n type(REG_FLOW_FNAME_FIELD, firstName);\n type(REG_FLOW_LNAME_FIELD, lastName);\n Browser.driver.switchTo().frame(\"abv-GDPR-frame\").manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n // Manually to tap ACCEPT on the GDPR window\n Browser.driver.switchTo().defaultContent();\n click(REG_FLOW_GENDER_RADIOBUTTON); //to choose male\n click(REG_FLOW_DAY_DROPDOWN);\n click(REG_FLOW_DAY_3); // to choose 3th\n click(REG_FLOW_MONTH_DROPDOWN);\n click(REG_FLOW_MONTH_5); // to choose May\n click(REG_FLOW_YEAR_DROPDOWN);\n click(REG_FLOW_YEAR_1998); // to choose 1998\n\n findElement(REG_FLOW_CAPTCHA_FIELD);\n click(REG_FLOW_CAPTCHA_FIELD);\n // Timeout to enter the CAPTCHA manually\n // EXPLICIT WAIT DA MU TURYA\n click(REG_FLOW_CREATE_BUTTON);\n String successfulRegMessage = Browser.driver.findElement(REG_SUCCESS_MESSAGE).getText().trim();\n assertTrue(successfulRegMessage.contains(\"Успешна регистрация.\"), \"No SUCCESS message\");\n click(LOGIN_TO_YOUR_EMAIL_BUTTON);\n }",
"public String createRegisterForm(Register reg)\n {\n DBConnect db = new DBConnect();\n Connection con;\n \n try\n {\n con = (Connection) db.establishConnection();\n String q = \"insert into registerUser (register_name, register_email, register_phone, register_pass)\"\n + \"values (?, ?, ?, ?)\";\n \n PreparedStatement prepareState = con.prepareStatement(q);\n \n prepareState.setString(1, reg.getRegisterName());\n prepareState.setString(2, reg.getRegisterEmail());\n prepareState.setString(3, reg.getRegisterPhone());\n prepareState.setString(4, reg.getRegisterPassword());\n \n prepareState.execute();\n con.close();\n \n return \"Successfully Registered..!!\";\n }\n \n catch(Exception ex)\n {\n System.err.println(\"Exception..!!\");\n System.err.println(\"Message: \" + ex.getMessage());\n \n return \"Data Not Registered..!!\";\n }\n \n }",
"@Override\n public void onRegistrationAccomplished() {\n Prefs.setSignedIn(true);\n // Proceed to Main\n proceedToMainActivityAndFinish();\n }",
"@Override\n\t\t\t\t\tprotected Void doInBackground(Void... params) {\n\n\t\t\t\t\t\taController.register(context, email, regId);\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}",
"@Override\n public void run() {\n if (serverR.equals(available)){\n Log.d(TAG, \"run: REGISTERED SUCCESSFULLY\");\n\n } else {\n Log.d(TAG, \"run: REGISTRATION ERROR\");\n Toast.makeText(getApplicationContext(),\n \"Something went wrong.\", Toast.LENGTH_LONG).show();\n }\n }",
"private void checkRegistationValidation() {\r\n\t\tUtility.hideKeyBoard(this);\r\n\t\tif (firstName.getText().toString().length() == 0\r\n\t\t\t\t&& lastName.getText().toString().length() == 0\r\n\t\t\t\t&& emailAddress.getText().toString().length() == 0\r\n\t\t\t\t&& password.getText().toString().length() == 0\r\n\t\t\t\t&& confirmPassword.getText().toString().length() == 0) {\r\n\t\t\tshowToastMessage(\"All fields are mendatory\");\r\n\t\t} else if (emailAddress.getText().toString().length() == 0) {\r\n\r\n\t\t\temailAddress.setError(Constant.emailFieldValidation);\r\n\t\t\temailAddress.setText(\"\");\r\n\t\t\temailAddress.requestFocus();\r\n\t\t} else if (firstName.getText().toString().length() == 0) {\r\n\t\t\tfirstName.setError(\"Enter first name\");\r\n\t\t\tfirstName.setText(\"\");\r\n\t\t\tfirstName.requestFocus();\r\n\t\t} else if (lastName.getText().toString().length() == 0) {\r\n\t\t\tlastName.setError(\"Enter first name\");\r\n\t\t\tlastName.setText(\"\");\r\n\t\t\tlastName.requestFocus();\r\n\t\t} else if (password.getText().toString().length() == 0) {\r\n\t\t\tpassword.setError(Constant.passwordFieldValidation);\r\n\t\t\t;\r\n\t\t\tpassword.setText(\"\");\r\n\t\t\tpassword.requestFocus();\r\n\t\t} else if (!Utility.validateEmail(emailAddress.getText().toString())) {\r\n\t\t\temailAddress.setError(Constant.emailFormatValidation);\r\n\t\t\temailAddress.setText(\"\");\r\n\t\t\temailAddress.requestFocus();\r\n\r\n\t\t} else if (!password.getText().toString()\r\n\t\t\t\t.equals(confirmPassword.getText().toString())) {\r\n\t\t\tconfirmPassword.setError(\"Confirm password not same as password\");\r\n\t\t\tconfirmPassword.setText(\"\");\r\n\t\t\tconfirmPassword.requestFocus();\r\n\t\t} else {\r\n\t\t\tif (isConnectedToInternet()) {\r\n\t\t\t\tloadingProgress.setVisibility(View.VISIBLE);\r\n\t\t\t\tsendRegistrationRequestToServer();\r\n\r\n\t\t\t} else {\r\n\t\t\t\tnew Utility().showCustomDialog(\"Ok\", \"Internet Connection\",\r\n\t\t\t\t\t\t\"no internet access\", false, RegistrationActivity.this,\r\n\t\t\t\t\t\tnull, null);\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public String getRegisterSuccessMessage() {\n\t\twaitToElementVisible(driver,RegisterPageUI.REGISTER_SUCCEESS_MESSAGE);\n\t\treturn getElementText(driver,RegisterPageUI.REGISTER_SUCCEESS_MESSAGE);\n\t}",
"@Override\n public void onValidationSucceeded() {\n String email = mEmailField.getText().toString();\n String firstName = mFirstNameField.getText().toString();\n String lastName = mLastNameField.getText().toString();\n String password = mPasswordField.getText().toString();\n\n mSignUpInterface.onSignup(email, firstName, lastName, password);\n }",
"@Test\n\tpublic void TC01_Register() {\n\t\tclickToElemnet(registerLinkX);\n\t\tSystem.out.println(\"TC01 : 1. Register Page Display Status : \" + checkElementDisplayed(registerPageX));\n\n\t\t// Register new accout\n\t\tclickToElemnet(genderMaleRadioBtnX);\n\t\tsendkeysToElement(firstNameTxtX, regFirstName);\n\t\tsendkeysToElement(lastNameTxtX, regLastName);\n\t\tselectElementFromDropDown(dateOfBirthDropDownX, regDateOfBirth);\n\t\tselectElementFromDropDown(dateOfMonthDropDownX, regDateOfMonth);\n\t\tselectElementFromDropDown(dateOfYearDropDownX, regDateOfYear);\n\t\tsendkeysToElement(emailTxtX, regEmail);\n\t\tsendkeysToElement(companyNameTxtX, regCompanyName);\n\t\tsendkeysToElement(passwordTxtX, regPassword);\n\t\tsendkeysToElement(confirmPasswordTxtX, regPassword);\n\t\tclickToElemnet(registerBtnX);\n\n\t\t// Verify Account is Created Successfully\n\t\tSystem.out.println(\"TC01 : 2. Register message : \" + getTextFromElement(registerSuccessMsgX));\n\n\t\t// Click Log Out Link\n\t\tSystem.out.println(\"TC01 : 3. Click Log Out Link\");\n\t\tclickToElemnet(logOutLinkX);\n\n\t\t// Verify navigate to Home Page\n\t\tSystem.out.println(\"TC01 : 4. Navigate to Home Page : \" + driver.getCurrentUrl());\n\n\t}",
"@Then(\"^registration should be successful$\")\npublic void registration_should_be_successful() throws Throwable {\n\tSystem.out.println(\"Successfuly completed the regitration process\");\n}",
"public void onSignUpClick() {\n\t\tString uid = regview.getUsername();\n\t\tString pw = regview.getPassword();\n\t\tString na = regview.getName();\n\t\tString em = regview.getEmail();\n\t\tString text = \"\";\n\t\tif(uid.equals(\"\") || pw.equals(\"\") || na.equals(\"\")|| em.equals(\"\")){\n\t\t\ttext = \"Please fill out all fields!\";\n\t\t} else if(regview.findUser(uid)!=User.NULL_USER){\n\t\t\ttext = \"The username already exsit, please try another one!\";\n\t\t} else {\n\t\t\tregview.addUser(new User(uid,pw,na,em));\n\t\t\tregview.goLoginPage();\n\t\t}\n\t\tregview.setRegisterText(text);\n\t}",
"public void attemptRegistration(final Context context, final RegistrationListener listener) {\n final String registrationType;\n if (mRegistrationResponse != null && !TextUtils.isEmpty(mRegistrationResponse.session)) {\n AuthParams authParams = null;\n if (mPhoneNumber != null && !isCompleted(LoginRestClient.LOGIN_FLOW_TYPE_MSISDN) && !TextUtils.isEmpty(mPhoneNumber.getSid())) {\n Uri identityServerUri = mHsConfig.getIdentityServerUri();\n if (identityServerUri == null) {\n listener.onIdentityServerMissing();\n return;\n } else {\n registrationType = LoginRestClient.LOGIN_FLOW_TYPE_MSISDN;\n authParams = getThreePidAuthParams(mPhoneNumber.getClientSecret(), identityServerUri.getHost(),\n mPhoneNumber.getSid(), LoginRestClient.LOGIN_FLOW_TYPE_MSISDN);\n }\n } else if (mEmail != null && !isCompleted(LoginRestClient.LOGIN_FLOW_TYPE_EMAIL_IDENTITY)) {\n if (TextUtils.isEmpty(mEmail.getSid())) {\n // Email token needs to be requested before doing validation\n Log.d(LOG_TAG, \"attemptRegistration: request email validation\");\n requestValidationToken(context, mEmail, new ThreePidRequestListener() {\n @Override\n public void onIdentityServerMissing() {\n listener.onIdentityServerMissing();\n }\n\n @Override\n public void onThreePidRequested(ThreePid pid) {\n if (!TextUtils.isEmpty(pid.getSid())) {\n // The session id for the email validation has just been received.\n // We trigger here a new registration request without delay to attach the current username\n // and the pwd to the registration session.\n attemptRegistration(context, listener);\n\n // Notify the listener to wait for the email validation\n listener.onWaitingEmailValidation();\n }\n }\n\n @Override\n public void onThreePidRequestFailed(String errorMessage) {\n listener.onThreePidRequestFailed(errorMessage);\n }\n });\n return;\n } else {\n Uri identityServerUri = mHsConfig.getIdentityServerUri();\n if (identityServerUri == null) {\n listener.onIdentityServerMissing();\n return;\n } else {\n registrationType = LoginRestClient.LOGIN_FLOW_TYPE_EMAIL_IDENTITY;\n authParams = getThreePidAuthParams(mEmail.getClientSecret(), identityServerUri.getHost(),\n mEmail.getSid(), LoginRestClient.LOGIN_FLOW_TYPE_EMAIL_IDENTITY);\n }\n }\n } else if (!TextUtils.isEmpty(mCaptchaResponse) && !isCompleted(LoginRestClient.LOGIN_FLOW_TYPE_RECAPTCHA)) {\n registrationType = LoginRestClient.LOGIN_FLOW_TYPE_RECAPTCHA;\n authParams = getCaptchaAuthParams(mCaptchaResponse);\n } else if (mTermsApproved && !isCompleted(LoginRestClient.LOGIN_FLOW_TYPE_TERMS)) {\n registrationType = LoginRestClient.LOGIN_FLOW_TYPE_TERMS;\n authParams = new AuthParams(LoginRestClient.LOGIN_FLOW_TYPE_TERMS);\n } else if (supportStage(LoginRestClient.LOGIN_FLOW_TYPE_DUMMY)) {\n registrationType = LoginRestClient.LOGIN_FLOW_TYPE_DUMMY;\n authParams = new AuthParams(LoginRestClient.LOGIN_FLOW_TYPE_DUMMY);\n } else if (isPasswordBasedFlowSupported()) {\n // never has been tested\n registrationType = LoginRestClient.LOGIN_FLOW_TYPE_PASSWORD;\n authParams = new AuthParamsLoginPassword();\n\n if (null != mUsername) {\n ((AuthParamsLoginPassword) authParams).user = mUsername;\n }\n\n if (null != mPassword) {\n ((AuthParamsLoginPassword) authParams).password = mPassword;\n }\n } else {\n // others\n registrationType = \"\";\n }\n\n if (TextUtils.equals(registrationType, LoginRestClient.LOGIN_FLOW_TYPE_MSISDN)\n && mEmail != null && !isCaptchaRequired()) {\n // Email will not be processed\n mShowThreePidWarning = true;\n mEmail = null;\n }\n\n final RegistrationParams params = new RegistrationParams();\n if (!registrationType.equals(LoginRestClient.LOGIN_FLOW_TYPE_RECAPTCHA)\n && !registrationType.equals(LoginRestClient.LOGIN_FLOW_TYPE_TERMS)) {\n if (mUsername != null) {\n params.username = mUsername;\n }\n if (mPassword != null) {\n params.password = mPassword;\n }\n }\n\n if (authParams != null) {\n // Always send the current session\n authParams.session = mRegistrationResponse.session;\n\n params.auth = authParams;\n }\n\n register(context, params, new InternalRegistrationListener() {\n @Override\n public void onRegistrationSuccess() {\n if (mShowThreePidWarning) {\n // An email was entered but was not attached to account\n listener.onRegistrationSuccess(context.getString(R.string.auth_threepid_warning_message));\n } else {\n listener.onRegistrationSuccess(null);\n }\n }\n\n @Override\n public void onRegistrationFailed(String message) {\n if (TextUtils.equals(ERROR_MISSING_STAGE, message)\n && (mPhoneNumber == null || isCompleted(LoginRestClient.LOGIN_FLOW_TYPE_MSISDN))) {\n if (mEmail != null && !isCompleted(LoginRestClient.LOGIN_FLOW_TYPE_EMAIL_IDENTITY)) {\n attemptRegistration(context, listener);\n } else if (isTermsRequired()) {\n listener.onWaitingTerms(getLocalizedLoginTerms(context));\n } else {\n // At this point, only captcha can be the missing stage\n listener.onWaitingCaptcha(getCaptchaPublicKey());\n }\n } else {\n listener.onRegistrationFailed(message);\n }\n }\n\n @Override\n public void onResourceLimitExceeded(MatrixError e) {\n listener.onResourceLimitExceeded(e);\n }\n });\n }\n }",
"@Override\r\n\r\n public void getResult(String result) {\n Log.d(\"myApp_AWS\", \"Registration:\" + result);\r\n\r\n if (!result.equals(\"\\\"Successful Registration\\\"\")) {\r\n runOnUiThread(new Runnable() {\r\n @Override\r\n public void run() {\r\n Toast.makeText(Rinnai11eRegistration.this, \"Web Services Error.\",\r\n Toast.LENGTH_LONG).show();\r\n }\r\n });\r\n } else {\r\n\r\n runOnUiThread(new Runnable() {\r\n @Override\r\n public void run() {\r\n Toast.makeText(Rinnai11eRegistration.this, \"Update Successful.\",\r\n Toast.LENGTH_LONG).show();\r\n }\r\n });\r\n }\r\n }",
"private void doRegister(){\n Map<String, String> mParams = new HashMap<>();\n mParams.put(\"account\", etPhone.getText().toString());\n mParams.put(\"password\", etPwd.getText().toString());\n mParams.put(\"code\", etValid.getText().toString());\n\n x.http().post(HttpUtils.getRequestParams(\"/teacher/v1/register\", mParams),\n\n new Callback.CommonCallback<String>() {\n @Override\n public void onSuccess(String result) {\n\n CustomProgress.hideDialog();\n LogUtil.d(\"\"+result);\n Response response = CommonUtil.checkResponse(result);\n if (response.isStatus()) {\n SharedPreferences shareAutoLogin = MyApplication.getInstance().getShareAutoLogin();\n SharedPreferences.Editor editor = shareAutoLogin.edit();\n editor.putBoolean(MyApplication.getInstance().AUTOLOGIN, true);\n editor.commit();\n MyApplication.getInstance().setShareApp(etPhone.getText().toString(), etPwd.getText().toString());\n User user = User.getUserFromJsonObj(response.getData().optJSONObject(\"data\"));\n User.setCurrentUser(user);\n MobclickAgent.onProfileSignIn(user.getNickName());\n\n // 登录环信\n if (!StringUtils.isEmpty(user.hxId) && !StringUtils.isEmpty(user.hxPwd))\n AppUtils.loginEmmobAndSaveInfo(user);\n\n // 极光推送设置别名\n JPushInterface.setAlias(RegisterActivity.this, user.getId() + \"\", new TagAliasCallback() {\n @Override\n public void gotResult(int i, String s, Set<String> set) {\n if (i == 0) {\n LogUtil.i(\"极光推送别名设置成功,别名:\" + s);\n }\n }\n });\n\n socketLogin(user.getToken());\n\n Intent intent = new Intent(RegisterActivity.this, CodeActivity.class);\n startActivity(intent);\n finish();\n } else {\n Toast.makeText(x.app(), response.getData().optString(\"message\"), Toast.LENGTH_SHORT).show();\n\n }\n }\n\n @Override\n public void onError(Throwable ex, boolean isOnCallback) {\n\n CustomProgress.hideDialog();\n\n if (ex instanceof HttpException) { // 网络错误\n HttpException httpEx = (HttpException) ex;\n int responseCode = httpEx.getCode();\n String responseMsg = httpEx.getMessage();\n String errorResult = httpEx.getResult();\n LogUtil.d(responseCode + \":\" + responseMsg);\n Toast.makeText(x.app(), x.app().getResources().getString(R.string.net_error), Toast.LENGTH_SHORT).show();\n } else { // 其他错误\n // ...\n }\n //Toast.makeText(x.app(), ex.getMessage(), Toast.LENGTH_LONG).show();\n }\n\n @Override\n public void onCancelled(CancelledException cex) {\n Toast.makeText(x.app(), \"cancelled\", Toast.LENGTH_LONG).show();\n }\n\n @Override\n public void onFinished() {\n\n }\n });\n\n }",
"@Then(\"^click on the Register button$\")\r\n\tpublic void click_on_the_Register_button() throws Throwable {\n\t register.submitRegistration();\r\n\t}",
"private void gcmRegister() {\n\t\taController = (Controller) getApplicationContext();\n\n\t\t// Check if Internet present\n\t\tif (!aController.isConnectingToInternet()) {\n\n\t\t\t// Internet Connection is not present\n\t\t\taController.showAlertDialog(RegisterActivity.this,\n\t\t\t\t\t\"Internet Connection Error\",\n\t\t\t\t\t\"Please connect to Internet connection\", false);\n\t\t\t// stop executing code by return\n\t\t\treturn;\n\t\t}\n\t\t// Make sure the device has the proper dependencies.\n\t\tGCMRegistrar.checkDevice(this);\n\n\t\t// Make sure the manifest permissions was properly set\n\t\tGCMRegistrar.checkManifest(this);\n\t\t// Register custom Broadcast receiver to show messages on activity\n\t\tregisterReceiver(mHandleMessageReceiver, new IntentFilter(\n\t\t\t\tConfig.DISPLAY_MESSAGE_ACTION));\n\n\t\t// Get GCM registration id\n\t\tfinal String regId = GCMRegistrar.getRegistrationId(this);\n\t\tLog.i(\"regId\", regId);\n\n\t\t// Check if regid already presents\n\t\tif (regId.equals(\"\")) {\n\n\t\t\t// Register with GCM\n\t\t\tGCMRegistrar.register(getApplicationContext(),\n\t\t\t\t\tConfig.GOOGLE_SENDER_ID);\n\n\t\t} else {\n\n\t\t\t// Device is already registered on GCM Server\n\t\t\tif (GCMRegistrar.isRegisteredOnServer(this)) {\n\t\t\t\t// Try to register again, but not in the UI thread.\n\t\t\t\t// It's also necessary to cancel the thread onDestroy(),\n\t\t\t\t// hence the use of AsyncTask instead of a raw thread.\n\n\t\t\t\tfinal Context context = this;\n\t\t\t\tmRegisterTask = new AsyncTask<Void, Void, Void>() {\n\n\t\t\t\t\t@Override\n\t\t\t\t\tprotected Void doInBackground(Void... params) {\n\n\t\t\t\t\t\t// Register on our server\n\t\t\t\t\t\t// On server creates a new user\n\n\t\t\t\t\t\taController.register(context, email, regId);\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\t@Override\n\t\t\t\t\tprotected void onPostExecute(Void result) {\n\t\t\t\t\t\tmRegisterTask = null;\n\t\t\t\t\t}\n\n\t\t\t\t};\n\n\t\t\t\t// execute AsyncTask\n\t\t\t\tmRegisterTask.execute(null, null, null);\n\n\t\t\t} else {\n\n\t\t\t}\n\t\t}\n\t}",
"public RegistrationInfo getRegistrationInfo();",
"@When(\"^the user opens the registration webpage$\")\r\n\tpublic void the_user_opens_the_registration_webpage() throws Throwable {\n\t r.Reg();\r\n\t}",
"private void registerInBackground()\n {\n\tnew AsyncTask<Void, Void, String>()\n\t{\n\t @Override\n\t protected String doInBackground(Void... params)\n\t {\n\t \tLog.i(Globals.TAG, \"backroundregister calisri\");\n\t\tString msg = \"\";\n\t\ttry\n\t\t{\n\t\t if (gcm == null)\n\t\t {\n\t\t \tgcm = GoogleCloudMessaging.getInstance(context);\n\t\t }\n\t\t\t regid = gcm.register(Globals.GCM_SENDER_ID);\n\t\t\t msg = \"Device registered, registration ID=\" + regid;\n\n\t\t // You should send the registration ID to your server over\n\t\t // HTTP, so it can use GCM/HTTP or CCS to send messages to your app.\n\t\t sendRegistrationIdToBackend();\n\n\t\t // For this demo: we use upstream GCM messages to send the\n\t\t // registration ID to the 3rd party server\n\n\t\t // Persist the regID - no need to register again.\n\t\t storeRegistrationId(context, regid);\n\t\t}\n\t\tcatch (IOException ex)\n\t\t{\n\t\t msg = \"Error :\" + ex.getMessage();\n\t\t // If there is an error, don't just keep trying to register.\n\t\t // Require the user to click a button again, or perform\n\t\t // exponential back-off.\n\t\t}\n\t\treturn msg;\n\t }\n\n\t @Override\n\t protected void onPostExecute(String msg)\n\t {\n\t\t((TextView) findViewById(R.id.gcm_userid_textview)).setText(regid);\n\t }\n\t}.execute(null, null, null);\n }",
"@Test(priority=1, dataProvider=\"User Details\")\n\t\tpublic void registration(String firstname,String lastname,String emailAddress,\n\t\t\t\tString telephoneNum,String address1,String cityName,String postcodeNum,\n\t\t\t\tString country,String zone,String pwd,String confirm_pwd) throws Exception{\n\t\t\t\n\t\t\thomePage = new HomePage(driver);\n//'**********************************************************\t\t\t\n//Calling method to click on 'Create Account' link\n\t\t\tregistraionPageOC = homePage.clickCreateAccount();\n//'**********************************************************\t\t\t\n//Calling method to fill user details in Registration page and verify account is created\n\t\t\tregistraionPageOC.inputDetails(firstname,lastname,emailAddress,telephoneNum,address1,cityName,postcodeNum,country,zone,pwd,confirm_pwd);\n\t\t\ttry{\n\t\t\tAssert.assertEquals(\"Your Account Has Been Created!\", driver.getTitle(),\"Titles Not Matched: New Account Not Created\");\n\t\t\textentTest.log(LogStatus.PASS, \"Registration: New User Account is created\");\n\t\t\t}catch(Exception e){\n\t\t\t\textentTest.log(LogStatus.FAIL, \"Registration is not successful\");\n\t\t\t}\n\t\t}",
"private boolean handleRegister(String serverMessage){\r\n\t\t// Separating the message STATUS + OTHER\r\n\t\tString[] messageParts = serverMessage.split(SEPARATOR);\r\n\r\n\t\t// Get status code from message\r\n\t\tint messageStatus = Integer.parseInt(messageParts[0]);\r\n\r\n\t\t// Process status\r\n\t\tswitch (messageStatus) {\r\n\t\tcase REQUEST_OK:\r\n\r\n\t\t\tSystem.out.println(\"Register request OK\");\r\n\t\t\tJOptionPane.showMessageDialog(null,\"Username is crated now you can Sign in!\", \"Register successful\",\r\n\t\t\t\t\tJOptionPane.INFORMATION_MESSAGE);\r\n\t\t\treturn true;\r\n\r\n\t\tcase INCORRECT_REQUEST_FORMAT:\r\n\r\n\t\t\tSystem.err.println(\"Oups! \\nSomethin went wrong!\\n Request format was invalid\");\r\n\t\t\tbreak;\t\t\r\n\r\n\t\tcase USER_NAME_ALREADY_EXIST:\r\n\r\n\t\t\tJOptionPane.showMessageDialog(null,\"Username alredy exists!\", \"Error\",\r\n\t\t\t\t\tJOptionPane.ERROR_MESSAGE);\r\n\t\t\tbreak;\r\n\r\n\t\tdefault:\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}",
"@Override\n\t\t\t\t\tpublic void onSuccess(String arg0) {\n\t\t\t\t\t\tsuper.onSuccess(arg0);\n\t\t\t\t\t\tLog.i(\"test\", \"return---\" + arg0);\n\t\t\t\t\t\tif (JsonPaser.paserRegisterResult(arg0).equals(name)) {\n\t\t\t\t\t\t\tSharedPreferences sp = getApplication().getSharedPreferences(Configure.SHARED_PREFERENCES,\n\t\t\t\t\t\t\t\t\t\t\tActivity.MODE_PRIVATE);\n\t\t\t\t\t\t\tsp.edit().putString(Configure.TOKEN,FlashScreenActivity.token).commit();\n\t\t\t\t\t\t\tsp.edit().putString(Configure.EMAIL,emailEditText.getText().toString()).commit();\n\t\t\t\t\t\t\tif (pd != null && pd.isShowing())\n\t\t\t\t\t\t\t\tpd.dismiss();\n\t\t\t\t\t\t\tIntent i = new Intent(getApplicationContext(),Seiri01Activity.class);\n\t\t\t\t\t\t\ti.putExtra(\"first\", \"0\");\n\t\t\t\t\t\t\ti.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n\t\t\t\t\t\t\tstartActivity(i);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}",
"private void registerBackground() {\n new AsyncTask<Void,Void,Boolean>() {\n @Override\n protected Boolean doInBackground(Void... params) {\n try {\n if (gcm == null) {\n gcm = GoogleCloudMessaging.getInstance(context);\n }\n mregistrationGCMMessageView.setText(R.string.looking_for_regid);\n regid = gcm.register(SENDER_ID);\n \n // Save the regid - no need to register again.\n setRegistrationId(context, regid);\n\n } catch (IOException ex) {\n \tLog.v(\"RegisterGCM\", \"Registration not found. \" + ex);\n \treturn false;\n }\n return true;\n }\n\n @Override\n protected void onPostExecute(Boolean result) {\n if(!result)\n \tmregistrationGCMMessageView.setText(R.string.failed_regid);\n else\n \taskForUserAndPassword();\n }\n }.execute(null, null, null);\n }",
"@Test(groups ={Slingshot,Regression,CsaAgent})\t\n\t\tpublic void verifyPartnerServiceAgentRegisterUser() throws Exception {\n\t\t\tReport.createTestLogHeader(\"PSA Journey\", \"To verify whether the Partner service agent is able to register a Broker through Partner service agent journey\");\n\t\t\tUserProfile userProfile = new TestDataHelper().getUserProfile(\"PSABroker\");\n\t\t\tCrmUserProfile crmuserProfile = new TestDataHelper().getCrmUserProfile(\"SlingshotCrmDetails\"); \n\t\t\tnew PartnerServiceAgentAction()\n\t\t\t.navigateToPSARegistration()\n\t\t\t.clickRegisteraUser(userProfile);\n\t\t\t/*new SapCrmAction()\n\t\t\t .loginDetails(crmuserProfile)\n\t\t\t .searchByAccountId(crmuserProfile, userProfile);*/\n\t\t\tnew RegistrationAction()\n\t\t\t.openEncryptURL(userProfile)\n\t\t\t.fillRegistrationDetails(userProfile)\n\t\t\t.verifyThankYouPage()\n\t\t\t.clickLoginLink()\n\t\t\t.verifyAuditEntry(userProfile)\n\t\t\t.verifyEmailIdInDb(userProfile);\n\t\t\t}",
"public void uidRegistered(UIDRegistrationEvent uidregistrationevent) {\n \r\n }",
"private void registerUser() {\n\n // Get register name\n EditText mRegisterNameField = (EditText) findViewById(R.id.register_name_field);\n String nickname = mRegisterNameField.getText().toString();\n\n // Get register email\n EditText mRegisterEmailField = (EditText) findViewById(R.id.register_email_field);\n String email = mRegisterEmailField.getText().toString();\n\n // Get register password\n EditText mRegisterPasswordField = (EditText) findViewById(R.id.register_password_field);\n String password = mRegisterPasswordField.getText().toString();\n\n AccountCredentials credentials = new AccountCredentials(email, password);\n credentials.setNickname(nickname);\n\n if (DataHolder.getInstance().isAnonymous()) {\n credentials.setOldUsername(DataHolder.getInstance().getUser().getUsername());\n }\n\n sendRegistrationRequest(credentials);\n }",
"public int register() \n { \n File file = new File(MSB_REGISTION_FILE);\n if(!file.exists()) \n {\n LOGGER.info(\"Stop registering as can't find msb registion file:\" + file.getAbsolutePath()); \n return CommonConstant.MsbRegisterCode.MSDB_REGISTER_FILE_NOT_EXISTS;\n }\n\n Map<?, ?> msbRegistionBodyMap = getMsbRegistrationData();\n if(null == msbRegistionBodyMap)\n {\n LOGGER.info(\"Reading data from msb registion file failed:\" + file.getAbsolutePath()); \n return CommonConstant.MsbRegisterCode.MSDB_REGISTER_FILE_NOT_EXISTS;\n }\n\n LOGGER.info(\"Registering body: \" + JsonUtil.toJson(msbRegistionBodyMap));\n\n bRegistrationStatus = sendRequest(msbRegistionBodyMap);\n \n return bRegistrationStatus \n ? CommonConstant.MsbRegisterCode.MSDB_REGISTER_SUCESS \n : CommonConstant.MsbRegisterCode.MSDB_REGISTER_FAILED;\n }",
"private static int requestRegNum() { // From Assignment2 Starter Code by Dave Houtman\r\n\t\treturn (Integer.parseInt(getResponseTo(\"Enter registration number : \")));\r\n\t}",
"public void UserHasBeenRegistered() {\r\n\t\t\tJOptionPane.showMessageDialog(new JFrame(), \"User has been registered\",\"\", JOptionPane.INFORMATION_MESSAGE);\r\n\t\t\tNameTF.setText(\"\");\r\n\t\t\tSurnameTF.setText(\"\");\r\n\t\t\tUsernameTF.setText(\"\");\r\n\t\t\tPasswordTF.setText(\"\");\r\n\t\t\tEmailTF.setText(\"\");\r\n\t\t\tAddressTF.setText(\"\");\r\n\t\t\tCardNTF.setValue(null);\r\n\t\t}",
"public interface OnRegistrationListener {\n void onRegistrationSuccess();\n void onRegistrationFailed(String message);\n}",
"public void register(View view) {\n if(radioGroup.getCheckedRadioButtonId() == -1){\n Snackbar.make(getCurrentFocus(),\"Please select one of the Options: Student or Professor\",Snackbar.LENGTH_LONG).show();\n return;\n }\n if (usn.getText().toString().trim().equals(\"\")){\n usn.setError(\"This field cannot be empty\");\n return;\n } else if (password.getText().toString().trim().equals(\"\")){\n password.setError(\"This field cannot be empty\");\n return;\n } else if(password.getText().toString().trim().length() < 8){\n password.setError(\"Password too short.\");\n return;\n } else if(confirmPassword.getText().toString().trim().equals(\"\")){\n confirmPassword.setError(\"This field cannot be empty\");\n return;\n } else if(!(password.getText().toString().trim()\n .equals(confirmPassword.getText().toString().trim()))){\n password.setError(\"Passwords do not match\");\n confirmPassword.setError(\"Passwords do not match\");\n return;\n }\n progressBar.setVisibility(View.VISIBLE);\n mAuth.signInAnonymously().addOnSuccessListener(authResult -> myRef.child(usn.getText().toString().trim()).addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot dataSnapshot) {\n try {\n String username = dataSnapshot.child(\"emailId\").getValue().toString();\n String password = confirmPassword.getText().toString().trim();\n System.out.println(username);\n mAuth.createUserWithEmailAndPassword(username,password)\n .addOnCompleteListener(RegisterActivity.this,task -> {\n Log.d(\"TAG\",\"Created User:\"+task.isSuccessful());\n if(!task.isSuccessful()){\n Toast.makeText(RegisterActivity.this, \"Error occurred.\" +\n \" Could not create user. Please \" +\n \"check your internet connection\", Toast.LENGTH_LONG).show();\n return;\n }\n else {\n startActivity(new Intent(RegisterActivity.this,LoginActivity.class));\n finish();\n }\n });\n\n }catch (NullPointerException e){\n usn.setError(\"Invalid USN. Please check your input or contact\" +\n \" your department for help\");\n progressBar.setVisibility(View.INVISIBLE);\n }\n }\n @Override\n public void onCancelled(@NonNull DatabaseError databaseError) {\n\n }\n }))\n .addOnFailureListener(e -> {\n progressBar.setVisibility(View.INVISIBLE);\n Snackbar.make(view,\"Something went wrong.Please check if you have an internet connection or that the details\" +\n \"entered are valid\",Snackbar.LENGTH_LONG).show();\n });\n }",
"@Override\n protected Void doInBackground(Void... params) {\n ServerUtilities.register(context, name, email, regId);\n return null;\n }",
"private void register_user() {\n\n\t\tHttpRegister post = new HttpRegister();\n\t\tpost.execute(Config.URL + \"/api/newuser\");\n\n\t}",
"@Test \n\tpublic void testRegisterValidUser() throws Exception {\n\t\tapp.getMailinatorHelper().getEmailsNumber();\n//\t\tbasePage.fillInRegistrationForm();\n\t\t\n\t\t//Step 1: Register valid user\n\t\t//\t\tStep 1-1: Fill and send form\n\t\t//\t\tStep 1-2: Get confirm email\n\t\t//\t\tStep 1-3: Confirm registration\n\t\t//\t\tStep 1-4: Check relogin\n\t\t//\t\tStep 1-1: Register valid user\n\t\t//\t\tStep 1-1: Register valid user\n\t\t//Step 2: Check that user successfully registered\n\t\t\n\t}",
"@Test\r\n\tpublic void TC_02_verify_Registration_ValidData() {\r\n\r\n\t\thomePgObj = new Page_Home(driver);\r\n\t\tregPgObj = homePgObj.click_RegistrationLink();\r\n\t\t\r\n\t\t// Step 1: Verify the registration page is displayed\r\n\t\t\r\n\t\tflag = regPgObj.registrationPgDisplay();\r\n\t\t\r\n\t\t// Step 2: Enter valid registration details including first name,last name,email address, password and confirm password\r\n\t\t\r\n\t\tAssert.assertTrue(flag, \"Registration page is displayed\");\r\n\t\tregPgObj.enterRegistrationDetails(\"firstName\", firstName);\r\n\t\tregPgObj.enterRegistrationDetails(\"lastName\", lastName);\r\n\t\tregPgObj.enterRegistrationDetails(\"email\", email);\r\n\t\tregPgObj.enterRegistrationDetails(\"password\", password);\r\n\t\tregPgObj.enterRegistrationDetails(\"confirmPassword\", confirmPassword);\r\n\t\t\r\n\t\t// Step 3: Click on Sign in button\r\n\t\t\r\n\t\tregPgObj.clickSignInButton();\r\n\t\t\r\n\t\t// Step 4: Verify user should be able to register themselves by verifying their credentials on registration page\r\n\t\t\r\n\t\tregUserInfo = Page_Registration.getRegisteredUserInfo();\r\n\t\tif (regUserInfo.toLowerCase().contains(firstName.toLowerCase())\r\n\t\t\t\t&& regUserInfo.toLowerCase().contains(lastName.toLowerCase()))\r\n\t\t\tSystem.out.println(\"User registered successfully\");\r\n\t\telse\r\n\t\t\tSystem.out.println(\"User could not be registered\");\r\n\r\n\t}",
"private void sendRegisterMessage() {\n Message initMessage = new Message(\"register\");\n initMessage.name = name;\n sendMessage(initMessage);\n\n log(\"sent init. message:\" + initMessage);\n }",
"@Then(\"^user gives the details$\")\r\n\tpublic void user_gives_the_details() throws Throwable {\n\t register.registrationOfCustomer();\r\n\t}",
"public void setAWSUserRegistration_Agree() {\r\n\r\n Tx_RN171DeviceSetDeviceName();\r\n\r\n /////////////////////////////////////////////////\r\n //Register/Insert Customer\r\n /////////////////////////////////////////////////\r\n\r\n //Call method and post appropriate values\r\n AWSconnection.insertCustomerURL(AppGlobals.userregInfo.userregistrationEmail,\r\n AppGlobals.userregInfo.userregistrationPassword,\r\n AppGlobals.userregInfo.userregistrationStreetAddress,\r\n AppGlobals.userregInfo.userregistrationSuburb,\r\n AppGlobals.userregInfo.userregistrationCityRegion,\r\n AppGlobals.userregInfo.userregistrationFirstName,\r\n AppGlobals.userregInfo.userregistrationLastName,\r\n AppGlobals.userregInfo.userregistrationPostcode,\r\n AppGlobals.userregInfo.userregistrationCountry,\r\n\r\n //Call interface to retrieve Async results\r\n new AWSconnection.textResult() {\r\n @Override\r\n\r\n public void getResult(String result) {\r\n\r\n //Do stuff with results here\r\n //Returns either success or fail message\r\n //Log.i(\"Registration:\", result);\r\n Log.d(\"myApp_AWS\", \"Registration:\" + result);\r\n\r\n if (!result.equals(\"\\\"Successful Registration\\\"\")) {\r\n runOnUiThread(new Runnable() {\r\n @Override\r\n public void run() {\r\n Toast.makeText(Rinnai11eRegistration.this, \"Web Services Error.\",\r\n Toast.LENGTH_LONG).show();\r\n }\r\n });\r\n } else {\r\n\r\n runOnUiThread(new Runnable() {\r\n @Override\r\n public void run() {\r\n Toast.makeText(Rinnai11eRegistration.this, \"Update Successful.\",\r\n Toast.LENGTH_LONG).show();\r\n }\r\n });\r\n }\r\n }\r\n });\r\n\r\n /////////////////////////////////////////\r\n //Register Appliance\r\n /////////////////////////////////////////\r\n\r\n //Call method and post appropriate values\r\n AWSconnection.insertCustomerApplianceURL(AppGlobals.userregInfo.userregApplianceInfo_now.userregistrationApplianceSerial,\r\n AppGlobals.userregInfo.userregApplianceInfo_now.userregistrationApplianceType,\r\n AppGlobals.userregInfo.userregApplianceInfo_now.userregistrationApplianceModel,\r\n AppGlobals.fireplaceWifi.get(AppGlobals.selected_fireplaceWifi).UUID,\r\n AppGlobals.userregInfo.userregistrationEmail,\r\n AppGlobals.userregInfo.userregApplianceInfo_now.userregistrationApplianceName,\r\n\r\n //Call interface to retrieve Async results\r\n new AWSconnection.textResult() {\r\n @Override\r\n\r\n public void getResult(String result) {\r\n\r\n //Do stuff with results here\r\n //Returns either success or fail message\r\n //Log.i(\"Registration:\", result);\r\n Log.d(\"myApp_AWS\", \"Registration:\" + result);\r\n\r\n if (!result.equals(\"\\\"Appliance Registration Successful\\\"\")) {\r\n\r\n runOnUiThread(new Runnable() {\r\n @Override\r\n public void run() {\r\n Toast.makeText(Rinnai11eRegistration.this, \"Web Services Error.\",\r\n Toast.LENGTH_LONG).show();\r\n }\r\n });\r\n } else {\r\n runOnUiThread(new Runnable() {\r\n @Override\r\n public void run() {\r\n Toast.makeText(Rinnai11eRegistration.this, \"Update Successful.\",\r\n Toast.LENGTH_LONG).show();\r\n }\r\n });\r\n }\r\n }\r\n });\r\n }",
"@Test\r\n\t public void register1() {\n\t\t \tthis.admin.createClass(\"ecs60\",2017,\"sean\",50);\r\n\t \t\r\n\t assertFalse(this.student.isRegisteredFor(\"gurender\", \"ecs60\", 2017));\r\n\t \r\n\t }",
"public String register() throws NonUniqueBusinessKeyException,\n ValidationException, ObjectNotFoundException,\n MailOperationException, RegistrationException {\n if (logger.isDebugLoggingEnabled()) {\n\n }\n\n String mId = getMarketplaceId();\n String parameter = getRequest().getParameter(\n Constants.REQ_PARAM_SERVICE_KEY);\n String outcome = BaseBean.OUTCOME_SUCCESS;\n\n Long serviceKey = null;\n if (parameter != null && parameter.trim().length() > 0) {\n serviceKey = Long.valueOf(parameter);\n }\n // FIXME: Must be fixed in identity service.\n if (!isInternalMode()) {\n // A confirmation mail must be send, not a user created mail.\n // If no password is given it will be generated\n password = \"\";\n }\n try {\n organization = getAccountingService().registerCustomer(\n getOrganization(), user.getVOUserDetails(), password,\n serviceKey, mId, getSupplierId());\n } catch (NonUniqueBusinessKeyException ex) {\n if (isInternalMode()) {\n throw ex;\n }\n ex.setMessageKey(BaseBean.ERROR_USER_ALREADY_EXIST);\n ExceptionHandler.execute(ex, true);\n return BaseBean.OUTCOME_ERROR;\n }\n if (logger.isDebugLoggingEnabled()) {\n\n }\n return outcome;\n }",
"private void register(UserAuthenticationMessage uaMessage) {\n\t\tinitialize();\n\t\tUser newUser = uaMessage.getUser();\n\t\tHashMap<String, Boolean> dbInfo = DatabaseRequests.registerNewUser(newUser);\n\t\tcreateRegistrationAnswer(dbInfo.get(MIDs.EMAIL_EXISTS), dbInfo.get(MIDs.USER_EXISTS), dbInfo.get(MIDs.AUTHENTICATE));\n\t}",
"public static void enableRegNotifications() {\n\t\t\n\t}",
"@Override\r\n\tpublic void onFinishGetVerifyCode(int reg17FoxReturn) {\n\r\n\t\tswitch (reg17FoxReturn) {\r\n\t\tcase 103:\r\n\t\t\tdisplayRegisterResult(\"authKey出错\");\r\n\t\t\tbreak;\r\n\t\tcase 104:\r\n\t\t\tdisplayRegisterResult(\"参数不全\");\r\n\t\t\tbreak;\r\n\t\tcase 105:\r\n\t\t\tdisplayRegisterResult(\"手机格式错误\");\r\n\t\t\tbreak;\r\n\t\tcase 106:\r\n\t\t\tdisplayRegisterResult(\"此手机号已经注册\");\r\n\t\t\tbreak;\r\n\t\tcase 107:\r\n\t\t\tdisplayRegisterResult(\"此手机号不存在\");\r\n\t\t\tbreak;\r\n\t\tcase 108:\r\n\t\t\tToast.makeText(this, \"验证短信稍后发送到您手机\", Toast.LENGTH_LONG).show();\r\n\t\t\tbreak;\r\n\t\tcase 109:\r\n\t\t\tdisplayRegisterResult(\"短信发送失败\");\r\n\t\t\tbreak;\r\n\t\tcase 110:\r\n\t\t\tdisplayRegisterResult(\"短信验证码超时,请重新获取验证码\");\r\n\t\t\tbreak;\r\n\t\tcase 111:\r\n\t\t\tdisplayRegisterResult(\"短信验证码不正确\");\r\n\t\t\tbreak;\r\n\t\tcase 112:\r\n\t\t\tdisplayRegisterResult(\"短信验证通过\");\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tdisplayRegisterResult(\"服务器内部错误\");\r\n\t\t}\r\n\t\tenableYzBtnHandler.sendEmptyMessageDelayed(1, 1000);\r\n\t}",
"public String register() {\r\n\t\tif (password.equals(passwordConfirm)) {\r\n\t\t\tUser newUser = new User(username, password);\r\n\t\t\t\r\n\t\t\tif (dataManager.addUser(newUser)) {\r\n\t\t\t\tFacesMessage message = new FacesMessage(\"User has been registered successfully.\");\r\n\t\t\t\tFacesContext.getCurrentInstance().addMessage(null, message);\r\n\t\t\t\tlogger.info(\"New user has been registered.\");\r\n\t\t\t\treturn \"login.xhtml\";\r\n\t\t\t\t\r\n\t\t\t}\t\t\t\r\n\t\t\tFacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR, \"\", \"A user with the same username already exists.\");\r\n\t\t\tFacesContext.getCurrentInstance().addMessage(\"registration_form:username\", message);\t\t\t\r\n\t\t}\r\n\t\telse {\r\n\t\t\tFacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR, \"\", \"Password confirmation is incorrect.\");\r\n\t\t\tFacesContext.getCurrentInstance().addMessage(\"registration_form:password_confirm\", message);\t\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"public String registration() {\n if (name != null) {\n int createdUsers = DBUtils.addUser(name, password, email);\n if (createdUsers > 0) {\n try {\n HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();\n request.login(name, password);\n initUser();\n request.getSession().setAttribute(\"current_user\", this);\n } catch (ServletException e) {\n FacesContext context = FacesContext.getCurrentInstance();\n FacesMessage message = new FacesMessage(\"Wrong login or password\");\n message.setSeverity(FacesMessage.SEVERITY_ERROR);\n context.addMessage(\"login\", message);\n }\n return \"/index?faces-redirect=true\";\n }\n }\n return \"/pages/register.xhtml?faces-redirect=true\";\n }",
"@Override\n\t\t\tpublic void onSuccess() {\n\t\t\t\tToast.makeText(MainActivity.this, \"submit success\", Toast.LENGTH_LONG).show();\n\t\t\t}",
"public Successful_Registration() {\n initComponents();\n }",
"private void register() {\n Intent registrationIntent = new Intent(REQUEST_REGISTRATION_INTENT);\n registrationIntent.setPackage(GSF_PACKAGE);\n registrationIntent.putExtra(\n EXTRA_APPLICATION_PENDING_INTENT, PendingIntent.getBroadcast(context, 0, new Intent(), 0));\n registrationIntent.putExtra(EXTRA_SENDER, senderId);\n context.startService(registrationIntent);\n }",
"@RequestMapping(\"/processForm\")\n\tpublic String processForm( @Valid @ModelAttribute(\"register\") Register theRegister, BindingResult theBindingResult) {\n\t\tSystem.out.println(\"Register new: \" + theRegister.getFirstName() \n\t\t\t\t\t\t+ \" \" + theRegister.getLastName());\n\t\t\n\t\tif(theBindingResult.hasErrors()) {\n\t\t\t\n\t\t\treturn \"register-form\";\n\t\t}else {\n\t\t\treturn \"register-confirmation\";\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}",
"public boolean registerToServer() throws Exception{\n \t\n\t\t// On crée un objet container pour contenir nos donnée\n\t\t// On y ajoute un AdminStream de type Registration avec comme params le login et le mot de pass\n \tRegistrationRequest regRequest = new RegistrationRequest(login, pass);\n\t\ttry {\n\t\t\t// On tente d'envoyer les données\n\t\t\toos_active.writeObject(regRequest);\n\t\t\t// On tente de recevoir les données\n\t\t\tRegistrationResponse regResponse = (RegistrationResponse)ois_active.readObject();\n\n\t\t\t// On switch sur le type de retour que nous renvoie le serveur\n\t\t\t// !!!Le type enum \"Value\" est sujet à modification et va grandir en fonction de l'avance du projet!!!\n\t\t\tswitch(regResponse.getResponseType()){\n\t\t\tcase REG_ALREADY_EXISTS:\n\t\t\t\topResult = \"Error : User already exist!\";\n\t\t\t\treturn false;\n\t\t\tcase REG_LOGIN_BAD_FORMAT:\n\t\t\t\topResult = \"Error : login bad format!\";\n\t\t\t\treturn false;\n\t\t\tcase REG_PASS_BAD_FORMAT:\n\t\t\t\topResult = \"Error : password bad format!\";\n\t\t\t\treturn false;\n\t\t\tcase REG_SUCCESS:\n\t\t\t\topResult = \"Account registration succeed!\";\n\t\t\t\treturn true;\n\t\t\tcase REG_UNKNOW_ERROR:\n\t\t\t\topResult = \"Error : Unknown error!\";\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tthrow new ClientChatException (ClientChatException.IO_ERREUR, \"ERROR: Communication Error\");\n\t\t}\n\t\treturn false;\n }",
"public void registration() {\n\t\tSystem.out.print(\"Enter Name : \");\r\n\t\tthis.name=scan.nextLine();\r\n\t\tSystem.out.print(\"Enter Age : \");\r\n\t\tthis.age=scan.nextInt();\r\n\t\tSystem.out.print(\"Enter Gender : \");\r\n\t\tthis.gender=scan.next().charAt(0);\r\n\t\tscan.nextLine();\r\n\t\tSystem.out.print(\"Enter Price : \");\r\n\t\tthis.price=scan.nextDouble();\r\n\t\tSystem.out.print(\"Enter Quantity : \");\r\n\t\tthis.quantity=scan.nextInt();\t\r\n\t\tSystem.out.println(\"Register Successfully\");\r\n\t}",
"@PostMapping(\"/registration\")\n\t public String registration(@ModelAttribute(\"userForm\") User userForm, BindingResult bindingResult,Model model) {if (bindingResult.hasErrors()) {\n\t return \"registration\";\n\t }\n\t userService.save(userForm);\n\t localUsername=userForm.getUsername();\n\t boolean flag=userService.autoLogin(userForm.getUsername(), userForm.getPasswordConfirm());\n\t model.addAttribute(\"expense\", expenseService.getMonthAndYearAndAmount());\n\t model.addAttribute(\"username\",userForm.getUsername());\n\t return \"redirect:/dashboard\";\n\t }",
"@Test\n\tpublic void StartRegistration() throws Exception {\n\n\t\t// Enter the text in textbox\n\n\t\tdriver.findElement(By.xpath(\"//android.widget.EditText[@content-desc='my_text_fieldCD']\"))\n\t\t\t\t.sendKeys(\"Wunder Test\");\n\n\t\t// click on registration button\n\n\t\tdriver.findElement(By.id(\"io.selendroid.testapp:id/startUserRegistration\")).click();\n\n\t\t// Wait for 10 second\n\n\t\tThread.sleep(10000);\n\n\t\t// Fill registration form data\n\n\t\tWebElement element;\n\n\t\t// Username\n\t\telement = driver.findElement(By.id(\"io.selendroid.testapp:id/inputUsername\"));\n\t\telement.sendKeys(\"Wunder Test\");\n\n\t\t// E-mail\n\t\telement = driver.findElement(By.id(\"io.selendroid.testapp:id/inputEmail\"));\n\t\telement.sendKeys(\"rshw8487@gmail.com\");\n\n\t\t// Password\n\t\telement = driver.findElement(By.id(\"io.selendroid.testapp:id/inputPassword\"));\n\t\telement.clear();\n\t\telement.sendKeys(\"Travel123\");\n\n\t\t// Name\n\t\telement = driver.findElement(By.id(\"io.selendroid.testapp:id/inputName\"));\n\t\telement.clear();\n\t\telement.sendKeys(\"Rahul\");\n\n\t\t// Select Programming language\n\t\telement = driver.findElement(By.id(\"io.selendroid.testapp:id/input_preferedProgrammingLanguage\"));\n\t\telement.click();\n\n\t\telement = driver.findElement(By.id(\"android:id/text1\"));\n\t\telement.click();\n\n\t\t// Accept adds\n\t\telement = driver.findElement(By.id(\"io.selendroid.testapp:id/input_adds\"));\n\t\telement.click();\n\n\t\t// Register user\n\t\telement = driver.findElement(By.id(\"io.selendroid.testapp:id/btnRegisterUser\"));\n\t\telement.click();\n\n\t\t// Confirm registration\n\t\telement = driver.findElement(By.id(\"io.selendroid.testapp:id/buttonRegisterUser\"));\n\t\telement.click();\n\n\t}",
"private void register() {\n RegisterModel registerModel = new RegisterModel(edtEmail.getText().toString(),\n edtPaswd.getText().toString(),\n edtDisplayName.getText().toString());\n\n Response.Listener<RegisterApiResponse> responseListener = new Response.Listener<RegisterApiResponse>() {\n @Override\n public void onResponse(RegisterApiResponse response) {\n if (response.isSuccess()) login();\n }\n };\n\n Response.ErrorListener errorListener = new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n progressDialog.cancel();\n if (error != null) {\n String errorMsg = \"An error occurred\";\n String err = (error.getMessage() == null) ? errorMsg : error.getMessage();\n Log.d(TAG, err);\n error.printStackTrace();\n\n if (err.matches(AppConstants.CONNECTION_ERROR) || err.matches(AppConstants.TIMEOUT_ERROR)) {\n AlertDialog.Builder alertDialog = new AlertDialog.Builder(RegisterActivity.this);\n alertDialog.setTitle(getString(R.string.error_title_signup));\n alertDialog.setMessage(getString(R.string.error_message_network)).setCancelable(false)\n .setPositiveButton(getString(R.string.dialog_ok), new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.cancel();\n }\n });\n alertDialog.show();\n } else if (err.matches(\".*Duplicate entry .* for key 'name_UNIQUE'.*\")) {\n edtDisplayName.setError(\"username taken\");\n edtDisplayName.requestFocus();\n } else if (err.matches(\".*The email has already been taken.*\")) {\n edtEmail.setError(\"email taken\");\n edtEmail.requestFocus();\n } else {\n AlertDialog.Builder alertDialog = new AlertDialog.Builder(RegisterActivity.this);\n alertDialog.setTitle(getString(R.string.error_title_signup));\n alertDialog.setMessage(getString(R.string.error_message_network)).setCancelable(false)\n .setPositiveButton(getString(R.string.dialog_ok), new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.cancel();\n }\n });\n alertDialog.show();\n }\n }\n }\n };\n\n\n progressDialog.setMessage(getString(R.string.progress_dialog_message_login));\n RegistrationRequests registerRequest =\n RegistrationRequests.register(this, registerModel, responseListener, errorListener);\n VolleyRequest.getInstance(this.getApplicationContext()).addToRequestQueue(registerRequest);\n progressDialog.show();\n }",
"@Override\n public void onClick(View v) {\n if(!isEmpty(mUserRegBinding.editTextPrivEmail.getText().toString())\n && !isEmpty(mUserRegBinding.editTextPrivPassword.getText().toString())\n && !isEmpty(mUserRegBinding.editTextPrivConfirmPassword.getText().toString())){\n\n //check if passwords match\n if(doStringsMatch(mUserRegBinding.editTextPrivPassword.getText().toString(),\n mUserRegBinding.editTextPrivConfirmPassword.getText().toString())){\n\n //Initiate user registration task\n registerNewEmail(mUserRegBinding.editTextPrivEmail.getText().toString(),\n mUserRegBinding.editTextPrivPassword.getText().toString());\n }else{\n Snackbar.make(getCurrentFocus().getRootView(), \"Passwords do not Match\", Snackbar.LENGTH_SHORT).show();\n }\n\n }else{\n Snackbar.make(getCurrentFocus().getRootView(), \"You must fill out all the fields\", Snackbar.LENGTH_SHORT).show();\n }\n }",
"@Override\n\t\t\t\t\tpublic void onSuccess() {\n\t\t\t\t\t\tToast.makeText(RegisterActivity.this,\"Sign up successfully!\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\tstartActivity(new Intent(RegisterActivity.this, LoginActivity.class));\n\t\t\t\t\t}",
"@OnClick(R.id.register_email_register_button)\n void onClickRegister(){\n if(isInfoValidate()){\n //Call Register Http, first put the information into bundle\n// Bundle bundle = new Bundle();\n// bundle.putString(Constant.REGISTER_PHONE_NUM, mEmailAddress.getText().toString());\n// bundle.putString(Constant.REGISTER_PASSWORD, mPassword.getText().toString());\n// bundle.putInt(Constant.REGISTER_REGION, mRegionSpinner.getSelectedItemPosition());\n//\n// callRegisterHttp(mEmailAddress.getText().toString(),\n// mRegionSpinner.getSelectedItemPosition(),\n// bundle);\n\n //\n\n\n JSONObject jsonParams = new JSONObject();\n JSONObject outerJsonParams = new JSONObject();\n try {\n// jsonParams.put(\"username\", \"michael_firebasechat_1\");\n // String userNameString = mEmailAddress.getText().toString().split(\"@\")[0];\n jsonParams.put(\"username\", mUsername.getText().toString());\n jsonParams.put(\"email\", mEmailAddress.getText().toString());\n jsonParams.put(\"password\", mPassword.getText().toString());\n outerJsonParams.put(\"user\",jsonParams);\n StringEntity entity = new StringEntity(outerJsonParams.toString());\n callRegisterByEmailHttp(entity);\n } catch (JSONException e) {\n e.printStackTrace();\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n }\n\n }\n else {\n //Show the warning text\n new SweetAlertDialog(getContext(), SweetAlertDialog.WARNING_TYPE)\n .setTitleText(getString(R.string.warning_title))\n .setContentText(errorText)\n .setConfirmText(getString(R.string.warning_confirm))\n .show();\n }\n }",
"private void charge_up() throws GB_Exception {\n try{\n if(PersonalDataController.getInstance().existRegistry(username)){\n putPersonalInformation();\n }else{\n putDefaultInformation();\n }\n } catch (SQLException | IOException ex) {\n LOG.error(ex);\n throw new GB_Exception(\"Error al carga informacion de usuario. Comuniquese con su administrador.\");\n }\n }",
"@Test(priority=2)\n\tpublic void completeSignUpProcess(){\n\t\tsignup.clearAllFields();\n\t\tsignup.enterId(\"manish.vr111@gmail.com\");\n\t\tsignup.enterFirstName(\"Manish Kumar\");\n\t\tsignup.enterLastName(\"Vuttunoori\");\n\t\tsignup.enterPassword(\"qwerty126\");\n\t\tsignup.reenterPassword(\"qwerty126\");\n\t\tsignup.clickSubmit();\n\t\t// must go to home page but wont as the mail id used here is already registered for an account, \n\t\t//so just checking for single error i.e. Email is already registered.\n\t\tAssert.assertEquals(1, signup.getErrors().size());\n\t}",
"public void signup(){\n\t\tboolean result = SignUpForm.display(\"Chocolate Chiptunes - Sign Up\", \"Sign-Up Form\");\n\t\tSystem.out.println(result);\n\t}",
"public void register()\n {\n String n = nameProperty.getValue();\n if (n == null || n.isEmpty())\n {\n throw new IllegalArgumentException(\"Field cannot be empty\");\n }\n String p = passwordProperty.getValue();\n if (p == null || p.isEmpty())\n {\n throw new IllegalArgumentException(\"Field cannot be empty\");\n }\n String e = emailProperty.getValue();\n if (e == null || e.isEmpty())\n {\n throw new IllegalArgumentException(\"Field cannot be empty\");\n }\n String ph = phoneProperty.getValue();\n if (ph == null || ph.isEmpty())\n {\n throw new IllegalArgumentException(\"Field cannot be empty\");\n }\n if (ph.length() != 8)\n {\n throw new IllegalArgumentException(\"Invalid phone number\");\n }\n try\n {\n Integer.parseInt(ph);\n }\n catch (NumberFormatException ex)\n {\n throw new IllegalArgumentException(\"Invalid phone number\", ex);\n }\n String t = titleProperty.getValue();\n if (t == null || t.isEmpty())\n {\n throw new IllegalArgumentException(\"Field cannot be empty\");\n }\n String a = authorProperty.getValue();\n if (a == null || a.isEmpty())\n {\n throw new IllegalArgumentException(\"Field cannot be empty\");\n }\n String y = yearProperty.getValue();\n if (y == null || y.isEmpty())\n {\n throw new IllegalArgumentException(\"Field cannot be empty\");\n }\n if (y.length() != 4)\n {\n throw new IllegalArgumentException(\"Invalid year\");\n }\n try\n {\n Integer.parseInt(y);\n }\n catch (NumberFormatException ex)\n {\n throw new IllegalArgumentException(\"Invalid year\", ex);\n }\n\n try\n {\n\n model.registerUser(n, p, e, ph, t, a, y);\n\n }\n catch (Exception e1)\n {\n\n e1.printStackTrace();\n }\n\n }",
"Register.Req getRegisterReq();",
"@OnClick(R.id.activity_register_button_register)\n public void onRegisterClick(View mView) {\n if (!isFinishing()) {\n mUtility.hideKeyboard(RegisterActivity.this);\n mStringUsername = mEditTextUsername.getText().toString().trim();\n mStringAccountName = mEditTextAccountName.getText().toString().trim();\n mStringEmail = mEditTextEmail.getText().toString().trim();\n mStringMobileNO = mEditTextMobileNO.getText().toString().trim();\n mStringPassword = mEditTextPassword.getText().toString().trim();\n mStringDevicesUIDFCMToken = FirebaseInstanceId.getInstance().getToken();\n mPreferenceHelper.setDeviceToken(mStringDevicesUIDFCMToken);\n if (mStringUsername.equalsIgnoreCase(\"\")) {\n showMessageRedAlert(mRelativeLayoutMain, getResources().getString(R.string.str_sign_up_enter_name), getResources().getString(R.string.str_ok));\n return;\n }\n if (mStringAccountName.equalsIgnoreCase(\"\")) {\n showMessageRedAlert(mRelativeLayoutMain, getResources().getString(R.string.str_sign_up_enter_account_name), getResources().getString(R.string.str_ok));\n return;\n }\n if (mStringCountryCode.equalsIgnoreCase(\"\")) {\n showMessageRedAlert(mRelativeLayoutMain, getResources().getString(R.string.str_select_country_code), getResources().getString(R.string.str_ok));\n return;\n }\n\n if (mStringMobileNO.equalsIgnoreCase(\"\")) {\n showMessageRedAlert(mRelativeLayoutMain, getResources().getString(R.string.str_sign_up_enter_mobile_no), getResources().getString(R.string.str_ok));\n return;\n }\n if (mStringMobileNO.length() < 10 || mStringMobileNO.length() > 15) {\n showMessageRedAlert(mRelativeLayoutMain, getResources().getString(R.string.str_sign_up_enter_valid_mobile_no), getResources().getString(R.string.str_ok));\n return;\n }\n if (!mStringEmail.equalsIgnoreCase(\"\")) {\n if (!mUtility.isValidEmail(mStringEmail)) {\n showMessageRedAlert(mRelativeLayoutMain, getResources().getString(R.string.str_sign_up_enter_valid_email_address), getResources().getString(R.string.str_ok));\n return;\n }\n }\n if (mStringPassword.equalsIgnoreCase(\"\")) {\n showMessageRedAlert(mRelativeLayoutMain, getResources().getString(R.string.str_sign_up_enter_password), getResources().getString(R.string.str_ok));\n return;\n }\n if (mStringPassword.length() < 6 || mStringPassword.length() > 15) {\n showMessageRedAlert(mRelativeLayoutMain, getResources().getString(R.string.str_sign_up_enter_valid_password), getResources().getString(R.string.str_ok));\n return;\n }\n if (!mCheckBoxTermNCondition.isChecked()) {\n showMessageRedAlert(mRelativeLayoutMain, getResources().getString(R.string.str_sign_up_agree_terms_condition), getResources().getString(R.string.str_ok));\n return;\n }\n if (mStringDevicesUIDFCMToken == null || mStringDevicesUIDFCMToken.equalsIgnoreCase(\"null\") || mStringDevicesUIDFCMToken.equalsIgnoreCase(\"\")) {\n mStringDevicesUIDFCMToken = FirebaseInstanceId.getInstance().getToken();\n }\n if (mStringDevicesUIDFCMToken == null || mStringDevicesUIDFCMToken.equalsIgnoreCase(\"null\") || mStringDevicesUIDFCMToken.equalsIgnoreCase(\"\")) {\n mStringDevicesUIDFCMToken = System.currentTimeMillis() + \"\";\n }\n\n console.log(\"asxasxasxasx_token\",mStringDevicesUIDFCMToken);\n\n if (!mUtility.haveInternet()) {\n showMessageRedAlert(mRelativeLayoutMain, getResources().getString(R.string.str_no_internet_connection), getResources().getString(R.string.str_ok));\n } else {\n checkUserRegister();\n }\n }\n }",
"@Override\n\tpublic void registrarSalida() {\n\t\t\n\t}",
"@Override\n\tpublic void registrarSalida() {\n\t\t\n\t}",
"@Test\r\n public void positiveRegistration() {\r\n driver.get(\"http://127.0.0.1:8888/wp-login.php?action=register\");\r\n StringBuilder sb = new StringBuilder(len);\r\n for (int i = 0; i < len; i++) {\r\n sb.append(AB.charAt(rnd.nextInt(AB.length())));\r\n }\r\n String charSequence = \"\";\r\n charSequence = sb.toString();\r\n WebElement loginField = driver.findElement(By.xpath(\"//input[@id='user_login']\"));\r\n loginField.sendKeys(charSequence);\r\n WebElement passwdField = driver.findElement(By.xpath(\"//input[@id='user_email']\"));\r\n passwdField.sendKeys(charSequence+\"@gmail.com\");\r\n\r\n WebElement registerButton = driver.findElement(By.xpath(\"//input[@name='wp-submit']\"));\r\n registerButton.click();\r\n\r\n WebElement registrationMessage = driver.findElement(By.xpath(\"//p[@class='message']\"));\r\n Assert.assertEquals(registrationMessage.getText(),\"Регистрация завершена. Проверьте вашу почту.\");\r\n }",
"public boolean canRegister() {\n return true;\n }",
"public String submit()\r\n\t{\n\t\tUserDetailsInterface userImpl = new UserDetailsImpl();\r\n\t\t\r\n\t\tint result = 0;\r\n\t\ttry{\r\n\t\t//Pass all value through registerbean class to userImpl Interface and call saveUser() method\r\n\t\t\tresult = userImpl.saveAccountadminUser(emailid.toLowerCase().trim(), password, firstname, lastname, shortname,hashkey,organizationname);\r\n\t\t\r\n\t\t\t//boolean valid = LoginDAO.validate(user, pwd);\r\n\t\t\tif (result == 1) {\r\n\t\t\t\tFacesContext.getCurrentInstance().addMessage(\r\n\t\t\t\t\t\tnull,\r\n\t\t\t\t\t\tnew FacesMessage(FacesMessage.SEVERITY_WARN,\r\n\t\t\t\t\t\t\t\t\"Admin Role created successfully\",\r\n\t\t\t\t\t\t\t\t\"\"));\r\n\t\t\t\treturn \"login\";\r\n\t\t\t}\r\n\t\t\tif (result == 2) {\r\n\t\t\t\tFacesContext.getCurrentInstance().addMessage(\r\n\t\t\t\t\t\tnull,\r\n\t\t\t\t\t\tnew FacesMessage(FacesMessage.SEVERITY_WARN,\r\n\t\t\t\t\t\t\t\t\"User Inactive\",\r\n\t\t\t\t\t\t\t\t\"User already created, please activate the user credentials before login the sytem\"));\r\n\t\t\t\treturn \"accountadminregister\";\r\n\t\t\t}\r\n\t\t\tif (result == 4) {\r\n\t\t\t\tFacesContext.getCurrentInstance().addMessage(\r\n\t\t\t\t\t\tnull,\r\n\t\t\t\t\t\tnew FacesMessage(FacesMessage.SEVERITY_WARN,\r\n\t\t\t\t\t\t\t\t\"Internal Error\",\r\n\t\t\t\t\t\t\t\t\"Please check the server logs\"));\r\n\t\t\t\treturn \"accountadminregister\";\r\n\t\t\t}\r\n\t\t\tif (result == 6) {\r\n\t\t\t\tFacesContext.getCurrentInstance().addMessage(\r\n\t\t\t\t\t\tnull,\r\n\t\t\t\t\t\tnew FacesMessage(FacesMessage.SEVERITY_WARN,\r\n\t\t\t\t\t\t\t\t\"User Exit\",\r\n\t\t\t\t\t\t\t\t\"User already created, please login with your credentials\"));\r\n\t\t\t\treturn \"accountadminregister\";\r\n\t\t\t}\r\n\t\t\tif (result == 7) {\r\n\t\t\t\tFacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_WARN,\r\n\t\t\t\t\t\t\"Please do not use public domain\", \"Please use own company domain\"));\r\n\t\t\t\treturn \"accountadminregister\";\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\te.printStackTrace();\r\n\t\t\tFacesContext.getCurrentInstance().addMessage(\r\n\t\t\t\t\tnull,\r\n\t\t\t\t\tnew FacesMessage(FacesMessage.SEVERITY_WARN,\r\n\t\t\t\t\t\t\t\"Internal Error\",\r\n\t\t\t\t\t\t\t\"Please check the server logs\"));\r\n\t\t\treturn \"accountadminregister\";\r\n\t\t}\r\n\t\r\n\t\treturn \"sendemailbutton\";\r\n\t}",
"public interface OnSignUpFinishedListener {\n void userNameError();\n void passwordError();\n void mailError();\n void exitoOperacion(String preferencia, String sesion);\n}"
] | [
"0.7641318",
"0.7417356",
"0.72241867",
"0.7211431",
"0.6981077",
"0.689751",
"0.68646795",
"0.6841043",
"0.6833489",
"0.6826733",
"0.68185097",
"0.6818426",
"0.67955965",
"0.67579377",
"0.67507505",
"0.6741109",
"0.6700361",
"0.66943955",
"0.6683992",
"0.6609455",
"0.65800476",
"0.6507412",
"0.64891565",
"0.64607644",
"0.64473206",
"0.6409353",
"0.640026",
"0.63693464",
"0.6356795",
"0.63541603",
"0.6342031",
"0.6341765",
"0.6337762",
"0.6282868",
"0.627645",
"0.6262875",
"0.6254549",
"0.6248578",
"0.6244068",
"0.6235673",
"0.6231415",
"0.62203",
"0.6206883",
"0.62015843",
"0.6191082",
"0.61861336",
"0.61777234",
"0.61730504",
"0.6162464",
"0.61584485",
"0.6150797",
"0.6148636",
"0.6146803",
"0.61284876",
"0.61259466",
"0.6125047",
"0.61201805",
"0.61190283",
"0.6115451",
"0.6114919",
"0.6101177",
"0.60994434",
"0.60971534",
"0.60891235",
"0.60746515",
"0.60725105",
"0.60710263",
"0.6070328",
"0.60633546",
"0.60574996",
"0.60557526",
"0.605549",
"0.60504377",
"0.60453737",
"0.60451645",
"0.6045058",
"0.6041392",
"0.60408986",
"0.6031898",
"0.6029212",
"0.6026293",
"0.601555",
"0.60080516",
"0.600403",
"0.5987118",
"0.5973836",
"0.5973373",
"0.59666353",
"0.5961714",
"0.5960556",
"0.5956223",
"0.59554535",
"0.5954312",
"0.59529245",
"0.595009",
"0.59453356",
"0.59453356",
"0.5940727",
"0.5939585",
"0.59371156",
"0.5934766"
] | 0.0 | -1 |
C.Reg16 The confirmation email should contain a link that activates the user account | @Test
public void testConfirmationEmail() throws Exception {
User user = new User(username, password);
user = userService.save(user);
String token = registerController.generateUserToken(user);
assert !user.isEnabled();
String response = restTemplate.getForObject(url + "/token/" + token, String.class);
user = userService.getUser(username);
assert user.isEnabled();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void activateUser(String email, String activationToken);",
"private String sendConfirmationEmail(UserEntity user) {\n try {\n Properties emailAccountProperties = new Properties();\n try {\n emailAccountProperties.load(getClass().getResourceAsStream(\"/registration.properties\"));\n } catch (IOException e) {\n logger.warn(\"Cannot open registration properties file to send email:\", e);\n return null;\n }\n\n final String username = emailAccountProperties.getProperty(\"username\");\n final String password = emailAccountProperties.getProperty(\"password\");\n\n Properties prop = new Properties();\n prop.put(\"mail.smtp.auth\", \"true\");\n prop.put(\"mail.smtp.starttls.enable\", \"true\");\n prop.put(\"mail.smtp.host\", \"smtp.gmail.com\");\n prop.put(\"mail.smtp.port\", \"587\");\n\n Session session = Session.getInstance(prop, new javax.mail.Authenticator() {\n @Override\n protected PasswordAuthentication getPasswordAuthentication() {\n return new PasswordAuthentication(username, password);\n }\n });\n\n try {\n Message message = new MimeMessage(session);\n message.setFrom(new InternetAddress(\"cityconteam@gmail.com\"));\n message.setRecipients(Message.RecipientType.TO, InternetAddress.parse(user.getEmail()));\n message.setSubject(\"Welcome to CityCon!\");\n String reglink = RandomStringUtils.random(30, true, true);\n message.setContent(\"You received this email because you tried to register at <a href=http://citycon.ml>citycon.ml</a>.\" +\n \" Go <a href=http://citycon.ml/registration?reglink=\" + reglink + \">here</a>\" +\n //\" or <a href=http://localhost:8080/registration?reglink=\" + reglink + \"> here </a>\" +\n \" to complete your registration.\" +\n \"<br><br>If you didn't ask for registration, just ignore this message.\" +\n \"<br><br><hr>With love,<br>your CityCon team.\",\n \"text/html; charest=utf-8\");\n Transport.send(message);\n logger.trace(\"Sent reglink {}\", reglink);\n return reglink;\n } catch (MessagingException e) {\n logger.warn(\"Exception during sending email\", e);\n return null;\n }\n } catch (Exception e) {\n logger.warn(\"Unexpected exception\", e);\n return null;\n }\n }",
"public RegisterConfirmedPage activateAccount(String email) {\r\n\t\tactiveRailwayAccount(email);\r\n\r\n\t\t/*\r\n\t\t * this.clickLinkEmail(_activateSubject, email); \r\n\t\t * // Switch tab chrome ---------\r\n\t\t * ArrayList<String> arr = new\r\n\t\t * ArrayList<String>(Constant.WEBDRIVER.getWindowHandles());\r\n\t\t * Constant.WEBDRIVER.switchTo().window(arr.get(1)); // End Switch tab chrome\r\n\t\t * --------- //closeWindow(); //switchWindow();\r\n\t\t */\r\n\r\n\t\tArrayList<String> tabs = new ArrayList<String>(Constant.WEBDRIVER.getWindowHandles());\r\n\t\tConstant.WEBDRIVER.switchTo().window(tabs.get(0));\r\n\t\treturn new RegisterConfirmedPage();\r\n\t}",
"public void confirmRegistration(RegistrationData d) {}",
"public void resendConfirmationToken(RegistrationRequest request) {\n String requestEmail = request.getEmail();\n\n // delete old token and create new through user service\n // and get token UUID\n String token = applicationUserService.resendConfirmationToken(\n // convert request to client user\n convertRegistrationRequestToApplicationUser(request));\n\n // create confirmation link\n String host = \"localhost:8080\";\n String link = \"http://\" + host + \"/registration/confirm?token=\" + token;\n // send email with link to the user's email address\n emailSender.send(requestEmail,\n // build email message\n EmailMessageHelper.buildEmailMessage(request.getUsername(), link));\n\n }",
"private void sendEmailVerification() {\n final FirebaseUser user = mAuth.getCurrentUser();\n user.sendEmailVerification()\n .addOnCompleteListener(this, new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n // [START_EXCLUDE]\n // Re-enable button\n\n if (task.isSuccessful()) {\n Toast.makeText(LoginCombActivity.this,\n \"Verification email sent to \" + user.getEmail(),\n Toast.LENGTH_SHORT).show();\n } else {\n Log.e(TAG, \"sendEmailVerification\", task.getException());\n Toast.makeText(LoginCombActivity.this,\n \"Failed to send verification email.\",\n Toast.LENGTH_SHORT).show();\n }\n // [END_EXCLUDE]\n }\n });\n // [END send_email_verification]\n }",
"public void goToConfirmation() {\n ((AccountIdentifierRegistrationFragment) getParentFragment()).showChildFragment(PhoneNumberRegistrationConfirmationFragment.newInstance(this.airPhone, this.dataPassedIn.toBuilder().accountSource(AccountSource.Phone).build()), true);\n }",
"public ModelAndView activateAccount(HttpServletRequest request,\r\n\t\t\tHttpServletResponse response) {\r\n\t\tInstAdminRegistrationInfo input = new InstAdminRegistrationInfo();\r\n HttpSession session = request.getSession(true);\r\n\t\t\r\n input.setUserId(request.getParameter(\"userId\"));\r\n input.setInstituteName(request.getParameter(\"instituteName\"));\r\n input.setInstituteNickName(request.getParameter(\"instituteNickName\"));\r\n input.setCity(request.getParameter(\"city\"));\r\n input.setState(request.getParameter(\"state\"));\r\n input.setCountry(request.getParameter(\"country\"));\r\n input.setPrimaryEmailId(request.getParameter(\"adminEmail\"));\r\n int i = instAdminRegistrationDAO.updateRequestStatus(input);\r\n\t\tif (i > 0) {\r\n\t\t\treturn new ModelAndView(\"sendpassword/accountInfo\", \"info\",\r\n\t\t\t\t\t\"Account request confirmed successfully.\");\r\n\t\t} else {\r\n\t\t\treturn new ModelAndView(\"sendpassword/accountInfo\", \"info\",\r\n\t\t\t\t\t\"Page Expired.\");\r\n\t\t}\r\n\t}",
"public static void sendConfirmationMail(String toMail){\n String confirmationText = \"Welcome as a new user of Household Manager.\" +\n \"\\n You can log in with \"+toMail+ \" and the password you chose.\" +\n \"If you've forgotten your password you can get a new one sent from our Login page.\";\n sendMail(toMail,confirmationText);\n }",
"@Test(dependsOnMethods = {\"register\"})\n void confirmEmailAddressByCaptcha() {\n common.findWebElementByXpath(\"//*[@id=\\\"content\\\"]/fieldset/label/div\").click();\n\n //Click on Send captcha button\n common.timeoutSeconds(2);\n common.findWebElementById(\"send-captcha-button\").click();\n\n //No magic code is set\n common.verifyStatusMessage(\"Det uppstod ett problem med verifieringen av att du är en människa. \" +\n \"Var god försök igen.\");\n }",
"public String approveRegistration() {\n\t\treturn \"Company approved\";\r\n\t}",
"@Override\r\n\t\t\tpublic void onClick(ClickEvent event) {\n\t\t\t\tString resetUrl = \"#activateacc;uid=\" + user.getRefId();\r\n\t\t\t\tWindow.open(resetUrl, \"Password Reset\", \"\");\r\n\t\t\t}",
"public void enviarAlertaDeQueEstaOnline(){\n //mandaria un mail a los usuarios avisando que ya esta disponible para ver.\n System.out.println(\"Enviando mail con url \" + this.url);\n }",
"public void generateEnquireLink();",
"String getConfirmationMessage();",
"@Override\n public void onClick(DialogInterface dialog, int which) {\n String mail = resetMail.getText().toString();\n fAuth.sendPasswordResetEmail(mail).addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n Toast.makeText(Login.this, \"Reset Link Sent To Your Email.\", Toast.LENGTH_SHORT).show();\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Toast.makeText(Login.this, \"Error ! Reset Link is Not Sent\" + e.getMessage(), Toast.LENGTH_SHORT).show();\n }\n });\n }",
"private void sendEmailVerification() {\n showProgressDialog();\n\n // [START send_email_verification]\n final FirebaseUser user = mAuth.getCurrentUser();\n assert user != null;\n user.sendEmailVerification()\n .addOnCompleteListener(this, new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n // [START_EXCLUDE]\n // Re-enable button\n if (task.isSuccessful()) {\n Toast.makeText(getApplicationContext(),\n \"Verification email sent to \" + user.getEmail(),\n Toast.LENGTH_SHORT).show();\n } else {\n Log.e(TAG, \"sendEmailVerification\", task.getException());\n Toast.makeText(getApplicationContext(),\n \"Failed to send verification email.\",\n Toast.LENGTH_SHORT).show();\n }\n hideProgressDialog();\n // [END_EXCLUDE]\n }\n });\n // [END send_email_verification]\n }",
"public String openShowUnconfirmed(){\r\n\t\treturn SUCCESS;\r\n\t}",
"public String confirm()\n\t{\n\t\tconfirm = true;\n\t\treturn su();\n\t}",
"private boolean sendConfirmationMail(String login,\n\t\t\t\t\t String password,\n\t\t\t\t\t String addressMail,\n\t\t\t\t\t String pageName)\n {\n\ttry {\n\t String text = \"Bonjour\\n\\n Nous avons reçu une demande d'inscription au système de gestion de documents d'enseignement. Si vous avez demandé l'inscription, veuillez vous rendre à l'adresse suivante:\\n\\n\\thttp://\"+(InetAddress.getLocalHost()).getHostAddress()+\":\"+this.PORT+\"/tdoms/index.jsp?pg=user-files/tmpfiles/\"+pageName+\"\\n\\n Votre inscription au système ne sera effective que lorsque vous vous serez rendu sur cette page. Le login et le mot de passe de votre compte seront alors:\\n\\n\\tLogin: \"+login+\"\\n\\tMot de passe: \"+password+\"\\n\\n Si vous n'avez pas demandé l'inscription au système t-doms, quelqu'un a utilisé votre adresse mail pour essayer de s'inscrire. Nous vous présentons dans ce cas nos plus sincères excuses.\\n\\n Cordialement,\\n le système T-doms\";\n\t String mailHostFile = this.appliPath+\"conf/mailhost.txt\";\n\t new Mailer().sendMail(\"matthieubriend@club-internet.fr\", addressMail,\n\t\t\t\t \"Confirmation de l'inscription\", text, mailHostFile);\n\t} catch (Exception e) {\n\t affichePourTests(e.getMessage());\n\t return false;\n\t}\n\treturn true;\n }",
"@Override\n\tpublic void sendOrderConfirmationHtmlEmail(Order order) {\n\t\t\n\t}",
"public void sendRegistrationEmail(User user, HttpServletRequest request) {\r\n try {\r\n VerificationToken token = new VerificationToken(user);\r\n verificationTokenRepo.save(token);\r\n\r\n String appUrl = request.getScheme() + Constants.SERVER_URL + \"register/confirm/\" + token.getToken();\r\n\r\n UserDTO userDTO = new UserDTO();\r\n userDTO.setFirstName(user.getFirstName());\r\n userDTO.setUsername(user.getUsername());\r\n\r\n // Build message body\r\n String subject = \"\";\r\n String template = \"\";\r\n Map<String, Object> modelObject = null;\r\n\r\n subject = Constants.REGISTRATIONSUBJECT;\r\n template = Constants.REGISTRATIONTEMPLATE;\r\n modelObject = ImmutableMap.of(\r\n \"name\", userDTO.getFirstName(),\r\n \"appUrl\", appUrl\r\n );\r\n\r\n // Send email with required info\r\n sendMimeEmailWithFreemarker(subject, template, userDTO, modelObject);\r\n } catch (UnsupportedEncodingException | CannotSendEmailException | URISyntaxException e) {\r\n e.printStackTrace();\r\n }\r\n }",
"public void sendMail(RegistrationData d) {}",
"@SuppressWarnings(\"deprecation\")\n\t\t\t\tpublic void onClick(View v) \n\t {\n\t \tif (emailCheckedBool == true)\n\t \t{\n\t \tString[] to = {\"jonathan.obrien@mycit.ie\", \"jonathanoddball@gmail.com\"}; \n\t String[] cc = {\"Support@flight.net\"}; \n\t \tsendEmail(to, cc,getApplicationContext().getResources().getString(R.string.support),\n\t \"Email Contents will go here\");\n\t \t}\n\t \t\n\t \t\n\t \t// for the pending intent\n\t \t\n\t\t\t\t\tContext context = getApplicationContext();\n\t\t\t\t\t\n\t\t\t\t\t// messages to be added to the notification \n\t\t\t\t\tCharSequence contentTitle = \"Thank You For Youre Booking\";\n\t\t\t\t\tCharSequence contentText = \"Recommened Service for Car-Hire\";\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// an intent to open a webpage\n\t\t\t\t\tIntent msgIntent = new Intent(Intent.ACTION_VIEW, Uri\n\t\t\t\t\t\t\t.parse(\"http://www.autoeurope.ie/\"));\n\t\t\t\t\t\n\t\t\t\t\t// the pending intent to flag the new task \n\t\t\t\t\tPendingIntent intent = PendingIntent.getActivity(Confirmation.this, 0, msgIntent,\n\t\t\t\t\t\t\tIntent.FLAG_ACTIVITY_NEW_TASK);\n\t\t\t\t\t\n\t\t\t\t\tmsg.defaults |= Notification.DEFAULT_SOUND;\n\t\t\t\t\tmsg.flags |= Notification.FLAG_AUTO_CANCEL;\n\n\t\t\t\t\tmsg.setLatestEventInfo(context, contentTitle, contentText,\n\t\t\t\t\t\t\tintent);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tmNManager.notify(NOTIFY_ID, msg);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// start next activty \n\t\t\t\t\t\n\t\t\t\t\tstartBookingDetails();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t \t\n\t }",
"private String createTemporaryConfirmationPage(String login, String pwd, String addressMail)\n {\n\tString pageName = generateRandomWord()+\".jsp\";\n\tString pagePath = this.appliPath+\"user-files/tmpfiles/\"+pageName;\n\tString message = \"<%@ page contentType=\\\"text/html;charset=UTF-8\\\" language=\\\"java\\\" %>\\n<%@ taglib uri=\\\"/WEB-INF/struts-bean.tld\\\" prefix=\\\"bean\\\" %>\\n<%@ taglib uri=\\\"/WEB-INF/struts-html.tld\\\" prefix=\\\"html\\\" %>\\n\\nPour confirmer votre inscription, cliquez sur le bouton ci-dessous.<br/>\\n<html:form action=\\\"/confirm\\\" name=\\\"confirm\\\" type=\\\"account.SubscribeForm\\\">\\n<html:hidden property=\\\"login\\\" name=\\\"login\\\" value=\\\"\"+login+\"\\\"/>\\n<html:hidden property=\\\"pwd\\\" name=\\\"pwd\\\" value=\\\"\"+pwd+\"\\\"/>\\n<html:hidden property=\\\"mail\\\" name=\\\"mail\\\" value=\\\"\"+addressMail+\"\\\"/>\\n<html:submit property=\\\"confirmation\\\" title=\\\"confirmationTitle\\\" value=\\\"Confirmer\\\"/>\\n</html:form>\";\n\ttry{\n\t BufferedWriter file = new BufferedWriter(new FileWriter(pagePath));\n\t file.write(message);\n\t file.close();\n\t}catch(IOException ioe)\n\t { ioe.printStackTrace(); affichePourTests(ioe.getMessage()); return null; }\n\treturn pageName;\n }",
"public void ClickConfirmationPage() {\r\n\t\tconfirmation.click();\r\n\t\t\tLog(\"Clicked the \\\"Confirmation\\\" button on the Birthdays page\");\r\n\t}",
"public boolean enviarMailConfirmacion(Agente agente, Usuario usuario){\n\n try {\n\n //seteamos el asunto\n// message.setSubject(\"UNDEC - Activar Cuenta Nortia UNDEC\");\n//\n// //seteamos el mensaje que vamos a enviar\n// message.setContent(\"<html>\\n\" +\n// \"<body>\\n\" +\n// \"\\n Hola, para poder activar la cuenta haga click en el siguiente link ----> \" +\n// \"<a href=\\\"\"+new URLWEB().getAbsoluteApplicationUrl()+\"/activarcuenta.xhtml?username=\"+usuario.getUsuarionombre()+\n// \"&hash=\"+usuario.getUsuarioclave()+\n// \"\\\">\\n\" +\n// \"Activar cuenta</a>\\n\" +\n// \"\\n\" +\n// \"En caso de no poder pegue en el browser lo siguiente\\n \"+\n// new URLWEB().getAbsoluteApplicationUrl()+\"/activarcuenta.xhtml?username=\"+usuario.getUsuarionombre()+\n// \"&hash=\"+usuario.getUsuarioclave()+\"\\n\"+\n// \"Muchas Gracias\"+\n// \"</body>\\n\" +\n// \"</html>\", \"text/html\");\n// //colocamos la direccion de donde enviamos el correo\n// Address address = new InternetAddress(agente.getEmail());\n// message.setFrom(address);\n// //Colocamos la direccion de la persona a enviar\n// Address send = new InternetAddress(agente.getOtroemail(),false);\n// message.addRecipient(Message.RecipientType.TO,send);\n// message.addRecipient(Message.RecipientType.BCC, new InternetAddress( agente.getOtroemail()));\n// //la persona que envia con la validacion de su cuenta.\n// Transport trans = session.getTransport(\"smtp\");\n// //Aca se autentifica que la direccion de la persona que envia sea válida\n// //trans.connect();\n// trans.connect(\"sisgap@undec.edu.ar\",\"sgap*9812\");\n// trans.sendMessage(message,message.getAllRecipients());\n// trans.close();\n Email email = new Email();\n email.setFromAddress(\"Nortia UNDEC\", \"sisgap@undec.edu.ar\");\n email.addRecipient(agente.getApellido(), agente.getEmail(), RecipientType.TO);\n email.addRecipient(agente.getApellido(), agente.getOtroemail(), RecipientType.BCC);\n email.setTextHTML(\"Hola \"+usuario.getUsuarionombre()+\", <br /> para poder activar la cuenta haga click en el siguiente link ----> \" +\n\"<a href=\\\"\"+new URLWEB().getAbsoluteApplicationUrl()+\"/activarcuenta.xhtml?username=\"+usuario.getUsuarionombre()+\n \"&hash=\"+usuario.getUsuarioclave() +\n\"\\\"> Activar cuenta </a> <br />\"+\n \n\"En caso de no poder pegue en el browser lo siguiente \" +\n new URLWEB().getAbsoluteApplicationUrl()+\"/activarcuenta.xhtml?username=\"+usuario.getUsuarionombre()+\n\"&hash=\"+usuario.getUsuarioclave()+\"<br />\" +\n\"Muchas Gracias\");\n email.setSubject(\"UNDEC - Activar Cuenta Nortia UNDEC\");\n \n // or:\n new Mailer(\"localhost\", 25, \"sisgap@undec.edu.ar\", \"sgap*9812\").sendMail(email);\n } catch (Exception ex) {\n\n ex.printStackTrace();\n //Si el correo tiene algun error lo retornaremos aca\n JsfUtil.addErrorMessage(ex,\"No se pudo crear el Usuario\");\n\n return false;\n\n// } catch (MalformedURLException ex) {\n// Logger.getLogger(EnviarMail.class.getName()).log(Level.SEVERE, null, ex);\n// return false;\n }\n //Correo tuvo exito dara una salida en este punto indicando que si se envio\n return true;\n \n }",
"@Override\n public void onClick(DialogInterface dialog, int which) {\n String mail = resetMail.getText().toString();\n mAuth.sendPasswordResetEmail(mail).addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n Toast.makeText(LoginActivity.this,\"Reset Link sent to your Email.\", Toast.LENGTH_SHORT).show();\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Toast.makeText(LoginActivity.this,\"Error ! Reset Link is Not Sent.\" + e.getMessage(), Toast.LENGTH_SHORT).show();\n }\n });\n }",
"@Override\n public void onClick(DialogInterface dialog, int which) {\n String mail = resetMail.getText().toString();\n fAuth.sendPasswordResetEmail(mail).addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n Toast.makeText(Login.this, \"Reset link sent to your email.\", Toast.LENGTH_SHORT).show();\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Toast.makeText(Login.this, \"Error! Reset link was not sent\" + e.getMessage(), Toast.LENGTH_SHORT).show();\n }\n });\n\n }",
"@Override\n protected void onSubmit()\n {\n final ApplicationUser appUser = (ApplicationUser) getModelObject();\n UserRegistration userRegistration = new UserRegistration(appUser.getBusinessUser());\n paramUserId = userRegistration.getUserId();\n //paramDateTime = userRegistration.getRequestTimeAsString();\n //paramToken = userRegistration.getMailToken();\n\n // Note: Dccd does not use a validation Page!\n\n\t\t\t// Construct the url for the activation of member and/or organisation\n\t\t\tMap<String, String> parameterMap = new HashMap<String, String>();\n\t\t\tparameterMap.put(\"userId\", paramUserId);\n\t\t\tparameterMap.put(\"inEditMode\", \"0\"); // activation button is placed on non-edit page!\n\t\t\tparameterMap.put(\"enableModeSwitch\", \"1\");\n\t\t\tfinal String activationUrl = createPageURL(MemberPage.class, parameterMap);\n\t\t\tuserRegistration.setActivationUrl(activationUrl);\n\t\t\tlogger.debug(\"activationUrl: \" + activationUrl);\n\n if (isOrganisationEdit())\n {\n \tlogger.debug(\"new Organisation must now be registered\");\n \tassert(null != newOrganisation);\n \t// Also register the new organisation\n \tlogger.debug(\"New organistation: \" + newOrganisation.getId());\n \tOrganisationRegistration organisationRegistration =\n \t\tnew OrganisationRegistration(newOrganisation);\n\n \tuserRegistration.setOrganisation(newOrganisation);\n \tDccdUserService.getService().handleRegistrationRequest(userRegistration, organisationRegistration);\n\n \tif (!organisationRegistration.isCompleted())\n \t{\n \t\t// something went wrong!\n \tlogger.debug(\"Could not complete organisation registration\");\n for (String stateKey : organisationRegistration.getAccumulatedStateKeys())\n {\n //error(getString(stateKey));\n \t// allow for substitution\n error(getString(stateKey, new Model(organisationRegistration)));\n }\n \t}\n }\n else\n {\n \tuserRegistration.setOrganisation(selectedOrganisation);\n \tuserRegistration = DccdUserService.getService().handleRegistrationRequest(userRegistration);\n }\n\n if (userRegistration.isCompleted())\n {\n disableForm(new String[] {});\n info(getString(\"missionAccomplished\", new Model(appUser)));\n //setResponsePage(new InfoPage(getString(\"registrationpage.header\")));\n // use specific page for the confirmation\n setResponsePage(new RegistrationConfirmPage(appUser));\n }\n else\n {\n \tlogger.debug(\"Could not complete user registration\");\n for (String stateKey : userRegistration.getAccumulatedStateKeys())\n {\n error(getString(stateKey));\n }\n }\n logger.debug(\"End onSubmit: \" + userRegistration.toString());\n }",
"@Override\n public void onClick(DialogInterface dialogInterface, int i) {\n String mail = resetMail.getText().toString();\n firebaseAuth.sendPasswordResetEmail(mail).addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n Toast.makeText(LogIn.this,\"Reset Link sent.\",Toast.LENGTH_SHORT).show();\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Toast.makeText(LogIn.this,\"Error | Reset Link not sent.\",Toast.LENGTH_SHORT).show();\n }\n });\n }",
"void finalConfirm(ITransaction trans,boolean confirmation, String userId);",
"public void onClick(View view){\n if(password.getText().toString().equals(confirm.getText().toString()))\n creatAccount(email.getText().toString(), password.getText().toString(), username.getText().toString());\n else\n showMessage(\"Confirmed Password is not the same as Password\");\n }",
"public void signUpUser(RegistrationRequest request) {\n String requestEmail = request.getEmail();\n\n // sign up user through user service and get token UUID\n String token = applicationUserService.signUpUser(\n // convert request to client user\n convertRegistrationRequestToApplicationUser(request));\n\n // create confirmation link\n String host = \"localhost:8080\";\n String link = \"http://\" + host + \"/registration/confirm?token=\" + token;\n\n // send email with link to the user's email address\n emailSender.send(requestEmail,\n // build email message\n EmailMessageHelper.buildEmailMessage(request.getUsername(), link));\n\n }",
"private void sendEmailVerification(){\n FirebaseUser firebaseUser = mfirebaseAuth.getCurrentUser();\n if(firebaseUser!=null){\n firebaseUser.sendEmailVerification().addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n if(task.isSuccessful()){\n Toast.makeText(SignUpActivity.this, \"Successfully Registered, Verification E-mail sent!\", Toast.LENGTH_SHORT).show();\n mfirebaseAuth.signOut();\n finish();\n startActivity(new Intent(SignUpActivity.this, LoginActivity.class));\n }else {\n Toast.makeText(SignUpActivity.this, \"Verification email could not be sent, please try again later\", Toast.LENGTH_SHORT).show();\n\n }\n }\n });\n }\n\n }",
"@Override\n\tprotected String showConfirmation() {\n\t\treturn \"Payment is successful. Check your credit card statement for PetSitters, Inc.\";\n\t}",
"@Override\n public void onClick(View v) {\n if (isEmailValid(inputEmail.getText().toString())) {\n if(inputPass.getText().toString().equals(inputPassConfirm.getText().toString())) {\n // Open next page of registration\n try {\n Intent i = new Intent(mContext, RegisterFinalActivity.class);\n i.putExtra(\"email\", inputEmail.getText().toString());\n i.putExtra(\"pass\", inputPass.getText().toString());\n mContext.startActivity(i);\n } catch (Exception e) {\n Log.i(\"Not found\", Arrays.toString(e.getStackTrace()));\n }\n } else {\n runOnUiThread(() -> {\n Toast toast = Toast.makeText(getApplicationContext(), \"Parolele introduse nu coincid!\", Toast.LENGTH_LONG);\n toast.show();\n });\n }\n } else {\n runOnUiThread(() -> {\n Toast toast = Toast.makeText(getApplicationContext(), \"Email-ul introdus nu este corespunzător!\", Toast.LENGTH_LONG);\n toast.show();\n });\n }\n }",
"@Override\n public ActionResult doExecute(HttpServletRequest req, RenderContext renderContext, final Resource resource,\n JCRSessionWrapper session, final Map<String, List<String>> parameters, URLResolver urlResolver) throws Exception {\n JCRTemplate.getInstance().doExecuteWithSystemSession(new JCRCallback<Boolean>() {\n \n \t@Override\n public Boolean doInJCR(JCRSessionWrapper session) throws RepositoryException {\n \t\tlogger.info(\"begin confirmationReservation\");\n if (mailService.isEnabled()) {\n // Prepare mail to be sent :\n String from = parameters.get(\"from\")==null?mailService.getSettings().getFrom():getParameter(parameters, \"from\");\n String bcc = parameters.get(\"bcc\")==null?null:getParameter(parameters, \"bcc\");\n String email = getParameter(parameters, \"email\");\n String key = getParameter(parameters, \"key\");\n String cc = getParameter(parameters,\"copie\");\n logger.info(\"send copie to : \"+cc);\n Map<String,Object> bindings = new HashMap<String,Object>();\n JCRNodeWrapper node = session.getNode(\"/sites/LARBRE/contents/reservations/\"+email+\"/\"+key);\n\t\t\t\t\tbindings.put(\"reservation\", node);\n\t\t\t\t\tNumberFormat formatter = DecimalFormat.getInstance(Locale.FRANCE);\n\t\t\t\t\tformatter.setMinimumFractionDigits(2);\n\t\t\t\t\tformatter.setMaximumFractionDigits(2);\n\t\t\t\t\tbindings.put(\"total\",formatter.format(node.getProperty(\"places\").getDouble()*8));\n\t\t\t\t\t/*\n\t\t bindings.put(\"confirmationlink\", requ.getScheme() +\"://\" + requ.getServerName() + \":\" + requ.getServerPort() +\n\t\t Jahia.getContextPath() + Render.getRenderServletPath() + \"/live/\"\n\t\t + node.getLanguage() + node.getPath() + \".confirmationReservation.do?email=\"+email+\"key=add\");\n */\n try {\n mailService.sendMessageWithTemplate(templatePath,bindings,email,from,cc,bcc,resource.getLocale(),\"Jahia User Registration\");\n } catch (ScriptException e) {\n logger.error(\"Error sending e-mail notification for user confirmation\", e);\n }\n }\n \n \t\tlogger.info(\"end confirmationReservation\");\n return true;\n }\n });\n return new ActionResult(HttpServletResponse.SC_OK,parameters.get(\"confirmationPage\").get(0));\n\t\t\n\t}",
"@Test(groups ={Slingshot,Regression,CsaAgent})\t\n\t\t\t\tpublic void verifyImpersonateUserLink() throws Exception {\n\t\t\t\t\tReport.createTestLogHeader(\"CSA Journey\", \"To verify the Password Reset functionality\");\n\t\t\t\t\tUserProfile userProfile = new TestDataHelper().getUserProfile(\"PSABroker\");\n\t\t\t\t\tSMRAccountDetails smrProfile = new TestDataHelper().getAllSMRUserProfile(\"ViewBillPartner\");\n\t\t\t\t\t//deregisterinBgbonline(userProfile); \n\t\t\t\t\t//Register a user \n\t\t\t\t\t/*new PartnerServiceAgentAction()\n\t\t\t\t\t.navigateToPSARegistration()\n\t\t\t\t\t.clickRegisteraUser(userProfile);\n\t\t\t\t\tnew SapCrmAction()\n\t\t\t\t\t .loginDetails(crmuserProfile)\n\t\t\t\t\t .searchByAccountId(crmuserProfile, userProfile);\n\t\t\t\t\tnew RegistrationAction()\n\t\t\t\t\t.openEncryptURL(userProfile)\n\t\t\t\t\t.fillRegistrationDetails(userProfile)\n\t\t\t\t\t.verifyThankYouPage()\n\t\t\t\t\t.clickLoginLink()\n\t\t\t\t\t.verifyAuditEntry(userProfile)\n\t\t\t\t\t.verifyEmailIdInDb(userProfile);*/\n\t\t\t\t\t//verify Lookup User functionality\n\t\t\t\t\tnew PartnerServiceAgentAction()\n\t\t\t\t\t.navigateToPSARegistration()\n\t\t\t\t\t.verifyFindUser(userProfile)\n\t\t\t\t\t.verifyImpersonateLink(smrProfile);\t \n\t\t\t\t}",
"@When(\"^user clicks on Register link$\")\r\n public void user_clicks_on_Register_link() throws Throwable {\n throw new PendingException();\r\n }",
"@Test(groups ={Slingshot,Regression,CsaAgent})\t\n\t\t\t\tpublic void verifyPasswordResetLink() throws Exception {\n\t\t\t\t\tReport.createTestLogHeader(\"CSA Journey\", \"To verify the Password Reset functionality\");\n\t\t\t\t\tUserProfile userProfile = new TestDataHelper().getUserProfile(\"PSABroker\");\n\t\t\t\t\t//deregisterinBgbonline(userProfile); \n\t\t\t\t\t//Register a user \n\t\t\t\t\t/*new PartnerServiceAgentAction()\n\t\t\t\t\t.navigateToPSARegistration()\n\t\t\t\t\t.clickRegisteraUser(userProfile);\n\t\t\t\t\tnew SapCrmAction()\n\t\t\t\t\t .loginDetails(crmuserProfile)\n\t\t\t\t\t .searchByAccountId(crmuserProfile, userProfile);\n\t\t\t\t\tnew RegistrationAction()\n\t\t\t\t\t.openEncryptURL(userProfile)\n\t\t\t\t\t.fillRegistrationDetails(userProfile)\n\t\t\t\t\t.verifyThankYouPage()\n\t\t\t\t\t.clickLoginLink()\n\t\t\t\t\t.verifyAuditEntry(userProfile)\n\t\t\t\t\t.verifyEmailIdInDb(userProfile);*/\n\t\t\t\t\t//verify Lookup User functionality\n\t\t\t\t\tnew PartnerServiceAgentAction()\n\t\t\t\t\t.navigateToPSARegistration()\n\t\t\t\t\t.verifyFindUser(userProfile)\n\t\t\t\t\t.verifyPasswordLink(userProfile);\t \n\t\t\t\t}",
"public void EnvoyerEmailSurveillant(Utilisateur user) {\n\t\t\t\t MimeMessage mimeMessage = mailSender.createMimeMessage(); \n\t\t\t try {\n\t\t\t MimeMessageHelper mimeMessageHelper = new MimeMessageHelper(mimeMessage, true);\n\t\t\t mimeMessageHelper.setSubject(\"Compte Surveillant \");\n\t\t\t mimeMessageHelper.setFrom(\"naifarsara@gmail.com\");\n\n\t\t\t mimeMessageHelper.setTo(user.getEmail());\n\t\t\t String url =\"scolarity.dpc.com.tn\";\n\t\t String content = \"Bonjour Mr ( Mmme), \" + user.getNom()+\" + \" + user.getPrenom()\n\t\t + \", votre nom d'utilisateur par la platforme scolarity est : \\n \" + user.getUsername() +\" \\n\"+\"et votre mot de passe est : \\n\"+ user.getPassword()+\"\\n\"+\"vous pouvez accéder au espace surveillant via l'adresse suivante : \\n\"+url+\"\\n\"+\" \\n Cordialement.\";\n\t\t System.out.println(content);\n\n\t\t\t mimeMessageHelper.setTo(user.getEmail());\n\t\t mimeMessageHelper.setText(content);\n\t\t // Add a resource as an attachment\n\t\t mimeMessageHelper.setText(\"<html><body><p>\" + content + \"</p> <img src=\\\"http://207.180.211.158:/logodpc.bmp\\\" width=\\\"50\\\" alt=\\\"Apen\\\"></body></html>\", true);\n\n\t\t\t \n\t\t\t \n\t\t\t mailSender.send(mimeMessageHelper.getMimeMessage());\n\t\t\t } catch (MessagingException e) {\n\t\t\t e.printStackTrace();\n\t\t\t }\n\t\t\t\t\n\t\t\t}",
"public void onSignupSuccess(){\n Toast.makeText(this, \"YEPP\", Toast.LENGTH_SHORT).show();\r\n Intent changetomain = new Intent(RegisterActivity.this, MainAccount.class) ;\r\n startActivity(changetomain);\r\n }",
"public static void SendEmailConfirmation(String toEmail, String content)\r\n {\r\n try\r\n {\r\n System.out.println(\"Se pregateste email-ul.\");\r\n\r\n Properties properties = new Properties();\r\n properties.put(\"mail.smtp.host\", \"smtp.gmail.com\");\r\n properties.put(\"mail.smtp.port\", \"587\");\r\n properties.put(\"mail.smtp.auth\", \"true\");\r\n properties.put(\"mail.smtp.starttls.enable\", \"true\");\r\n\r\n Authenticator auth = new Authenticator() {\r\n @Override\r\n protected PasswordAuthentication getPasswordAuthentication() {\r\n return new PasswordAuthentication(fromEmail, password);\r\n }\r\n };\r\n\r\n Session session = Session.getInstance(properties, auth);\r\n\r\n sendEmail(session, toEmail, \"[INFORMATII PERSONALE] Credentiale pentru aplicatia UVT StudentApp\", content);\r\n }\r\n catch ( Exception e)\r\n {\r\n System.out.println(\"Nu s-a putut trimite mail-ul.\");\r\n return;\r\n }\r\n }",
"public void Admin_Configuration_EmailSubscriptions()\n\t{\n\t\tAdmin_Configuration_EmailSubscriptions.click();\n\t}",
"@Click public void aboutEmailButton() {\n\n Intent emailIntent = new Intent(\n Intent.ACTION_SENDTO, Uri.parse(\"mailto:\" + Uri.encode(EMAIL))\n );\n //emailIntent.putExtra(Intent.EXTRA_SUBJECT, subject);\n //emailIntent.putExtra(Intent.EXTRA_TEXT, body);\n\n //startActivity(emailIntent);\n //startActivity(Intent.createChooser(emailIntent, \"Send an email\"));\n\n try {\n startActivity(emailIntent);\n } catch (ActivityNotFoundException e) {\n app.toasty(R.string.error_no_email_client);\n e.printStackTrace();\n }\n }",
"@Override\n public void onClick(View v) {\n\n mAuth.sendPasswordResetEmail(email)\n .addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n if (task.isSuccessful()) {\n Log.d(TAG, \"Email sent.\");\n messageDisplay.setText(\"Reset Email Sent Successfully!\");\n Toast.makeText(ForgotPasswordActivity.this, \"Reset Email Sent Successfully!\", Toast.LENGTH_SHORT).show();\n }\n\n else {\n //display some message here\n messageDisplay.setText(\"User Does Not Exist\");\n Toast.makeText(ForgotPasswordActivity.this, \"User Does Not Exist\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n }",
"@RequestMapping(\"/finalConfirm\")\n public String finalConfirm(Model model, Principal principal){\n model.addAttribute(\"user\", new User());\n model.addAttribute(\"categories\", categoryRepository.findAll());\n model.addAttribute(\"carts\", cartRepository.findAll());\n model.addAttribute(\"user_id\", userRepository.findByUsername(principal.getName()).getId());\n\n\n// model.addAttribute(\"carts\", cartRepository.findAll());\n\n SimpleMailMessage msg = new SimpleMailMessage(); //send confirmation email\n msg.setTo(userService.getUser().getEmail()); //add comma in between emails to send to multiple accounts\n msg.setTo(userService.getUser().getEmail()); //add comma in between emails to send to multiple accounts\n\n msg.setSubject(\"Thank you for your order\");\n msg.setText(\"Thank you for your order \\n You will arrive within 10 days\");\n\n javaMailSender.send(msg);\n\n Cart currentCart = cartRepository.findByEnabledAndUser(true, userService.getUser());\n currentCart.setEnabled(false);\n cartRepository.save(currentCart);\n\n return \"finalConfirm\";\n\n }",
"@Override\n public void onClick(View v) {\n if(!isEmpty(mUserRegBinding.editTextPrivEmail.getText().toString())\n && !isEmpty(mUserRegBinding.editTextPrivPassword.getText().toString())\n && !isEmpty(mUserRegBinding.editTextPrivConfirmPassword.getText().toString())){\n\n //check if passwords match\n if(doStringsMatch(mUserRegBinding.editTextPrivPassword.getText().toString(),\n mUserRegBinding.editTextPrivConfirmPassword.getText().toString())){\n\n //Initiate user registration task\n registerNewEmail(mUserRegBinding.editTextPrivEmail.getText().toString(),\n mUserRegBinding.editTextPrivPassword.getText().toString());\n }else{\n Snackbar.make(getCurrentFocus().getRootView(), \"Passwords do not Match\", Snackbar.LENGTH_SHORT).show();\n }\n\n }else{\n Snackbar.make(getCurrentFocus().getRootView(), \"You must fill out all the fields\", Snackbar.LENGTH_SHORT).show();\n }\n }",
"@Override\n public void onClick(DialogInterface dialog, int which) {\n String mail = resetMail.getText().toString();\n auth.sendPasswordResetEmail(mail).addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n Toast.makeText(Login.this, R.string.reset_sent, Toast.LENGTH_SHORT).show();\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Toast.makeText(Login.this, getString(R.string.reset_not_sent) + e.getMessage(), Toast.LENGTH_SHORT).show();\n }\n });\n\n }",
"public static void signUp(String username, String password, String alternativeEmail, String firstName, String lastName) {\n click(REGISTRATION_LINK);\n type(REG_FLOW_USERNAME_FIELD, username);\n click(REG_FLOW_CHECK_BUTTON);\n// if (!REG_FLOW_USERNAME_FREE_MESSAGE.toString().contains(\"Потребителското име е свободно\")) {\n// System.out.println(\"Try another username - the entered one is already in use\");\n// }\n type(REG_FLOW_PASSWORD_FIELD, password);\n type(REG_FLOW_PASSWORD_REENTER_FIELD, password);\n WebElement phoneCheckbox = Browser.driver.findElement(REG_FLOW_PHONE_CHECKBOX);\n if (phoneCheckbox.isEnabled()) {\n phoneCheckbox.click(); //that's how we disable it\n }\n type(REG_FLOW_ALTERNATIVE_EMAIL_FIELD, alternativeEmail);\n type(REG_FLOW_QUESTION_FIELD, \"To be or not to be?\");\n type(REG_FLOW_ANSWER_FIELD, \"To beeee.\");\n type(REG_FLOW_FNAME_FIELD, firstName);\n type(REG_FLOW_LNAME_FIELD, lastName);\n Browser.driver.switchTo().frame(\"abv-GDPR-frame\").manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n // Manually to tap ACCEPT on the GDPR window\n Browser.driver.switchTo().defaultContent();\n click(REG_FLOW_GENDER_RADIOBUTTON); //to choose male\n click(REG_FLOW_DAY_DROPDOWN);\n click(REG_FLOW_DAY_3); // to choose 3th\n click(REG_FLOW_MONTH_DROPDOWN);\n click(REG_FLOW_MONTH_5); // to choose May\n click(REG_FLOW_YEAR_DROPDOWN);\n click(REG_FLOW_YEAR_1998); // to choose 1998\n\n findElement(REG_FLOW_CAPTCHA_FIELD);\n click(REG_FLOW_CAPTCHA_FIELD);\n // Timeout to enter the CAPTCHA manually\n // EXPLICIT WAIT DA MU TURYA\n click(REG_FLOW_CREATE_BUTTON);\n String successfulRegMessage = Browser.driver.findElement(REG_SUCCESS_MESSAGE).getText().trim();\n assertTrue(successfulRegMessage.contains(\"Успешна регистрация.\"), \"No SUCCESS message\");\n click(LOGIN_TO_YOUR_EMAIL_BUTTON);\n }",
"public void resendVerificationEmail(){\n progressDialog.setMessage(\"Please wait...\");\n progressDialog.show();\n mAuth.getCurrentUser().sendEmailVerification().addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n if (task.isSuccessful()){\n alertDialogBuilderSentSuccessMessage(SignInActivity.this);\n Toast.makeText(SignInActivity.this,\"Sent email successfully.\",Toast.LENGTH_LONG).show();\n }else{\n Toast.makeText(SignInActivity.this,task.getException().getLocalizedMessage(),Toast.LENGTH_LONG).show();\n }\n\n progressDialog.dismiss();\n }\n });\n }",
"private void registerEmailAddr() {\r\n\t\t\t\tWindow.setTitle(Common.APPNAME);\r\n\t\t\t\tmanualRegisterBtn.setEnabled(false);\r\n\t\t\t\tfinal String emailAddrProvided = emailAddrField.getText();\r\n\t\t\t\tserverResponseLabel.setText(\"\");\r\n\t\t\t\tregisterService.manualRegister(emailAddrProvided,\r\n\t\t\t\t\tnew AsyncCallback<String>() {\r\n\t\t\t\t\t\tpublic void onFailure(Throwable caught) {\r\n\t\t\t\t\t\t\t// Show the RPC error message to the user\r\n\t\t\t\t\t\t\tdialogBox.setText(\"Email Address Registration - Failure\");\r\n\t\t\t\t\t\t\tdialogBox.center();\r\n\t\t\t\t\t\t\tcloseButton.setFocus(true);\r\n\t\t\t\t\t\t\tdialogBox.show();\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tpublic void onSuccess(String result) {\r\n\t\t\t\t\t\t\tif (\"Verified\".equalsIgnoreCase(result)) {\r\n\t\t\t\t\t\t\t\tString registerReturnUri = GWT.getHostPageBaseURL() + REGISTER_RETURN_URI;\r\n\t\t\t\t\t\t\t\tWindow.open(registerReturnUri, \"_self\", \"\"); \r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\temailAddrField.setText(\"\");\r\n\t\t\t\t\t\t\t\t/*\r\n\t\t\t\t\t\t\t\tWindow.alert(result);\r\n\t\t\t\t\t\t\t\t*/\r\n\t\t\t\t\t\t\t\tdialogBox.center();\r\n\t\t\t\t\t\t\t\tdialogBox.setAnimationEnabled(true);\r\n\t\t\t\t\t\t\t\tdialogBox.setWidth(\"320px\");\r\n\t\t\t\t\t\t\t\tdialogBox.setText(result);\r\n\t\t\t\t\t\t\t\tcloseButton.setFocus(true);\r\n\t\t\t\t\t\t\t\t/*\r\n\t\t\t\t\t\t\t\tmanualRegisterBtn.setEnabled(true);\r\n\t\t\t\t\t\t\t\t*/\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t);\r\n\t\t\t}",
"private void sendInvitationLink(){\n String invitationLink = mInvitationURL;\n String msg = \"Давайте вместе сыграем в Мюнхгаузена! Используйте мою реферерную ссылку: \"\n + invitationLink;\n\n System.out.println(msg);\n\n NSMutableArray<NSString> array = new NSMutableArray<NSString>();\n array.add(msg);\n\n UIActivityViewController activityViewController = new UIActivityViewController(array,null);\n UIViewController currentViewController = UIApplication.getSharedApplication().getKeyWindow().getRootViewController();\n\n if (isIpad()) {\n UIPopoverPresentationController popoverController = activityViewController.getPopoverPresentationController();\n popoverController.setSourceRect(new CGRect(UIScreen.getMainScreen().getBounds().getWidth()/2, UIScreen.getMainScreen().getBounds().getHeight()/2,0,0));\n popoverController.setSourceView(activityViewController.getView());\n popoverController.setPermittedArrowDirections(new UIPopoverArrowDirection(0));\n }\n\n currentViewController.presentViewController(activityViewController,true,null);\n\n// if (!MFMailComposeViewController.canSendMail()){\n// System.out.println(\"Device can't send email\")\n// return;\n// }\n//\n// MFMailComposeViewController mailer = new MFMailComposeViewController();\n// mailer.setMailComposeDelegate(new MFMailComposeViewControllerDelegate() {\n// @Override\n// public void didFinish(MFMailComposeViewController mfMailComposeViewController, MFMailComposeResult mfMailComposeResult, NSError nsError) {\n//\n// }\n// });\n//\n// mailer.setSubject(\"Invitation\");\n// mailer.setMessageBody(msg, true);\n// mailer.presentViewController(mailer, true, null);\n\n }",
"@Test(groups ={Slingshot,Regression})\n\tpublic void VerifyStandardUserspecificaccountsConfirmationPageNavigation() {\n\t\tReport.createTestLogHeader(\"MuMv\", \"Verify the Superuser Specific accounts Navigationlinks for the confirmation Page\");\n\n\t\tUserProfile userProfile = new TestDataHelper().getUserProfile(\"MuMVTestDataspl\");\n\t\tnew LoginAction()\n\t\t.BgbnavigateToLogin()\n\t\t.BgbloginDetails(userProfile);\n\t\tnew MultiUserMultiViewAction()\n\t\t.ClickManageUserLink()\n\t\t.ClickAddNewUserLink()\n\t\t.AddUserRadioButton()\n\t\t.StandardUser_Creation()\n\t\t.VerifySpecificAccountsViewName(userProfile)\t \t \t\t \t \n\t\t.AddNewUserNavigationVerification() \n\t\t.UserConfirmationPageNavigations();\t \t \t\t\n\t}",
"@Test(groups ={Slingshot,Regression})\n\tpublic void VerifyNewUserDetailsactivation() {\n\t\tReport.createTestLogHeader(\"MuMv\", \"Verify the Super User Overlay Yes Button Selection\");\n\n\t\tUserProfile userProfile = new TestDataHelper().getUserProfile(\"MuMVTestDatas\");\n\t\tnew LoginAction()\n\t\t.BgbnavigateToLogin()\n\t\t.BgbloginDetails(userProfile);\n\t\tnew MultiUserMultiViewAction()\n\t\t.ClickManageUserLink()\n\t\t.ClickAddNewUserLink()\n\t\t.AddUserRadioButton()\n\t\t.SuperUserCreation()\n\t\t.SuperUserOverlayyes(); \t \t \t \t \n\t}",
"@Override\n public void onRegistrationSuccess(RegistrationResponse response) {\n if (response.isStatus()) {\n\n startActivityForResult(new Intent(this,VerifyEmailActivity.class)\n .putExtra(getString(R.string.from_sign_up_key),true)\n .putExtra(getString(R.string.email_id_key),model.getEmail().getValue()),VERIFY_EMAIL_REQUEST_CODE);\n\n\n } else {\n StringBuilder errorMsg = new StringBuilder();\n if (null != response.getErrors()) {\n for (Error e : response.getErrors()) {\n if (e.getCode().equalsIgnoreCase(\"REG005\")) {\n signUpBinding.txtEmailId.setErrorEnabled(true);\n signUpBinding.txtEmailId.setError(e.getMessage());\n } else {\n errorMsg.append(e.getMessage()).append(\"\\n\");\n }\n }\n } else {\n errorMsg.append(getString(R.string.server_error));\n }\n signUpBinding.txtError.setText(errorMsg);\n signUpBinding.txtError.setVisibility(View.VISIBLE);\n }\n }",
"@And(\"^I goto Activation Page$\")\r\n\t\r\n\tpublic void I_goto_Activation_Page() throws Exception {\r\n\t\t\r\n\t\tenduser.click_activationTab();\r\n\t\t\r\n\t}",
"private void sendBookingConfirmMailWithMailtrapProvider(String userEmail, String token) throws MessagingException {\n String to = userEmail;//change accordingly \n// Gmail’s SMTP account,\n\n String userName = \"91c28c9b77f112\";//from mailtrap\n String password = \"9d4d7fbf411267\";\n\n //Get the session object \n //1. sets SMTP server properties\n Properties properties = new Properties();\n properties.put(\"mail.smtp.auth\", true);\n properties.put(\"mail.smtp.starttls.enable\", \"true\");\n properties.put(\"mail.smtp.host\", \"smtp.mailtrap.io\");\n properties.put(\"mail.smtp.port\", \"25\");\n properties.put(\"mail.smtp.ssl.trust\", \"smtp.mailtrap.io\");\n //2. creates a new session with an authenticator\n Authenticator auth = new Authenticator() {\n @Override\n public PasswordAuthentication getPasswordAuthentication() {\n return new PasswordAuthentication(userName, password);\n }\n };\n\n Session session = Session.getInstance(properties, auth);\n\n //3. Creates a new e-mail message\n Message msg = new MimeMessage(session);\n\n msg.setFrom(new InternetAddress(\"hungbsse130615@fpt.edu.vn\"));\n InternetAddress[] toAddresses = {new InternetAddress(to)};\n msg.setRecipients(Message.RecipientType.TO, toAddresses);\n msg.setSubject(\"Test send mail\");\n msg.setSentDate(new Date());\n msg.setText(\"Hello, this is example of sending email. ?token=\" + token);\n\n// MimeMessage message = new MimeMessage(session);\n// message.setFrom(new InternetAddress(from));\n// message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));\n //4. Send the message\n Transport.send(msg);\n System.out.println(\"message sent successfully....\");\n\n }",
"public void uponSuccessfulRegistration(String[] emailCCList){\n \tSimpleMailMessage[] mailMessageArray = new SimpleMailMessage[1];\r\n Iterator iterator = userEmailIds.iterator();\r\n // for (int index = 0; iterator.hasNext(); index ++){\r\n SimpleMailMessage message = new SimpleMailMessage();\r\n String toAddress = (String)iterator.next();\r\n message.setFrom(\"thotaparvathidevi@gmail.com\");\r\n message.setTo(\"durgasridevi.salugu@mntsoft.co.in\");\r\n message.setSubject(\"With CC\");\r\n message.setCc(emailCCList);\r\n message.setText(\"Mail Sent from @parvathi@gmail.com\");\r\n mailMessageArray[0] = message;\r\n// }\r\n mailSender.send(mailMessageArray);\r\n }",
"private void createRegistrationAnswer(boolean existEMail, boolean existUser, boolean registrationCompleted) {\n\t\tUserAuthenticationAckMessage uaaMessage = new UserAuthenticationAckMessage(MIDs.REGISTRATION);\n\t\tuaaMessage.setAuthentication(registrationCompleted);\n\t\tuaaMessage.setUserExists(existUser);\n\t\tuaaMessage.setEMailExists(existEMail);\n\t\tthis.mesController.sendMessage(uaaMessage);\n\t}",
"private void sendProofEmail(String proof){\n \t\n \tIntent emailIntent = new Intent(android.content.Intent.ACTION_SEND);\n \temailIntent.setType(\"plain/text\");\n \t\n \t//emailIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n\n \t/* Fill it with Data */\n \temailIntent.setType(\"plain/text\");\n \t//emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{\"to@email.com\"});\n \temailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, \"Here's the code from FlipSHA\");\n \temailIntent.putExtra(android.content.Intent.EXTRA_TEXT, \"Looks like you don't believe your friend,\" +\n \t\t\t\" do a SHA1 of this string to see the proof \"+proof);\n \tstartActivity(emailIntent); \n }",
"public void clickOnContinueAsGuestUserLink()\n \t{\n \t\tproductRequirementsPageLocators.continueAsGuestUserLIink.click();\n\n \t}",
"private void subscriptionComplete(String username, String email){\n //preparo la schermata da mostrare\n TextView name = (TextView) findViewById(R.id.user_name_confirm);\n if(name!=null) name.setText(username);\n TextView description = (TextView) findViewById(R.id.new_user_description);\n String desc = getString(R.string.registration_confirmed_description);\n desc = desc.replace(\"FUCKINGMAIL\",email);\n if(description!=null) description.setText(desc);\n //eseguo lo scambio dei layout mostrati\n View first = findViewById(R.id.subscribe_first);\n View second = findViewById(R.id.subscribe_second);\n if(first!=null && second != null) {\n first.setVisibility(View.INVISIBLE);\n second.setVisibility(View.VISIBLE);\n }\n //nascondo pulsanti da toolbar\n menu.findItem(R.id.next).setVisible(false);\n\n }",
"public void confirmSignUp(Activity activity, CognitoUser user, String confirmCode,\n boolean forcedAliasCreation, GenericHandler confirmHandler) {\n // Callback for Cognito sign up confirmation\n GenericHandler wrapperConfirmHandler = new GenericHandler() {\n @Override\n public void onSuccess() {\n // Bayun Registration success Callback\n Handler.Callback bayunAuthSuccess = msg -> {\n confirmHandler.onSuccess();\n return false;\n };\n\n\n // Bayun Registration failure Callback\n Handler.Callback bayunAuthFailure = msg -> {\n Exception exception = new Exception(msg.getData().getString(Constants.ERROR));\n confirmHandler.onFailure(exception);\n return false;\n };\n\n // Bayun Registration authorizeEmployeeCallback Callback\n Handler.Callback authorizeEmployeeCallback = msg -> {\n String employeePublicKey = msg.getData().getString(Constants.EMPLOYEE_PUBLICKEY);\n Exception exception = new Exception(\"Employee Authorization is Pending\");\n confirmHandler.onFailure(exception);\n return false;\n };\n\n // Registration with Bayun\n BasicBayunCredentials basicBayunCredentials = new BasicBayunCredentials\n (appId, companyName, user.getUserId(), signUpPassword.toCharArray(),\n appSecret, applicationKeySalt);\n\n\n if(signUpIsRegisterWithPwd){\n BayunApplication.bayunCore.registerEmployeeWithPassword\n (activity,companyName,user.getUserId(),signUpPassword, authorizeEmployeeCallback, bayunAuthSuccess, bayunAuthFailure);\n }else {\n BayunApplication.bayunCore.registerEmployeeWithoutPassword(activity,companyName,user.getUserId()\n ,signUpEmail,false, authorizeEmployeeCallback,\n null,null,null, bayunAuthSuccess, bayunAuthFailure);\n\n }\n// BayunApplication.bayunCore.registerEmployeeWithPassword\n// (activity,companyName,user.getUserId(),signUpPassword, authorizeEmployeeCallback, bayunAuthSuccess, bayunAuthFailure);\n\n\n }\n\n @Override\n public void onFailure(Exception exception) {\n confirmHandler.onFailure(exception);\n }\n };\n\n // Confirmation call with Cognito\n user.confirmSignUpInBackground(confirmCode, forcedAliasCreation, wrapperConfirmHandler);\n }",
"@When(\"^I fill in valid Email address and click on create an account$\")\n\tpublic void I_fill_in_valid_Email_address_and_click_on_create_an_account() throws Throwable {\n\n\t\trandomNumber r = new randomNumber();\n\t\tString emailString = \"Example\" + r.gen();\n\t\tString emailAddress = emailString + \"@gmail.com\";\n\t\tdriver.findElement(By.id(\"email_create\")).sendKeys(emailAddress);\n\t\tdriver.findElement(By.id(\"SubmitCreate\")).submit();\n\t}",
"public void sendregisteruser(registerDTO register) {\n MimeMessagePreparator preparator = new MimeMessagePreparator()\n {\n public void prepare(MimeMessage mimeMessage) throws Exception\n {\n mimeMessage.setRecipient(Message.RecipientType.TO, new InternetAddress(register.getEmail()));\n mimeMessage.setSubject(\"Welcome to The Indian Bus Service\");\n\n MimeMessageHelper helper = new MimeMessageHelper(mimeMessage, true);\n\n helper.setText(\"<html><body>\"\n + \"<br>\"\n + \"<h2>Hello \"+register.getFirstname()+\" \"+register.getLastname()+\"</h2>\"\n + \"<p>Welcome to <b>Indian Bus Service</b></p>\"\n + \"<br>\"\n + \"<p>Username:- \"+register.getEmail()+\"</p>\"\n + \"<p>Hope you are doing well in this lockdown.</b></p>\"\n + \"<p>Date your login : </p>'\"+new Date()+\"'</body></html>\", true);\n }\n };\n\n try {\n mailSender.send(preparator);\n }\n catch (MailException ex) {\n // simply log it and go on...\n System.err.println(ex.getMessage());\n }\n }",
"public void onForgotClicked(View v) {\n\n }",
"public void resendVerificationEmail(View view) {\n current_user.sendEmailVerification().addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n if (task.isSuccessful()) {\n Toast toast = Toast.makeText(getApplicationContext(), \"Verification email has been resent to \" +\n current_user.getEmail() + \". Please check your inbox/spam folder.\",\n Toast.LENGTH_LONG);\n\n // Centering the text\n LinearLayout toastLayout = (LinearLayout) toast.getView();\n if (toastLayout.getChildCount() > 0) {\n TextView textView = (TextView) toastLayout.getChildAt(0);\n textView.setGravity(Gravity.CENTER_VERTICAL | Gravity.CENTER_HORIZONTAL);\n }\n\n toast.show();\n }\n }\n });\n }",
"@Override\n public void onClick(View arg0) {\n Intent email = new Intent(getApplicationContext(), email.class);\n startActivity(email);\n }",
"void confirm();",
"public void enviarEmail(String c, Ciudadano a){\n\t}",
"public KPAUISignOnFccPage clickRefillPrescriptionLink(){\n getRefillPrescriptionLink().click();\n return new KPAUISignOnFccPage(driver);\n }",
"public void requestConfirmationCode() {\n PhoneNumberVerificationRequest.forPhoneNumberVerification(this.airPhone.formattedPhone()).withListener((Observer) this.phoneNumberVerificationRequestListener).execute(this.requestManager);\n }",
"@Override\n public void onComplete(@NonNull Task<Void> task) {\n firebaseUser.sendEmailVerification().addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n\n // make the progressBar invisible\n pd.cancel();\n\n // store the user name\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putBoolean(\"isNotVerified\",true);\n editor.putString(\"userName\",name_of_user);\n editor.putString(\"userEmail\",emailId);\n editor.putString(\"password\",userPin);\n editor.apply();\n\n // call an intent to the user verification activity\n startActivity(new Intent(LoginActivity.this,\n UserVerificationActivity.class));\n // finish this activity, so that user can't return\n LoginActivity.this.finish();\n }\n });\n\n }",
"@Test(groups ={Slingshot,Regression,SubmitMeterRead})\n\t\t\tpublic void AnonymousElecSmrCR_Multipleregister_newuser_emailurl(){\n\t\t\t\tReport.createTestLogHeader(\"Anonymous SMR\", \"Verifies the anonymous SMR page for Gas customer\");\n\t\t\t\tSMRAccountDetails smrProfile = new TestDataHelper().getAllSMRUserProfile(\"Anonymousnonalertbpcp\");\n\t\t\t\tCrmUserProfile crmuserProfile = new TestDataHelper().getCrmUserProfile(\"CrmDetailsforSMR\");\n\t\t\t\tUserProfile userProfile = new TestDataHelper().getUserProfile(\"ViewuserVerifynew\");\t\t\n\t\t\t new SubmitMeterReadAction()\n\t\t\t .openSMRpageforemailurl(smrProfile)\n\t\t\t .verifyAnonymousSAPElecCus_CR_Multiplereg_newuser_emailurl(smrProfile);\n\t\t\t // .VerifySAPCRM_SMR_noalret(smrProfile,crmuserProfile,userProfile);\n\t\t\t }",
"private void sendEmail(String result){\n \t\n \tIntent emailIntent = new Intent(android.content.Intent.ACTION_SEND);\n \temailIntent.setType(\"plain/text\");\n \t\n \t//emailIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n\n \t/* Fill it with Data */\n \temailIntent.setType(\"plain/text\");\n \t//emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{\"to@email.com\"});\n \temailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, \"Here's the code from FlipSHA\");\n \temailIntent.putExtra(android.content.Intent.EXTRA_TEXT, \"After the coin is flipped and\" +\n \t\t\t\" you don't believe in your friend, check this hash \"+ result);\n\n \t/* Send it off to the Activity-Chooser */\n \tstartActivity(emailIntent); \n }",
"@OnClick\n public void swapToEmail() {\n RegistrationAnalytics.trackEmailPhoneToggleEvent(getNavigationTrackingTag(), \"email\");\n ((AccountIdentifierRegistrationFragment) getParentFragment()).swapToEmail();\n }",
"void onSignUpEmailRegistered();",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tUser user = User.getInstance();\n\t\t\t\tuser.emailRecipe(currentRecipe, getApplicationContext());\n\t\t\t}",
"public void clickGoToYourAccountButton() {\n\t\telement(signUpObjects.getOTPButton).click();\n\t}",
"public String putNewRefCodeAndSendInvitations(ArrayList<String> validEmails, User user) throws MessagingException {\n\t\tString randomId = SessionIdentifierGenerator.nextSessionId();\n\t\tPreparedStatement pst;\n\t\tEmailHelper emailHelper = new EmailHelper();\n\t\ttry {\n\t\t\t\tfor(int index = 0;index < validEmails.size(); index++){\n\t\t\t\t\tpst = RegDataBaseManager.startDatabaseOperation(INSERT_USER);\n\t\t\t\t\tpst.setString(1, randomId+\"-\"+validEmails.get(index));\n\t\t\t\t\tpst.setString(2, randomId);\n\t\t\t\t\tpst.setString(3, validEmails.get(index));\n\t\t\t\t\tRegDataBaseManager.getDatabaseOprationResult(pst);\n\t\t\t\t\temailHelper.sendInvitationEmail(validEmails.get(index), randomId, user);\n\t\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 randomId;\n\t}",
"@Test(groups ={Slingshot,Regression})\n\tpublic void VerifyStandardUserallaccountsConfirmationPageNavigation() {\n\t\tReport.createTestLogHeader(\"MuMv\", \"Verify the StandardUser All accounts Navigationlinks for the confirmation Page\");\n\n\t\tUserProfile userProfile = new TestDataHelper().getUserProfile(\"MuMVTestDataspl\");\n\t\tnew LoginAction()\n\t\t.BgbnavigateToLogin()\n\t\t.BgbloginDetails(userProfile);\n\t\tnew MultiUserMultiViewAction()\n\t\t.ClickManageUserLink()\n\t\t.ClickAddNewUserLink()\n\t\t.AddUserRadioButton()\n\t\t.StandardUser_Creation()\n\t\t.VerifyAllAccountsViewName(userProfile)\n\t\t.EnterValid_StandardUserdata(userProfile) \t \t \t\t\n\t\t.AddNewUserNavigationVerification() //have to update navigation link\n\t\t.UserConfirmationPageNavigations();\t \t \t\t\n\t}",
"@Override\n public void onComplete(@NonNull Task<Void> task) {\n if (task.isSuccessful()) {\n Toast.makeText(Resetpasswordpage.this, \"Email Sent\", Toast.LENGTH_SHORT).show();\n Intent resetpasswordintent = new Intent(Resetpasswordpage.this, Loginpage.class);\n startActivity(resetpasswordintent);\n //close activity when done\n finish();\n } else {\n //otherwise create new toast (error)\n Toast.makeText(Resetpasswordpage.this, \"Please enter correct details\", Toast.LENGTH_SHORT).show();\n }\n }",
"boolean activateAccount(Integer userId);",
"@Test\r\n\tpublic void TC_08_verify_Existing_Email_Address() {\r\n\r\n\t\thomePgObj = new Page_Home(driver);\r\n\t\tregPgObj = homePgObj.click_RegistrationLink();\r\n\t\t\r\n\t\t// Step 1: Verify the registration page is displayed\r\n\t\t\r\n\t\tflag = regPgObj.registrationPgDisplay();\r\n\t\tAssert.assertTrue(flag, \"Registration page is displayed\");\r\n\t\t\r\n\t\t// Step 2: Enter valid/mandatory registration details with valid email address already taken\r\n\t\t\r\n\t\tregPgObj.enterRegistrationDetails(\"firstName\", firstName);\r\n\t\tregPgObj.enterRegistrationDetails(\"lastName\", lastName);\r\n\t\tregPgObj.enterRegistrationDetails(\"email\", email);\r\n\t\tregPgObj.enterRegistrationDetails(\"password\", password);\r\n\t\tregPgObj.enterRegistrationDetails(\"confirmPassword\", confirmPassword);\r\n\t\t\r\n\t\t// Step 3: Click on Sign in button\r\n\t\t\r\n\t\tregPgObj.clickSignInButton();\r\n\t\t\r\n\t\t// Step 4: Verify user should NOT be able to proceed further with registration as proper validation message regarding already registered\r\n\t\t//email address is displayed\r\n\t\terrMsg = Page_Registration.getMandatoryFieldErrMsg();\r\n\t\tAssert.assertEquals(errMsg, \"Username already taken.\");\r\n\r\n\t}",
"public abstract boolean confirm();",
"public void ClickOnConfirmCertificateInformationButton()\n\t\t{\n\t\t\tConfirmCertificateInformation.click();\n\t\t}",
"public void v_GuestRegistration(){\n\t\tResult=\"Pass\";\n\t\tLF.AddActualResult(Result);\n\t}",
"public void sendButtonClick(View v){\n String title = getText(R.string.mail_title).toString();\n String mailto = \"mailto:\" + emailAdress;\n Intent openEmailApp = new Intent(Intent.ACTION_SENDTO);\n openEmailApp.setType(\"plain/text\");\n openEmailApp.setData(Uri.parse(mailto));\n openEmailApp.putExtra(Intent.EXTRA_SUBJECT, userName + title);\n openEmailApp.putExtra(Intent.EXTRA_TEXT, evaluationMessage);\n startActivity(openEmailApp);\n }",
"@RequestMapping(value={\"/confirmaccount\"}, method = RequestMethod.GET)\n public String confirmAccount (Model model,\n \t\t@RequestParam(value = \"token\", required = false) String token) {\n \n model.addAttribute(\"title\", messages.getMessage(\"text.login.tittle\", null, LocaleContextHolder.getLocale()));\n \t//si el token no es nulo\n if (token != null) {\n \t\n \t//Buscamos el token\n \tConfirmationToken confirm = confirmationTokenDao.findConfirmationToken(token);\n \t\n \t//si no existe el token, enviamos que no existe\n if (confirm == null) {\n model.addAttribute(\"error\", messages.getMessage(\"auth.message.invalidToken\", null, LocaleContextHolder.getLocale()));\n return \"aplication/login\";\n \n //si existe el token\n } else {\n \t\n \t//extraemos el usuario y lo activamos\n \tUser user = confirm.getUser();\n \tuser.setEnabled(true);\n \tuserDao.update(user);\n \t\n \t//borramos el token y reenviamos a login con un mensaje de correcto\n \t\tconfirmationTokenDao.remove(confirm);\n \t\t\n \tmodel.addAttribute(\"success\", messages.getMessage(\"auth.message.useractivated\", null, LocaleContextHolder.getLocale()));\n \t\n return \"aplication/login\";\n }\n \n //si el token es nulo\n } else {\n \treturn \"redirect:/login?lang=\" + LocaleContextHolder.getLocale().getLanguage();\n }\n \n }",
"public void registerConfirm_Dear(WebDriver driver) {\n\t\tString ActualValue_RegConfDear = op.getText(driver, RegisterConfirmObj.textDearFnLn);\r\n\t\tString expectedValue_RegConfDear = \"Dear Sangam Y,\";\r\n\r\n\t\t// validation\r\n\t\tif(expectedValue_RegConfDear.equals(ActualValue_RegConfDear))\r\n\r\n\t\t\tSystem.out.println(\"Pass - Dear Sangam Y\");\r\n\r\n\t\telse\r\n\t\t\tSystem.out.println(\"Fail - Dear Sangam Y\");\r\n\t}",
"public void onClick_AGSU_signUp(View view) {\n AnimationTools.startLoadingAnimation(Constants.ANIMATION_CODE_AGSU_LOADING, this, signUpButton_rootLayout, R.style.AGSU_loading_progress_bar);\n\n FirestoreManager.saveUserData(SecondarySignUpManager.getDatabaseUser());\n\n //add a password-email auth method\n AuthCredential credential = EmailAuthProvider.getCredential(SecondarySignUpManager.getDatabaseUser().getEmail(), SecondarySignUpManager.getDatabaseUser().getPassword());\n AuthenticationManager.getCurrentUser().linkWithCredential(credential).addOnCompleteListener(new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if(task.isSuccessful()) {\n System.out.println(\"[Neuron.SecondarySignUpActivity.onClick_AGSU_signUp]: link with email credential SUCCESSFUL! User uid = \" + task.getResult().getUser().getDisplayName());\n Constants.isSignUpInProcess = false; //sign up is now finished\n\n //in AGSU user is always new --> send verification email\n EmailVerification.sendVerificationEmail();\n\n Constants.isSecondarySignUpInProcess = false; //end of secondary sign up process\n\n ActivityTools.startNewActivity(activityContext, MainActivity.class);\n } else {\n System.err.println(\"[Neuron.SecondarySignUpActivity.onClick_AGSU_signUp]: ERROR: link with email credential FAILED! \" + task.getException().getMessage());\n }\n\n AnimationTools.stopLoadingAnimation(Constants.ANIMATION_CODE_AGSU_LOADING);\n }\n });\n\n }",
"public String returnConfirmPassword() {\n\t\treturn this.registration_confirmpassword.getAttribute(\"value\");\r\n\t}",
"public void ClickOnUserAgreement() {\n\t\tUserAgreement.click();\n\t}",
"public void clickSignUpFromATemplate() {\n\t\tselenium.clickByXpath(signUp);\n\t}",
"@Override\n\t\tpublic void onClick(View v) {\n\t\t\tC2DMessaging.register(getBaseContext(), \"write2sanchit@gmail.com\");\t\t\t\n\t\t}",
"public void onClick(View v) {\n\t if(toggle.isChecked())\n\t {\n\t Toast.makeText(getApplicationContext(), \"Email Confirmation Enabled\",\n\t \t\t Toast.LENGTH_SHORT).show();\n\t emailCheckedBool = true;\n\t\t \t\n\t }\n\t else\n\t {\n\t Toast.makeText(getApplicationContext(), \"Email Confirmation Disabled\",\n\t \t\t Toast.LENGTH_SHORT).show();\n\t emailCheckedBool = false;\n\t }\n\t }",
"public void mo31160a(C12710e<C12824g> eVar) {\n C12884a.m37499a(\"passport_email_register_verify\", \"email\", this.f33895b.mo31341a(\"type\"), (C12707b) eVar, this.f33896c);\n }",
"public void RegisterUser() {\n try {\n reg = new Registration();\n reg.setFirstName(FName);\n reg.setLastName(LName);\n reg.setCompanyName(CompanyName);\n reg.setEmail(Email);\n reg.setMobile(mobile);\n ValidateRegistration validator = new ValidateRegistration();\n boolean legitmail = validator.validateEmail(reg);\n if ( legitmail == false ) {\n System.out.println(\"Not a legitimate Email\");\n FacesContext c = FacesContext.getCurrentInstance();\n FacesMessage m = new FacesMessage(\"Invalid Email\", \"The email provided is not correct\");\n c.addMessage(null, m);\n } else {\n FacesContext c = FacesContext.getCurrentInstance();\n c.getApplication().getNavigationHandler().handleNavigation(c, null, \"mainpage.xhtml\");\n }\n } catch (Exception ex) {\n System.out.println(ex.getMessage());\n }\n }"
] | [
"0.7005122",
"0.69045013",
"0.6698793",
"0.6353074",
"0.6327735",
"0.6185398",
"0.6152515",
"0.6116181",
"0.603224",
"0.60305107",
"0.60269165",
"0.6018643",
"0.5993788",
"0.59925693",
"0.59462905",
"0.5931452",
"0.5920418",
"0.5893373",
"0.58892936",
"0.5878088",
"0.58414274",
"0.5838582",
"0.58303666",
"0.5821681",
"0.58115435",
"0.5811347",
"0.5782195",
"0.57697463",
"0.5738063",
"0.5727099",
"0.5711434",
"0.5710452",
"0.56995547",
"0.5692836",
"0.5692311",
"0.56772125",
"0.56741405",
"0.56650525",
"0.5627364",
"0.56259227",
"0.5607001",
"0.5603707",
"0.55916786",
"0.55788666",
"0.55784595",
"0.55621684",
"0.5555418",
"0.55510634",
"0.5549868",
"0.55462676",
"0.5544192",
"0.55295086",
"0.55177075",
"0.5514454",
"0.55092305",
"0.5503604",
"0.5501628",
"0.5496509",
"0.5491894",
"0.54782766",
"0.5476086",
"0.5467432",
"0.54608077",
"0.5447541",
"0.54464126",
"0.5443664",
"0.5435497",
"0.5431281",
"0.54213405",
"0.5420952",
"0.5420002",
"0.54137343",
"0.54103297",
"0.5402314",
"0.5389842",
"0.5387593",
"0.538754",
"0.5385672",
"0.5371551",
"0.5370132",
"0.53434986",
"0.5341793",
"0.533812",
"0.5331068",
"0.53280467",
"0.5324897",
"0.5323483",
"0.5319802",
"0.5315614",
"0.53111434",
"0.5308258",
"0.5307214",
"0.5303989",
"0.5301956",
"0.5295007",
"0.52863526",
"0.528537",
"0.52770317",
"0.5275654",
"0.52739817"
] | 0.5381807 | 78 |
Construct an empty list | public int size() {
return headReference == null ? 0 : headReference.size();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static <T> List<T> createList() {\n\t\treturn Collections.emptyList();\n\t}",
"public void makeEmpty() {\r\n\t\tArrays.fill(list, -1);\r\n\t}",
"@SuppressWarnings(\"unchecked\")\r\n public void createList() {\r\n items = new int[MAX_LIST];\r\n NumItems = 0;\r\n }",
"public List()\n\t{\n\t\tthis(null, null);\n\t}",
"@SuppressWarnings(\"unchecked\")\r\n \tpublic List() {\r\n \t\titems = (T[]) new Object[INIT_LEN];\r\n \t\tnumItems = 0;\r\n \t\tcurrentObject = 0;\r\n \t}",
"@SuppressWarnings(\"unchecked\" )\n public static <T> ConstList<T> make() {\n return emptylist;\n }",
"List() {\n this.length = 0;\n }",
"public static <T>\n LazyList<T> empty() {\n return EMPTY;\n }",
"public List() {\n this.list = new Object[MIN_CAPACITY];\n this.n = 0;\n }",
"List() {\n final int ten = 10;\n list = new int[ten];\n size = 0;\n }",
"public void makeEmpty() {\n for (int i = 0; i < buckets.length; i++) {\n buckets[i] = new SList();\n }\n size = 0;\n }",
"@Nonnull\n public static <T> PlayList<T> empty()\n {\n return new PlayList<>();\n }",
"@SuppressWarnings(\"unchecked\")\n public ArrayList() {\n list = (E[])new Object[DEFAULT_CAP];\n capacity = 10;\n size = 0;\n }",
"public List()\n {\n list = new Object [10];\n }",
"@SuppressWarnings(\"unchecked\")\n\tpublic ArrayList() {\n\t\tsize = 0;\n\t\tlist = (E[]) new Object[INIT_SIZE];\n\t}",
"private Lists() { }",
"List<Wine> emptyMethodReturnList(){\n return List.of();\n }",
"public static LinkedList createEmpty(){\n return new LinkedList();\n }",
"private static List<Student> createEmptyList(DataStructureChoice dsChoice) {\r\n\r\n\t\tList<Student> foo = null; /** declared using an Interface declaration */\r\n\t\t\r\n\t\tswitch ( dsChoice ) {\r\n\t\tcase JAVA_ARRAY_LIST:\r\n\t\t\tfoo = new ArrayList<Student>();\r\n\t\t\tbreak;\r\n\t\tcase JAVA_LINKED_LIST:\r\n\t\t\tfoo = new LinkedList<Student>();\r\n\t\t\tbreak;\r\n\t\tcase CSC205_LINKED_LIST:\r\n\t\t\tfoo = new CSC205_Project_1_Linked_List<Student>();\r\n\r\n\t\t\tCSC205_Project_1_Linked_List<Student> fooAlias = \r\n\t\t\t\t\t(CSC205_Project_1_Linked_List<Student>) foo;\r\n\r\n\t\t\tbridges.setDataStructure( fooAlias.getDummyHeader() ); \r\n\r\n\t\t\t/** highlight the dummy header node in red */\r\n\t\t\tfooAlias.getDummyHeader().getVisualizer().setColor( \"RED\" );\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tSystem.out.println ( \"Illegal choice of data structure\");\r\n\t\t\tSystem.exit(1); // abort the program\r\n\t\t}\r\n\t\treturn foo;\r\n\t}",
"public MyArrayList ()\r\n {\r\n \tlist = new Object[100];\r\n \tnumElements = 0;\r\n }",
"public static <T> List<T> getOrEmptyList(List<T> list) {\n return list == null ? Collections.emptyList() : list;\n }",
"public Builder clearList() {\n list_ = com.google.protobuf.LazyStringArrayList.EMPTY;\n bitField0_ = (bitField0_ & ~0x08000000);\n onChanged();\n return this;\n }",
"public ArrayList() {\n elements = new Object[DEFAULT_CAPACITY];\n }",
"public void emptyList() {\n coursesTaken = new ArrayList<CourseTaken>();\r\n }",
"public static ImmutableIntList of() {\n return EMPTY;\n }",
"@SuppressWarnings(\"unchecked\")\n\tpublic ArrayList () {\n\t\tcapacity = 10;\n\t\tsize = 0;\n\t\tlist = (E[]) new Object[capacity];\n\t}",
"myArrayList() {\n\t\thead = null;\n\t\ttail = null;\n\t}",
"public list() {\r\n }",
"abstract protected Object newList( int capacity );",
"@SuppressWarnings(\"unchecked\")\n\tpublic ArrayList() {\n\t\tObject[] oList = new Object[INIT_SIZE];\n\t\tlist = (E[]) oList;\n\t\tsize = INIT_SIZE;\n\t}",
"public MutiList() {\n\t\tsuper();\n\t\tthis.myList = new ArrayList<>();\n\t}",
"public List() {\n\t\tthis.head = null; \n\t}",
"public ArrayList()\n {\n list = new int[SIZE];\n length = 0;\n }",
"public ArrayList() { // constructs list with default capacity\n this(CAPACITY);\n }",
"ListType createListType();",
"public TempList() {\n list = new ArrayList<T>();\n }",
"public AList() {\n items = (TypeHere[]) new Object[100];\n size = 0;\n }",
"@Test\n\tpublic void createListWithInitialCapacity() {\n\t\tList<String> list1 = new ArrayList<>();\n\n\t\t// You can set capacity using constructor of ArrayList\n\t\tList<String> list2 = new ArrayList<>(20);\n\n\t\tassertTrue(list1.isEmpty());\n\t\tassertTrue(list2.isEmpty());\n\t\tassertTrue(list1.equals(list2));\n\t}",
"public List(){\n\t\tthis(\"list\", new DefaultComparator());\n\t}",
"public MyArrayList() {\r\n\t\tthis.list=new Object[this.capacity];\r\n\t}",
"public ArrayList() {\n arr = (T[]) new Object[10];\n size = 0;\n }",
"public AList() {\n size = 0;\n items = (Item[]) new Object[100];\n }",
"public AList() {\n size = 0;\n items = (Item[]) new Object[100];\n }",
"public MyArrayList() {\n elements = new Object[DEFAULT_CAPACITY];\n }",
"private ContentProposalList getEmptyProposalArray() {\n\t\treturn new ContentProposalList();\n\t}",
"public linkedList() { // constructs an initially empty list\r\n\r\n }",
"public static <T> List<T> createList (T... args) {\n\tif (args == null) { return new ArrayList<T>(); };\n\treturn new ArrayList<T>(Arrays.asList(args));\n }",
"public void makeEmpty() {\n System.out.println(\"List is now empty\");\n head = null;\n tail = null;\n\n }",
"public Lista()\n {\n empty=true;\n next = null;\n }",
"public List hardList() {\r\n List result = new ArrayList();\r\n\r\n for (int i=0; i < size(); i++) {\r\n Object tmp = get(i);\r\n\r\n if (tmp != null)\r\n result.add(tmp);\r\n }\r\n\r\n return result;\r\n }",
"private void createLoanList() {\n\t\tArrayList<Object> loans = new ArrayList<Object>(Arrays.asList(loanArray));\n\t\tfor (int i = 0; i < loans.size(); i++)\n\t\t\tif (((Loan) loans.get(i)).getFineAmount() == 0)\n\t\t\t\tloans.remove(i);\n\t\tlist = new LoanList();\n\t\tlist.setItems(loans);\n\t\tadd(list);\n\t}",
"@SuppressWarnings(\"unchecked\")\n\tpublic ArrayList1() {\n\t\telements = (E[]) new Object[CAPACITY];\n\t\tsize = 0;\n\t}",
"public ListStack() {\n\t\tlist = new ArrayList<>();\n\t}",
"private void initList() {\n\n }",
"@SuppressWarnings(\"unchecked\")\n public ArrayList(int initialCap) {\n list = (E[])new Object[0];\n capacity = initialCap;\n size = 0;\n }",
"public ArrayList() {\n\t\tthis.elements = new Object[5];\n\t\tthis.last = -1;\n\t}",
"public static java.util.List singletonList(java.lang.Object arg0)\n { return null; }",
"public ArrayList() {\n //sets an array with no length\n this.array = (E[]) new Object[0];\n }",
"public SLList()\n {\n head = tail = null;\n }",
"public void makeEmpty() {\n defTable = new DList[sizeBucket];\n for(int i=0; i<sizeBucket; i++) {\n defTable[i] = new DList();\n }\n size = 0;\n }",
"public SimpleArrayList() {\n this.values = new Object[SimpleArrayList.DEFAULT_SIZE];\n }",
"@Override\n public void makeEmpty() {\n this.head = null;\n this.tail = null;\n }",
"public ListHolder()\n {\n this.list = new TestList(15, false);\n }",
"public void makeEmpty();",
"public void makeEmpty();",
"public ArrayJList() {\n this(DEFAULT_CAPACITY);\n }",
"public TreeList()\n {\n\t this.lst = new AVLTree();\n\t this.length = 0;\n }",
"public void makeEmpty() {\n // remove Squares until empty\n while (!exploreList.isEmpty()) {\n exploreList.getNext();\n }\n }",
"public void clearInitialize(){\n index=0;\n for(int i =0; i < list.length;i++){\n list[i]=0;\n }\n hasFilled = false;\n\n }",
"public SmartList() {\n size = 0;\n storage = null;\n }",
"public void EmptyList(){\n BusStopSearcherPresenter.setListview(initList(emptylist));\n }",
"public NumericObjectArrayList() {\r\n list = new Copiable[10];\r\n count = 0;\r\n }",
"private void addToEmptyList(T data) {\n this.first = this.last = new Node(data);\n this.nrOfElements++;\n }",
"public OccList()\n {\n int capacity = 8;\n data = new Occ[capacity];\n // initialize data with empty occ\n for (int i=0; i<capacity; i++) data[i] = new Occ(); \n }",
"abstract void makeList();",
"@Override\n public List<Object> list() {\n return null;\n }",
"public ListMatcher empty() {\n\n\t\tnotNull();\n\t\t\n\t\tif (target.isEmpty()) {\n\t\t\treturn this;\n\t\t}\n\n\t\tthrow getException(\"Expected an empty list but it was %s\", target);\n\t}",
"public ArrayList() {\n\t\tthis(10, 75);\n\t}",
"protected <V> List<V> newObject(Collection<V> initialValues) {\n return new ArrayList<>(initialValues);\n }",
"public ArrayList(int initCapacity) {\n elements = new Object[initCapacity];\n }",
"public ContactList()\n {\n myList = new ArrayList<>();\n }",
"private static <T> List<T> m971u(List<T> list) {\n return list == null ? Collections.emptyList() : list;\n }",
"public LinkedJList() {\n this(DEFAULT_CAPACITY);\n }",
"ArrayListOfStrings () {\n list = new ArrayList<String>();\n }",
"public SimpleList(int capacity) {\n this.values = new Object[capacity];\n }",
"public TempList(int n) {\n list = new ArrayList<T>(n >= 0 ? n : 0);\n }",
"public List<Input> inputList_no_dependency_no_timeout() {\n Input t3 = new Input(\"T3\",3, 43);\n Input t2 = new Input(\"T2\",2, 42);\n Input t1 = new Input(\"T1\",1, 41);\n List<Input> input = new ArrayList<>(); input.add(t2); input.add(t3); input.add(t1);\n return input;\n }",
"@SuppressWarnings(\"unchecked\")\n \tpublic static <T> List<T> createConcurrentList() {\n \t\treturn (List<T>) Collections.synchronizedList(createArrayList());\n \t}",
"public MyArrayList() {\n\t\tthis(EXTRA_SPACE);\n\t}",
"public SequenceList() {\n // Only require a single constructor, which sets both object\n // references to null.\n listHead = null;\n listTail = null;\n }",
"public DLList() {\r\n init();\r\n }",
"public CellList() {\n head = null;\n size = 0;\n }",
"public DateList() {\n DateNode ln = new DateNode(null);\n first = ln;\n last = ln;\n }",
"public EmptyList(int head, WeirdList tail) {\n super(head, tail);\n }",
"public Builder clearIsList() {\n bitField0_ = (bitField0_ & ~0x00000004);\n isList_ = false;\n onChanged();\n return this;\n }",
"public static IntArrayList zero(int size) {\n IntArrayList result = new IntArrayList(size);\n result.elementsCount = size;\n return result;\n }",
"@Test\r\n\tpublic void testEmptyConstructor() {\r\n\t\tDoubleList sample = new DoubleList();\r\n\t\tAssert.assertNull(sample.getFirst());\r\n\t}",
"public Builder clearIsList() {\n bitField0_ = (bitField0_ & ~0x00000008);\n isList_ = false;\n onChanged();\n return this;\n }",
"public MyArrayList() {\n mMyArray = new Comparable[10];\n size = 10;\n head = tail = size / 3;\n }",
"private static <T> List<T> list(T... elements) {\n return ImmutableList.copyOf(elements);\n }",
"public IntList() { // doesn't HAVE to be declared public, but doesn't hurt\n theList = new int[STARTING_SIZE];\n size = 0;\n }"
] | [
"0.78212774",
"0.7214653",
"0.7009123",
"0.7004504",
"0.6977844",
"0.69731045",
"0.695063",
"0.6899796",
"0.6891791",
"0.6878837",
"0.6869469",
"0.6850948",
"0.6835927",
"0.68334335",
"0.6775636",
"0.6773693",
"0.67661047",
"0.6749901",
"0.67474294",
"0.67458093",
"0.6744689",
"0.6734874",
"0.67304736",
"0.67028654",
"0.6690796",
"0.6586194",
"0.65439636",
"0.6510152",
"0.6487493",
"0.64864326",
"0.6480752",
"0.6461946",
"0.645927",
"0.64574146",
"0.6441258",
"0.6429745",
"0.64205176",
"0.6390226",
"0.63787055",
"0.63724035",
"0.63594985",
"0.6359498",
"0.6359498",
"0.63476473",
"0.63364077",
"0.63358474",
"0.63332367",
"0.6324846",
"0.63115364",
"0.63008535",
"0.6300137",
"0.6298115",
"0.62948495",
"0.6284813",
"0.627266",
"0.6271685",
"0.6266362",
"0.62595433",
"0.6258209",
"0.6241907",
"0.623576",
"0.62280905",
"0.6220036",
"0.6179565",
"0.6179565",
"0.6179431",
"0.61690205",
"0.61605203",
"0.6148636",
"0.6140034",
"0.6133401",
"0.61274004",
"0.6123394",
"0.6106187",
"0.6103695",
"0.6097919",
"0.6096612",
"0.6096289",
"0.60575026",
"0.6054277",
"0.6047666",
"0.60454684",
"0.6042858",
"0.60388243",
"0.603024",
"0.6018191",
"0.6004822",
"0.60020894",
"0.59953874",
"0.5982183",
"0.5975952",
"0.59729034",
"0.5972449",
"0.596748",
"0.5959142",
"0.59521705",
"0.59425557",
"0.594176",
"0.5940463",
"0.59308857",
"0.59305745"
] | 0.0 | -1 |
Created by Gao Yuan on 2015/8/22. | public interface ISecurityVerifier {
public static final String COMPONENT_NAME = "ISecurityVerifier";
Access getAllPossibleAccess(SecurityAccessor accessor, String resourceEntity, Access mask);
boolean canAccess(SecurityAccessor accessor, String resourceEntity, Access access);
boolean canAccess(SecurityAccessor accessor, String resourceEntity, Access access, Object... instances);
void checkAccess(SecurityAccessor accessor, String resourceEntity, Access access) throws NoPermissionException;
void checkAccess(SecurityAccessor accessor, String resourceEntity, Access access, Object... instances) throws NoPermissionException;
boolean canAccessMappedResource(SecurityAccessor accessor, String mappedResource, Access access);
void setAuthorityProvider(IAuthorityProvider provider);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void perish() {\n \n }",
"private stendhal() {\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n\tpublic void grabar() {\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\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}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"private void poetries() {\n\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"public void gored() {\n\t\t\n\t}",
"public void mo38117a() {\n }",
"@Override\n public void func_104112_b() {\n \n }",
"private void strin() {\n\n\t}",
"public final void mo51373a() {\n }",
"@Override\n\tprotected void interr() {\n\t}",
"@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}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo4359a() {\n }",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n protected void getExras() {\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}",
"private void kk12() {\n\n\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"private void init() {\n\n\t}",
"@Override\n\tpublic void jugar() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\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 protected void initialize() \n {\n \n }",
"@Override\n void init() {\n }",
"@Override\n public 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\n\tpublic void emprestimo() {\n\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\n }",
"@Override\n public void init() {\n\n }",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tprotected void doF4() {\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 mo6081a() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"protected boolean func_70814_o() { return true; }",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\n\tpublic void init()\n\t{\n\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"public void mo55254a() {\n }",
"@Override\n protected void init() {\n }",
"private void init() {\n\n\n\n }",
"private Rekenhulp()\n\t{\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n public void settings() {\n // TODO Auto-generated method stub\n \n }",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\n public void init() {}",
"@Override\n\tprotected void initdata() {\n\n\t}",
"public void Tyre() {\n\t\t\r\n\t}",
"private void m50366E() {\n }",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {}",
"Petunia() {\r\n\t\t}",
"@Override\n\tpublic void init() {\n\t}"
] | [
"0.61987686",
"0.60768455",
"0.6040314",
"0.60001004",
"0.5982635",
"0.59792626",
"0.59792626",
"0.5966816",
"0.58915615",
"0.588227",
"0.58604443",
"0.5855946",
"0.58558595",
"0.5841195",
"0.58141",
"0.5811733",
"0.5790185",
"0.5761768",
"0.571643",
"0.57125324",
"0.5695284",
"0.56824833",
"0.5674805",
"0.56737345",
"0.56724244",
"0.5666401",
"0.56599146",
"0.5659781",
"0.5659781",
"0.5656003",
"0.5651518",
"0.5639043",
"0.5633182",
"0.5623357",
"0.56192327",
"0.5617125",
"0.5612763",
"0.5612763",
"0.5612763",
"0.5612763",
"0.5612763",
"0.5590306",
"0.5586719",
"0.5583601",
"0.5577982",
"0.55609775",
"0.5529735",
"0.5529735",
"0.5529735",
"0.5529735",
"0.5529735",
"0.5529735",
"0.5529735",
"0.5528649",
"0.5525754",
"0.5513557",
"0.55118155",
"0.55118155",
"0.55118155",
"0.55095845",
"0.5505856",
"0.5505856",
"0.5505856",
"0.54938346",
"0.54938346",
"0.5480319",
"0.5480319",
"0.5480319",
"0.5480286",
"0.5480286",
"0.5476614",
"0.5471488",
"0.5463914",
"0.54479855",
"0.54479855",
"0.54479855",
"0.54479855",
"0.54479855",
"0.54479855",
"0.544321",
"0.54409766",
"0.54393756",
"0.5435085",
"0.5433841",
"0.5432742",
"0.5431464",
"0.54227567",
"0.5421401",
"0.54168224",
"0.5414515",
"0.5414179",
"0.54119325",
"0.5409545",
"0.54006714",
"0.5398342",
"0.5397681",
"0.53935367",
"0.5391705",
"0.53820854",
"0.5380543",
"0.53780967"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
init();
} | {
"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 |
/getSumFrom1toX this method should calculate the sum the numbers from 1 to the number passed | public static int getSumFrom1toX(int num ){
int sum = 0;
for (int x=1; x<=num; x++){
sum+= x;
}
return sum;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static int getSumFrom1toX (int x){\n int sum = 0 ;\n for (int i = 1; i <=x ; i++) {\n sum += i ;\n\n }\n return sum ;\n\n }",
"public static int obtenerSumauno(int x){\n // dclaracion de variable\n int suma = 0;\n // ciclo usado para la suma continua\n for (int i = 1; i <= x; i++) {\n suma += i;\n }\n // retorno del resultado\n return suma;\n }",
"private static int summation(int x) {\n if (x == 1)\n return 1;\n else \n return x + summation(x - 1);\n }",
"private int Sum1(int x) {\n int a = ROTR(6, x);\n int b = ROTR(11, x);\n int c = ROTR(25, x);\n int ret = a ^ b ^ c;\n return ret;\n }",
"static int sumOf1To100nos() {\r\n\t\t \r\n\t\t int sum =0;\r\n\t\t \r\n\t\t for(int i=1; i<=100;i++) {\r\n\t\t\t sum+=i;\r\n\t\t }\r\n\t\t \r\n\t\t return sum;\r\n\t }",
"public static void sumNum() {\n\t\tint result = 0;\n\t\tfor(int i = 1; i<=112; i = i + 3) {\n\t\t\tresult = result + i;\t\n\t\t}\n\tSystem.out.println(\"Sum = \" + result);\n\t}",
"public static int sumUpTo(Integer num)\n {\n int total = 0;\n for(int i = 0; i < num + 1; i++)\n total += i;\n return total;\n }",
"public static int p_sum(){\n Scanner keyboard = new Scanner(System.in);\n System.out.println(\"please put the how many numbers you want to sum:\");\n int v_sum_numbers = keyboard.nextInt();\n int v_total_sum= 0;\n for (int i=1; i<=v_sum_numbers;i=i+1){\n System.out.println(\"please input the \"+i+\" number: \");\n int v_sum_num = keyboard.nextInt();\n v_total_sum= v_total_sum+v_sum_num;\n }\n return v_total_sum;\n }",
"double getSum();",
"double getSum();",
"static int sum(int n) {\n\t\tif(n==1) \n\t\t\treturn 1;\n\t\treturn n+sum(n-1);\n\t}",
"public static int sumSqure(int x){\n int sum=0;\n do{\n sum+=(x%10)*(x%10);\n x=x/10;\n }while(x!=0);\n return sum;\n }",
"public Integer sumNumbers(List<Integer> numbers) throws Exception;",
"public int sum(int number) {\n int sum = 0;\n while (Math.abs(number) != 0) {\n sum += Math.abs(number % RADIX);\n number /= RADIX;\n }\n return sum;\n }",
"private int Sum0(int x) {\n int a = ROTR(2, x);\n int b = ROTR(13, x);\n int c = ROTR(22, x);\n int ret = a ^ b ^ c;\n return ret;\n }",
"public Integer sumLogic(int startingNumber, int endingNumber){\n\t\tSystem.out.println(\"Print Sum from this number\");\n\t\tint sum = 0;\n\t\tfor(int x = startingNumber; x <= endingNumber; x++){\n\t\t\tsum = sum + x;\n\t\t\tSystem.out.println(\"New number is: \" + x + \" sum: \" + sum);\n\t\t}\n\t\treturn 0;\n\t}",
"int getSuma();",
"private int calc(int x, int n, int i, int sum) {\n int ways = 0;\n\n // Calling power of 'i' raised to 'n'\n int p = (int) Math.pow(i, n);\n while (p + sum < x) {\n // Recursively check all greater values of i\n ways += calc(x, n, i + 1,\n p + sum);\n i++;\n p = (int) Math.pow(i, n);\n }\n\n // If sum of powers is equal to x\n // then increase the value of result.\n if (p + sum == x)\n ways++;\n\n // Return the final result\n return ways;\n }",
"static int sumOfNumbers(int x, int y) {\n return x + y;\n }",
"private static int sum(int[] coins,int coinsCount,int startIndex){\n int sum = 0;\n for(int c1=startIndex;c1<startIndex+coinsCount;c1++){\n sum += coins[c1];\n }\n return sum;\n }",
"private static void calc1(int x) {\n\t\tx+=1;\n\t}",
"public long iterativeSum(long n){\n long result = 0;\n for(long i = 1L; i <= n; i++){\n result += i;\n }\n return result;\n }",
"private static int sum1DArrRecursive(int[] myArr1D, int min, int max)\n {\n int sum = 0;\n if(min==max)\n { \n sum += myArr1D[max];\n return sum;\n }\n else\n {\n sum += myArr1D[min] + sum1DArrRecursive(myArr1D, min+1, max);\n return sum;\n }\n }",
"private int sum(AFormula o1){\n\t\t\t\t\n\t\t\t\treturn o1.calculate(customerType, weekdayCount, weekendCount);\n\t\t\t\t\n\t\t\t}",
"public int sumNumbers(TreeNode root) {\n // track the sum that we want to add\n int solution = 0;\n\n // execute a dfs to find the leaf nodes\n solution = findLeafNodes(root, solution);\n\n // return the solution\n return solution;\n }",
"public int sumNumbers(TreeNode root) {\n if(root == null)\n return 0;\n res = 0;\n sumnum(root,0);\n return res;\n }",
"public int sumFirstAndLastDigit(int num) {\n\t\t// TODO Write an implementation for this method declaration\n\t\tint sum;\n\t\tint firstDigit = 0;\n\t\tint lastDigit = 0;\n\t\tint size;\n\t\tint num2;\n\t\tString num_string;\n\t\tif(num < 0) {\n\t\t\tsum = -1;\n\t\t}\n\t\telse {\n\t\t\tnum_string = Integer.toString(num);\n\t\t\tsize = num_string.length()-1;\n\t\t\tfirstDigit = (int)(num / (Math.pow(10, size)));\n\t\t\twhile(num > 10) {\n\t\t\t\tnum2 = (int)(num / (Math.pow(10, size)));\n\t\t\t\tnum = num % (int)(num2 * (Math.pow(10, size)));;\n\t\t\t\t//System.out.println(num);\n\t\t\t\tsize--;\n\t\t\t\t\n\t\t\t}\n\t\t\tlastDigit = num;\n\t\t\t//System.out.println(firstDigit);\n\t\t\t//System.out.println(lastDigit);\n\t\t\tsum = firstDigit+lastDigit;\n\t\t\t//System.out.println(sum);\n\t\t}\n\t\t\n\n\n\n//\t\tfirstDigit = (int) (num / (Math.pow(10, size)));\n//\t\tnum = (int)(num / (Math.pow(10, size)));\n//\t\tfirstDigit = num;\n\n\n\t\t\n\t\treturn sum;\n\t}",
"int calculate() {\n return getSum() + b1;\n }",
"public int calcSum() {\n\t\tint sum = 0;\n\t\tfor (int count = 0; count < data.size(); count++)\n\t\t\tsum += (int)data.get(count);\n\t\treturn sum;\n\t}",
"public int sumNumbers(TreeNode root) {\n int solution = 0;\n\n String currentPath = \"\";\n\n // execute a dfs to find the leaf nodes\n findLeafNodes(root, currentPath);\n\n // loop through all the paths, convert to int, add to solution\n for(String curr:rootToLeafs){\n // save the current string as an integer\n int currentVal = Integer.parseInt(curr);\n\n // add the current value to the solution\n solution+=currentVal;\n }\n\n // return the solution\n return solution;\n }",
"public int GetSum(int a, int b) {\n\t\tint result = 0;\r\n\t\tint number = 0;\r\n\t\t\r\n\t\t//If a is greater than b, I will loop through all the integers between them, starting by b and summing 1 in every step of the loop \r\n\t\tif (a > b) {\r\n\r\n\t\t\tfor (int x = b; x <= a; x++) {\r\n\t\t\t\t//The number variable will be the x step of the loop, starting from b\r\n\t\t\t\tnumber = x;\r\n\t\t\t\tresult += number;\r\n\t\t\t\tnumber++;\r\n\t\t\t}\r\n\t\t//It will be similar if a is greater than b, but starting counting from a\r\n\t\t} else if (a < b) {\r\n\t\t\tfor (int x = a; x <= b; x++) {\r\n\t\t\t\tnumber = x;\r\n\t\t\t\tresult += number;\r\n\t\t\t\tnumber++;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t//If the two values are similar, the method just return one of them, ie a:\r\n\t\telse {\r\n\t\t\tresult = a;\r\n\t\t\t\r\n\t\t}\r\n\r\n\t\t//Finally the method return the result.\r\n\t\treturn result;\r\n\r\n\t}",
"public static void main(String[] args) {\n // initialize number to sum up to.\n int x = 3792;\n // Display the summation result.\n System.out.println(\"The sum of integers from 1 to \" + x +\n \" is \" + summation(x) + \".\");\n }",
"public static void main(String[] args) {\n\t\t\r\n\t\tint n= 545;\r\n\t\tint sum=0;\r\n\t\twhile(n>0)\r\n\t\t{\r\n\t\t\tint reminder = n%10; // 5\r\n\t\t\tsum = sum+reminder;\r\n\t\t\tn= n/10;\r\n\t\t}\r\n\t\tSystem.out.println(\"sum of given numbers \" + sum);\r\n\r\n\t}",
"public static int sum1(int[] a, int n) // summen av de n første\n {\n if (n == 1) return a[0]; // summen er verdien selv\n return sum1(a,n-1) + a[n-1]; // summen av de n-1 første + a[n-1]\n }",
"int sumRootToLeafNumbers();",
"public void exercise_4_31()\n {\n int index = 0;\n int sum = 0;\n \n while (index < 10) {\n index++;\n sum += index;\n }\n System.out.println(sum);\n }",
"public double getSumXX() { \n\t\treturn sumX1X1; \n\t}",
"public int sum()\n {\n return sum(0,0,size);\n }",
"public int sumNumbers(TreeNode root) {\n\t if(null == root) return 0;\n\t int bsum = 0;\n\t int tsum = 0;\n\t return sum (root, bsum, tsum);\n\t \n\t }",
"public static double getSum(long num) {\r\n double total = 0;\r\n for(int i = 0; i < digitBit.length; i ++){\r\n double sum = 0;\r\n Bucket bkt = digitBit[i].bucket;\r\n //find sum of buckets of size (j+1)\r\n while(bkt.endTimestamp >= (currentTimeStamp - num + 1)){\r\n sum += bkt.size;\r\n if(bkt.next != null){\r\n bkt = bkt.next;\r\n }else{\r\n break;\r\n }\r\n }\r\n if(bkt.startTimeStamp >= (currentTimeStamp - num + 1)){\r\n sum += (bkt.size)/2;\r\n }\r\n //add the contribution of ith position bits to the total\r\n total += sum * Math.pow(2, i);\r\n }\r\n return total;\r\n }",
"public static int findTotal(int number) {\n int num = 0;\n for (int i = 1; i < number; i++) {\n num += i*(number/i);\n }\n return num;\n }",
"public static double[] nSumTo1(int n) {\n Random r = new Random();\n double[] nums = new double[n];\n int sum = 100;\n\n for (int i = 0; i < nums.length-1; i++) {\n int randInt = r.nextInt(200);\n int num = randInt % (sum + 1);\n sum -= num;\n nums[i] = num / 100.0;\n }\n nums[nums.length-1] = sum / 100.0;\n\n return nums;\n }",
"private int getSumOfSquares(int n) {\n\t\tint sum = 0;\n\t\tint number = n;\n\t\tint current;\n\t\t\n\t\twhile(number != 0) {\n\t\t\tcurrent = number % 10;\n\t\t\tsum += Math.pow(current, 2);\n\t\t\tnumber /= 10;\n\t\t}\n\t\treturn sum;\n\t}",
"public static void main(String[] args) {\n int sum = 0;\n int num;\n System.out.println(\"Give your no:\");\n Scanner keyboard = new Scanner(System.in);\n\n num = keyboard.nextInt();\n for (int i = 1; i <= num; i++) {\n sum = sum + i;}\n System.out.println(sum);\n\n }",
"public static int calculateSum(int n)\n {\n int sum =0 ;\n for(int i = 3;i <= n; i++ )\n {\n if(i%3 == 0 || i%5 == 0)\n {\n sum += i;\n }\n }\n return sum;\n }",
"private static int sumDigits(int sum) {\n int result;\n do {\n result = 0;\n while (sum != 0) {\n result += sum % 10;\n sum /= 10;\n }\n sum = result;\n }\n while (result > 9);\n return result;\n }",
"static int sum(int... args) {\n\t\tint sum = 0;\n\t\tfor (int arg : args)\n\t\t\tsum += arg;\n\t\treturn sum;\n\t}",
"@Override\n public int divisor_sum(int n) {\n int x;\n int sum = 0;\n for (int i = 1; i <= n; i++) {\n if(n%i == 0){\n x = i;\n sum += x;\n }\n }\n return sum;\n }",
"public static int sum67(List<Integer> numbers) {\n boolean start = false;\n Integer sumOfNumbers = 0;\n for (Integer number : numbers) {\n if (!start && number != 6) {\n sumOfNumbers += number;\n } else if (number == 6) {\n start = true;\n } else if (start && number == 7) {\n start = false;\n }\n }\n return sumOfNumbers;\n }",
"static BigInteger findSum(BigInteger n) {\n if (n.equals(BigInteger.ZERO))\n return BigInteger.ZERO;\n BigInteger TWO = BigInteger.valueOf(2);\n\n BigInteger sum = BigInteger.ZERO;\n sum = sum.add(\n n.multiply(n.add(BigInteger.ONE))\n .divide(TWO)\n );\n\n BigInteger flooredN = findFraction(n);\n sum = sum.add(\n n.multiply(flooredN)\n );\n\n sum = sum.subtract(\n flooredN.multiply(flooredN.add(BigInteger.ONE))\n .divide(TWO)\n );\n\n sum = sum.subtract(findSum(flooredN));\n\n return sum;\n }",
"public int sumCount(int number){\n int sum=0;\n for(int i=1; i<=number; i++){\n sum=sum+countSetBits(i);\n }\n return sum;\n }",
"static long findSum(int N)\n\t{\n\t\tif(N==0) return 0;\n\t\treturn (long)((N+1)>>1)*((N+1)>>1)+findSum((int)N>>1);\n\t\t\n\t}",
"public int getSum(int x, int y){\n return x+y;\n }",
"CheckSum generateCheckSum();",
"public static int getSum(int b, int n1, int n2) {\n int carry = 0;\r\n int pos = 1;\r\n int num = 0;\r\n while (n1 != 0 || n2 != 0 || carry != 0) {\r\n int a = n1 % 10;\r\n int d = n2 % 10;\r\n int c = a + d + carry;\r\n \r\n // if (c >= b)\r\n // c = c % b;\r\n carry = c/ b;\r\n c=c%b;\r\n num = num + pos * (c);\r\n \r\n pos *= 10;\r\n n1 /= 10;\r\n n2 /= 10;\r\n }\r\n\r\n return num;\r\n }",
"public static void main(String[] args) {\nint array[]= {13, 25, 9,56,54,89,17};\r\nint sum =0;\r\n\r\nfor (int i=0; i<=6; i++) {\r\n\tsum = sum + array[i];\r\n}\r\nSystem.out.println(\"the sume of the numbers is \" +sum);\r\n\t}",
"public static int sumOfTerms(int from, int to){\n return (from == 0 || from == 1) ? firstNTerms(to) : sumOfTerms(from, to, 1);\n }",
"public double getSumX() { \n\t\treturn sumX1; \n\t}",
"@Nonnull\r\n\tpublic static Observable<Integer> sumInt(\r\n\t\t\t@Nonnull final Observable<Integer> source) {\r\n\t\treturn aggregate(source, Functions.sumInteger(), Functions.<Integer, Integer>identityFirst());\r\n\t}",
"int getSumaAdunata();",
"public double sum() {\n double sum = x;\n Lista iter = new Lista(this);\n while (iter.next != null) {\n sum += iter.next.x;\n iter = iter.next;\n }\n return sum;\n }",
"public static int sumRange(int c) {\r\n int sum = 0;\r\n for(int i = 0; i <= c; i++) {\r\n //System.out.println( i );\r\n sum += i;\r\n } \r\n return sum;\r\n }",
"public static void main (String[] args){\n int a,no,sum=0;\nScanner s=new Scanner(System.in);\n//System.out.println(\"Enter any number: \");\nno=s.nextInt();\nwhile(no>0)\n{\na=no%10;\nno=no/10;\nsum=sum+a;\n}\nSystem.out.println(sum);\n}",
"@Override\n public Integer reduce(Integer value, Integer sum) {\n return value + sum;\n }",
"public static int sumDigits(int number){\n if(number < 10){\r\n return -1;\r\n }\r\n\r\n\r\n //need to assign the digit to an empty variable\r\n int sum = 0;\r\n\r\n while(number > 0){\r\n\r\n //assign last digit in number to variable\r\n int last_digit = number%10;\r\n\r\n //add last_digit to sum\r\n sum += last_digit;\r\n\r\n //drop the least significant digit\r\n number = number/10;\r\n\r\n //number is now the digits without the last digit and this new number is used to test the loop\r\n }\r\n\r\n return sum;\r\n\r\n\r\n\r\n }",
"public static double sum(double n) {\n\t\tdouble sum = 0;\t// Sum of the series\n\t\tfor (double i = 1; i <= n; i++) {\n\t\t\tsum += i / (i + 1);\n\t\t}\n\t\treturn sum;\n\t}",
"public static int sumUpTo(int integer) {\n int out = 0;\n if (integer >= 0)\n {\n for (int count = 0 ; count <= integer ; count++ )\n {\n out = out + count;\n }\n }\n else // if integer is negative\n {\n for (int index = integer ; index <= 0 ; index++)\n {\n out = out + index;\n }\n }\n return out;\n }",
"private static long calc1()\n {\n final int min = 1000;\n final int max = 10000;\n\n // initialize\n List<List<Integer>> m = new ArrayList<>();\n for (int k = 0; k < end; k++) {\n List<Integer> list = new ArrayList<Integer>();\n int n = 1;\n while (k >= start) {\n int p = pkn(k, n);\n if (p >= max) {\n break;\n }\n if (p >= min) {\n list.add(p);\n }\n n++;\n }\n m.add(list);\n }\n\n boolean[] arr = new boolean[end];\n arr[start] = true;\n\n List<Integer> solutions = new ArrayList<>();\n List<Integer> list = m.get(start);\n for (Integer first : list) {\n LinkedList<Integer> values = new LinkedList<>();\n values.add(first);\n f(m, arr, values, 1, solutions);\n // we stop at the first solution found\n if (!solutions.isEmpty()) {\n break;\n }\n }\n\n // solutions.stream().forEach(System.out::println);\n int res = solutions.stream().reduce(0, Integer::sum);\n return res;\n }",
"private static int sum(List<Integer> counts) {\n int total = 0;\n for (int count : counts) {\n total += count;\n }\n return total;\n }",
"public Node findSumOfNumbers(Node l1, Node l2) {\n\t\tint carry =0;\n \n\t\tNode newHead = null;\n\t\tNode tempNodeForIteration=null;\n\t\tint sum=0;\n \n\t\tint count=0;\n\t\twhile(l1!=null || l2!=null)\n\t\t{\n\t\t\tcount++;\n\t\t\tsum=carry;\n\t\t\tif(l1!=null)\n\t\t\t{\n\t\t\t\tsum=sum+l1.value;\n\t\t\t\tl1=l1.next;\n\t\t\t}\n \n\t\t\tif(l2!=null)\n\t\t\t{\n\t\t\t\tsum=sum+l2.value;\n\t\t\t\tl2=l2.next;\n\t\t\t}\n \n \n\t\t\tcarry=sum/10;\n\t\t\tsum=sum%10;\n\t\t\t// Check if it first node for the result\n\t\t\tif(count==1)\n\t\t\t{ \n\t\t\t\ttempNodeForIteration = new Node(sum);\n\t\t\t\tnewHead=tempNodeForIteration;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// 1-->5 -->7\n\t\t\t\t//tempNodeForIteration first node is =1\n\t\t\t\tNode tempSumNode=new Node(sum);\n\t\t\t\t//tempNodeForIteration second node is =5\n\t\t\t\ttempNodeForIteration.next=tempSumNode;\n\t\t\t\t//tempNodeForIteration node holding last node =5\n\t\t\t\ttempNodeForIteration=tempNodeForIteration.next;\n\t\t\t}\n \n\t\t}\n\t\tif(carry!=0)\n\t\t{\n\t\t\tNode tempNode=new Node(carry);\n\t\t\ttempNodeForIteration.next=tempNode;\n\t\t}\n\t\treturn newHead;\n\t}",
"private void calcSum() {\n String numberVal = number.getText().toString();\n if (numberVal.isEmpty()) {\n numberVal = \"0\";\n }\n\n int count = Integer.parseInt(numberVal);\n\n if (count > 1e5) {\n Toast.makeText(\n this,\n \"The given number is too large for product of even items!\",\n Toast.LENGTH_SHORT).show();\n }\n\n\n // array initialization\n int[] arr = new int[count];\n for (int i = 0; i < count; i++) {\n arr[i] = i + 1;\n }\n\n // calculate sum\n long sum = 0;\n for (int i = 0; i < count; i++) {\n sum += arr[i];\n }\n\n result.setText(String.format(\"The sum is %d\", sum)); ;\n }",
"public int sum (List<? extends Number> numbers){\n\t\tif (numbers.size() > 0) {\n\t\t\tint sum = 0;\n\n\t\t\tfor ( int i = 0 ; i < numbers.size() ; i++) {\n\t\t\t\tif (numbers.get(i) instanceof Double ) {\n\t\t\t\t\tsum += numbers.get(i).intValue();\n\t\t\t\t} else {\n\t\t\t\t\tsum += (int) numbers.get(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn sum;\n\t\t}\n\t\treturn 0;\n\t}",
"private static long countSummations(int target) {\n if (target == 1){\n return 1;\n }\n\n return countSummations(target, 0, target - 1);\n }",
"public static void main(String[] args) {\n\t\tint start,end;\r\n\t\tint sum=0;\r\n\t\tScanner scan = new Scanner(System.in);\r\n\t\t\r\n\t\tSystem.out.println(\"enter the start number\");\r\n\t\tstart = scan.nextInt();\r\n\t\t\r\n\t\tSystem.out.println(\"enter the end number\");\r\n\t\tend = scan.nextInt();\r\nfor(int i=start;i<=end;i++)\r\n\t{\r\n\t\tfor(int j=1;j<i;j++)\r\n\t\t{\r\n\t\tsum = sum+j;\r\n\t\t}\r\n\t\t\r\n\t}\r\n\tif (sum==start)\r\n\t\r\n\t\tSystem.out.println(sum);\r\n\t\r\n\t\r\n}",
"public static void main(String[] args) {\n Scanner keyboard = new Scanner(System.in);\n System.out.println(\"Enter a number greater than 1 and less than 100\");\n int num = keyboard.nextInt();\n int sum = 0;\n // sum is set to 0 index set to equal to or less than user input. sum increases with each pass with index plus current sum\n for (int i = 1; i <= num; i++) {\n sum += i;\n System.out.println(sum);\n }\n }",
"@Override\n\t\t\tpublic Integer call(Integer sum, Integer i) throws Exception {\n\t\t\t\treturn sum+i;\n\t\t\t}",
"public static void main(String[] args) {\n\n int finalNumber = 8;\n\n sum(finalNumber);\n System.out.println(sum(finalNumber));\n }",
"public int getSumofElements(ArrayList<Integer> input)\n\t\t\tthrows RemoteException;",
"private static BigInteger findSum(BigInteger start, BigInteger end) {\n return start.add(end).multiply(end.subtract(start).add(new BigInteger(\"1\"))).divide(new BigInteger(\"2\"));\n }",
"public static int sumOfNs(int targetNumber, int... result) {\n int score = IntStream.of(result).filter(val -> val == targetNumber).sum();\n return score;\n }",
"public int getSum(List<Integer> a){\n\n int sum = 0;\n\n for(int i = 0; i<a.size(); i++){\n if(a.get(i)<0){\n continue;\n } else{\n sum +=a.get(i);\n }\n }\n return sum;\n }",
"public static int sumAll(int n1,int n2) {\n int sum=0;\n for(int i=0;i<12;sum+=weights[n1][n2][i],i++);\n return sum;\n }",
"public static void main(String[] args){\n int i = 0;\n int sum = 0;\n while (sum <= 10){\n i++;\n sum += i;\n System.out.println(i+ \",\" + sum);\n }\n }",
"private static int findSum(int[] nums, int start, int end) {\n int sum = 0;\n for ( int i = start ; i < end ; i++ ) {\n sum = sum + nums[i];\n }\n return sum;\n }",
"default int sumOfAll(int a, int b) {\n\t\t\treturn 0;\n\t\t}",
"public static String findSum(int[] a, int x){\r\n\t\tQuickSort.quick_sort(a, 0, a.length -1);\r\n\t\tint delta, binR;\r\n\t\tfor(int i = 0; i < a.length - 1; i++){\r\n\t\t\tdelta = x - a[i];\r\n\t\t\t// we don't want to search from the beginning of the array,\r\n\t\t\t// since we should have found it earlier\r\n\t\t\tbinR = BinarySearch.search(a, delta, i + 1, a.length - 1);\r\n\t\t\tif(binR >= 0) {\r\n\t\t\t\treturn delta + \" \" + a[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn \"Not Found\";\r\n\t}",
"public long getSum()\n {\n long sum = 0;\n\n for(int i = 0; i < integerList.length; i++)\n {\n sum = sum + integerList[i];\n }\n\n return sum;\n }",
"public static int totalSum(int... result) {\n int score = IntStream.of(result).sum();\n return score;\n }",
"@Override\n\t\t\tpublic Integer apply(Integer num1, Integer num2) {\n\t\t\t\treturn num1+num2;\n\t\t\t}",
"private static int calcDigitsSum(long number) {\r\n\t\tint sum = 0;\r\n\t\t\r\n\t\twhile (number != 0) {\r\n\t\t\tint value = (int) (number % 10);\r\n\t\t\tsum += value;\r\n\t\t\tnumber /= 10;\r\n\t\t}\r\n\t\t\r\n\t\treturn sum;\r\n\t}",
"public int sum() {\n\t\treturn (x + y);\n\t}",
"public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\t\n\t\tint sum = 0;\n\t\tint count=1;\n\t\t\n\t\twhile(count<20) {\n\t\t\t\n\t\t\tsum= sum+count;\n\t\t\tSystem.out.println(\"current sum is: \" + sum + \"and\"+ \"count is: \" +count);\n\t\t\t//System.out.println(count);\n\t\t\tcount++;\n\t\t}\n\t\tSystem.out.println(\"total sum is: \"+sum);\n\t\t\n\t\t/*Birinin:\n\t\t * int firstNumber = 0;\n int secondNumber = 0;\n int total = 0;\n int tempNumber = 0;\n \n Scanner scan = new Scanner(System.in);\n System.out.println(\"Enter first number: \");\n firstNumber = scan.nextInt();\n System.out.println(\"Enter second number: \");\n secondNumber = scan.nextInt();\n \n if ( firstNumber > secondNumber) {\n tempNumber = firstNumber;\n firstNumber = secondNumber;\n secondNumber = tempNumber;\n }\n int x = firstNumber;\n while (x <=secondNumber) {\n total = total + x++;\n }\n System.out.println(\"The total :\"+total);\n\t\t */\n\t\t\n\t\t\n\t\t// how do you get the the sum of number \n\t\t\t\t// starting from one till desiged number \n\t\t\t\t// user input 5 --> 1+2+3+4+5 = 15 ; \n\t\t\t\t\n\t\t\t//\tint sum = 0 ; \n\t\t\t\t// 1 + 0 = 1 \n\t\t\t\t// 2 + 1 = 3 \n\t\t\t\t// 3 + 3 = 6 \n\t\t\t\t// ..... \n\t\t\t\t//int count = 1 ; \n\t\t\t\t\n\t\t\t\t//while(count <=100) {\n\t\t\t\t\t\n\t\t\t\t//\tsum = sum + count ; \n\t\t\t\t//\tSystem.out.println(\"current sum :\"+sum + \" count is \"+ count );\n\t\t\t\t\t//System.out.println(count);\n\t\t\t\t\t//count++;\n\t\t\t\t//}\n\t\t\t\t\n\t\t\t\t//System.out.println(sum);\n\n\t\t\n\t}",
"private static void findNumbers(int[] candidates, int sum,\n List<List<Integer>> res, List<Integer> r, int i) {\n if (sum < 0) {\n return;\n }\n\n // if we get exact answer\n if (sum == 0) {\n List<Integer> r2 = new ArrayList<>(r);\n if (!res.contains(r2)) {\n res.add(r2);\n }\n return;\n }\n\n // Recur for all remaining elements that have value smaller than sum.\n while (i < candidates.length - 1) {\n i++;\n\n // Till every element in the array starting from i which can contribute to the sum\n r.add(candidates[i]); // add them to list\n\n // recur for next numbers\n findNumbers(candidates, sum - candidates[i], res, r, i);\n\n // remove number from list (backtracking)\n r.remove(r.size() - 1);\n }\n }",
"private static int reductionInt10(int[] x) {\n int sum = 0;\n // Amenable to complete unrolling.\n for (int i = 10; i <= 10; i++) {\n sum += x[i];\n }\n return sum;\n }",
"public static void main(String[] args) \n\t{\n\t\t\n\t\tint sum = 153;\n\t\tint num1 = 0;\n\t\t\n\t\twhile(sum>0)\n\t\t{\n\t\t\tint num = sum%10; //3\n\t\t\tnum1 = num1+num*num*num;\n\t\t\tsum = sum/10;\n\t\t}\n\t\t\n\t\tSystem.out.println(num1);\n\t\t\n\n\t}",
"private static int missingNumber(int[] nums) {\n\t\t// TODO Auto-generated method stub\n\t\tint sum = 0; \n\t\tint end = nums.length; \n\t\t\n for(int i=0; i<end; i++){\n sum += i;\n sum = sum - nums[i];\n }\n \n sum = sum + end; \n\t\t\t\t\n\t\treturn sum;\n\t}",
"public static float different_same_sum(float x)\n\t{\n\n\t\tfloat forward_sum = 0;\n\t\tfloat backward_sum = 0;\n\n\t\tfor (float i = 1; i <= 100; i++)\n\t\t{\n\t\t\tforward_sum += ((float)Math.pow(x - 1f, i) * (float)Math.pow(-1f, i + 1f) / i);\n\t\t}\n\t\tfor (float i = 100; i >= 1; i--)\n\t\t{\n\t\t\tbackward_sum += ((float)Math.pow(x - 1f, i) * (float)Math.pow(-1f, i + 1f) / i);\n\t\t}\n\n\t\treturn forward_sum - backward_sum;\n\t\t/*\n\t\t * Da nur eine begrenzte Anzahl Nachkommastellen gespeichert werden kann gibt es\n\t\t * bei float-addition oft kleine Fehler, hier häufen sich diese Fehler an.\n\t\t * Aufgrund dieser Rundungsfehler spielt die Reihenfolge der Addition eine\n\t\t * Rolle, deswegen erhalten wir hier zwei verschiedene Ergebnise.\n\t\t */\n\t}",
"public static int addDigits(int x)\n\t{\n\t\t//Method variable\n\t\tint sum = 0;\n\t\t//Assign while loop and return a value.\n\t\twhile(x>0)\n\t\t{\n\t\t\t sum = x%10+sum;\n\t\t\t x=x/10;\n\t\t}\n\t\treturn(sum);\n\t}",
"public static void main(String[] args) {\n int input = 7123456;\n int result = sumOfDigits(input, 0);\n System.out.println(result);\n }",
"public static void main(String[] args) {\n System.out.println(sumBetween(1, 0)); // testing sumBetween\n System.out.println(sumBetween(0, 0));\n System.out.println(sumBetween(26, 31));\n System.out.println(sumBetween(-16, 1));\n }"
] | [
"0.808174",
"0.72404873",
"0.69546086",
"0.67850095",
"0.67414093",
"0.6427093",
"0.6370629",
"0.63071907",
"0.6272057",
"0.6272057",
"0.62185574",
"0.61499196",
"0.6111133",
"0.60850054",
"0.6042967",
"0.6037487",
"0.60364294",
"0.6009582",
"0.6008597",
"0.5992204",
"0.5955123",
"0.5940903",
"0.5933448",
"0.59193975",
"0.59176385",
"0.5891618",
"0.58763856",
"0.58675927",
"0.58560705",
"0.58381003",
"0.5807441",
"0.5800736",
"0.5788903",
"0.578589",
"0.5780836",
"0.5768861",
"0.5765117",
"0.5760366",
"0.5758659",
"0.5754597",
"0.5717883",
"0.57120425",
"0.5710609",
"0.5703823",
"0.5701051",
"0.56975853",
"0.56734955",
"0.56670696",
"0.5665984",
"0.56652504",
"0.56628895",
"0.56591284",
"0.56546265",
"0.56454206",
"0.5644141",
"0.563995",
"0.5629958",
"0.5621287",
"0.5607532",
"0.56062776",
"0.5582714",
"0.55755603",
"0.55549365",
"0.5554728",
"0.55496794",
"0.55446374",
"0.55352026",
"0.55311567",
"0.5530846",
"0.5528072",
"0.5528065",
"0.5527458",
"0.55267113",
"0.55066085",
"0.55012697",
"0.5499689",
"0.54983073",
"0.549124",
"0.5479617",
"0.5478622",
"0.54760873",
"0.54717165",
"0.5470085",
"0.546977",
"0.54631853",
"0.54580146",
"0.54573935",
"0.54549277",
"0.5454138",
"0.5449981",
"0.54493135",
"0.5444708",
"0.5435317",
"0.5433677",
"0.54322284",
"0.54291666",
"0.54290044",
"0.54274255",
"0.54235685",
"0.54166335"
] | 0.80086434 | 1 |
/ build_GOT_Email This method should build email using user's first and last name | public static String build_GOT_Email(String fName, String lName){
//String email = fName.substring(0,1)+lName+"@NightWatch.com";
//String email = fName.charAt(0)+lName+"@NightWatch.com";
//return email;
return fName.charAt(0)+lName+"@NightWatch.com";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static String build_GOT_Email(String firstName, String lastName){\n String email = firstName.charAt(0)+lastName+\"@NightWatch.com\";\n return email;\n }",
"public static String buildEmail (String first, String last){\n\n String firstNameFixed = \"\";\n firstNameFixed+=firstNameFixed+first.charAt(0); // first.charAt(0);\n\n String lastNameFixed = \"\";\n for (int i = 0; i <last.length() ; i++) { //last.length();\n lastNameFixed += last.charAt(i);\n\n }\n String nameFixed = firstNameFixed+lastNameFixed+\"@NightWatch.com\";\n\n\n return nameFixed ;\n }",
"public static String build_GOT_Email (String first, String last){\n // String email = first.charAt(0) + last + \"@NightWatch.com\";\n // return email ;\n // another way to print i can say this is the simplest way\n return first.charAt(0) + last + \"@NightWatch.com\";\n\n }",
"java.lang.String getUserEmail();",
"String getUserMail();",
"java.lang.String getEmail();",
"java.lang.String getEmail();",
"java.lang.String getEmail();",
"java.lang.String getEmail();",
"java.lang.String getEmail();",
"java.lang.String getEmail();",
"public Email(String firstName, String lastName){\r\n\t\tthis.firstName = firstName;\r\n\t\tthis.lastName = lastName;\r\n\t\t\r\n\t\t//Call a method asking for the department - return the department.\r\n\t\tthis.department = setDepartment();\r\n\t\t\r\n\t\t//Call a method for generating password - return the password.\r\n\t\tthis.password = randomPassword(defaultPasswordLength);\r\n\t\t\r\n\t\t//Combine elements to generate Email.\r\n\t\temail = this.firstName.toLowerCase()+\".\"+this.lastName.toLowerCase()+\"@\"+this.department+\".\"+companySuffix;\r\n\t}",
"public Email(String firstName, String lastName) {\r\n\t\tthis.firstName=firstName;\r\n\t\tthis.lastName=lastName;\r\n\t\t\r\n\t\t\r\n\t//Call a method asking for the department - return the department\r\n\tthis.department = setDepartment();\r\n\t\t\r\n\t\r\n\t//Call a method that returns a random password\r\n\tthis.password=randomPassword(defaultPasswordLength);\r\n\t\tSystem.out.println(\"Your password is: \" + this.password);\r\n\t\t\r\n\t\t\r\n\t//Combine elements to generate email\r\n\temail=firstName.toLowerCase() + \".\" + lastName.toLowerCase() + \"@\" + department + \".\" + companySuffix;\r\n\t\t\r\n\t}",
"public void createUserEmail(UserBean useBean) throws Exception;",
"public Builder setUserEmail(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000004;\n userEmail_ = value;\n onChanged();\n return this;\n }",
"public static String buildUsernameForgotRequestBody( String email ) {\n\t\tStringWriter sw = new StringWriter();\n\t\tPrintWriter pw = new PrintWriter( sw );\n\t\tpw.println(\"{\");\n\t\tpw.println(\" \\\"email\\\":\\\"\" + email + \"\\\"\");\n\t\tpw.println(\"}\");\n\t\treturn sw.toString();\n\t}",
"String getEmail();",
"String getEmail();",
"String getEmail();",
"String getEmail();",
"String getEmail();",
"public Email(String firstname,String lastname)\r\n\t{\r\n\t\tthis.firstname=firstname;\r\n\t\tthis.lastname=lastname;\r\n\t\t//System.out.println(\"EMAIL CREATED:\"+this.firstname+this.lastname);\r\n\t\t//create a method asking for department\r\n\t\tthis.department=setDepartment();\r\n\t\t//System.out.println(\"Deaprtment:\"+this.department);\r\n\t\t//call a method to create default password\r\n\t\tthis.password=setRandompassword(defaultpasswordlength);\r\n\t\t//System.out.println(\"Your Password is:\"+this.password);\r\n\t\temail=firstname.toLowerCase()+\".\"+lastname+\"@\"+\".\"+department+\".com\";\r\n\t\t//System.out.println(\"Your emailid is: \"+email);\r\n\t\t\r\n\t}",
"public static String buildUsernameForgotRequestBody() {\n\t\tStringWriter sw = new StringWriter();\n\t\tPrintWriter pw = new PrintWriter( sw );\n\t\tpw.println(\"{\");\n\t\tpw.println(\" \\\"postalCode\\\":\\\"92131\\\"\");\n\t\tpw.println(\"}\");\n\t\treturn sw.toString();\n\t}",
"public User forgotPassword (String inputUsername, String inputEmail, String textForEmailBody) {\n\t\t\n\t String [] recievers = new String[1];\n\t recievers[0] = inputEmail;\n\t \n\t if( this.myCompany.isCompanyMember(inputUsername) != null)\n\t {\n\t\tif(!emailAvailability(inputEmail))\n\t\t{\n\t\t\tfor(int i=0; i<myCompany.getCompanyMembers().size(); i++)\n\t\t\t{\n\t\t\t\tif(inputEmail.equalsIgnoreCase(myCompany.getCompanyMembers().get(i).getMyAccount().getEmail()))\n\t\t\t\t{\n\t\t\t\t\tUser user = myCompany.getCompanyMembers().get(i);\n\t\t\t\t\tHelp.sendGMail(\"itintelligenceuom@gmail.com\", \"ITintelligence2001\", recievers, \"Account Recovery\", textForEmailBody);\n\t\t\t\t\treturn user;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t }\n\t \n\t return null;\n\t}",
"public String generateRandomEmail() {\n return generateLocalPart() + \"@test\" + getRandNumber() + \".com\";\n }",
"public Builder setEmail(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n email_ = value;\n onChanged();\n return this;\n }",
"public Builder setEmail(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n email_ = value;\n onChanged();\n return this;\n }",
"public Builder setEmail(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000004;\n email_ = value;\n onChanged();\n return this;\n }",
"String getUserMainEmail( int nUserId );",
"public EmailAddress build(){\n return new EmailAddress(this);\n }",
"public void sendUsernameChangeEmail(UserDTO userDTO) {\r\n try {\r\n Map<String, Object> modelObject = null;\r\n\r\n modelObject = ImmutableMap.of(\r\n \"name\", userDTO.getFirstName()\r\n );\r\n\r\n // Send email with required info\r\n sendMimeEmailWithFreemarker(Constants.USERNAME_UPDATE_SUBJECT, Constants.USERNAME_UPDATE_TEMPLATE,\r\n userDTO, modelObject);\r\n } catch (UnsupportedEncodingException | CannotSendEmailException | URISyntaxException e) {\r\n e.printStackTrace();\r\n }\r\n }",
"public void sendRegistrationEmail(User user, HttpServletRequest request) {\r\n try {\r\n VerificationToken token = new VerificationToken(user);\r\n verificationTokenRepo.save(token);\r\n\r\n String appUrl = request.getScheme() + Constants.SERVER_URL + \"register/confirm/\" + token.getToken();\r\n\r\n UserDTO userDTO = new UserDTO();\r\n userDTO.setFirstName(user.getFirstName());\r\n userDTO.setUsername(user.getUsername());\r\n\r\n // Build message body\r\n String subject = \"\";\r\n String template = \"\";\r\n Map<String, Object> modelObject = null;\r\n\r\n subject = Constants.REGISTRATIONSUBJECT;\r\n template = Constants.REGISTRATIONTEMPLATE;\r\n modelObject = ImmutableMap.of(\r\n \"name\", userDTO.getFirstName(),\r\n \"appUrl\", appUrl\r\n );\r\n\r\n // Send email with required info\r\n sendMimeEmailWithFreemarker(subject, template, userDTO, modelObject);\r\n } catch (UnsupportedEncodingException | CannotSendEmailException | URISyntaxException e) {\r\n e.printStackTrace();\r\n }\r\n }",
"private String _getEmail(int classType, int index) {\n String email = \"\";\n\n switch (classType) {\n case CS_C_UNIV:\n email += _getRelativeName(classType, index) + \"@\" +\n _getRelativeName(classType, index) + \".edu\";\n break;\n case CS_C_DEPT:\n email += _getRelativeName(classType, index) + \"@\" +\n _getRelativeName(classType, index) + \".\" +\n _getRelativeName(CS_C_UNIV, instances_[CS_C_UNIV].count - 1) + \".edu\";\n break;\n default:\n email += _getRelativeName(classType, index) + \"@\" +\n _getRelativeName(CS_C_DEPT, instances_[CS_C_DEPT].count - 1) +\n \".\" + _getRelativeName(CS_C_UNIV, instances_[CS_C_UNIV].count - 1) +\n \".edu\";\n break;\n }\n\n return email;\n }",
"private String sendConfirmationEmail(UserEntity user) {\n try {\n Properties emailAccountProperties = new Properties();\n try {\n emailAccountProperties.load(getClass().getResourceAsStream(\"/registration.properties\"));\n } catch (IOException e) {\n logger.warn(\"Cannot open registration properties file to send email:\", e);\n return null;\n }\n\n final String username = emailAccountProperties.getProperty(\"username\");\n final String password = emailAccountProperties.getProperty(\"password\");\n\n Properties prop = new Properties();\n prop.put(\"mail.smtp.auth\", \"true\");\n prop.put(\"mail.smtp.starttls.enable\", \"true\");\n prop.put(\"mail.smtp.host\", \"smtp.gmail.com\");\n prop.put(\"mail.smtp.port\", \"587\");\n\n Session session = Session.getInstance(prop, new javax.mail.Authenticator() {\n @Override\n protected PasswordAuthentication getPasswordAuthentication() {\n return new PasswordAuthentication(username, password);\n }\n });\n\n try {\n Message message = new MimeMessage(session);\n message.setFrom(new InternetAddress(\"cityconteam@gmail.com\"));\n message.setRecipients(Message.RecipientType.TO, InternetAddress.parse(user.getEmail()));\n message.setSubject(\"Welcome to CityCon!\");\n String reglink = RandomStringUtils.random(30, true, true);\n message.setContent(\"You received this email because you tried to register at <a href=http://citycon.ml>citycon.ml</a>.\" +\n \" Go <a href=http://citycon.ml/registration?reglink=\" + reglink + \">here</a>\" +\n //\" or <a href=http://localhost:8080/registration?reglink=\" + reglink + \"> here </a>\" +\n \" to complete your registration.\" +\n \"<br><br>If you didn't ask for registration, just ignore this message.\" +\n \"<br><br><hr>With love,<br>your CityCon team.\",\n \"text/html; charest=utf-8\");\n Transport.send(message);\n logger.trace(\"Sent reglink {}\", reglink);\n return reglink;\n } catch (MessagingException e) {\n logger.warn(\"Exception during sending email\", e);\n return null;\n }\n } catch (Exception e) {\n logger.warn(\"Unexpected exception\", e);\n return null;\n }\n }",
"@AutoEscape\n\tpublic String getEmail_address();",
"public static String randomEmail() {\n\t\tRandom randomGenerator = new Random(); \n\t\tint randomInt = randomGenerator.nextInt(10000); \n\t\treturn \"username\"+ randomInt +\"@yopmail.com\"; \n\t}",
"public static String validEmailAddressGenerator() {\n\n\t\tStringBuffer sb = new StringBuffer();\n\t\tString allChar = \"0123456789abcdefghijklmnopqrstuvwxyz\";\n\n\t\tRandom random = new Random();\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tsb.append(allChar.charAt(random.nextInt(allChar.length())));\n\t\t}\n\n\t\tString tmp = sb.toString();\n\n\t\tsb.append(\"@\");\n\t\tsb.append(tmp);\n\t\tsb.append(\".com\");\n\n\t\tString mailAdd = sb.toString();\n\n\t\treturn mailAdd;\n\t}",
"private String extractEMailAddress() {\n return SwingUtil.extract(emailJTextField, Boolean.TRUE);\n }",
"public Builder setEmail(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n email_ = value;\n onChanged();\n return this;\n }",
"private IModel<String> createCurrentEmailModel() {\n return Model.of(userModel.getObject().getEmail());\n }",
"private ForgotPasswordUser populateForgotPassword()\n\t{\n\t\tForgotPasswordUser fUser = new ForgotPasswordUser();\n\t\tfUser.setAction(WebServiceAction.FORGOTPASSWORD);\n\t\tfUser.setEmail(medtUserName.getText().toString());\n\t\treturn fUser;\n\t}",
"private String getUserEmailAddress() {\n\t\tUser user = UserDirectoryService.getCurrentUser();\n\t\tString emailAddress = user.getEmail();\n\n\t\treturn emailAddress;\n\t}",
"public String updateEmail(String value) {\n String message = invalidValueMessage + value + \". Please enter a proper email address.\\n\";\n if (validateEmail(value) || value.equals(\"\")) {\n message = updatedMessage;\n setEmail(value);\n }\n return message;\n }",
"public static void main(String[] args) {\n /* Generate the email factory */\n EMailGenerationSystem generateEmail = new EmailFactory();\n \n /* Generate the email for business customer.*/\n System.out.println(\"---This is the start of the email for\"\n + \" Business Customer.---\"); \n generateEmail.generateEmail(\"Business\"); /* Generate email. */\n System.out.println(\"\\n\"); /* separate the test cases */\n \n /* Generate the email for frequent customer.*/\n System.out.println(\"---This is the start of the email for \"\n + \"Frequent Customer.---\"); \n generateEmail.generateEmail(\"Frequent\"); /* Generate email. */\n System.out.println(\"\\n\");/* separate the test cases */\n \n /* Generate the email for new customer.*/\n System.out.println(\"---This is the start of the email for \"\n + \"New Customer.---\"); \n generateEmail.generateEmail(\"New\"); /* Generate email. */\n System.out.println(\"\\n\");/* separate the test cases */\n \n /* Generate the email for returning customer.*/\n System.out.println(\"---This is the start of the email for \"\n + \"Returning Customer.---\"); \n generateEmail.generateEmail(\"returning\"); /* Generate email. */\n System.out.println(\"\\n\");/* separate the test cases */\n \n /* Generate the email for vip customer.*/\n System.out.println(\"---This is the start of the email for\"\n + \" VIP Customer.---\"); \n generateEmail.generateEmail(\"VIP\"); /* Generate email. */\n System.out.println(\"\\n\");/* separate the test cases */\n \n /* Generate the email for mispelling. The message will print out indicating error.*/\n System.out.println(\"---This is the start of the email for email \"\n + \" generation failure.---\"); \n generateEmail.generateEmail(\"custumer\"); /* Generate email. */\n }",
"public String getEmailInString() {\n\t\tString shortenedBody = StringHelper.shortenString(body, 75, .5);\n\t\tString indentedBody = \"\\t\" + shortenedBody.replace(StringHelper.newline, StringHelper.newline + \"\\t\");\n\t\tString bodyLine = \"(Shortened) Body (html >>> \" + html + \"):\" + StringHelper.newline + indentedBody;\n\n\t\tStringBuilder bodyPartBuilder = new StringBuilder(\"bodyParts:\");\n\t\tfor (MimeBodyPart mimeBodyPart : bodyParts) {\n\t\t\tbodyPartBuilder.append(StringHelper.newline).append(\"\\t\");\n\t\t\ttry {\n\t\t\t\tbodyPartBuilder.append(mimeBodyPart.getFileName());\n\t\t\t} catch (Throwable ex) {\n\t\t\t\t//We don't care if this error is thrown. We don't want this to break anything.\n\t\t\t\tbodyPartBuilder.append(\"N/A\");\n\t\t\t}\n\t\t}\n\t\treturn StringHelper.splitBy(StringHelper.newline,\n\t\t\t\t\t\t\"from: \" + from,\n\t\t\t\t\t\t\"replyTo: \" + StringHelper.splitBy(\", \", replyTo),\n\t\t\t\t\t\t\"to: \" + StringHelper.splitBy(\", \", to),\n\t\t\t\t\t\t\"cc: \" + StringHelper.splitBy(\", \", cc),\n\t\t\t\t\t\t\"bcc: \" + StringHelper.splitBy(\", \", bcc),\n\t\t\t\t\t\t\"subject: \" + subject,\n\t\t\t\t\t\tbodyLine,\n\t\t\t\t\t\tbodyPartBuilder.toString());\n\t}",
"public java.lang.String getUserEmail() {\n java.lang.Object ref = userEmail_;\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 userEmail_ = s;\n }\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"public String getUserEmail(String nick) throws DAOException;",
"@Override\n public String buildEavMail(String reason, RequestDataLecturer requestDataLecturer) {\n Context context = setGeneralVariables(requestDataLecturer);\n setLecturerSpecificVariables(context, requestDataLecturer);\n context.setVariable(\"reason\", reason);\n context.setVariable(\"mailType\", \"lecturer\");\n return templateEngine.process(\"eavMailTemplate\", context);\n }",
"public static String getUserEmail() {\r\n return null;\r\n }",
"public java.lang.String getEmailAddress();",
"public Builder additionalEmail(String additionalEmail) { \n this.additionalEmail = additionalEmail;\n return this;\n }",
"public String getEmail()\r\n/* 31: */ {\r\n/* 32:46 */ return this.email;\r\n/* 33: */ }",
"public static String generateRandomUsername() {\n final String randomFirst = Long.toHexString(Double.doubleToLongBits(Math\n .random()));\n final String randomSecond = Long.toHexString(Double.doubleToLongBits(Math\n .random()));\n final String randomThird = Long.toHexString(Double.doubleToLongBits(Math\n .random()));\n String userName = randomFirst + randomSecond + randomThird;\n\n userName = userName.substring(0, 10) + \"@ngetestmail.com\";\n\n return userName;\n }",
"public static void main(String[] args) {\n\n String email=\"craig_federighi@apple.com\";\n\n String firstName=email.substring(0,email.indexOf('_')) ;\n String lastName=email.substring(email.indexOf('_')+1,email.indexOf('@'));\n\n String domain=email.substring(email.indexOf('@')+1,email.indexOf('.'));\n String topLevelDomain = email.substring(email.indexOf('.')+1);\n\n\n\n String ch=\"\"+firstName.charAt(0);\n ch=ch.toUpperCase();\n\n firstName=firstName.replaceFirst(firstName.charAt(0)+\"\", \"\");\n System.out.println(\"First name: \"+ch+firstName );\n\n\n String ch1=\"\"+lastName.charAt(0);\n ch1=ch1.toUpperCase();\n\n lastName=lastName.replaceFirst(lastName.charAt(0)+\"\", \"\");\n System.out.println(\"Last name: \"+ch1+lastName);\n\n\n\n System.out.println(\"Domain: \"+domain );\n System.out.println(\"Top-Level Domain: \"+topLevelDomain);\n\n\n\n\n\n\n\n\n }",
"public java.lang.String getUserEmail() {\n java.lang.Object ref = userEmail_;\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 userEmail_ = s;\n }\n return s;\n }\n }",
"private String findDisplayName(String emailText) {\n for (User user : userList) {\n //Log.i(TAG, \"findDisplayName() : for loop\");\n if (user.getEmail().equals(emailText)) {\n //Log.i(TAG, \"emailText: \" + emailText);\n //Log.i(TAG, \"user.getEmail(): \" + user.getEmail());\n //Log.i(TAG, \"user.getUserName(): \" + user.getUserName());\n if (user.getUserName() == null) {\n break;\n }\n return user.getUserName();\n }\n }\n return \"No UserName\";\n }",
"public void testFirstEmailAddress() {\n rootBlog.setProperty(SimpleBlog.EMAIL_KEY, \"\");\n assertEquals(\"\", rootBlog.getFirstEmailAddress());\n rootBlog.setProperty(SimpleBlog.EMAIL_KEY, \"me@mydomain.com\");\n assertEquals(\"me@mydomain.com\", rootBlog.getFirstEmailAddress());\n rootBlog.setProperty(SimpleBlog.EMAIL_KEY, \"me@mydomain.com,you@yourdomain.com\");\n assertEquals(\"me@mydomain.com\", rootBlog.getFirstEmailAddress());\n }",
"private void createUserInFirebaseHelper(final String encodedEmail) {\n }",
"public String getEmail() {\r\n // Bouml preserved body begin 00040D82\r\n\t System.out.println(email);\r\n\t return email;\r\n // Bouml preserved body end 00040D82\r\n }",
"public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n System.out.println(\"enter your first name, last name, company seperated by space\");\n String firstName, lastName, company, email;\n firstName = scan.next(); //(\"Dilmurod\");\n lastName = scan.next(); //(\"Yakubov\");\n company = scan.next();//(\"Verizon\");\n email = (firstName+\"_\"+lastName+\"@\"+company+\".com\");\n System.out.println(\"My name is \"+lastName+\", \"+firstName+\" and I work for \"+ company+\" and my email is: \"\n + email);\n\n\n\n }",
"String getEmail(int type);",
"com.google.protobuf.ByteString\n getUserEmailBytes();",
"public abstract String getEmail( String [ ] strLineDataArray );",
"public static String generateEmail(int length) {\n\t\tString allowedChars = \"abcdefghijklmnopqrstuvwxyz\" + // alphabets\n\t\t\t\t\"1234567890\"; // numbers\n\n\t\tString email = \"\";\n\t\tString temp = RandomStringUtils.random(length, allowedChars);\n\t\temail = temp.substring(0, temp.length() - 9) + \"@wrap.org\";\n\t\treturn email;\n\t}",
"java.lang.String getDelegateSuggestedSignerEmail();",
"public static String getUniqueEmail() {\n return \"email\" + getUniqueString(6) + \"-\" + getUniqueString(10) + \"@domain\" + getUniqueString(10) + \".com\";\n }",
"public String returnEmail() {\n\t\treturn this.registration_email.getAttribute(\"value\");\r\n\t}",
"@Test\r\n public void testGetEmail() {\r\n user = userFactory.getUser(\"C\");\r\n assertEquals(\"cust@mail.ie\", user.getEmail());\r\n }",
"@Override\n\tpublic void createDigestEmail() {\n\n\t}",
"public String getAlternateEmail() { return alternateEmail; }",
"String getCustomerEmail(String bookingRef);",
"Optional<String> email();",
"String buildUserMessage(Throwable t);",
"@Override\n\tpublic java.lang.String getPersonalEmail() {\n\t\treturn _candidate.getPersonalEmail();\n\t}",
"public void sendregisteruser(registerDTO register) {\n MimeMessagePreparator preparator = new MimeMessagePreparator()\n {\n public void prepare(MimeMessage mimeMessage) throws Exception\n {\n mimeMessage.setRecipient(Message.RecipientType.TO, new InternetAddress(register.getEmail()));\n mimeMessage.setSubject(\"Welcome to The Indian Bus Service\");\n\n MimeMessageHelper helper = new MimeMessageHelper(mimeMessage, true);\n\n helper.setText(\"<html><body>\"\n + \"<br>\"\n + \"<h2>Hello \"+register.getFirstname()+\" \"+register.getLastname()+\"</h2>\"\n + \"<p>Welcome to <b>Indian Bus Service</b></p>\"\n + \"<br>\"\n + \"<p>Username:- \"+register.getEmail()+\"</p>\"\n + \"<p>Hope you are doing well in this lockdown.</b></p>\"\n + \"<p>Date your login : </p>'\"+new Date()+\"'</body></html>\", true);\n }\n };\n\n try {\n mailSender.send(preparator);\n }\n catch (MailException ex) {\n // simply log it and go on...\n System.err.println(ex.getMessage());\n }\n }",
"@When(\"I try to register a new user with existing email\")\n\tpublic void i_try_to_register_a_new_user_with_existing_email() {\n\n\t\tString sql = \"select email from users\\n\" + \"where email is not null\\n\" + \" limit 1;\";\n\t\temail = (String) DBUtils.getCellValue(sql);\n\t\tassertNotNull(email);\n\n\t\tresponce = RestAssured.given().header(\"Authorization\", RestUtils.token).param(\"first-name\", \"Johnny\")\n\t\t\t\t.param(\"last-name\", \"Cage\").param(\"email\", email).param(\"password\", \"subzerobest\")\n\t\t\t\t.param(\"role\", \"student-team-member\").param(\"batch-number\", \"8\").param(\"team-name\", \"CodeHunters\")\n\t\t\t\t.param(\"campus-location\", \"VA\").when().post(RestAssured.baseURI + \"/api/students/student\");\n\n\t}",
"public java.lang.String getUserEmail() {\r\n return userEmail;\r\n }",
"private String getSendMailResetPasswordContent(UserForm userForm) {\n return \"\";\n }",
"public String getFromEmailAddress() {\n return getValue(\"eurekaclinical.userservice.email.from\");\n }",
"public void signUpWithEmail(final String email, final String firstName,\n final String lastName, final String password, String gender,\n final Date dateOfBirth, final Double heightInMeters,\n final Double weightInKg,\n final ServiceClientCompletion<ResponseResult> completion)\n {\n // Validate email format.\n if (!isEmailFormat(email) && completion != null)\n {\n final ResponseResult result =\n new ResponseResult(\n false,\n \"Please enter a valid email.\",\n ServiceClientConstants.SERVICE_RESPONSE_STATUS_CODE_BAD_PARAMETERS);\n completion\n .onCompletion(\n ServiceResultStatus.FAILED,\n ServiceClientConstants.SERVICE_RESPONSE_STATUS_CODE_BAD_PARAMETERS,\n result);\n return;\n }\n\n // create request headers\n final HashMap<String, String> headers = new HashMap<String, String>(2);\n headers.put(\"Authorization\", AUTHORIZATION_HEADER);\n headers.put(\"Content-Type\", \"application/json\");\n\n // body\n final Map<String, Object> body = new HashMap<String, Object>(9);\n body.put(FIRST_NAME, firstName);\n body.put(LAST_NAME, lastName);\n body.put(EMAIL, email);\n body.put(PASSWORD, password);\n body.put(REMEMBER_ME, \"true\");\n if (!StringHelper.isNullOrEmpty(gender))\n {\n // MALE and FEMALE are only valid options, and case sensitive.\n gender = gender.toUpperCase(Locale.US);\n body.put(GENDER, gender);\n }\n if (dateOfBirth != null)\n {\n // Convert to ISO 8601 string.\n final DateFormat df = new SimpleDateFormat(\"yyyy-MM-dd\", Locale.US);\n body.put(DATE_OF_BIRTH, df.format(dateOfBirth) + \"T12:00:00Z\");\n }\n if (heightInMeters != null)\n {\n body.put(HEIGHT, heightInMeters);\n }\n if (weightInKg != null)\n {\n body.put(WEIGHT, weightInKg);\n }\n\n final Gson gson = new GsonBuilder().create();\n final String bodyJson = gson.toJson(body);\n\n this.beginRequest(REGISTER_ENDPOINT, ServiceMethod.PUT, headers, null,\n bodyJson, ServiceResponseFormat.GSON,\n new ServiceResponseTransform<JsonElement, ResponseResult>()\n {\n @Override\n public ResponseResult transformResponseData(\n final JsonElement json)\n throws ServiceResponseTransformException\n {\n final ResponseResult result =\n checkResultFromAuthService(json);\n if (!StringHelper.isNullOrEmpty(result.errorMessage)\n && result.errorMessage.toLowerCase(Locale.US).contains(\n \"attempt to insert duplicate record\"))\n {\n result.success = false;\n result.errorMessage =\n \"That email is already registered.\";\n result.responseCode =\n ServiceClientConstants.SERVICE_RESPONSE_STATUS_CODE_BAD_PARAMETERS;\n }\n else if (result.success)\n {\n final boolean success =\n setSharecareToken(json, false, false);\n if (!success)\n {\n result.success = false;\n result.responseCode =\n ServiceClientConstants.SERVICE_RESPONSE_STATUS_CODE_BAD_DATA;\n }\n }\n else\n {\n result.success = false;\n result.responseCode =\n ServiceClientConstants.SERVICE_RESPONSE_STATUS_CODE_BAD_DATA;\n if (!StringHelper.isNullOrEmpty(result.errorMessage)\n && result.errorMessage.toLowerCase(Locale.US)\n .contains(\"invalid email address\"))\n {\n result.errorMessage = \"Please enter a valid email.\";\n result.responseCode =\n ServiceClientConstants.SERVICE_RESPONSE_STATUS_CODE_BAD_PARAMETERS;\n }\n else if (!StringHelper\n .isNullOrEmpty(result.errorMessage)\n && result.errorMessage.toLowerCase(Locale.US)\n .contains(\"account already exists\"))\n {\n result.errorMessage =\n \"That email is already registered. Please try again with another email.\";\n result.responseCode =\n ServiceClientConstants.SERVICE_RESPONSE_STATUS_CODE_BAD_PARAMETERS;\n }\n }\n\n if (result.responseCode != ServiceClientConstants.SERVICE_RESPONSE_STATUS_CODE_SUCCESS\n && result.responseCode != ServiceClientConstants.SERVICE_RESPONSE_STATUS_CODE_BAD_PARAMETERS)\n {\n result.success = false;\n result.errorMessage = \"ERROR\";\n }\n\n LogError(\"signUpWithEmail\", result);\n return result;\n }\n }, new ServiceClientCompletion<ResponseResult>()\n {\n\n @Override\n public void onCompletion(\n final ServiceResultStatus serviceResultStatus,\n final int responseCode, ResponseResult resultValue)\n {\n if (completion != null)\n {\n if (resultValue == null)\n {\n resultValue =\n new ResponseResult(\n false,\n \"ERROR\",\n ServiceClientConstants.SERVICE_RESPONSE_STATUS_CODE_BAD_PARAMETERS);\n }\n\n completion.onCompletion(resultValue.success\n ? ServiceResultStatus.SUCCESS\n : ServiceResultStatus.FAILED,\n resultValue.responseCode, resultValue);\n }\n }\n });\n }",
"public String adcionarEmail() {\n\t\tpessoa.adicionaEmail(email);\n\t\tthis.email = new Email();\n\t\treturn null;\n\t}",
"public java.lang.String getSenderLastName() {\r\n return senderLastName;\r\n }",
"@Override\n public String getPayTo() {\n return getFirstName() + \" \" + getLastName();\n }",
"@AutoEscape\n public String getEmail();",
"private String createDisplayName(User user, String listName) {\n assert ((user != null) && (user.getUsername() != null));\n String name = StringUtils.isNotBlank(user.getName()) ? user.getName() : user.getUsername();\n if (StringUtils.isNotBlank(user.getEmail()) && NAME_AND_EMAIL.equals(listName)) {\n name = name + \" <\" + user.getEmail() + \">\";\n } else if (NAME_AND_USERNAME.equals(listName)) {\n name = name + \" (\" + user.getUsername() + \")\";\n }\n assert (name != null);\n return name;\n }",
"@Test\n\t void testEmail() {\n\t\tString expected=\"faizan@gmail.com\";\n\t\tString actual=user.getEmail();\n\t\tassertEquals(expected, actual);\n\t}",
"public void createUser(String firstName, String emailAddress) {\n\n this.firstName = firstName;\n this.emailAddress = emailAddress;\n\n }",
"private void emailExistCheck() {\n usernameFromEmail(email.getText().toString());\n }",
"private String SuggestEmail() {\n EmailDAOHE emaildaohe = new EmailDAOHE();\n List<String> suggestString = emaildaohe.findEmailByUserId(getUserId());\n List<Email> suggestList = new ArrayList<Email>();\n for (int i = 0; i < suggestString.size(); i++) {\n Email email = new Email();\n email.setUserId((long) i);\n email.setSender(StringEscapeUtils.escapeHtml(suggestString.get(i) + \"; \"));\n suggestList.add(email);\n }\n String listEmail = emaildaohe.convertToJSONArray(suggestList, \"userId\", \"sender\", \"sender\");\n return listEmail;\n }",
"public String returnLastName() {\n\t\treturn this.registration_lastname.getAttribute(\"value\");\r\n\t}",
"protected String createEmailString(Set emails) {\n StringBuffer commaDelimitedString = new StringBuffer();\n Iterator emailIterator = emails.iterator();\n \n while (emailIterator.hasNext()) {\n String mappedUser = (String) emailIterator.next();\n // append default suffix if need to\n if (mappedUser.indexOf(\"@\") < 0) {\n mappedUser += defaultSuffix;\n }\n \n commaDelimitedString.append(mappedUser);\n if (emailIterator.hasNext()) {\n commaDelimitedString.append(\",\");\n }\n } \n \n LOG.debug(\"List of emails: \" + commaDelimitedString);\n \n return commaDelimitedString.toString();\n }",
"public static void sendMail (String email, String name, String surname) throws AddressException,MessagingException {\n \n Properties props = new Properties();\n props.put(\"mail.smtp.host\", \"smtp.gmail.com\");\n props.put(\"mail.smtp.auth\", \"true\");\n props.put(\"mail.smtp.port\", \"587\");\n props.put(\"mail.smtp.starttls.enable\", \"true\");\n props.put(\"mail.smtp.ssl.trust\", \"smtp.gmail.com\");\n\n Session session = Session.getDefaultInstance(props,\n new javax.mail.Authenticator() {\n protected PasswordAuthentication getPasswordAuthentication() {\n return new PasswordAuthentication(\"donotreplyfriday@gmail.com\",\"progettoweb2018\");\n }\n });\n\n try {\n\n Message message = new MimeMessage(session);\n message.setFrom(new InternetAddress(\"donotreplyfriday@gmail.com\"));\n message.setRecipients(Message.RecipientType.TO,\n InternetAddress.parse(email));\n message.setSubject(\"Benvenuto in Friday!\");\n message.setText(name+\" \"+surname+\", Benvenuto in Friday!\"+\n \"\\n\\n link di conferma : http://localhost:8080/Friday/confirmRegistrationServlet?email=\"+email);\n\n Transport.send(message);\n\n } catch (MessagingException e) {\n throw new RuntimeException(e);\n }\n }",
"@JsonIgnore\r\n public String getEmailAddress() {\r\n return OptionalNullable.getFrom(emailAddress);\r\n }",
"public String getUserEmail() {\r\n return userEmail;\r\n }",
"public String getUserEmail() {\r\n return userEmail;\r\n }",
"private static MimeMessage createEmail(String to,\n String from,\n FormattedOutput formattedTeacherOutput) throws MessagingException {\n Properties props = new Properties();\n Session session = Session.getDefaultInstance(props, null);\n\n MimeMessage email = new MimeMessage(session);\n email.setFrom(new InternetAddress(from));\n email.addRecipient(javax.mail.Message.RecipientType.TO,\n new InternetAddress(to));\n email.setSubject(formattedTeacherOutput.subject());\n email.setContent(formattedTeacherOutput.entireHtml(), \"text/html\");\n return email;\n }",
"protected String getUsername(MailAddress m) {\n return m.getLocalPart() + \"@localhost\";\n }",
"public java.lang.String getSenderLastName2() {\r\n return senderLastName2;\r\n }",
"public Email getEmail()\r\n {\r\n /**\r\n * Ya hemos leido. Se devuelve una nueva instancia en cada envio de mail para evitar problemas de sincronizacion.\r\n */\r\n return createEmailInstance();\r\n }",
"public void enterRandomEmailId() {\n String email = \"test\" + Utility.getRandomString(3) + \"@gmail.com\";\n Reporter.addStepLog(\"Enter email \" + email + \" to email field \" + _emailField.toString());\n sendTextToElement(_emailField, email);\n log.info(\"Enter email \" + email + \" to email field \" + _emailField.toString());\n }"
] | [
"0.7826288",
"0.7455601",
"0.7387285",
"0.6509246",
"0.6304763",
"0.6272814",
"0.6272814",
"0.6272814",
"0.6272814",
"0.6272814",
"0.6272814",
"0.61900574",
"0.6166977",
"0.58499384",
"0.5833137",
"0.5825547",
"0.5815707",
"0.5815707",
"0.5815707",
"0.5815707",
"0.5815707",
"0.57002825",
"0.5666115",
"0.5554293",
"0.55452394",
"0.55414504",
"0.55414504",
"0.5530493",
"0.55147743",
"0.5510959",
"0.55062395",
"0.54999",
"0.54959625",
"0.5495072",
"0.5492035",
"0.5484839",
"0.5484173",
"0.54751587",
"0.5468021",
"0.5464903",
"0.54575896",
"0.5442414",
"0.5437913",
"0.5434231",
"0.5425449",
"0.5412073",
"0.5408669",
"0.54001987",
"0.53929394",
"0.5385515",
"0.53852415",
"0.53800714",
"0.53777623",
"0.53751564",
"0.53740484",
"0.53727543",
"0.53624874",
"0.53537273",
"0.5351435",
"0.5350027",
"0.53471535",
"0.5339995",
"0.53206706",
"0.5313824",
"0.53111494",
"0.53032076",
"0.52957386",
"0.52880704",
"0.52876186",
"0.527924",
"0.52750725",
"0.52741534",
"0.52560526",
"0.52541685",
"0.52485394",
"0.5231141",
"0.52200973",
"0.5213146",
"0.52082324",
"0.5203639",
"0.52021605",
"0.519093",
"0.51879543",
"0.5186792",
"0.5184317",
"0.5183612",
"0.5163924",
"0.51602197",
"0.51586056",
"0.5157296",
"0.51540613",
"0.5152145",
"0.51466167",
"0.5144829",
"0.5144829",
"0.5136468",
"0.5133154",
"0.5133104",
"0.5123806",
"0.5123707"
] | 0.7149208 | 3 |
Created by zbsz on 2017/6/9. | public interface IFingerPrintView {
void onSetImg(Bitmap bmp);
void onText(String msg);
void onFpSucc(String msg);
} | {
"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\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 comer() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"private static void cajas() {\n\t\t\n\t}",
"private void poetries() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void comer() \r\n\t{\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}",
"public final void mo51373a() {\n }",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n }",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"public void mo38117a() {\n }",
"@Override\n void init() {\n }",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"private void init() {\n\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\n\tpublic void jugar() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n public void init() {\n\n }",
"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\tpublic void nghe() {\n\n\t}",
"@Override\n public void init() {}",
"@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\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"private void kk12() {\n\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\r\n\tpublic void init() {}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n protected void init() {\n }",
"private void m50366E() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\n\tpublic void init() {\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"protected boolean func_70814_o() { return true; }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n public int describeContents() { return 0; }",
"@Override\n\tpublic void init()\n\t{\n\n\t}",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"private Rekenhulp()\n\t{\n\t}",
"private void strin() {\n\n\t}",
"private void init() {\n\n\n\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}",
"public void mo6081a() {\n }",
"@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}",
"@Override\n public void initialize() { \n }",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"void berechneFlaeche() {\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 }",
"@Override\n\t\tpublic void init() {\n\t\t}",
"@Override\n public int retroceder() {\n return 0;\n }",
"@Override\n\tpublic int mettreAJour() {\n\t\treturn 0;\n\t}"
] | [
"0.6106053",
"0.594521",
"0.58975816",
"0.58557403",
"0.58557403",
"0.5837246",
"0.5754515",
"0.57414305",
"0.5737717",
"0.5714668",
"0.5673735",
"0.56708246",
"0.56705695",
"0.56687146",
"0.5665761",
"0.5662702",
"0.56527776",
"0.565138",
"0.5644952",
"0.563631",
"0.5615575",
"0.5594582",
"0.5594582",
"0.5594582",
"0.5594582",
"0.5594582",
"0.5573962",
"0.5568759",
"0.5555864",
"0.55557036",
"0.5540311",
"0.55331427",
"0.5528541",
"0.55227077",
"0.5515098",
"0.5511554",
"0.550297",
"0.5493383",
"0.54820573",
"0.54788375",
"0.54788375",
"0.54785144",
"0.5478261",
"0.5478261",
"0.5478261",
"0.54770434",
"0.5469554",
"0.54691124",
"0.54691124",
"0.54549724",
"0.54549724",
"0.54549724",
"0.54535496",
"0.54512715",
"0.5448325",
"0.54418206",
"0.54418206",
"0.54418206",
"0.5431907",
"0.542156",
"0.54192054",
"0.54192054",
"0.54192054",
"0.54192054",
"0.54192054",
"0.54192054",
"0.5413394",
"0.54100037",
"0.53989327",
"0.53986263",
"0.53958184",
"0.5389368",
"0.53844136",
"0.53844136",
"0.53842086",
"0.5376395",
"0.5375308",
"0.5372348",
"0.53514606",
"0.5348167",
"0.5338831",
"0.5331429",
"0.5331429",
"0.5331429",
"0.5331429",
"0.5331429",
"0.5331429",
"0.5331429",
"0.53243184",
"0.53174496",
"0.5317102",
"0.5314644",
"0.5306917",
"0.5302536",
"0.5296328",
"0.5293792",
"0.52911925",
"0.5280061",
"0.5266063",
"0.5247118",
"0.5244726"
] | 0.0 | -1 |
Use this factory method to create a new instance of this fragment using the provided parameters. | public static MaintainDeliveryRequestFragment newInstance(String userId, String mode) {
MaintainDeliveryRequestFragment fragment = new MaintainDeliveryRequestFragment();
Bundle args = new Bundle();
args.putString(ARG_USERID, userId);
args.putString(ARG_MODE, mode);
fragment.setArguments(args);
return fragment;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static FragmentTousWanted newInstance() {\n FragmentTousWanted fragment = new FragmentTousWanted();\n Bundle args = new Bundle();\n fragment.setArguments(args);\n return fragment;\n }",
"protected abstract Fragment createFragment();",
"public void createFragment() {\n\n }",
"@Override\n protected Fragment createFragment() {\n Intent intent = getIntent();\n\n long id = intent.getLongExtra(MovieDetailFragment.EXTRA_ID, -1);\n return MovieDetailFragment.newInstance(id);\n }",
"public CuartoFragment() {\n }",
"public StintFragment() {\n }",
"public ExploreFragment() {\n\n }",
"public RickAndMortyFragment() {\n }",
"public FragmentMy() {\n }",
"public LogFragment() {\n }",
"public FeedFragment() {\n }",
"public HistoryFragment() {\n }",
"public HistoryFragment() {\n }",
"public static MyFeedFragment newInstance() {\n return new MyFeedFragment();\n }",
"public WkfFragment() {\n }",
"public static ScheduleFragment newInstance() {\n ScheduleFragment fragment = new ScheduleFragment();\n Bundle args = new Bundle();\n //args.putString(ARG_PARAM1, param1);\n //args.putString(ARG_PARAM2, param2);\n fragment.setArguments(args);\n return fragment;\n }",
"public ProfileFragment(){}",
"public WelcomeFragment() {}",
"public static ForumFragment newInstance() {\n ForumFragment fragment = new ForumFragment();\n Bundle args = new Bundle();\n fragment.setArguments(args);\n\n return fragment;\n }",
"public static NotificationFragment newInstance() {\n NotificationFragment fragment = new NotificationFragment();\n Bundle args = new Bundle();\n// args.putString(ARG_PARAM1, param1);\n// args.putString(ARG_PARAM2, param2);\n fragment.setArguments(args);\n return fragment;\n }",
"public progFragment() {\n }",
"public HeaderFragment() {}",
"public static RouteFragment newInstance() {\n RouteFragment fragment = new RouteFragment();\n Bundle args = new Bundle();\n //fragment.setArguments(args);\n return fragment;\n }",
"public EmployeeFragment() {\n }",
"public Fragment_Tutorial() {}",
"public NewShopFragment() {\n }",
"public FavoriteFragment() {\n }",
"public static MyCourseFragment newInstance() {\n MyCourseFragment fragment = new MyCourseFragment();\r\n// fragment.setArguments(args);\r\n return fragment;\r\n }",
"public static MessageFragment newInstance() {\n MessageFragment fragment = new MessageFragment();\n Bundle args = new Bundle();\n\n fragment.setArguments(args);\n return fragment;\n }",
"public static ReservationFragment newInstance() {\n\n ReservationFragment _fragment = new ReservationFragment();\n// Bundle args = new Bundle();\n// args.putString(ARG_PARAM1, param1);\n// args.putString(ARG_PARAM2, param2);\n// fragment.setArguments(args);\n return _fragment;\n }",
"public CreateEventFragment() {\n // Required empty public constructor\n }",
"public static RecipeListFragment newInstance() {\n RecipeListFragment fragment = new RecipeListFragment();\n// Bundle args = new Bundle();\n// args.putString(ARG_PARAM1, param1);\n// args.putString(ARG_PARAM2, param2);\n// fragment.setArguments(args);\n return fragment;\n }",
"public static Fragment newInstance() {\n\t\treturn new ScreenSlidePageFragment();\n\t}",
"public NoteActivityFragment() {\n }",
"public static WeekViewFragment newInstance(int param1, int param2) {\n WeekViewFragment fragment = new WeekViewFragment();\n //WeekViewFragment 객체 생성\n Bundle args = new Bundle();\n //Bundle 객체 생성\n args.putInt(ARG_PARAM1, param1);\n //ARG_PARAM1에 param1의 정수값 넣어서 args에 저장\n args.putInt(ARG_PARAM2, param2);\n //ARG_PARAM2에 param2의 정수값 넣어서 args에 저장\n fragment.setArguments(args);\n //args를 매개변수로 한 setArguments() 메소드 수행하여 fragment에 저장\n return fragment; //fragment 반환\n }",
"public static Fragment0 newInstance(String param1, String param2) {\n Fragment0 fragment = new Fragment0();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, param1);\n args.putString(ARG_PARAM2, param2);\n fragment.setArguments(args);\n return fragment;\n }",
"public static QueenBEmbassyF newInstance() {\n QueenBEmbassyF fragment = new QueenBEmbassyF();\n //the way to pass arguments between fragments\n Bundle args = new Bundle();\n\n fragment.setArguments(args);\n return fragment;\n }",
"public static Fragment newInstance() {\n StatisticsFragment fragment = new StatisticsFragment();\n Bundle args = new Bundle();\n fragment.setArguments(args);\n return fragment;\n }",
"public EventHistoryFragment() {\n\t}",
"public HomeFragment() {}",
"public PeopleFragment() {\n // Required empty public constructor\n }",
"public static FeedFragment newInstance() {\n FeedFragment fragment = new FeedFragment();\n return fragment;\n }",
"public static MainFragment newInstance(String param1, String param2) {\n MainFragment fragment = new MainFragment();\n Bundle args = new Bundle();\n fragment.setArguments(args);\n return fragment;\n }",
"public VantaggiFragment() {\n // Required empty public constructor\n }",
"public AddressDetailFragment() {\n }",
"public ArticleDetailFragment() { }",
"public static DropboxMainFrag newInstance() {\n DropboxMainFrag fragment = new DropboxMainFrag();\n // set arguments in Bundle\n return fragment;\n }",
"public RegisterFragment() {\n }",
"public EmailFragment() {\n }",
"public static CommentFragment newInstance() {\n CommentFragment fragment = new CommentFragment();\n\n return fragment;\n }",
"public static FragmentComida newInstance(String param1) {\n FragmentComida fragment = new FragmentComida();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, param1);\n fragment.setArguments(args);\n return fragment;\n\n\n }",
"public static ParqueosFragment newInstance() {\n ParqueosFragment fragment = new ParqueosFragment();\n return fragment;\n }",
"public ForecastFragment() {\n }",
"public FExDetailFragment() {\n \t}",
"public static AddressFragment newInstance(String param1) {\n AddressFragment fragment = new AddressFragment();\n\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, param1);\n fragment.setArguments(args);\n\n return fragment;\n }",
"public TripNoteFragment() {\n }",
"public ItemFragment() {\n }",
"public NoteListFragment() {\n }",
"public CreatePatientFragment() {\n\n }",
"public DisplayFragment() {\n\n }",
"public static frag4_viewcompliment newInstance(String param1, String param2) {\r\n frag4_viewcompliment fragment = new frag4_viewcompliment();\r\n Bundle args = new Bundle();\r\n args.putString(ARG_PARAM1, param1);\r\n args.putString(ARG_PARAM2, param2);\r\n fragment.setArguments(args);\r\n return fragment;\r\n }",
"public static fragment_profile newInstance(String param1, String param2) {\n fragment_profile fragment = new fragment_profile();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, param1);\n args.putString(ARG_PARAM2, param2);\n fragment.setArguments(args);\n return fragment;\n }",
"@Override\n\tprotected Fragment createFragment() {\n\t\treturn new FormFragment();\n\t}",
"public static MainFragment newInstance() {\n MainFragment fragment = new MainFragment();\n Bundle args = new Bundle();\n fragment.setArguments(args);\n return fragment;\n }",
"public ProfileFragment() {\n\n }",
"public BackEndFragment() {\n }",
"public CustomerFragment() {\n }",
"public static FriendsFragment newInstance(int sectionNumber) {\n \tFriendsFragment fragment = new FriendsFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }",
"public ArticleDetailFragment() {\n }",
"public ArticleDetailFragment() {\n }",
"public ArticleDetailFragment() {\n }",
"public static Fragment newInstance() {\n return new SettingsFragment();\n }",
"public SummaryFragment newInstance()\n {\n return new SummaryFragment();\n }",
"public PeersFragment() {\n }",
"public TagsFragment() {\n }",
"public static ProfileFragment newInstance() {\n ProfileFragment fragment = new ProfileFragment();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, \"\");\n args.putString(ARG_PARAM2, \"\");\n fragment.setArguments(args);\n return fragment;\n }",
"public static FriendsFragment newInstance() {\n FriendsFragment fragment = new FriendsFragment();\n\n return fragment;\n }",
"public HomeSectionFragment() {\n\t}",
"public static FirstFragment newInstance(String text) {\n\n FirstFragment f = new FirstFragment();\n Bundle b = new Bundle();\n b.putString(\"msg\", text);\n\n f.setArguments(b);\n\n return f;\n }",
"public PersonDetailFragment() {\r\n }",
"public static LogFragment newInstance(Bundle params) {\n LogFragment fragment = new LogFragment();\n fragment.setArguments(params);\n return fragment;\n }",
"public RegisterFragment() {\n // Required empty public constructor\n }",
"public VehicleFragment() {\r\n }",
"public static Fine newInstance(String param1, String param2) {\n Fine fragment = new Fine();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, param1);\n args.putString(ARG_PARAM2, param2);\n fragment.setArguments(args);\n return fragment;\n }",
"public static FriendsFragment newInstance(String param1, String param2) {\n FriendsFragment fragment = new FriendsFragment();\n Bundle args = new Bundle();\n fragment.setArguments(args);\n return fragment;\n }",
"public static ChangesViewFragment newInstance() {\n\t\tChangesViewFragment fragment = new ChangesViewFragment();\n\t\tBundle args = new Bundle();\n\t\targs.putInt(HomeViewActivity.ARG_SECTION_NUMBER, 2);\n\t\tfragment.setArguments(args);\n\t\treturn fragment;\n\t}",
"public static NoteFragment newInstance(String param1, String param2) {\n NoteFragment fragment = new NoteFragment();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, param1);\n args.putString(ARG_PARAM2, param2);\n fragment.setArguments(args);\n return fragment;\n }",
"public static MainFragment newInstance(Context context) {\n MainFragment fragment = new MainFragment();\n if(context != null)\n fragment.setVariables(context);\n return fragment;\n }",
"@Override\n\tprotected Fragment createFragment() {\n\t\treturn new CrimeListFragment();\n\t}",
"public static MoneyLogFragment newInstance() {\n MoneyLogFragment fragment = new MoneyLogFragment();\n return fragment;\n }",
"public static ForecastFragment newInstance() {\n\n //Create new fragment\n ForecastFragment frag = new ForecastFragment();\n return(frag);\n }",
"public static MainFragment newInstance(String param1, String param2) {\n MainFragment fragment = new MainFragment();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, param1);\n args.putString(ARG_PARAM2, param2);\n fragment.setArguments(args);\n return fragment;\n }",
"public static MainFragment newInstance(String param1, String param2) {\n MainFragment fragment = new MainFragment();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, param1);\n args.putString(ARG_PARAM2, param2);\n fragment.setArguments(args);\n return fragment;\n }",
"public static MainFragment newInstance(String param1, String param2) {\n MainFragment fragment = new MainFragment();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, param1);\n args.putString(ARG_PARAM2, param2);\n fragment.setArguments(args);\n return fragment;\n }",
"public static MyTaskFragment newInstance(String param1) {\n MyTaskFragment fragment = new MyTaskFragment();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, param1);\n fragment.setArguments(args);\n return fragment;\n }",
"public static MyProfileFragment newInstance(String param1, String param2) {\n MyProfileFragment fragment = new MyProfileFragment();\n return fragment;\n }",
"public static MainFragment newInstance(int param1, String param2) {\n MainFragment fragment = new MainFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_PARAM1, param1);\n\n args.putString(ARG_PARAM2, param2);\n fragment.setArguments(args);\n return fragment;\n }",
"public PlaylistFragment() {\n }",
"public static HistoryFragment newInstance() {\n HistoryFragment fragment = new HistoryFragment();\n return fragment;\n }",
"public static SurvivorIncidentFormFragment newInstance(String param1, String param2) {\n// SurvivorIncidentFormFragment fragment = new SurvivorIncidentFormFragment();\n// Bundle args = new Bundle();\n// args.putString(ARG_PARAM1, param1);\n// args.putString(ARG_PARAM2, param2);\n// fragment.setArguments(args);\n// return fragment;\n\n SurvivorIncidentFormFragment fragment = new SurvivorIncidentFormFragment();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, param1);\n args.putString(ARG_PARAM2, param2);\n fragment.setArguments(args);\n return fragment;\n\n\n }",
"public static PersonalFragment newInstance(String param1, String param2) {\n PersonalFragment fragment = new PersonalFragment();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, param1);\n args.putString(ARG_PARAM2, param2);\n fragment.setArguments(args);\n return fragment;\n }"
] | [
"0.7259329",
"0.72331375",
"0.71140355",
"0.69909847",
"0.69902235",
"0.6834592",
"0.683074",
"0.68134046",
"0.6801526",
"0.6801054",
"0.67653185",
"0.6739714",
"0.6739714",
"0.6727412",
"0.6717231",
"0.6705855",
"0.6692112",
"0.6691661",
"0.66869426",
"0.66606814",
"0.6646188",
"0.66410166",
"0.6640725",
"0.6634425",
"0.66188246",
"0.66140765",
"0.6608169",
"0.66045964",
"0.65977716",
"0.6592119",
"0.659137",
"0.65910816",
"0.65830594",
"0.65786606",
"0.6562876",
"0.65607685",
"0.6557126",
"0.65513307",
"0.65510213",
"0.65431285",
"0.6540448",
"0.65336084",
"0.6532555",
"0.6528302",
"0.6524409",
"0.652328",
"0.6523149",
"0.6516528",
"0.65049976",
"0.6497274",
"0.6497235",
"0.64949715",
"0.64944136",
"0.6484968",
"0.6484214",
"0.64805835",
"0.64784926",
"0.64755154",
"0.64710265",
"0.6466466",
"0.6457089",
"0.645606",
"0.6454554",
"0.6452161",
"0.64520335",
"0.6450325",
"0.64488834",
"0.6446765",
"0.64430225",
"0.64430225",
"0.64430225",
"0.64420956",
"0.6441306",
"0.64411277",
"0.6438451",
"0.64345145",
"0.64289486",
"0.64287597",
"0.6423755",
"0.64193285",
"0.6418699",
"0.6414679",
"0.6412867",
"0.6402168",
"0.6400724",
"0.6395624",
"0.6395109",
"0.6391252",
"0.63891554",
"0.63835025",
"0.63788056",
"0.63751805",
"0.63751805",
"0.63751805",
"0.6374796",
"0.63653135",
"0.6364529",
"0.6360922",
"0.63538784",
"0.6351111",
"0.635067"
] | 0.0 | -1 |
Inflate the layout for this fragment | @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_maintain_delivery_request, container, false);
//setup reference to UI Objects and setup listener for buttons
mOrderNumberETxt = (EditText) view.findViewById(R.id.order_number);
mRestaurantNameETxt = (EditText) view.findViewById(R.id.restaurant_name);
mSelectRestaurantAddressBtn = (Button) view.findViewById(R.id.select_restaurant_address_btn);
mSelectRestaurantAddressBtn.setOnClickListener(this);
mSelectDeliveryAddressBtn = (Button) view.findViewById(R.id.select_delivery_address_btn);
mSelectDeliveryAddressBtn.setOnClickListener(this);
Button actionBtn = (Button) view.findViewById(R.id.action_button);
actionBtn.setOnClickListener(this);
Button cancelBtn = (Button) view.findViewById(R.id.cancel_btn);
cancelBtn.setOnClickListener(this);
if(mMode == NEW_DEL_REQ_MODE){
actionBtn.setText(R.string.create_request);
}else if (mMode == VIEW_DEL_REQ_MODE){
//reserve for future use
}
//setup firebase database reference
mDatabase = FirebaseDatabase.getInstance().getReference();
return view;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_main_allinfo, container, false);\n }",
"@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n\t\t\tBundle savedInstanceState) {\n\t\treturn inflater.inflate(R.layout.wallpager_layout, null);\r\n\t}",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_invit_friends, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View inflate = inflater.inflate(R.layout.fragment_zhuye, container, false);\n initView(inflate);\n initData();\n return inflate;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.fragment_posts, parent, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n return inflater.inflate(R.layout.ilustration_fragment, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_sow_drug_cost_per_week, container, false);\n\n db = new DataBaseAdapter(getActivity());\n hc = new HelperClass();\n pop = new FeedSowsFragment();\n\n infltr = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n parent = (LinearLayout) v.findViewById(R.id.layout_for_add);\n tvTotalCost = (TextView) v.findViewById(R.id.totalCost);\n\n getData();\n setData();\n\n return v;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_stream_list, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_event, container, false);\n\n\n\n\n\n\n\n\n return v;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_feed, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.screen_select_list_student, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_overall, container, false);\n mNamesLayout = (LinearLayout) rootView.findViewById(R.id.fragment_overall_names_layout);\n mOverallView = (OverallView) rootView.findViewById(R.id.fragment_overall_view);\n return rootView;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState)\n {\n\n\n view = inflater.inflate(R.layout.fragment_earning_fragmant, container, false);\n ini(view);\n return view;\n }",
"@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n super.onCreateView(inflater, container, savedInstanceState);\n final View rootview = inflater.inflate(R.layout.activity_email_frag, container, false);\n ConfigInnerElements(rootview);\n return rootview;\n }",
"@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n\t\t\tBundle savedInstanceState) {\n\t\trootView = inflater.inflate(R.layout.fragment_attack_armor, container, false);\r\n\r\n\t\tfindInterfaceElements();\r\n\t\taddRangeSelector();\r\n\t\tupdateHeadings();\r\n\t\tsetListeners();\r\n\r\n\t\tsetFromData();\r\n\r\n\t\treturn rootView;\r\n\t}",
"@SuppressLint(\"InflateParams\")\r\n\t@Override\r\n\tpublic View initLayout(LayoutInflater inflater) {\n\t\tView view = inflater.inflate(R.layout.frag_customer_all, null);\r\n\t\treturn view;\r\n\t}",
"@Override\r\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_fore_cast, container, false);\r\n initView();\r\n mainLayout.setVisibility(View.GONE);\r\n apiInterface = RestClinet.getClient().create(ApiInterface.class);\r\n loadData();\r\n return view;\r\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_friend, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n rootView = inflater.inflate(R.layout.fragment_detail, container, false);\n image = rootView.findViewById(R.id.fr_image);\n name = rootView.findViewById(R.id.fr_name);\n phoneNumber = rootView.findViewById(R.id.fr_phone_number);\n email = rootView.findViewById(R.id.fr_email);\n street = rootView.findViewById(R.id.fr_street);\n city = rootView.findViewById(R.id.fr_city);\n state = rootView.findViewById(R.id.fr_state);\n zipcode = rootView.findViewById(R.id.fr_zipcode);\n dBrith = rootView.findViewById(R.id.date_brith);\n return rootView;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_pm25, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_kkbox_playlist, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_feed_pager, container, false);\n\n// loadData();\n\n findViews(rootView);\n\n setViews();\n\n return rootView;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n layout = (FrameLayout) inflater.inflate(R.layout.fragment_actualites, container, false);\n\n relLayout = (RelativeLayout) layout.findViewById(R.id.relLayoutActus);\n\n initListView();\n getXMLData();\n\n return layout;\n }",
"@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n rootView = inflater.inflate(R.layout.frag_post_prayer_video, container, false);\n setCustomDesign();\n setCustomClickListeners();\n return rootView;\n }",
"@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\t\treturn inflater.inflate(R.layout.lf_em4305_fragment, container, false);\n\t}",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_recordings, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view=inflater.inflate(R.layout.fragment_category, container, false);\n initView(view);\n bindRefreshListener();\n loadParams();\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_cm_box_details, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view=inflater.inflate(R.layout.fragment_layout12, container, false);\n\n iniv();\n\n init();\n\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_details, container, false);\n //return inflater.inflate(R.layout.fragment_details, container, false);\n getIntentValues();\n initViews();\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_mem_body_blood, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_qiugouxiaoxi, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View inflate = inflater.inflate(R.layout.fragment_coll_blank, container, false);\n initView(inflate);\n initData();\n return inflate;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_attendance_divide, container, false);\n\n initView(view);\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.show_program_fragment, parent, false);\n }",
"@Override\n public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,\n @Nullable Bundle savedInstanceState) {\n return inflater.inflate(R.layout.visualization_fragment, container, false);\n\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n rootView = inflater.inflate(R.layout.fragment_category_details_page, container, false);\n initializeAll();\n\n return rootView;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n final View v = inflater.inflate(R.layout.fragemnt_reserve, container, false);\n\n\n\n\n return v;\n }",
"protected int getLayoutResId() {\n return R.layout.activity_fragment;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_all_quizs, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n role = getArguments().getInt(\"role\");\n rootview = inflater.inflate(R.layout.fragment_application, container, false);\n layout = rootview.findViewById(R.id.patentDetails);\n progressBar = rootview.findViewById(R.id.progressBar);\n try {\n run();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return rootview;\n }",
"@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\t\tview = inflater.inflate(R.layout.fragment_zhu, null);\n\t\tinitView();\n\t\tinitData();\n\t\treturn view;\n\t}",
"@Override\n\t\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)\n\t\t{\n\t\t\tView rootView = inflater.inflate(R.layout.maimfragment, container, false);\n\t\t\treturn rootView;\n\t\t}",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n // Inflate the layout for this fragment\n return inflater.inflate(R.layout.fragment__record__week, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_porishongkhan, container, false);\n\n\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_dashboard, container, false);\n resultsRv = view.findViewById(R.id.db_results_rv);\n resultText = view.findViewById(R.id.db_search_empty);\n progressBar = view.findViewById(R.id.db_progressbar);\n lastVisitText = view.findViewById(R.id.db_last_visit);\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(getLayoutId(), container, false);\n init(view);\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_feedback, container, false);\n self = getActivity();\n initUI(view);\n initControlUI();\n initData();\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_service_summery, container, false);\n tvVoiceMS = v.findViewById(R.id.tvVoiceValue);\n tvDataMS = v.findViewById(R.id.tvdataValue);\n tvSMSMS = v.findViewById(R.id.tvSMSValue);\n tvVoiceFL = v.findViewById(R.id.tvVoiceFLValue);\n tvDataBS = v.findViewById(R.id.tvDataBRValue);\n tvTotal = v.findViewById(R.id.tvTotalAccountvalue);\n return v;\n }",
"@Override\r\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_clan_rank_details, container, false);\r\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_star_wars_list, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View inflate = inflater.inflate(R.layout.fragment_lei, container, false);\n\n initView(inflate);\n initData();\n return inflate;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_quotation, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_wode_ragment, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n\n\n\n\n\n return inflater.inflate(R.layout.fragment_appoint_list, parent, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n if (rootView == null) {\n rootView = inflater.inflate(R.layout.fragment_ip_info, container, false);\n initView();\n }\n return rootView;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_offer, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_rooms, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n\n View view = inflater.inflate(R.layout.fragment_img_eva, container, false);\n\n getSendData();\n\n initView(view);\n\n initData();\n\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_project_collection, container, false);\n ButterKnife.bind(this, view);\n fragment = this;\n initView();\n getCollectionType();\n // getCategoryList();\n initBroadcastReceiver();\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_yzm, container, false);\n initView(view);\n return view;\n }",
"@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n\t\tmainLayout = inflater.inflate(R.layout.fragment_play, container, false);\r\n\t\treturn mainLayout;\r\n\t}",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_invite_request, container, false);\n initialiseVariables();\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n getLocationPermission();\n return inflater.inflate(R.layout.centrum_fragment, container, false);\n\n\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_habit_type_details, container, false);\n\n habitTitle = rootView.findViewById(R.id.textViewTitle);\n habitReason = rootView.findViewById(R.id.textViewReason);\n habitStartDate = rootView.findViewById(R.id.textViewStartDate);\n habitWeeklyPlan = rootView.findViewById(R.id.textViewWeeklyPlan);\n\n return rootView;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_information_friends4, container, false);\n\n if (getArguments() != null) {\n FriendsID = getArguments().getString(\"keyFriends\");\n }\n\n return v;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_post_details, container, false);\n\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_hotel, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view=inflater.inflate(R.layout.fragment_bus_inquiry, container, false);\n initView();\n initData();\n initDialog();\n getDataFromNet();\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_weather, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_srgl, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_ground_detail_frgment, container, false);\n init();\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_book_appointment, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_wheretogo, container, false);\n ids();\n setup();\n click();\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n binding = DataBindingUtil\n .inflate(inflater, R.layout.fragment_learning_leaders, container, false);\n init();\n\n return rootView;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_end_game_tab, container, false);\n\n setupWidgets();\n setupTextFields(view);\n setupSpinners(view);\n\n // Inflate the layout for this fragment\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.memoir_fragment, container, false);\n\n getUserIdFromSharedPref();\n configureUI(view);\n configureSortSpinner();\n configureFilterSpinner();\n\n networkConnection = new NetworkConnection();\n new GetAllMemoirTask().execute();\n\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_jadwal, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_delivery_detail, container, false);\n initialise();\n\n\n\n return view;\n }",
"@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_4, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_all_product, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_group_details, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment06_7, container, false);\n initView(view);\n setLegend();\n setXAxis();\n setYAxis();\n setData();\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_downloadables, container, false);\n }",
"@Override\n public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.movie_list_fragment, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_like, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_hall, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_unit_main, container, false);\n TextView mTxvBusinessAassistant = (TextView) view.findViewById(R.id.txv_business_assistant);\n TextView mTxvCardINformation = (TextView) view.findViewById(R.id.txv_card_information);\n RelativeLayout mRelOfficialWebsite = (RelativeLayout) view.findViewById(R.id.rel_official_website);\n RelativeLayout mRelPictureAblum = (RelativeLayout) view.findViewById(R.id.rel_picture_album);\n TextView mTxvQrCodeCard = (TextView) view.findViewById(R.id.txv_qr_code_card);\n TextView mTxvShareCard = (TextView) view.findViewById(R.id.txv_share_card);\n mTxvBusinessAassistant.setOnClickListener(this.mOnClickListener);\n mTxvCardINformation.setOnClickListener(this.mOnClickListener);\n mRelOfficialWebsite.setOnClickListener(this.mOnClickListener);\n mRelPictureAblum.setOnClickListener(this.mOnClickListener);\n mTxvQrCodeCard.setOnClickListener(this.mOnClickListener);\n mTxvShareCard.setOnClickListener(this.mOnClickListener);\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_moviespage, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_s, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_overview, container, false);\n\n initOverviewComponents(view);\n registerListeners();\n initTagListener();\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_bahan_ajar, container, false);\n initView(view);\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n root = (ViewGroup) inflater.inflate(R.layout.money_main, container, false);\n context = getActivity();\n initHeaderView(root);\n initView(root);\n\n getDate();\n initEvetn();\n return root;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.fragment_historical_event, parent, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_event_details, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_video, container, false);\n unbinder = ButterKnife.bind(this, view);\n initView();\n initData();\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n\n v= inflater.inflate(R.layout.fragment_post_contacts, container, false);\n this.mapping(v);\n return v;\n }",
"@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_measures, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_feed, container, false);\n findViews(view);\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_surah_list, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_data_binded, container, false);\n }"
] | [
"0.6739604",
"0.67235583",
"0.6721706",
"0.6698254",
"0.6691869",
"0.6687986",
"0.66869223",
"0.6684548",
"0.66766286",
"0.6674615",
"0.66654444",
"0.66654384",
"0.6664403",
"0.66596216",
"0.6653321",
"0.6647136",
"0.66423255",
"0.66388357",
"0.6637491",
"0.6634193",
"0.6625158",
"0.66195583",
"0.66164845",
"0.6608733",
"0.6596594",
"0.65928894",
"0.6585293",
"0.65842897",
"0.65730995",
"0.6571248",
"0.6569152",
"0.65689117",
"0.656853",
"0.6566686",
"0.65652984",
"0.6553419",
"0.65525705",
"0.65432084",
"0.6542382",
"0.65411425",
"0.6538022",
"0.65366334",
"0.65355957",
"0.6535043",
"0.65329415",
"0.65311074",
"0.65310687",
"0.6528645",
"0.65277404",
"0.6525902",
"0.6524516",
"0.6524048",
"0.65232015",
"0.65224624",
"0.65185034",
"0.65130377",
"0.6512968",
"0.65122765",
"0.65116245",
"0.65106046",
"0.65103024",
"0.6509013",
"0.65088093",
"0.6508651",
"0.6508225",
"0.6504662",
"0.650149",
"0.65011525",
"0.6500686",
"0.64974767",
"0.64935696",
"0.6492234",
"0.6490034",
"0.6487609",
"0.6487216",
"0.64872116",
"0.6486594",
"0.64861935",
"0.6486018",
"0.6484269",
"0.648366",
"0.6481476",
"0.6481086",
"0.6480985",
"0.6480396",
"0.64797544",
"0.647696",
"0.64758915",
"0.6475649",
"0.6474114",
"0.6474004",
"0.6470706",
"0.6470275",
"0.64702207",
"0.6470039",
"0.6467449",
"0.646602",
"0.6462256",
"0.64617974",
"0.6461681",
"0.6461214"
] | 0.0 | -1 |
This interface must be implemented by activities that contain this fragment to allow an interaction in this fragment to be communicated to the activity and potentially other fragments contained in that activity. See the Android Training lesson Communicating with Other Fragments for more information. | public interface OnFragmentInteractionListener {
void onFinishCreatingRequest();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public interface OnFragmentInteractionListener {\n void onFragmentMessage(String TAG, Object data);\n}",
"public interface FragmentInteraction {\n void switchToBoardView();\n void switchToPinsView();\n void switchToPins(PDKBoard pdkBoard);\n void switchToDescription(PDKPin pin);\n}",
"public interface IFragmentView {\n public Activity getActivity();\n public void onItemClick(int position);\n}",
"public interface OnFragmentInteractionListener {\n void onMainFragmentInteraction(String string);\n }",
"@Override\n public void onAttach(Context context) {\n super.onAttach(context);\n if (context instanceof RequestFragmentInterface) {\n mInterface = (RequestFragmentInterface) context;\n } else {\n throw new RuntimeException(context.toString()\n + \" must implement OnFragmentInteractionListener\");\n }\n }",
"public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n public void onCallBellPressed(MessageReason reason);\n }",
"void onFragmentInteraction();",
"void onFragmentInteraction();",
"void onFragmentInteraction();",
"public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n\n\n void onFragmentInteraction(String mId, String mProductName, String mItemRate, int minteger, int update);\n }",
"public interface OnFragmentInteractionListener {\n public void onFragmentInteraction(String id);\n }",
"public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n void onFragmentInteraction();\n }",
"public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n public void onComidaSelected(int comidaId);\n }",
"public interface OnFragmentInteractionListener {\n public void onFragmentInteraction(Qualification q);\n }",
"public interface OnFragmentInteractionListener {\n void onReceiverAcceptRequest(int nextState, String requestId);\n }",
"public interface FragMainLife\n{\n\tpublic void onResumeFragMainLife();\n}",
"public interface OnFragmentListener {\n\n void onAction(Intent intent);\n}",
"public interface IBaseFragmentActivity {\n void onFragmentExit(BaseFragment fragment);\n\n void onFragmentStartLoading(BaseFragment fragment);\n\n void onFragmentFinishLoad(BaseFragment fragment);\n}",
"public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n void onFragmentInteraction(String string);\n }",
"void onFragmentInteraction(Object ref);",
"public interface OnParametersFragmentInteractionListener {\n public void startTask();\n }",
"public interface OnFragmentInteractionListener {\n // Update argument type and name\n public void onFragmentInteraction(String id);\n }",
"public interface OnFragmentInteractionListener {\n void onFragmentInteraction(Parcelable selectedItem);\n }",
"public interface FragmentInterface {\r\n void fragmentBecameVisible();\r\n}",
"public interface OnFragmentInteractionListener {\n public void onFragmentInteraction(String key);\n }",
"public interface OnFragmentInteractionListener {\n void newList();\n\n void searchList();\n }",
"public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n void pasarALista();\n }",
"public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n\n /**\n * This interface's single method. The hosting Activity must implement this interface and\n * provide an implementation of this method so that this Fragment can communicate with the\n * Activity.\n *\n * @param spotId\n */\n// void onFragmentInteraction(Uri uri);\n void onFragmentInteraction(int spotId);\n// void onFragmentInteraction(LatLng spotPosition);\n\n }",
"public interface MainGameActivityCallBacks {\n public void onMsgFromFragmentToMainGame(String sender, String strValue);\n}",
"public interface IFragment {\n void onFragmentRefresh();\n\n void onMenuClick();\n}",
"public interface FragmentInterface {\n\n void onCreate();\n\n void initLayout();\n\n void updateLayout();\n\n void sendInitialRequest();\n}",
"public interface OnFragmentInteractionListener {\n void onFragmentInteraction(String accessToken, String network);\n }",
"public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n void onFragmentInteraction(View v);\n }",
"public interface OnFragmentInteractionListener {\n void swapFragments(SetupActivity.SetupActivityFragmentType type);\n\n void addServer(String name, String ipAddress, String port);\n }",
"public interface OnFragmentInteractionListener {\n\t\tvoid restUp(IGameState gameState);\n\t\tvoid restartGame();\n\t}",
"public interface OnFragmentInteractionListener\n {\n // TODO: Update argument type and name\n public void onFragmentInteraction(String id);\n }",
"public interface PersonalFragmentView extends BaseMvpView {\n\n}",
"public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n public void onFragmentInteraction(String id);\n }",
"public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n public void onFragmentInteraction(String id);\n }",
"public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n public void onFragmentInteraction(String id);\n }",
"public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n public void onFragmentInteraction(String id);\n }",
"public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n public void onFragmentInteraction(String id);\n }",
"public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n public void onFragmentInteraction(String id);\n }",
"public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n public void onFragmentInteraction(String id);\n }",
"public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n public void onFragmentInteraction(String id);\n }",
"public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n public void onFragmentInteraction(String id);\n }",
"void onFragmentInteraction(View v);",
"public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n void onFragmentInteraction(ArrayList<Recepie> recepieList);\n }",
"public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n void onFragmentInteraction(String id);\n }",
"void onFragmentInteractionMain();",
"public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n public void showRestaurantDetail(Map<String, Object> objectMap);\n\n public void showAddRestaurantFragment(String location);\n }",
"public interface FragmentNavigator {\n\n void SwitchFragment(Fragment fragment);\n}",
"public interface FragmentModellnt {\n void FragmentM(OnFinishListener onFinishListener,String dataId);\n}",
"public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n //void onFragmentInteraction(Uri uri);\n }",
"void onFragmentInteraction(String id);",
"public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n void onFragmentInteraction(ArrayList naleznosci, String KLUCZ);\n }",
"public interface OnFragmentInteractionListener {\r\n // TODO: Update argument type and name\r\n void onEditFragmentInteraction(Student student);\r\n }",
"public interface OnFragmentInteractionListener {\n void onStartFragmentStarted();\n\n void onStartFragmentStartTracking();\n\n void onStartFragmentStopTracking();\n }",
"public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n Long onFragmentInteraction();\n }",
"public interface OnFragmentInteractionListener {\n void onFragmentInteraction(Uri uri);\n void onFragmentInteraction(String id);\n}",
"public interface IBaseFragment extends IBaseView {\n /**\n * 出栈到目标fragment\n * @param targetFragmentClass 目标fragment\n * @param includeTargetFragment 是否包涵目标fragment\n * true 目标fragment也出栈\n * false 出栈到目标fragment,目标fragment不出栈\n */\n void popToFragment(Class<?> targetFragmentClass, boolean includeTargetFragment);\n\n /**\n * 跳转到新的fragment\n * @param supportFragment 新的fragment继承SupportFragment\n */\n void startNewFragment(@NonNull SupportFragment supportFragment);\n\n /**\n * 跳转到新的fragment并出栈当前fragment\n * @param supportFragment\n */\n void startNewFragmentWithPop(@NonNull SupportFragment supportFragment);\n\n /**\n * 跳转到新的fragment并返回结果\n * @param supportFragment\n * @param requestCode\n */\n void startNewFragmentForResult(@NonNull SupportFragment supportFragment,int requestCode);\n\n /**\n * 设置fragment返回的result\n * @param requestCode\n * @param bundle\n */\n void setOnFragmentResult(int requestCode, Bundle bundle);\n\n /**\n * 跳转到新的Activity\n * @param clz\n */\n void startNewActivity(@NonNull Class<?> clz);\n\n /**\n * 携带数据跳转到新的Activity\n * @param clz\n * @param bundle\n */\n void startNewActivity(@NonNull Class<?> clz,Bundle bundle);\n\n /**\n * 携带数据跳转到新的Activity并返回结果\n * @param clz\n * @param bundle\n * @param requestCode\n */\n void startNewActivityForResult(@NonNull Class<?> clz,Bundle bundle,int requestCode);\n\n /**\n * 当前Fragment是否可见\n * @return true 可见,false 不可见\n */\n boolean isVisiable();\n\n /**\n * 获取当前fragment绑定的activity\n * @return\n */\n Activity getBindActivity();\n\n}",
"public void onFragmentInteraction(String id);",
"public void onFragmentInteraction(String id);",
"public void onFragmentInteraction(String id);",
"public void onFragmentInteraction(String id);",
"public void onFragmentInteraction(String id);",
"public void onFragmentInteraction(String id);",
"public void onFragmentInteraction(String id);",
"public void onFragmentInteraction(String id);",
"public void onFragmentInteraction(String id);",
"public void onFragmentInteraction(String id);",
"public void onFragmentInteraction(String id);",
"public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n void onSocialLoginInteraction();\n }",
"public interface OnFragmentInteractionListener {\n /**\n * On fragment interaction.\n *\n * @param uri the uri\n */\n// TODO: Update argument type and name\n public void onFragmentInteraction(Uri uri);\n }",
"public interface OnFragmentListener {\n void onClick(Fragment fragment);\n}",
"public interface LoginFragmentListener {\n public void OnRegisterClicked();\n public void OnLoginClicked(String User, String Pass);\n}",
"public interface OnFragmentInteractionListener {\n void playGame(Uri location);\n }",
"public interface MoveFragment {\n\n\n public void moveFragment(Fragment selectedFragment);\n\n}",
"public interface FragmentInterface {\n public void fragmentResult(Fragment fragment, String title);\n}",
"public interface ChangeFragmentListener {\n void changeFragment();\n}",
"public interface OnProductItemFragmentInteraction{\r\n public void itemSelected(Producto product);\r\n }",
"@Override\n public void onAttach(Context context) {\n super.onAttach(context);\n //this registers this fragment to recieve any EventBus\n EventBus.getDefault().register(this);\n }",
"public interface AddFarmFragmentView extends BaseView {\n\n\n}",
"void onFragmentInteraction(int position);",
"void OpenFragmentInteraction();",
"public interface OnFragmentInteractionListener {\n\t\t// TODO: Update argument type and name\n\t\tpublic void onFragmentInteraction(Uri uri);\n\t}",
"public interface FragmentDataObserver {\n void getDataFromActivity(String data);\n\n}",
"public interface OnFragInteractionListener {\n\n // replace top fragment with this fragment\n interface OnMainFragInteractionListener {\n void onWifiFragReplace();\n void onHistoryFragReplace();\n void onHistoryWithOsmMapFragReplace();\n void onMainFragReplace();\n }\n\n // interface for WifiPresenterFragment\n interface OnWifiScanFragInteractionListener {\n void onGetDataAfterScanWifi(ArrayList<WifiLocationModel> list);\n void onAllowToSaveWifiHotspotToDb(String ssid, String pass, String encryption, String bssid);\n }\n\n // interface for HistoryPresenterFragment\n interface OnHistoryFragInteractionListener {\n // get wifi info\n void onGetWifiHistoryCursor(Cursor cursor);\n // get mobile network generation\n void onGetMobileHistoryCursor(Cursor cursor);\n // get wifi state and date\n void onGetWifiStateAndDateCursor(Cursor cursor);\n }\n\n interface OnMapFragInteractionListerer {\n void onGetWifiLocationCursor(Cursor cursor);\n }\n}",
"public interface PesonageFragmentView extends MvpView {\n\n}",
"public interface OnUsersFragmentInteractionListener {\n void onListFragmentInteraction(User item);\n }",
"public interface MainScreeInteractionListener {\n // TODO: Update argument type and name\n void onFragmentInteractionMain();\n }",
"public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n void onClickNextTurn();\n }",
"public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n void onFragmentInteraction();\n\n void changeBottomNavSelection(int menuItem);\n }",
"public interface OnFragmentInteractionListener {\n void onFragmentInteraction(Uri uri);\n}",
"public interface OnFragmentInteractionListener {\n public void onFragmentInteraction(Uri uri);\n }",
"public interface OnFragmentInteractionListener {\n public void onFragmentInteraction(Uri uri);\n }",
"public interface OnFragmentInteractionListener {\n public void onFragmentInteraction(Uri uri);\n }",
"public interface OnFragmentInteractionListener {\n void onSignoutClicked();\n\n void onExtraScopeRequested();\n }",
"public interface OnListFragmentInteractionListener {\n void onListFragmentInteraction(Note note);\n}",
"interface OnMainFragInteractionListener {\n void onWifiFragReplace();\n void onHistoryFragReplace();\n void onHistoryWithOsmMapFragReplace();\n void onMainFragReplace();\n }"
] | [
"0.73250246",
"0.7208194",
"0.7135128",
"0.7124374",
"0.7122289",
"0.7015256",
"0.6976415",
"0.6976415",
"0.6976415",
"0.697415",
"0.69679785",
"0.69658804",
"0.6961106",
"0.6953952",
"0.6943612",
"0.69336414",
"0.6929252",
"0.69277585",
"0.692306",
"0.6909864",
"0.69028807",
"0.6897262",
"0.68948984",
"0.6882655",
"0.68815297",
"0.6875588",
"0.6864281",
"0.68607974",
"0.68597907",
"0.68587786",
"0.6856009",
"0.6844289",
"0.6839765",
"0.6830054",
"0.68176347",
"0.68169826",
"0.6810604",
"0.67696476",
"0.67696476",
"0.67696476",
"0.67696476",
"0.67696476",
"0.67696476",
"0.67696476",
"0.67696476",
"0.67696476",
"0.67690516",
"0.6766415",
"0.6761695",
"0.67551124",
"0.67533374",
"0.6698162",
"0.6681282",
"0.66737175",
"0.6670758",
"0.6669734",
"0.6661607",
"0.66612685",
"0.6655428",
"0.66521543",
"0.6644687",
"0.664394",
"0.664394",
"0.664394",
"0.664394",
"0.664394",
"0.664394",
"0.664394",
"0.664394",
"0.664394",
"0.664394",
"0.664394",
"0.6638479",
"0.663606",
"0.6631513",
"0.66253483",
"0.66251284",
"0.6618284",
"0.66096157",
"0.66095537",
"0.6609517",
"0.66047883",
"0.65973",
"0.6597272",
"0.658741",
"0.6572349",
"0.656913",
"0.6560113",
"0.6560098",
"0.65549636",
"0.65490955",
"0.65482724",
"0.65431726",
"0.65389806",
"0.6534305",
"0.6534305",
"0.6534305",
"0.6519628",
"0.6516709",
"0.6516625"
] | 0.67864025 | 37 |
Create a new demo | public AbstractDemo(String title) {
this.title = title;
pressed = new HashSet<Integer>();
foreground = Color.black;
background = Color.white;
bodyColor = Color.black;
rayColor = Color.red;
BruteForce bf = new BruteForce();
ConfigurableBodyOverlapper overlapper = new ConfigurableBodyOverlapper();
overlapper.registerDefaults();
space = new Space(bf, overlapper);
ConfigurableRayBodyIntersector intersector = new ConfigurableRayBodyIntersector();
intersector.registerDefaults();
space.equipForRays(bf, intersector);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void newDemo() {\r\n \t\t\r\n \t\tString date = new SimpleDateFormat(\"yyyy-MM-dd_HH-mm-ss\").format(new Date());\r\n \t\tthis.fileName = this.demoFolder + this.map.replace(\".xml\", \"\") + \"_\" + date + \".r2d\";\r\n \t\ttry {\r\n \t\t\tthis.fos = (FileOutputStream)this.fileIO.writeFile(this.fileName);\r\n \t\t} catch (IOException e) {\r\n \t\t}\r\n \t\t\r\n \t\ttry {\r\n \t\t\tthis.demoParts.put(this.map + \"/\");\r\n \t\t} catch (InterruptedException e) {\r\n \t\t}\r\n \t}",
"public long createDemo() {\n mDemoId = insertDemo(\"unnamed\");\n return mDemoId;\n }",
"Lab create();",
"ExternalExample createExternalExample();",
"public Demo() {\n\t\t\n\t}",
"public static void demo() {\n\t\tlab_2_2_5();\n\n\t}",
"public void startDemo() {\n // Welcoming display\n this.view.displayMenu();\n\n // State of the inventory and the users\n this.view.displaySystem(this.system);\n\n this.view.displayExampleMessage();\n\n // Example with a student\n Student s = this.system.getStudents().get(0);\n\n Calendar startDate = Calendar.getInstance();\n Calendar endDate = Calendar.getInstance();\n endDate.setTimeInMillis(endDate.getTimeInMillis() + 6*24*60*60*1000);\n\n Loan l = s.book(Model.IPAD3, new Period(startDate, endDate));\n this.system.checkLoan(l);\n\n this.view.displayBorrow(s, l);\n this.system.putAway(l);\n this.view.displayReturn(s, l);\n\n // Example with a teacher\n\n Teacher t = this.system.getTeachers().get(0);\n\n Loan l2 = s.book(Model.XPERIAZ, new Period(startDate, endDate));\n this.system.checkLoan(l2);\n\n this.view.displayBorrow(t, l2);\n this.system.putAway(l2);\n this.view.displayReturn(t, l2);\n\n }",
"public void setDemo(java.lang.String demo) {\n this.demo = demo;\n }",
"@Test\n public void testDemotivatorCreateSuccess() throws IOException{\n \tFixtures.deleteAllModels();\n \tFixtures.loadModels(\"data/user.yml\");\n \t\n \tauthenticate();\n \t\n \tMap<String, String> createDemoParams = new HashMap<String, String>();\n \tcreateDemoParams.put(\"title\", THIRTY_CHARS_TITLE);\n \tcreateDemoParams.put(\"text\", EIGHTY_CHARS_TEXT);\n \tcreateDemoParams.put(\"mode\", \"create\");\n \tMap<String, File> fileParams = new HashMap<String, File>();\n \tFile file = new File(\"test/data/image.jpg\");\n \tfileParams.put(\"image\", file);\n\n \tResponse response = POST(\"/create\", createDemoParams, fileParams);\n\n \tassertStatus(200, response);\n \tassertContentType(\"application/json; charset=utf-8\", response);\n \t\n \tList<Demotivator> demos = Demotivator.findAll();\n \tassertEquals(1, demos.size());\n \tassertEquals(THIRTY_CHARS_TITLE, demos.get(0).getTitle());\n \tassertEquals(EIGHTY_CHARS_TEXT, demos.get(0).getText());\n \tassertEquals(\"localhost\", demos.get(0).getDomain().getName());\n \tlong id = demos.get(0).getId().longValue();\n \t\n \tassertContentEquals(\"{\\\"fileName\\\":\\\"/image/thumb.test.file.name\\\",\\\"id\\\":\\\"\" + id + \"\\\",\\\"status\\\":\\\"success\\\"}\", response);\n }",
"public DemonstrationApp()\n {\n // Create Customers of all 3 types\n s = new Senior(\"alice\", \"123 road\", 65, \"555-5555\", 1);\n a = new Adult(\"stacy\", \"123 lane\", 65, \"555-1111\", 2);\n u = new Student(\"bob\", \"123 street\", 65, \"555-3333\", 3);\n \n //Create an account for each customer \n ca = new CheckingAccount(s,1,0);\n sa = new SavingsAccount(a,2,100);\n sav = new SavingsAccount(u,3,1000);\n \n //Create a bank\n b = new Bank();\n \n //Create a date object\n date = new Date(2019, 02, 12);\n }",
"public void create() {\n\t\t\n\t}",
"public DemoPanel() {\n }",
"public Demo3() {}",
"public static void main(String[] args) {\n\t\tnew OpenDemo();\r\n\t}",
"public static void main(String[] args) {\n ArrayList<String> tab = new ArrayList<>();\n tab.add(\"First\");\n tab.add(\"Hello\");\n tab.add(\"Last\");\n //Creation du modele\n LeModele leModele = new LeModele(tab);\n\n //Creation du controleur\n LeControleur leControleur = new LeControleur(leModele);\n\n //Creation de la vue\n LaVue laVue = new LaVue(leControleur);\n\n\n //Test\n\n\n }",
"public void create () {\n // TODO random generation of a ~100 x 100 x 100 world\n }",
"AliciaLab createAliciaLab();",
"private void addDemoButtons(int p_73972_1_, int p_73972_2_)\r\n\t{\r\n\t\tthis.buttonList.add(new GuiButton(11, this.width / 2 - 100, p_73972_1_, I18n.format(\"menu.playdemo\")));\r\n\t\tthis.buttonResetDemo = this.addButton(new GuiButton(12, this.width / 2 - 100, p_73972_1_ + p_73972_2_ * 1, I18n.format(\"menu.resetdemo\")));\r\n\t\tISaveFormat isaveformat = this.mc.getSaveLoader();\r\n\t\tWorldInfo worldinfo = isaveformat.getWorldInfo(\"Demo_World\");\r\n\r\n\t\tif (worldinfo == null)\r\n\t\t{\r\n\t\t\tthis.buttonResetDemo.enabled = false;\r\n\t\t}\r\n\t}",
"public void create(){}",
"public abstract IExperiment createExperiment(String description);",
"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}",
"Demo1Factory getDemo1Factory();",
"public void show(){\n System.out.println(\"Welcome to Edureka's Tutorial\");\n }",
"public static void main(String[] args) {\n\n Create createList = new Create();\n createList.create();\n\n }",
"public TestGeneratorGui(boolean create, JFrame frame, JTabbedPane tabbedPane) {\n\t\tthis.create = create;\n\t\ttutorControlFrame = frame;\n\t\ttutorControl = tabbedPane;\n\t}",
"Simple createSimple();",
"void createNewInstance(String filename)\n {\n iIncomingLobsFactory = new incomingLobsFactory();\n iIncomingLobsFactory.setPackageName(\"com.loadSample\");\n \n // include schemaLocation hint for validation\n iIncomingLobsFactory.setXSDFileName(\"LoadSample.xsd\");\n \n // encoding for output document\n iIncomingLobsFactory.setEncoding(\"UTF8\");\n \n // encoding tag for xml declaration\n iIncomingLobsFactory.setEncodingTag(\"UTF-8\");\n \n // Create the root element in the document using the specified root element name\n iIncomingLobs = (incomingLobs) iIncomingLobsFactory.createRoot(\"incomingLobs\");\n createincomingLobs();\n \n iIncomingLobsFactory.save(filename);\n }",
"public void showCreatePickUPTutorial() {\n ShowcaseView mShowcaseViewCreatePickup = new ShowcaseView.Builder(getActivity())\n .setTarget(new ViewTarget(createpickup))\n .setContentText(getResources().getString(R.string.tutorial_msg_create_pickup))\n .setContentTextPaint(Utility.getTextPaint(getActivity()))\n .singleShot(AppConstants.TUTORIAL_CREATE_PICK_UP_ID)\n .hideOnTouchOutside()\n .setStyle(R.style.CustomShowcaseTheme2)\n .build();\n\n RelativeLayout.LayoutParams lps = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);\n lps.addRule(RelativeLayout.ALIGN_PARENT_TOP);\n lps.addRule(RelativeLayout.ALIGN_PARENT_LEFT);\n int margin = ((Number) (getResources().getDisplayMetrics().density * 12)).intValue();\n lps.setMargins(margin, margin, margin, margin);\n mShowcaseViewCreatePickup.setButtonPosition(lps);\n mShowcaseViewCreatePickup.setButtonText(getResources().getString(R.string.tutorial_got_it));\n }",
"protected void createContents() {\r\n\t\tshell = new Shell();\r\n\t\tshell.setLayout(new GridLayout(1, false));\r\n\t\tshell.setSize(450, 300);\r\n\t\tshell.setText(\"SWT Application\");\r\n\t\t{\r\n\t\t\tfinal Button btnShowTheFake = new Button(shell, SWT.TOGGLE);\r\n\t\t\tbtnShowTheFake.addSelectionListener(new SelectionAdapter() {\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void widgetSelected(SelectionEvent arg0) {\r\n\t\t\t\t\tif (btnShowTheFake.getSelection()) {\r\n\t\t\t\t\t\tRectangle bounds = btnShowTheFake.getBounds();\r\n\t\t\t\t\t\tPoint pos = shell.toDisplay(bounds.x + 5, bounds.y + bounds.height);\r\n\t\t\t\t\t\ttooltip = showTooltip(shell, pos.x, pos.y);\r\n\t\t\t\t\t\tbtnShowTheFake.setText(\"Hide it\");\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (tooltip != null && !tooltip.isDisposed())\r\n\t\t\t\t\t\t\ttooltip.dispose();\r\n\t\t\t\t\t\tbtnShowTheFake.setText(\"Show The Fake Tooltip\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\tbtnShowTheFake.setText(\"Show The Fake Tooltip\");\r\n\t\t}\r\n\t}",
"public static void main(String[] args) {\n\t\tLinkedListedDemo demo=new LinkedListedDemo();\r\n\t\tdemo.addObjects();\r\n\t\tdemo.showElements();\r\n\t}",
"public Scene createScene() {\n\t\tmyRoot = new AnchorPane();\n\t\tmyTabs = new TabPane();\n\t\tButton newTab = new Button(CREATE_NEW_TAB);\n\t\tnewTab.setOnAction(event -> createNewTab());\n\t\t\n\t\tTabMainScreen mainScreen = new TabMainScreen(myResources.getString(WORKSPACE) + (myTabs.getTabs().size()));\n\t\tTabHelp help1 = new TabHelp(myResources.getString(BASIC_COMMANDS), HELP_TAB_TEXT1);\n\t\tTabHelp help2 = new TabHelp(myResources.getString(EXTENDED_COMMANDS), HELP_TAB_TEXT2);\n\t\t\n\t\tmyTabs.getTabs().addAll(mainScreen.getTab(myStage), help1.getTab(), help2.getTab());\n\t\t\n\t\tAnchorPane.setTopAnchor(myTabs, TABS_OFFSET);\n\t\tAnchorPane.setTopAnchor(newTab, NEWTAB_OFFSET);\n\t\t\n\t\tmyRoot.getChildren().addAll(myTabs, newTab);\n\t\n\t\tmyScene = new Scene(myRoot, windowHeight, windowWidth, Color.WHITE);\n\t\treturn myScene;\n\t}",
"public static void main(String[] args) {\n Demo3 d1 = new Demo3();\n\n\n }",
"public static void main(String[] args) {\n\t\tDemoStatic.show();\n\t\tDemoStatic d = new DemoStatic();\n\t\tDemoStatic d1 = new DemoStatic();\n\t\tDemoStatic d2 = new DemoStatic();\n\t\td2.show();\n\t\tDemoStatic d3 = new DemoStatic();\n\t\td3.show();\n\t}",
"public boolean isDemo() {\n return demo;\n }",
"public CreateHero() {\r\n\t\tinitComponents();\r\n\t}",
"protected void createContents() {\r\n\t\tshell = new Shell();\r\n\t\tshell.setSize(450, 300);\r\n\t\tshell.setText(\"SWT Application\");\r\n\r\n\t}",
"Hero createHero();",
"Lab create(Context context);",
"Drone createDrone();",
"public Idea create() {\n \t\t\tIdea idea = new Idea();\n \n \t\t\treturn idea;\n \t\t}",
"public void generateDemoQuiz() {\n Quiz demoQuiz = new Quiz(); //Instantiate a Quiz\n Category testCategory = makeCategory(); //Make some bs categories to attach the quiz\n Question question1 = new Question(); //Make some bs questions (just one for now)\n question1.setQuestion(\"Which of the following famous scientist cured Cat Cancer?\"); //Set the question ... of the question? IDK how to word this better\n\n //Make some funny cat names\n Answer a1 = new Answer(\"H. John Whiskers\");\n Answer a2 = new Answer(\"Bartolemeu Meowser\");\n Answer a3 = new Answer(\"Catalie Portman\");\n Answer a4 = new Answer(\"Anderson Pooper\");\n\n //Build an arraylist full of said cat names\n ArrayList<Answer> answerList = new ArrayList<Answer>();\n answerList.add(a1);\n answerList.add(a2);\n answerList.add(a3);\n answerList.add(a4);\n\n //Put those answers inside that question!\n question1.setAnswerChoices(answerList);\n question1.setCorrectAnswer(a1); //Everybody knows H John Whiskers cured kitty cancer\n\n //Build an arraylist full of the question(s) you just made, in our demo case there is only one question\n ArrayList<Question> questionList = new ArrayList<Question>();\n questionList.add(question1); //Put the questions inside your list\n\n\n //Put all the data you just made into a Quiz\n demoQuiz.setQuizName(\"Famous Cat Scientists\");\n demoQuiz.setQuizCategory(testCategory);\n demoQuiz.setQuizQuestions(questionList);\n\n }",
"public void create() {\n\t\trandomUtil = new RandomUtil();\n\t\t// create the camera using the passed in viewport values\n\t\tcamera = new OrthographicCamera(viewPortWidth, viewPortHeight);\n\t\tbatch.setProjectionMatrix(camera.combined);\n\t\tdebugRender = new Box2DDebugRenderer(true, false, false, false, false, true);\n\t\ttestWorld = new TestWorld(assetManager.blockManager(), new Vector2(0, 0f));\n\t\ttestWorld.genWorld(debugUtil);\n\t\ttestWorld.setCamera(getCamera());\n\t\tplayer.createBody(testWorld.getWorld(), BodyType.DynamicBody);\n\t\ttestWorld.getPlayers().add(player);\n\t\tworldParser = new WorldParser(testWorld, \"Test World\");\n\t\tworldParser = new WorldParser(testWorld, \"Test Write\");\n\t\tworldParser.parseWorld();\n\t\twriter = new WorldWriter(\"Test Write\", testWorld);\n\t}",
"@Override\r\n\tpublic Viewer create(String name) {\n\t\tif(this.isAllDataPresent())\r\n\t\t{\r\n\t\t\treturn new StressViewer(name);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}",
"@GetMapping(\"/create\")\n public String create(@RequestParam(\"fileExt\")\n final String fileExt, // create a sample file of the specified extension\n @RequestParam(value = \"sample\", required = false) final Optional<Boolean> isSample,\n @CookieValue(value = \"uid\", required = false) final String uid,\n final Model model) {\n Boolean sampleData = (isSample.isPresent() && !isSample.isEmpty()) && isSample.get();\n if (fileExt != null) {\n try {\n Optional<User> user = userService.findUserById(Integer.parseInt(uid)); // find a user by their ID\n if (!user.isPresent()) {\n // if the user with the specified ID doesn't exist, an error occurs\n throw new RuntimeException(\"Could not fine any user with id = \" + uid);\n }\n String fileName = documentManager.createDemo(fileExt,\n sampleData,\n uid,\n user.get().getName()); // create a demo document with the sample data\n if (fileName.isBlank() || fileName == null) {\n throw new RuntimeException(\"You must have forgotten to add asset files\");\n }\n return \"redirect:editor?fileName=\" + URLEncoder\n .encode(fileName, StandardCharsets.UTF_8); // redirect the request\n } catch (Exception ex) {\n model.addAttribute(\"error\", ex.getMessage());\n return \"error.html\";\n }\n }\n return \"redirect:/\";\n }",
"public static JPanel createDemoPanel() {\r\n JFreeChart chart = createChart(createDataset());\r\n ChartPanel panel = new ChartPanel(chart);\r\n panel.setMouseWheelEnabled(true);\r\n return panel;\r\n }",
"@Before\n\tpublic void criaShow() {\n\t\tshow = new Show(\"Lana Del Rey planeta Terra\", 100, 120, \"LIVRE\", \"Lana Del Rey\", 10);\n\t}",
"public void testWizards() {\n // open new file wizard\n NewFileWizardOperator nfwo = NewFileWizardOperator.invoke();\n nfwo.selectProject(\"SampleProject\");\n nfwo.selectCategory(\"Java\");\n nfwo.selectFileType(\"Java Class\");\n // go to next page\n nfwo.next();\n // create operator for the next page\n NewJavaFileNameLocationStepOperator nfnlso = new NewJavaFileNameLocationStepOperator();\n nfnlso.txtObjectName().typeText(\"MyNewClass\");\n // finish wizard\n //nfnlso.finish();\n // cancel wizard\n nfnlso.cancel();\n }",
"Help createHelp();",
"public static void main(String[] args) {\n com.abc.Demo d=new demo();\n Demo d1= new Demo1();\n \n\t}",
"public DemoPluginFactory() {}",
"public void create() {\n PDDocument document = new PDDocument();\n PDPage page = new PDPage();\n document.addPage(page);\n\n // Create a new font object selecting one of the PDF base fonts\n PDFont font = PDType1Font.HELVETICA_BOLD;\n try (document) {\n // Start a new content stream which will \"hold\" the to be created content\n writeDataToDocument(document, page, font);\n // Save the results and ensure that the document is properly closed:\n document.save(\"Hello World.pdf\");\n } catch (IOException ioException) {\n ioException.printStackTrace();\n }\n }",
"public void testNewFile() {\n // create a new package\n // \"Java Classes\"\n String javaClassesLabel = Bundle.getString(\"org.netbeans.modules.java.project.Bundle\", \"Templates/Classes\");\n NewJavaFileWizardOperator.create(SAMPLE_PROJECT_NAME, javaClassesLabel, \"Java Package\", null, SAMPLE1_PACKAGE_NAME);\n // wait package node is created\n Node sample1Node = new Node(new SourcePackagesNode(SAMPLE_PROJECT_NAME), SAMPLE1_PACKAGE_NAME);\n\n // create a new classes\n\n NewFileWizardOperator.invoke(sample1Node, javaClassesLabel, \"Java Main Class\");\n NewJavaFileNameLocationStepOperator nameStepOper = new NewJavaFileNameLocationStepOperator();\n nameStepOper.setObjectName(SAMPLE1_CLASS_NAME);\n nameStepOper.finish();\n // check class is opened in Editor\n new EditorOperator(SAMPLE1_FILE_NAME);\n NewFileWizardOperator.invoke(sample1Node, javaClassesLabel, \"Java Main Class\");\n nameStepOper = new NewJavaFileNameLocationStepOperator();\n nameStepOper.setObjectName(SAMPLE2_CLASS_NAME);\n nameStepOper.finish();\n // check class is opened in Editor and then close all documents\n new EditorOperator(SAMPLE2_FILE_NAME).closeAllDocuments();\n }",
"private static void createAndShowGUI() {\n\n //Create and set up the window.\n JFrame frame = new JFrame(\"ButtonDemo\");\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n //Create and set up the content pane.\n ButtonDemo newContentPane = new ButtonDemo();\n newContentPane.setOpaque(true); //content panes must be opaque\n frame.setContentPane(newContentPane);\n\n //Display the window.\n frame.pack();\n frame.setVisible(true);\n }",
"private void createNewLab(){\n String newLabName = NewLabNameTextfield.getText();\n // If lab doesn't exist make the new lab\n if(!Arrays.asList(labsPath.list()).contains(newLabName)){ \n try{\n LabExistLabel.setVisible(false);\n NewLabDialog.revalidate();\n //call python new_lab_script: new_lab_setup.py -b basename \n File labdir = new File(labsPath+File.separator+newLabName);\n labdir.mkdir();\n this.labName = newLabName;\n String cmd = \"new_lab_setup.py -b \"+NewLabBaseImageComboBox.getSelectedItem();\n doLabCommand(cmd);\n \n // Close the new lab dialog and open the new lab\n NewLabDialog.setVisible(false);\n openLab(new File(labsPath+File.separator+newLabName));\n } \n catch (IOException e){\n System.out.println(e);\n }\n }\n else{\n LabExistLabel.setVisible(true);\n NewLabDialog.revalidate();\n System.out.println(\"Lab already exists. Make the lab with a different name other than:\");\n printExistingLabs();\n }\n }",
"LectureProject createLectureProject();",
"public static void createNewLeague()\n\t{\n\t\t//put code to get input from end-user here.\n\t\t//generateFixtures(leagueName, teamAmount, homeAndAway, winPoints, drawPoints, lossPoints, teamNames);\n\t}",
"public void testZRecordingCreation() {\n\t\tsolo.pressSpinnerItem(3, 1);\n\t\tsolo.clickOnText(\"Begin Rehearsing\");\n\t\tsolo.clickOnText(\"Rec\");\n\t\tsolo.clickOnText(\"Rec\");\n\t\tsolo.typeText(0, \"testName\");\n\t\tsolo.clickOnText(\"Save\");\n\t\t// If file exists already then overwrite it\n\t\tif (solo.searchButton(\"Yes\")) {\n\t\t\tsolo.clickOnButton(\"Yes\");\n\t\t}\n\t\tsolo.pressMenuItem(4);\n\t\tassertTrue(solo.searchText(\"testName\"));\n\t}",
"private Demo doReadDemo() throws IOException {\n // create a resource loader\n final URL defaultRoot = ResourceUtil.getURL(\"demo/\");\n final URLClassLoader resourceLoader = new URLClassLoader(\n new URL[] { defaultRoot }, null);\n return doReadDemo(resourceLoader);\n }",
"private void _createPageDef()\n {\n _pageDef = new DemoPageDef();\n _pageDef.setupAttributes();\n \n List<DemoPageDef.SavedSearchDef> searchDefList = _pageDef.setupSavedSearchDefList();\n \n // Mark the first sabved Search definition as the current\n _currentDescriptor = new DemoQueryDescriptor(searchDefList.get(0));\n for (DemoPageDef.SavedSearchDef searchDef: searchDefList)\n {\n DemoQueryDescriptor qd = new DemoQueryDescriptor(searchDef);\n _QDMap.put(searchDef.getName(), qd); \n if (_currentDescriptor == null)\n _currentDescriptor = qd;\n }\n\n _queryModel = new DemoQueryModel(_QDMap);\n \n }",
"public NewTestWizardPage() {\n\t\tsuper(true, \"New Groovy Test Settings\");\n\n\t\tsetTitle(\"Groovy Test Class\");\n\t\tsetDescription(\"Create a new Groovy unit test class\");\n\t}",
"@Override\n\tpublic void create(IWizardEntity entity, WizardRunner runner) {\n\t\t\n\t}",
"private void challengeStartNew() {\n FragmentManager fm = getSupportFragmentManager();\n FragmentNewChallenge newChallenge = FragmentNewChallenge.newInstance(\"Titel\");\n newChallenge.show(fm, \"fragment_start_new_challenge\");\n }",
"private void createFrame() {\n System.out.println(\"Assembling \" + name + \" frame\");\n }",
"public CreateUAV(){\n createStage = new Stage();\n createStage.setTitle(\"UAV Setup\");\n createStage.initModality(Modality.APPLICATION_MODAL);\n setupOverwriteDialog();\n }",
"public static void example1() {\n // moved to edu.jas.application.Examples\n }",
"Documentation createDocumentation();",
"Documentation createDocumentation();",
"@Override\r\n\tpublic Viewer create(String name) {\n\t\tif(this.isAllDataPresent())\r\n\t\t{\r\n\t\t\treturn new ShapeViewer(name);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t\t\r\n\t}",
"private void createFrame(){\n System.out.println(\"Assembling \" + name + \" frame.\");\n }",
"public static void main(String[] args) {\n AddNewProject addNewProject = new AddNewProject();\n addNewProject.setVisible(true);\n }",
"Sample start();",
"@Override\n\tpublic void create() {\n\t\t\n\t}",
"public static void main(Demo args[])\n\t{\n\t\tEmployee1 employee=new Manager();\n\t\temployee.display();\n\t}",
"@Test\n public void testCreateView() {\n System.out.println(\"createView\");\n int i =1;\n AfinadorModelo modeloTest = new AfinadorModelo();\n AfinadorControlador controladorTest = new AfinadorControlador(modeloTest,i);\n String test = controladorTest.vista1.bpmOutputLabel.getText();\n if( test != \"APAGADO \")\n fail(\"The test case is a prototype.\");\n }",
"@Override\r\n\tpublic void create() {\n\t\t\r\n\t}",
"public DemoScreenControllerMasterApp(String[] args) {\r\n\t\t// transfer args to start the selected demo \r\n\t\t// via listener callback method \"tfStackReConnected()\" \r\n\t\t// => see end of this class\r\n\t\tthis.args = args;\r\n\t\t\r\n\r\n\t\t// Define Tinkerforge Stack (Listener)\r\n\t\tdemoTfStack = new DemoTfStackImpl(this);\r\n\r\n\t\t\r\n\t\t//Create connection and add listener\r\n\t\tnew TfConnectService(\"localhost\",4223, null, demoTfStack);\r\n\t\t\r\n\t\t// Define Clone LCD Connection\r\n\t\t// Connect will be processed after this stack is connected\r\n\t\tcloneHost = \"Tf-AU-EG-WZ\";\r\n\t\tclonePort = 4223;\r\n\t}",
"@Override\n\tpublic void create () {\n\n\t}",
"public static void main(String[] args) throws IOException {\n \n CreateInstance createInstance = new CreateInstance();\n\n try {\n createInstance.init(args);\n Flavor flavor = createInstance.getFlavor();\n createInstance.createInstance(flavor);\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n createInstance.close();\n }\n }",
"public static void create() {\r\n render();\r\n }",
"public TutorialStep1() {\n\n }",
"public void testGenericWizards() {\n // open new project wizard\n NewProjectWizardOperator npwo = NewProjectWizardOperator.invoke();\n npwo.selectCategory(\"Java Web\");\n npwo.selectProject(\"Web Application\");\n npwo.next();\n // create operator for next page\n WizardOperator wo = new WizardOperator(\"Web Application\");\n JTextFieldOperator txtName = new JTextFieldOperator((JTextField) new JLabelOperator(wo, \"Project Name:\").getLabelFor());\n txtName.clearText();\n txtName.typeText(\"MyApp\");\n wo.cancel();\n }",
"private void newProject()\n\t{\n\t\tnew FenetreCreationProjet();\n\t}",
"public static void main(String[] args) {\n new WebcamQRDemo();\r\n }",
"private void createNewVisualPane(int solverId) {\n }",
"private Demo doReadDemo(final ClassLoader demoResourceLoader) throws IOException {\n final Demo demo = new Demo();\n\n final URL demoConfiguration = demoResourceLoader.getResource(CONFIGURATION_NAME);\n\n if (null == demoConfiguration) {\n logger.logWarning(\"No {0} found in demo root. Please configure the demo properly.\",\n CONFIGURATION_NAME);\n } else {\n // load demo configuration\n final Properties configuration = new Properties();\n final InputStream demoConfigurationStream = demoConfiguration.openStream();\n try {\n configuration.load(demoConfiguration.openStream());\n } finally {\n demoConfigurationStream.close();\n }\n demo.setConfiguration(configuration);\n \n final String environment = demo.getProperty(\"environment\");\n if(null == environment) {\n logger.logWarning(\"Demo environment has not been configured.\");\n } else {\n final String scenarios = demo.getProperty(\"scenarios\");\n if (null == scenarios) {\n logger.logWarning(\"Demo scenarios have not been configured.\");\n }\n final StringTokenizer tokenizer = new StringTokenizer(scenarios, \",\");\n while (tokenizer.hasMoreTokens()) {\n configureScenario(demo, tokenizer.nextToken(), demoResourceLoader);\n }\n }\n }\n return demo;\n }",
"@Override\n public void Create() {\n\n initView();\n }",
"public LiveConnectDemo() {\n }",
"InlineDataExample createInlineDataExample();",
"@Override\n\tpublic void create() {\n\n\t}",
"public static void mainDemo(String[] args){\r\n\t\t\t\r\n\t\tDisplayManager.createDisplay();\r\n\t\tAudioMaster.init();\r\n\t\tLoader loader = new Loader();\r\n\t\t\r\n\t\tTextMaster.init(loader);\r\n\t\tFontType font = new FontType(loader.loadTextureWithBias(MyPaths.makeTexturePath(\"font/candara\"), 0.0f),\r\n\t\t\t\tnew File(MyPaths.makeFontPath(\"candara\")));\r\n\t\t\r\n\t\tPage homepage = new Page();\r\n\t\t\r\n\t\ttry {\r\n\t\t\tLoadPage.load(homepage, loader, \"/html/homepage.html\");\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\t/* Finished with test fonts */\r\n\t\t\r\n\t\t/* Load fbos */\r\n\t\t\r\n\t\tMinimapFrameBuffer fbos = new MinimapFrameBuffer();\r\n\r\n\t\tLevel level = new Level(loader);\r\n\r\n\t\ttry {\r\n\t\t\tLoadMap.load(\"default-map\", level);\r\n\t\t} catch (IOException e1) {\r\n\t\t\te1.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\t/* Load test minimap */\r\n\r\n\t\tGuiTexture minimap = new GuiTexture(fbos.getReflectionTexture(),\r\n\t\t\t\tnew Vector2f(0.83f, 0.78f), new Vector2f(0.14f, 0.18f));\r\n\t\tlevel.getGuis().add(minimap);\r\n\t\t\r\n\t\tFbo main_fbo = new Fbo(Display.getWidth(), Display.getHeight(), Fbo.DEPTH_RENDER_BUFFER);\r\n\t\tPostProcessing.init(loader);\r\n\t\t\r\n\t\t/* Gameloop below */\r\n\t\t\r\n\t\tboolean gameloop = false;\r\n\t\tPage currentPage = homepage;\r\n\t\t\r\n\t\twhile(!Display.isCloseRequested()){\r\n\t\t\t\r\n\t\t\tif(!gameloop){\r\n\t\t\t\trender(level.getmRenderer(), currentPage);\r\n\t\t\t\tcurrentPage = currentPage.update(loader);\r\n\t\t\t\tgameloop = currentPage == null;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tfloat dt = DisplayManager.getDelta();\r\n\t\t\t\tmandatoryUpdates(level, dt);\r\n\t\t\t\ttestColorFunction(level.getPicker(), font);\r\n\t\t\t\tinteractWithGuis(level);\r\n\t\t\t\trender(level, fbos, main_fbo, false);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tPostProcessing.cleanUp();\r\n\t\tmain_fbo.cleanUp();\r\n\t\tTextMaster.cleanUp();\r\n\t\tlevel.getmRenderer().cleanUp();\r\n\t\tloader.cleanUP();\r\n\t\tDisplayManager.closeDisplay();\r\n\t\tAudioMaster.cleanUp();\r\n\t}",
"public static void main(String[] args) {\n\t\tdemointer d=new Exm1();\r\n\t\t//demointer d1=new Exm2();\r\n\t\t//Exm1 a=new Exm1();\r\n\t\tExample1 ex=new Example1();\r\n\t\tex.demo(d);\r\n\t\t\r\n\t}",
"public static void main(String[] args) {\n System.out.println(\"Create the player.\");\n }",
"@Override public void createSample(Sample sample)\n {\n try\n {\n clientDoctor.createSample(sample);\n }\n catch (RemoteException e)\n {\n throw new RuntimeException(\"Error while creating sample. Please try again.\");\n }\n }",
"public static void main(String[] args) {\n demoClass();\n }",
"public static void main(String[] args) {\n demoClass();\n }",
"private void demoSimple(){\r\n\t\t\r\n\t\tint s = 0;\t// screen id\r\n\t\tint l = 0; // line\r\n\t\tint p = 0; // position\r\n\r\n\t\t//---------------------\r\n\t\t// Screen Controller \r\n\t\t//---------------------\r\n\t\t// Instantiate ScreenController\r\n\t\tsc = ScreenControllerImpl.getNewInstance(demoTfStack.getTfLcd());\r\n\t\t\r\n\t\t//---------------------\r\n\t\t// Source Definitions \r\n\t\t//---------------------\r\n\r\n\t\t// This counter counts up (one per second) and push its value by itself\r\n\t\t// See SourceCounter for more details how to implement a push item\r\n\t\tItemSourceToPush counterSource = new SourceCounter();\r\n\r\n\t\t// The lateron used Screen Clock needs not source definition\r\n\t\t// It can be directly created as a screen item\r\n\t\t\r\n\t\t\r\n\t\t//---------------------\r\n\t\t// Screens\r\n\t\t//---------------------\r\n\t\t\r\n\t\t// Push Demo Clock\r\n\t\t++s; l=0; p=0;\r\n\t\tsc.addNewScreenToSequence(s);\r\n\t\tsc.addMaskLine(1, 0, \" Push Demo-Clock\");\r\n\t\t// A screen clock is a push item, depending on the selected format it pushes the new value in different time periods\r\n\t\tScreenClock item1 = new ScreenClockImpl(\r\n\t\t\t\tnull\t\t\t// null: the screen controller writes to LCD. Not the item directly \r\n\t\t\t\t, ScreenClock.FORMAT_DATE_TIME_M\r\n\t\t\t\t, s\t\t\t\t// screen id\r\n\t\t\t\t, ++l\t\t\t\t// row\r\n\t\t\t\t, p);\t\t\t// position\r\n\t\tsc.addItem(item1);\r\n\t\t\r\n\t\t\r\n\t\t// Push Demo Counter\r\n\t\t++s; l=0; p=0;\r\n\t\tsc.addNewScreenToSequence(s);\r\n\t\tsc.addMaskLine(s, l, \" Push Demo-Counter\");\r\n\t\t// The counter source is to put into a screen item container\r\n\t\t// For Push or Pull Items the same container (ScreenItemImpl) is used\r\n\t\tScreenItem item2 = new ScreenItemImpl(\r\n\t\t\t\tnull\t\t\t// null: the screen controller writes to LCD. Not the item directly\r\n\t\t\t\t, counterSource\t// counter object (has to implement specific methods)\r\n\t\t\t\t, 0\t\t\t\t// pull refresh period: 0: no pull, the item pushes by itself \r\n\t\t\t\t, s\t\t\t\t// screen id\r\n\t\t\t\t, ++l\t\t\t// line\r\n\t\t\t\t, p);\t\t\t// position\r\n\t\tsc.addItem(item2);\r\n\r\n\t\t\r\n\t\t// Push Demo Clock + Counter\r\n\t\t++s; l=0; p=0;\r\n\t\tsc.addNewScreenToSequence(s);\r\n\t\tsc.addMaskLine(s, l, \" Clock + Counter\");\r\n\t\t// A screen clock is a push item, depending on the selected format it pushes the new value in different time periods\r\n\t\tScreenClock item3 = new ScreenClockImpl(\r\n\t\t\t\tnull\t\t\t// null: the screen controller writes to LCD. Not the item directly \r\n\t\t\t\t, ScreenClock.FORMAT_DATE_TIME_M\r\n\t\t\t\t, s\t\t\t\t// screen id\r\n\t\t\t\t, ++l\t\t\t// line\r\n\t\t\t\t, p);\t\t\t// position\r\n\t\tsc.addItem(item3);\r\n\t\t// The same counter source is used twice\r\n\t\tScreenItem item4 = new ScreenItemImpl(\r\n\t\t\t\tnull\t\t\t// null: the screen controller writes to LCD. Not the item directly\r\n\t\t\t\t, counterSource\t// counter object (has to implement specific methods)\r\n\t\t\t\t, 0\t\t\t\t// pull refresh period: 0: no pull, the item pushes by itself \r\n\t\t\t\t, s\t\t\t\t// screen id\r\n\t\t\t\t, ++l\t\t\t// line\r\n\t\t\t\t, p);\t\t\t// position\r\n\t\tsc.addItem(item4);\r\n\r\n\r\n\t\t// Activate the first screen to show (makes the screenController active too)\r\n\t\tsc.activateScreen(1);\r\n\r\n\t\t// Create and connect the Clone LCD\r\n\t\tclone = new DemoScreenControllerClientApp(this, cloneId, cloneHost, clonePort);\r\n\t\t\r\n\t\t// See methods \"tfCloneReConnect(..)\" and \"tfCloneDisconnect(..)\" in this class\r\n\t\t// for further handling of the Clone LCD\r\n\r\n\t}",
"public void createScene();",
"public void startTrial(View view) {\n demo = false;\n updateCurrentFragment(new SetupFragment(), \"setup\");\n }",
"UADev createNewUADev(String id,String name,String title,String desc)\r\n\t{\r\n\t\tUADev ret = new UADev() ;\r\n\t\tret.id = id ;\r\n\t\treturn updateUADev(ret,name,title,desc);\r\n\t}",
"private void createWizard(String persoName, String persoImage, int persoLife, int attack) {\n\t\tpersoList.add(new Wizard(persoName, persoImage, persoLife, attack));\n\t}",
"DocBook createDocBook();"
] | [
"0.67341244",
"0.6724742",
"0.6151388",
"0.6066514",
"0.6012713",
"0.6002509",
"0.59882325",
"0.5959346",
"0.58323896",
"0.58041066",
"0.5795907",
"0.57909125",
"0.57484233",
"0.5738002",
"0.57379156",
"0.57364327",
"0.5730244",
"0.57293427",
"0.5670682",
"0.56607425",
"0.56506145",
"0.56289923",
"0.55972815",
"0.5597238",
"0.55961704",
"0.559188",
"0.55801433",
"0.5572398",
"0.55526245",
"0.5548836",
"0.5542572",
"0.554136",
"0.5523326",
"0.5516099",
"0.5515393",
"0.5512945",
"0.55109644",
"0.54944366",
"0.5493285",
"0.54800713",
"0.54717743",
"0.5467072",
"0.54637563",
"0.54593265",
"0.54517204",
"0.5449091",
"0.54355276",
"0.54318124",
"0.54288685",
"0.5418483",
"0.5416948",
"0.5409608",
"0.5399238",
"0.5397307",
"0.53915125",
"0.53861594",
"0.5367187",
"0.5366173",
"0.53661305",
"0.5356915",
"0.53562355",
"0.53494793",
"0.534536",
"0.534434",
"0.5341871",
"0.53383017",
"0.53383017",
"0.53319615",
"0.532957",
"0.5327489",
"0.5326259",
"0.53153247",
"0.5313463",
"0.5312023",
"0.52888393",
"0.52885896",
"0.52873266",
"0.52809995",
"0.5279721",
"0.52792966",
"0.52753687",
"0.52740026",
"0.5273942",
"0.5273266",
"0.52691823",
"0.52585894",
"0.5255528",
"0.5254972",
"0.52505165",
"0.5249499",
"0.5247794",
"0.52443635",
"0.5237829",
"0.5236201",
"0.5236201",
"0.5234816",
"0.52329665",
"0.5220364",
"0.52187085",
"0.52136385",
"0.5212895"
] | 0.0 | -1 |
Gets the space (already configured for overlap and rays). | protected Space getSpace() {
return space;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"DSpace getSpace();",
"public Point getSpace(){\r\n return this.space;\r\n }",
"public Space getSpace() {\n return space;\n }",
"public float getSpace() {\r\n return space;\r\n }",
"public double getSpace() {\n\treturn space;\n }",
"public static JavaSpace05 getSpace() {\n return instance.doGetSpace();\n }",
"public String[][] getSpace() {\n return this.space;\n }",
"public Box getSpace(int space){\r\n\t\treturn board[space];\r\n\t}",
"public Space getSpace(int space) {\n\t\treturn boardArray.get(space);\n\t}",
"public ArrayList<Space> getSpaces()\r\n\t{\r\n\t\treturn new ArrayList<Space>(_spaces.values());\r\n\t}",
"public Continuous2D getGeographySpace() {\n return obstacleSpace;\n }",
"public int getCargoSpace() {\n return cargoSpace;\n }",
"public List<Site> getSpaces() {\n SiteQuery sq = new SiteQuery.Builder().withSiteTypes(SiteType.SPACE).build();\n List<Site> s = PortalRequest.getInstance().getPortal().findSites(sq);\n return s;\n }",
"public Node getTargetSpace()\n {\n return _targetSpace;\n }",
"public List<Point> getReservedSpace(){\n\t\treturn reservedSpace;\n\t}",
"public Space findSpace(int spaceNum)\r\n\t{\r\n\t\tif (_spaces.containsKey(spaceNum))\r\n\t\t\treturn _spaces.get(spaceNum);\r\n\t\telse\r\n\t\t\treturn null;\r\n\t}",
"public Point findSpace(){\r\n Point toReturn = new Point(-1, -1);\r\n for (int i = 0; i<puzzleSize; i++){\r\n for (int j = 0; j<puzzleSize; j++){\r\n if (this.state[i][j] == 0)\r\n toReturn.setLocation(i,j);\r\n }\r\n }\r\n return toReturn;\r\n }",
"public double getWordSpace(\n )\n {return wordSpace;}",
"private Space get(Coordinates c) {\n\t\tSpace temp = head;\n\n\t\tif (c.x < xDim) {\n\t\t\tif (c.y < yDim) {\n\t\t\t\tfor (int i = 0; i < c.x; i++) {\n\t\t\t\t\ttemp = temp.getRight();\n\t\t\t\t}\n\t\t\t\tfor (int j = 0; j < c.y; j++) {\n\t\t\t\t\ttemp = temp.getBottom();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn temp;\n\n\t}",
"private Spaceship getTheSpaceship() {\n\t\tfor(GameObject object : gameObject)\n\t\t\tif(object instanceof Spaceship)\n\t\t\t\treturn (Spaceship) object;\n\t\treturn null;\n\t}",
"public SpaceState getSpaceState() {\n\t\treturn spaceState;\n\t}",
"public String getCurrentSpace() {\n return spaces.getValue();\n }",
"public PointInSpace getPointInSpace() {\n return point;\n }",
"@Override\n\tpublic List<Space> findAllSpace() throws Exception {\n\t\treturn spaceDao.findAllSpace();\n\t}",
"public static int getSpaceCounter() {\n\t\treturn spaceCounter;\n\t}",
"public List<Space> getSubSpaces() {\n\t\treturn subSpaces;\n\t}",
"String getSpace();",
"public String getSPACE_TYPE() {\n return SPACE_TYPE;\n }",
"public Long getSPACE() {\n return SPACE;\n }",
"public Toolbarspace getToolbarspace() {\n return toolbarspace;\n }",
"public Rectangle get_bounds() {\n return new Rectangle(x,y, width-3, height-3);\n }",
"@Override\n public List<FreeSpace3D> segmentSpace(Box box){\n ArrayList<FreeSpace3D> newFreeSpace3DS = new ArrayList<>();\n ArrayList<Surface> newSurfaces = new ArrayList();\n if(box.getZBottom() > position.getZ())\n {\n //the bottom of physical box is a separating plane\n FreeSpace3D fs = new FreeSpace3D(width, depth, box.getZBottom() - position.getZ(), position, this.pallet, supportingSurfaces);\n newFreeSpace3DS.add(fs);\n }\n\n if(box.getZTop() < getZTop())\n {\n // the top of the physical box is a separating plane\n // determine the intersecting area\n PositionedRectangle intersectingArea = box.getTop().getHorizontalIntersection(this.getPositionedBottom());\n Surface sf = new Surface(intersectingArea);\n FreeSpace3D fs = new FreeSpace3D(width, depth,position.getZ() + height - box.getZTop(),\n new Vector3D(position.getX(), position.getY(),box.getZTop()), this.pallet, sf);\n newFreeSpace3DS.add(fs);\n }\n\n if(box.getXLeft() > getXLeft())\n {\n //the left side of physical box is a separating plane\n ArrayList<Surface> remainingSupportingSurfaces = updateSurfaces(new PositionedRectangle(box.getXLeft() - getXLeft(), depth, position));\n if(!remainingSupportingSurfaces.isEmpty()){\n FreeSpace3D fs = new FreeSpace3D(box.getXLeft() - getXLeft(), depth, height, position, this.pallet, remainingSupportingSurfaces);\n newFreeSpace3DS.add(fs);\n }\n }\n\n if(box.getXRight() < getXRight())\n {\n // the right of the physical box is a separating plane\n ArrayList<Surface> remainingSupportingSurfaces = updateSurfaces(new PositionedRectangle(getXRight() - box.getXRight(), depth, new Vector3D(box.getXRight(), position.getY(), position.getZ())));\n if(!remainingSupportingSurfaces.isEmpty()){\n FreeSpace3D fs = new FreeSpace3D(getXRight() - box.getXRight(), depth,\n height, new Vector3D(box.getXRight(), position.getY(), position.getZ()), this.pallet, remainingSupportingSurfaces);\n newFreeSpace3DS.add(fs);\n }\n }\n\n if(box.getYFront() > getYFront())\n {\n // the front of the physical box is a separating plane\n ArrayList<Surface> remainingSupportingSurfaces = updateSurfaces(new PositionedRectangle(width, box.getYFront() - getYFront(), position));\n if(!remainingSupportingSurfaces.isEmpty()){\n FreeSpace3D fs = new FreeSpace3D(width, box.getYFront() - getYFront(), height, position, this.pallet, remainingSupportingSurfaces);\n newFreeSpace3DS.add(fs);\n }\n }\n\n if(box.getYBack() < getYBack())\n {\n // the back of the physical box is a separating plane\n ArrayList<Surface> remainingSupportingSurfaces = updateSurfaces(new PositionedRectangle(width, getYBack() - box.getYBack(), new Vector3D(position.getX(), box.getYBack(), position.getZ())));\n if(!remainingSupportingSurfaces.isEmpty()){\n FreeSpace3D fs = new FreeSpace3D(width, getYBack() - box.getYBack(),\n height, new Vector3D(position.getX(), box.getYBack(), position.getZ()), this.pallet, remainingSupportingSurfaces);\n newFreeSpace3DS.add(fs);\n }\n }\n\n return newFreeSpace3DS;\n }",
"public final String getXmlspace() {\n return ((SVGFilterElement)ot).getXmlspace();\n }",
"public Rectangle getBounds() {\n return new Rectangle(x, y, DIAMETER, DIAMETER); // returns a rectangle with its dimensions\r\n }",
"public MazePosition getEmptySpace() {\n\t MazePosition p = freeSpace.remove(freeSpace.size()-1);\n\t return p;\n }",
"public Rectangle getBounds() {\n return new Rectangle(x, y, 32, 32);\n }",
"public int getNewSpace() {\n if (!isValid()) return 0;\n int ret = 0;\n ret += (getMode().isCollection()) ? getTransportable().getSpaceTaken()\n : -getTransportable().getSpaceTaken();\n if (hasWrapped()) {\n ret += sum(wrapped, Cargo::getNewSpace);\n }\n return ret;\n }",
"public org.edna.mxv1.xsdata.XSDataSpaceGroup getSpaceGroup(\n ) {\n return this._spaceGroup;\n }",
"public Space()\n {\n this._valuesToPut = new ArrayList<>();\n this._defaultSpace = false;\n this._lock = false;\n }",
"public ArrayList<String> getSpaces(){\n return this.spaces; //allows us to get \n }",
"public Rectangle getBounds() {\n\treturn new Rectangle((int)x,(int)y,32,32);\n\t}",
"public Rectangle getBounds()\n {\n return new Rectangle ((int)x,(int)y,32,32);\n }",
"public float[] getBounds() {\r\n\t\tfloat[] bounds = {x_ - width_/ 2, x_ + width_ / 2, y_ - height_ / 2, y_ + height_ / 2};\r\n\t\treturn bounds;\r\n\t}",
"@Internal\n\tpublic CTChartSpace getCTChartSpace(){\n\t\treturn chartSpace;\n\t}",
"public Bounds getBounds () { return (bounds); }",
"public Space getSubSpace(String spaceName) {\t\n\t\treturn (Space)MappingUtil.getObject(spaceName); \n\t}",
"public static SpaceImpl getInstance() throws RemoteException {\n if(spaceImplInstance == null) {\n new SpaceImpl();\n }\n return spaceImplInstance;\n }",
"public MWC.GenericData.WorldArea getBounds()\r\n\t{\n\t\treturn null;\r\n\t}",
"public Rectangle getBounds() {\n\t\tRectangle Box = new Rectangle(x, y, 48, 48);\n\t\treturn Box;\n\t}",
"public boolean isSpaceship();",
"private int getDist(int x, int y, int direction) {\n\t\tint Spaces = 0;\n\t\tif(direction == 0)\n\t\t{\n\t\t\t\n\t\t\tPoint nextPoint = new Point(x, y++);\n\t\t\twhile(totalMap.isFreeSpace(nextPoint) && totalMap.isInsideGrid(nextPoint.x, nextPoint.y))\n\t\t\t{\n\t\t\t\tSpaces++;\n\t\t\t\tnextPoint.setLocation(x, y++);\n\t\t\t}\n\t\t}\n\t\tif(direction == 1)\n\t\t{\n\t\t\tPoint nextPoint = new Point(x++, y);\n\t\t\twhile(totalMap.isFreeSpace(nextPoint) && totalMap.isInsideGrid(nextPoint.x, nextPoint.y))\n\t\t\t{\n\t\t\t\tSpaces++;\n\t\t\t\tnextPoint.setLocation(x++, y);\n\t\t\t}\n\t\t}\n\t\tif(direction == 2)\n\t\t{\n\t\t\tPoint nextPoint = new Point(x--, y);\n\t\t\twhile(totalMap.isFreeSpace(nextPoint) && totalMap.isInsideGrid(nextPoint.x, nextPoint.y))\n\t\t\t{\n\t\t\t\tSpaces++;\n\t\t\t\tnextPoint.setLocation(x--, y);\n\t\t\t}\n\t\t}\n\t\tif(direction == 3)\n\t\t{\n\t\t\tPoint nextPoint = new Point(x, y--);\n\t\t\twhile(totalMap.isFreeSpace(nextPoint) && totalMap.isInsideGrid(nextPoint.x, nextPoint.y))\n\t\t\t{\n\t\t\t\tSpaces++;\n\t\t\t\tnextPoint.setLocation(x, y--);\n\t\t\t}\n\t\t}\n\t\treturn Spaces;\n\t}",
"public String getSpacecraft()\n {\n return spacecraft;\n }",
"public String getSpaceType() {\n\t\treturn type;\n\t}",
"public double getCharSpace(\n )\n {return charSpace;}",
"public Toolboxspace getToolboxspace() {\n return toolboxspace;\n }",
"public int getSpace(){\n // iterate through nodes\n int totalSpace = 0;\n Collection<SupplyNode> nodeCol = t.values();\n Iterator<SupplyNode> it = nodeCol.iterator();\n \n // multiply resource count by resource space\n while (it.hasNext()){\n SupplyNode s = it.next();\n totalSpace += (s.getCurrent()*s.getResource().getCost());\n }\n \n // return\n return totalSpace;\n }",
"public static JavaSpace05 getSpace(String spaceName) {\n return getSpace(spaceName, SorcerEnv.getSpaceGroup());\n }",
"public Rectangle getBounds() {\n\t\treturn new Rectangle((int) xPos, (int) yPos, (int) width, (int) height);\n\t}",
"protected abstract ColorSpace getColorSpace();",
"public Rectangle getBounds(){\r\n return new Rectangle(x, y, w, w);\r\n }",
"public Rectangle getBounds() {\r\n\t\treturn new Rectangle((int) (x * scalingX), (int) (y * scalingY), (int) rocketWidth, (int) rocketHeight);\r\n\t}",
"public Rectangle bounds()\n\t{\n\t\treturn (new Rectangle(x, y, 10, 10));\n\t}",
"public long getTotalSpace(){\n return totalSpace;\n }",
"public Rectangle getBounds() {\n\t\treturn new Rectangle(getX(),getY(),width, width);\n\t}",
"public Rectangle getBounds() {\r\n return new Rectangle(x, y, 55, 51);\r\n }",
"public RMRect getBounds() { return new RMRect(getX(), getY(), getWidth(), getHeight()); }",
"public Long getUsedSpace() {\n return usedSpace;\n }",
"public List<Move> getAvailableSpaces() {\n List<Move> availableMoves = new ArrayList<>();\n for (int i = 0; i < LENGTH; i++) {\n for (int j = 0; j < LENGTH; j++) {\n Move move = new Move(i, j);\n if (isValidMove(move)) {\n availableMoves.add(move);\n }\n }\n }\n return availableMoves;\n }",
"public Box[][] getGrid() {\n return this.grid;\n }",
"public Rectangle getBounds()\r\n\t{\r\n\t\treturn new Rectangle(x, y, w, h);\r\n\t}",
"@Override\n\tpublic Rectangle getBounds() {\n\t\treturn new Rectangle(screen_x, screen_y, pinWidth, pinWidth);\n\t}",
"public Iterator<Space> iterator() {\n return spaces.iterator();\n }",
"public Rectangle get_rect() {\n\t\treturn new Rectangle(\n\t\t\t\torigin_x+component_x, \n\t\t\t\torigin_y+component_y-component_height+3, \n\t\t\t\tcomponent_width, \n\t\t\t\tcomponent_height\n\t\t\t);\n\t}",
"public Rectangle2D getBoundary() {\n return new Rectangle2D(x, y, width, height);\n }",
"protected Space getSpaceInstance(int number) throws Exception {\n Space space = new Space();\n space.setDisplayName(\"my space \" + number);\n space.setPrettyName(space.getDisplayName());\n space.setRegistration(Space.OPEN);\n space.setDescription(\"add new space \" + number);\n space.setType(DefaultSpaceApplicationHandler.NAME);\n space.setVisibility(Space.PUBLIC);\n space.setRegistration(Space.VALIDATION);\n space.setPriority(Space.INTERMEDIATE_PRIORITY);\n space.setGroupId(\"/space/space\" + number);\n space.setAvatarUrl(\"my-avatar-url\");\n String[] managers = new String[] {rootIdentity.getRemoteId()};\n String[] members = new String[] {rootIdentity.getRemoteId()};\n String[] invitedUsers = new String[] {};\n String[] pendingUsers = new String[] {};\n space.setInvitedUsers(invitedUsers);\n space.setPendingUsers(pendingUsers);\n space.setManagers(managers);\n space.setMembers(members);\n space.setUrl(space.getPrettyName());\n space.setAvatarLastUpdated(System.currentTimeMillis());\n this.spaceService.saveSpace(space, true);\n tearDownSpaceList.add(space);\n return space;\n }",
"private String getKeySpace()\r\n\t\t{\r\n\t\t\tString firstKey;\r\n\t\t\tString lastKey;\r\n\t\t\tif (incompleteKeySpaces.isEmpty())\r\n\t\t\t{\r\n\t\t\t\trunningKeySpaces.add(highestKey);\r\n\t\t\t\tfirstKey = highestKey.toString();\r\n\t\t\t\thighestKey = highestKey.add(keySpaceSize);\r\n\t\t\t\tlastKey = highestKey.toString();\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\trunningKeySpaces.add(incompleteKeySpaces.get(0));\r\n\t\t\t\tfirstKey = incompleteKeySpaces.get(0).toString();\r\n\t\t\t\tlastKey = incompleteKeySpaces.get(0).add(keySpaceSize).toString();\r\n\t\t\t\tincompleteKeySpaces.remove(0);\r\n\t\t\t}\r\n\t\t\tlog(\"Assigning keyspace: \" + firstKey);\r\n\t\t\treturn firstKey + \",\" + lastKey;\r\n\t\t}",
"public Rectangle getBounds() {\n return new Rectangle((int) getX() - 20, (int) getY() - 20, 40, 40);\n }",
"public int getNumberOfSpaceActivities(Identity spaceIdentity);",
"public Bounds get() {\n\treturn bounds;\n }",
"public Rect getBound() {\n return new Rect((int) (x - radius), (int) (y - radius), (int) (x + radius), (int) (y + radius));\n }",
"public int getBound();",
"static Extractor bySpaces() {\n\t\t\treturn Splitter.SPACE_EXTRACTOR;\n\t\t}",
"public GameObject[][] getGrid(){\n\t\t\r\n\t\treturn this.grid;\r\n\t}",
"public static Dimension getPos()\n {\n Dimension pos = new Dimension( cX, cY );\n next();\n return pos;\n }",
"@Override\r\n\tSpaceship getShip() {\n\t\treturn new MotherShip(getWidth()/2, getHeight());\r\n\t}",
"public Messagespace getMessagespace() {\n return messagespace;\n }",
"public abstract Regionlike getGridBounds();",
"public PVector getWristPosition(){\n\t\treturn this.leap.map(this.arm.wristPosition());\n\t}",
"public Bounds getLogicalBounds() {\n return getDragContext().getLogicalBounds();\n }",
"public static JavaSpace05 getSpace(String spaceName, String spaceGroup) {\n return instance.doGetSpace(spaceName, spaceGroup);\n }",
"private DynamicgridSpacePartitioner getSpacePartitioner() throws ZookeeperException, ZookeeperNotFoundException {\n\t\tfinal DynamicgridSpacePartitioner spacepartitionier = (DynamicgridSpacePartitioner)\n\t\t\t\tdistributionGroupZookeeperAdapter.getSpaceparitioner(TEST_GROUP,\n\t\t\t\t\t\tnew HashSet<>(), new DistributionRegionIdMapper(TEST_GROUP));\n\n\t\treturn spacepartitionier;\n\t}",
"public boolean atSpaceship()\r\n\t{\r\n\t\treturn this.currentPlace.isSpaceship();\r\n\t}",
"Rectangle getBounds();",
"public Point getUniverseDimensions(){\n return this.physModel.getUniverseDimensions();\n }",
"Dimension getDimension();",
"int getBoundsX();",
"public int space(){\n return (tableSize - usedIndex);\n }",
"public void setCargoSpace(int cargoSpace) {\n this.cargoSpace = cargoSpace;\n }",
"public double getRrSpacing() {\n return rrSpacing;\n }",
"private Bounds getDrawBounds() {\n\t\tfinal float boundsWidth = 2 * OFFSET_X;\n\t\tfinal float boundsHeight = 2 * OFFSET_Y;\n\t\t\n\t\t//Get the center point of the player, then subtract by offset\n\t\tfinal float x = (activePlayer.getX() + activePlayer.getWidth() / 2f) \n\t\t\t\t/ activePlayer.getScaleX() - OFFSET_X;\n\n\t\tfinal float y = (activePlayer.getY() + activePlayer.getHeight() / 2f) \n\t\t\t\t/ activePlayer.getScaleY() - OFFSET_Y + 1;\n\t\t\n\t\treturn new Bounds(x, y, boundsWidth, boundsHeight);\n\t}"
] | [
"0.7954839",
"0.7416969",
"0.73610526",
"0.70815516",
"0.69599676",
"0.69030905",
"0.68653446",
"0.6728522",
"0.6693602",
"0.6599521",
"0.63968366",
"0.6215924",
"0.61209506",
"0.61161476",
"0.6081448",
"0.602002",
"0.59496737",
"0.5904221",
"0.58763516",
"0.58682597",
"0.5845124",
"0.58255476",
"0.5801501",
"0.57990885",
"0.56610197",
"0.5627905",
"0.55964756",
"0.5570003",
"0.55576074",
"0.549294",
"0.5488503",
"0.54708934",
"0.5445628",
"0.5433193",
"0.54209656",
"0.5397956",
"0.5384681",
"0.53664935",
"0.53635734",
"0.53363705",
"0.5318631",
"0.5309291",
"0.5305812",
"0.5302326",
"0.5278777",
"0.52597976",
"0.5243842",
"0.52406967",
"0.5237032",
"0.5233214",
"0.5232695",
"0.5208179",
"0.517747",
"0.51293314",
"0.51261526",
"0.5116223",
"0.5088071",
"0.5085667",
"0.50804543",
"0.5079353",
"0.5078219",
"0.5072216",
"0.5051622",
"0.5048026",
"0.5038978",
"0.5010515",
"0.50094414",
"0.50090975",
"0.5007897",
"0.5005334",
"0.5002816",
"0.49999845",
"0.49901202",
"0.49861425",
"0.49822122",
"0.49751982",
"0.49671897",
"0.4965692",
"0.49488208",
"0.49316898",
"0.49192515",
"0.49107262",
"0.49048144",
"0.48991486",
"0.4892335",
"0.4884345",
"0.48833483",
"0.48801866",
"0.48797932",
"0.4872686",
"0.48696968",
"0.4866121",
"0.4860747",
"0.48586348",
"0.48518205",
"0.48494673",
"0.48467767",
"0.4841297",
"0.48292047",
"0.48259935"
] | 0.73178625 | 3 |
Retrieve the title of the demo | public String getTitle() {
return title;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"String title();",
"String title();",
"String getTitle();",
"String getTitle();",
"String getTitle();",
"String getTitle();",
"String getTitle();",
"String getTitle();",
"String getTitle();",
"String getTitle();",
"String getTitle();",
"String getTitle();",
"String getTitle();",
"String getTitle();",
"String getTitle();",
"String getTitle();",
"String getTitle();",
"public String getTitle();",
"public String getTitle();",
"public String getTitle();",
"public String getTitle();",
"public String getTitle();",
"public String getTitle();",
"public String getTitle();",
"public String getTitle();",
"public String getTitle();",
"public String getTitle();",
"public String getTitle();",
"public String getTitle();",
"public String getTitle();",
"public String getTitle();",
"public String getTitle();",
"public String getTitle();",
"public String getTitle();",
"public String getTitle();",
"public java.lang.String getTitle();",
"public String getTitle() {\n \t\treturn getWebDriver().getTitle();\n \t}",
"public final String getTitle() {\r\n return config.title;\r\n }",
"public String title()\n\t{\n\t\treturn title;\n\t}",
"java.lang.String getTitle();",
"java.lang.String getTitle();",
"java.lang.String getTitle();",
"java.lang.String getTitle();",
"java.lang.String getTitle();",
"public String getTitle()\r\n\t{\r\n\t\treturn TITLE;\r\n\t}",
"public String getTitle() { return title; }",
"public String getTitle()\r\n {\r\n return title;\r\n }",
"public String getTitle()\r\n {\r\n return title;\r\n }",
"public String getTitle()\n {\n return title;\n }",
"public String getTitle() {\r\n return title;\r\n }",
"public String getTitle() {\r\n return title;\r\n }",
"public String getTitle() {\r\n return title;\r\n }",
"public String getTitle() {\r\n return title;\r\n }",
"public String getTitle() {\r\n return title;\r\n }",
"public String getTitle() {\r\n return title;\r\n }",
"public String getTitle() {\r\n return title;\r\n }",
"public String getTitle() {\r\n return title;\r\n }",
"public String title() {\n\t\treturn title;\n\t}",
"public String getTitle()\n {\n return title;\n }",
"public String getTitle()\n {\n return title;\n }",
"public String getTitle()\n {\n return title;\n }",
"public String getTitle()\n {\n return title;\n }",
"public String getTitle()\n {\n return title;\n }",
"public String getTitle()\n {\n return title;\n }",
"public String getTitle() {\n \t\treturn title;\n \t}",
"public String getTitle() {\n return title;\n }",
"public String getTitle() {\n return title;\n }",
"public String getTitle() {\n return title;\n }",
"public String getTitle() {\n return title;\n }",
"public String getTitle() {\n return title;\n }",
"public String getTitle()\n\t{\n\t\treturn title;\n\t}",
"public String getTitle()\n\t{\n\t\treturn title;\n\t}"
] | [
"0.7885867",
"0.7885867",
"0.76901644",
"0.76901644",
"0.76901644",
"0.76901644",
"0.76901644",
"0.76901644",
"0.76901644",
"0.76901644",
"0.76901644",
"0.76901644",
"0.76901644",
"0.76901644",
"0.76901644",
"0.76901644",
"0.76901644",
"0.76703674",
"0.76703674",
"0.76703674",
"0.76703674",
"0.76703674",
"0.76703674",
"0.76703674",
"0.76703674",
"0.76703674",
"0.76703674",
"0.76703674",
"0.76703674",
"0.76703674",
"0.76703674",
"0.76703674",
"0.76703674",
"0.76703674",
"0.76703674",
"0.76126564",
"0.75943273",
"0.758096",
"0.75794566",
"0.7541006",
"0.7541006",
"0.7541006",
"0.7541006",
"0.7541006",
"0.75392413",
"0.7536493",
"0.7530452",
"0.7530452",
"0.75201714",
"0.75067544",
"0.7499422",
"0.7499422",
"0.7499422",
"0.7499422",
"0.7499422",
"0.7499422",
"0.7499422",
"0.74960995",
"0.7478566",
"0.7478566",
"0.7478566",
"0.7478566",
"0.7478566",
"0.7478566",
"0.7477509",
"0.7477193",
"0.7477193",
"0.7477193",
"0.7477193",
"0.7477193",
"0.7463314",
"0.7463314"
] | 0.0 | -1 |
Called when a key is released. | protected void keyHit(int keyCode) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void keyReleased(KeyEvent key) {\n gsm.keyReleased(key.getKeyCode());\n }",
"@Override\n\tpublic void keyReleased(int k) {\n\n\t}",
"public void keyReleased() {\t\t\r\n \t\t\r\n \t\tkeys[keyCode] = false;\r\n \t}",
"@Override\r\n\tpublic void keyReleased(KeyEvent key) {\r\n\t\t// Invoke method if the key is released. \r\n\t\t// Do nothing, not all three methods need to be used. \r\n\t}",
"public void keyReleased(KeyEvent ke){}",
"@Override\n\t\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\t\n\t\t}",
"@Override\n\t\t\tpublic void keyReleased(KeyEvent arg0)\n\t\t\t{\n\t\t\t\t\n\t\t\t}",
"@Override\r\n\tpublic void keyReleased(int key, char c)\r\n\t{\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\t\t\r\n\t\t\t}",
"@Override\n\t\t\t\t\tpublic void keyReleased(KeyEvent arg0) {\n\n\t\t\t\t\t}",
"@Override\n\t\t\t\t\tpublic void keyReleased(KeyEvent arg0) {\n\n\t\t\t\t\t}",
"@Override\n\t\t\t\t\t\tpublic void keyReleased(KeyEvent arg0) {\n\n\t\t\t\t\t\t}",
"@Override\n\t\t\t\t\t\tpublic void keyReleased(KeyEvent arg0) {\n\n\t\t\t\t\t\t}",
"@Override\n\t\t\t\t\t\tpublic void keyReleased(KeyEvent arg0) {\n\n\t\t\t\t\t\t}",
"@Override\n\t\t\t\t\t\tpublic void keyReleased(KeyEvent arg0) {\n\n\t\t\t\t\t\t}",
"@Override\n\t\t\t\t\t\tpublic void keyReleased(KeyEvent arg0) {\n\n\t\t\t\t\t\t}",
"@Override\n\t\t\t\t\t\tpublic void keyReleased(KeyEvent arg0) {\n\n\t\t\t\t\t\t}",
"@Override\n\t\t\t\t\t\tpublic void keyReleased(KeyEvent arg0) {\n\n\t\t\t\t\t\t}",
"@Override\r\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\r\n\t}",
"@Override\n \t\t\tpublic void keyReleased(KeyEvent arg0) {\n \t\t\t\t\n \t\t\t}",
"@Override\n\tpublic void keyReleased(KeyEvent arg0)\n\t{\n\t\t\n\t}",
"@Override\n public void keyReleased(KeyEvent keyEvent) {\n\n b.keyReleased(keyEvent);\n }",
"public void keyReleased(KeyEvent arg0) {}",
"@Override\r\n\tpublic void keyReleased(KeyEvent arg0) {\n\t}",
"public void keyReleased(KeyEvent ke) {\n\t\t}",
"public abstract void keyReleased(KeyReleasedEvent keyReleasedEvent);",
"public void keyReleased (KeyEvent e)\r\n {\r\n \tkeyPressed = false;\r\n \tkeyReleased = true;\r\n \tkey = 0;\r\n }",
"@Override\r\n\t\t\tpublic void keyReleased(KeyEvent arg0) {\n\r\n\t\t\t}",
"@Override\n\tpublic void keyReleased(KeyEvent arg0) {\n\n\t}",
"@Override\n\tpublic void keyReleased(KeyEvent arg0) {\n\n\t}",
"@Override\n\tpublic void keyReleased(KeyEvent arg0) {\n\n\t}",
"@Override\n\tpublic void keyReleased(KeyEvent arg0) {\n\n\t}",
"@Override\n\tpublic void keyReleased(KeyEvent arg0) {\n\n\t}",
"@Override\n\t\t\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\n\t}",
"@Override\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\n\t}",
"@Override\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\n\t}",
"@Override\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\n\t}",
"@Override\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\n\t}",
"@Override\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\n\t}",
"@Override\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\n\t}",
"@Override\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\n\t}",
"@Override\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\n\t}",
"public void keyReleased(KeyEvent e) {}",
"public void keyReleased(KeyEvent e) {}",
"public void keyReleased(KeyEvent e) {}",
"public void keyReleased (KeyEvent arg0) {\n\t}",
"@Override\r\n\tpublic void keyReleased(java.awt.event.KeyEvent arg0) {\n\t\t\r\n\t}",
"public void keyReleased(KeyEvent e) \r\n {\r\n \tkeyUser = 0;\r\n }",
"public void keyReleased(KeyEvent e) {\n\t}",
"public void keyReleased(KeyEvent e)\t\n\t{\n\t}",
"public void keyReleased() {\n ticker.stop();\n }",
"@Override\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\tSystem.out.println(\"keyReleased\");\n\t}",
"@Override\n\tpublic void keyReleased(KeyEvent arg0) {\n\t\t\t\n\t}",
"public void keyReleased(KeyEvent e) {\n }",
"public void keyReleased(KeyEvent e){}",
"public void keyReleased (KeyEvent e){}",
"public void keyReleased(KeyEvent e) \r\n\t{\n\t}",
"public void keyReleased(KeyEvent arg0) {\n\r\n\t}",
"public void keyReleased(final KeyEvent e) {\n\n }",
"public void keyReleased(KeyEvent e) {\n\n\t\t\t}",
"public void keyReleased(KeyEvent e) {\n\t\t\t\t}",
"public void keyReleased(KeyEvent e) {\n\t\t\t\t}",
"public void keyReleased(KeyEvent e) {\n\t\t\t\t}",
"public void keyReleased(KeyEvent e) {\n\t\t\t\n\t\t\t}",
"public void keyReleased(KeyEvent e) {\n\n\t}",
"public void keyReleased(KeyEvent e) {\n\n\t}",
"public void keyReleased(KeyEvent e) {\n\n\t}",
"public void keyReleased(KeyEvent e)\n {\n \n }",
"@Override\n public void keyReleased(KeyEvent arg0) {\n\n }",
"public void keyReleased(KeyEvent e) {\n\n\t\t}",
"public void keyReleased(KeyEvent e)\n {\n \t//System.out.println(\"Key Released!\");\n }",
"@Override\n public void keyReleased(KeyEvent event) {\n }",
"@Override\n\tpublic void keyReleased(KeyEvent e)\n\t\t{\n\t\t\t\n\t\t}",
"public void keyReleased(KeyEvent arg0) {\n\n }",
"public void keyReleased(KeyEvent e) {\n\t\t\t\t\n\t\t\t}",
"public void keyReleased(KeyEvent e) {\n\t\t\t\t\n\t\t\t}",
"public void keyReleased(KeyEvent e) {\n\t\t\r\n\t}",
"@Override\r\n public void keyReleased(KeyEvent e)\r\n {\n }",
"@Override\r\n public void keyReleased(KeyEvent e) {\n }",
"public void keyReleased(KeyEvent e) {\n\r\n\t}",
"@Override\r\n public void keyReleased(KeyEvent e) {\r\n }",
"public void keyReleased(KeyEvent e){\n\t\tif(currentGame != null){\n\t\t\tcurrentGame.userReleasedKey(e);\n\t\t}\n\t}",
"@Override\r\n\t\tpublic void keyReleased(KeyEvent e) {\n\t\t}",
"@Override\n public void keyReleased(KeyEvent e) {\n }",
"@Override\n public void keyReleased(KeyEvent e) {\n }",
"@Override\n public void keyReleased(KeyEvent e) {\n }",
"@Override\n public void keyReleased(KeyEvent e) {}"
] | [
"0.81566626",
"0.81326836",
"0.79397255",
"0.7917568",
"0.7907643",
"0.7871763",
"0.78680515",
"0.7854274",
"0.78408027",
"0.7811016",
"0.7811016",
"0.78051513",
"0.78051513",
"0.78051513",
"0.78051513",
"0.78051513",
"0.78051513",
"0.78051513",
"0.7795908",
"0.7795908",
"0.7795908",
"0.7795908",
"0.7795908",
"0.7795908",
"0.7795908",
"0.7795908",
"0.7795908",
"0.7795908",
"0.7790854",
"0.7788241",
"0.77856666",
"0.77661055",
"0.7759362",
"0.77570415",
"0.7744709",
"0.77441216",
"0.77361035",
"0.7729684",
"0.7729684",
"0.7729684",
"0.7729684",
"0.7729684",
"0.7727318",
"0.7727318",
"0.7727318",
"0.7727318",
"0.7727318",
"0.77200896",
"0.77200896",
"0.77200896",
"0.77200896",
"0.77200896",
"0.77200896",
"0.77200896",
"0.77200896",
"0.77200896",
"0.7719015",
"0.7719015",
"0.7719015",
"0.76753116",
"0.76680756",
"0.7654466",
"0.7648386",
"0.76383317",
"0.7616087",
"0.76151025",
"0.76109886",
"0.7610592",
"0.76057136",
"0.75989455",
"0.75889575",
"0.7575341",
"0.75679123",
"0.75477636",
"0.7547633",
"0.7547633",
"0.7547633",
"0.75370365",
"0.7526541",
"0.7526541",
"0.7526541",
"0.75126046",
"0.7511802",
"0.7485129",
"0.74850667",
"0.7485014",
"0.7480032",
"0.7472453",
"0.746816",
"0.746816",
"0.7464512",
"0.74538356",
"0.74169993",
"0.74056596",
"0.7382278",
"0.7374575",
"0.73652786",
"0.7363685",
"0.7363685",
"0.7363685",
"0.7359404"
] | 0.0 | -1 |
Start the simulation running | public void start() {
initGUI();
initDemo();
float target = 1000 / 60.0f;
float frameAverage = target;
long lastFrame = System.currentTimeMillis();
float yield = 10000f;
float damping = 0.1f;
while (running) {
// adaptive timing loop from Master Onyx
long timeNow = System.currentTimeMillis();
frameAverage = (frameAverage * 10 + (timeNow - lastFrame)) / 11;
lastFrame = timeNow;
yield += yield * ((target / frameAverage) - 1) * damping + 0.05f;
for (int i = 0; i < yield; i++) {
Thread.yield();
}
update();
// render
Graphics2D g = (Graphics2D) strategy.getDrawGraphics();
g.setColor(background);
g.fillRect(0, 0, 500, 500);
draw(g);
renderGUI(g);
g.dispose();
strategy.show();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void startSimulation();",
"public void start() {\n notifyStart();\n simloop();\n notifyStop();\n }",
"public void start(){\n\t\t//System.out.println(\"SimulationTime.start\");\n\t\tthis.running\t\t\t= true;\n\t\tthis.pause\t\t\t\t= false;\n\t}",
"public void startSimulation(){\n Enumeration enumAgents = agents.elements();\n\n while (enumAgents.hasMoreElements()) {\n ProcessData data = (ProcessData) enumAgents.nextElement();\n createThreadFor(data.agent).start();\n }\n }",
"public void run() {\n\t\t\t\tui = new GUI();\n\t\t\t\tui.generateUI();\n\t\t\t\tui.showUI(true);\n\n\t\t\t\t// Start sim ticking - sim is initialized below *before* this is called\n\t\t\t\tsim.newSim();\n\t\t\t\tsim.start();\n\t\t\t}",
"@Override\r\n public void simulationStarted() {\n if (this.running == true) {\r\n this.stopSound();\r\n }\r\n\r\n // start the sound module thread\r\n this.soundThread.start();\r\n\r\n // stop the background sound if it is playing\r\n this.playBackgroundSound(false);\r\n\r\n // the simulation is now running\r\n this.runSimulationState = true;\r\n }",
"public void start() {\r\n if (ticks != 0) {\r\n if (uiCreator.isPresent()) {\r\n uiCreator.get().createUI(simulator);\r\n } else {\r\n simulator.start();\r\n }\r\n }\r\n }",
"public void start() {\n\t\tthis.controller.run();\n\t}",
"public void start() {\r\n\t\trunning = true;\r\n\t\trun();\r\n\t}",
"@Override\r\n public void runSimulation(){\r\n initialize();\r\n initialRun();\r\n initialize(\"square\");\r\n initialRun();\r\n initialize(\"circle\");\r\n initialRun();\r\n initialize(\"crack\");\r\n initialRun(); \r\n initialize(\"cross\");\r\n initialRun();\r\n }",
"public void startSimulation() {\n\t\t// process the inputs\n\t\ttry {\n\t\t\tthis.numberOfServers = Integer.parseInt(frame.getNumberOfQueues());\n\t\t\tthis.minProcessingTime = Integer.parseInt(frame.getMinServiceTime());\n\t\t\tthis.maxProcessingTime = Integer.parseInt(frame.getMaxServiceTime());\n\t\t\tthis.numberOfClients = Integer.parseInt(frame.getNumberOfClients());\n\t\t\tthis.timeLimit = Integer.parseInt(frame.getSimulationInterval());\n\t\t\tthis.selectionPolicy = frame.getSelectionPolicy();\n\t\t\tthis.minArrivingTime = Integer.parseInt(frame.getMinArrivingTime());\n\t\t\tthis.maxArrivingTime = Integer.parseInt(frame.getMaxArrivingTime());\n\t\t\tthis.maxTasksPerServer = Integer.parseInt(frame.getTasksPerServer());\n\t\t\tthis.simulationSpeed = Integer.parseInt(frame.getSimulationSpeed());\n\t\t} catch (NumberFormatException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tgenerateNRandomTasks();\n\t\tscheduler = new Scheduler(this.numberOfServers, this.maxTasksPerServer, this);\n\t\tscheduler.changeStrategy(this.selectionPolicy);\n\t\tscheduler.setMaxTasksPerServer(this.maxTasksPerServer);\n\t\t// initialise emptyQueueTime\n\t\temptyQueueTime = new int[this.numberOfServers];\n\t\tfor (int i = 0; i < this.numberOfServers; i++)\n\t\t\tthis.emptyQueueTime[i] = 0;\n\n\t\tThread th = new Thread(this);\n\t\tth.start();\n\t}",
"private void runSimulation() throws Exception{\n\t\tsimulatable.simulate();\n\t\tprintUsage();\n\t}",
"public void quickSimulation() {\n\t\tnew SimulationControleur();\n\t}",
"public void start() {\n while (true) {\n for (GameStep gameStep : gameStepList) {\n gameStep.performStep();\n }\n }\n }",
"@Override\n public void run() {\n try {\n generators.forEach(EventGenerator::start);\n if (log.isDebugEnabled()) {\n log.debug(\"Event generators started. Begin event simulation for uuid : \" + uuid);\n }\n } catch (SimulatorInitializationException e) {\n /**\n * catch exception so that any resources opened could be closed and rethrow an exception indicating which\n * simulation failed\n * */\n stop();\n throw new SimulatorInitializationException(\"Error occurred when initializing event generators for \" +\n \"simulation '\" + simulationProperties.getSimulationName() + \"'. \", e);\n }\n eventSimulation();\n }",
"public void run() {\r\n System.out.println(\"Start sim\");\r\n for (; isRunning;) {\r\n //int horLaneNum = optView.getUserHorNum();\r\n //if (horLaneNum == 1) {\r\n horX++;\r\n horSTX = horSTX;\r\n horSTY = horSTY;\r\n verY++;\r\n view.repaint();\r\n try {\r\n Thread.sleep(10);\r\n }\r\n catch (InterruptedException e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n }",
"public void run() \n\t{\n\t\tif(isRunning == true)\n\t\t{\n\t\t\tsimulation.tick();\n\t\t\tthis.updateStats();\n\t\t}\n\t}",
"public void start() {\n\t\tthis.startTime = System.nanoTime();\n\t\tthis.running = true;\n\t}",
"public void start() {\n System.out.println(\"Machine started.\");\n }",
"public void start() {\n \t\tgui.initialize();\n \t\t// DEBUG mode\n\t\tbman.get(0).boostSpeed(2);\n \n \t\tloop();\n \t}",
"public SimResult start() {\n\t\tSimResultBuilder srb = new SimResultBuilder();\n\t\tList<Long> durations = new ArrayList<Long>();\n\t\tList<Long> tardinesses = new ArrayList<Long>();\n\t\tsrb.overallStartTime(System.currentTimeMillis());\n\t\t(new AddInputs()).run();\n\t\tsrb.overallCompletionTime(System.currentTimeMillis());\n\t\tfor (Result<BaseClusterSimWorkflow> r : results) {\n\t\t\tdurations.add(r.getLifeTimeDuration());\n\t\t\ttardinesses.add(r.getTardiness());\n\t\t}\n\t\tsrb.duration(durations);\n\t\tsrb.tardiness(tardinesses);\n\t\tsrb.executionStatus(ExecutionStatus.SUCCESSFUL);\n\t\treturn srb.build();\n\t}",
"public void start() {\n\t\t// doctors start waiting at OPEN_TIME\n\t\tfor (int i = 0; i < _doctors.length; ++i) {\n\t\t\t_doctors[i].startWaiting();\n\t\t}\n\t\t_xrayDoctor.startWaiting();\n\t\tprintTimer();\n\t\tprint(\"Start of simulation.\");\n\t\tprint(\"All doctors start waiting.\");\n\n\t\t// recurse on all events\n\t\twhile (_eventQueue.hasMoreElements()) {\n\t\t\tEvent e = (Event) _eventQueue.nextElement();\n\t\t\tprocessEvent(e);\n\t\t}\n\n\t\t// doctors stop waiting at CLOSE_TIME, or when the last patient left.\n\t\ttime = Math.max(time, CLOSE_TIME);\n\t\tfor (int i = 0; i < _doctors.length; ++i) {\n\t\t\t_doctors[i].stopWaiting();\n\t\t}\n\t\t_xrayDoctor.stopWaiting();\n\t\tprintTimer();\n\t\tprint(\"All doctors stop waiting.\");\n\t\tprint(\"End of simulation.\");\n\t}",
"protected static void runningSimulation() {\n Scanner sc = new Scanner(System.in);\n\n try {\n // Getting the simulation type.\n System.out.print(\"Select the Simulation Method : \\n\" +\n \"\\t0 : To Run the Simulation to the Current Waiting Room\\n\" +\n \"\\t1 : To Run the Simulation for the Whole Waiting Room\\n\" +\n \"\\n\\t\\t : \");\n int situation = sc.nextInt();\n sc.nextLine();\n\n // Checking if the Simulation Type is valid.\n if (situation == 0 || situation == 1) {\n creatingSimulationStats(situation);\n simulationReport(TrainStation.getSimulationTrainQueues());\n launchingSimulationGUI(\"SimTQ\", TrainStation.getSimulationTrainQueues(), 0, 0, 0);\n\n }\n // When the simulation type is invalid.\n else {\n System.out.println(\"Invalid Selection.\");\n mainMenu();\n }\n }\n // When an Invalid character is added.\n catch (InputMismatchException e) {\n System.out.println(\"Invalid Input.\");\n mainMenu();\n }\n // When an error is OCCured when writing the simulation report.\n catch ( IOException e) {\n System.out.println(\"ERROR - Making the Simulation Report.\");\n mainMenu();\n }\n }",
"public final boolean startSimulation() {\n\t\tboolean result = true;\n\t\tfor (String mdl : executors.keySet()) {\n\t\t\tSubstructureExecutorI exe = executors.get(mdl);\n\t\t\tresult = result && exe.startSimulation();\n\t\t}\n\t\tsetRunning(true);\n\t\treturn result;\n\t}",
"public void start() {\n System.out.println(\"start\");\n }",
"public void start() {}",
"public void start() {}",
"public void start() {\n\t\tSystem.out.println(\"BMW.........start!!!.\");\n\t}",
"@GetMapping\n private SimulatorResult runSimulator() {\n return simulatorService.runSimulation();\n }",
"public void start()\r\n\t{\n\tSystem.out.println(\"normal start method\");\r\n\t}",
"public void start() {\n System.out.println(\"This vehicle starts\");\n }",
"public void start() {\r\n\t\tdiscoverTopology();\r\n\t\tsetUpTimer();\r\n\t}",
"@Override\r\n public void initialRun(){\r\n tProcess = parser.nextSimProcessTime();\r\n System.out.println();\r\n boolean goRun=true;\r\n while(goRun){\r\n\r\n if(currentTime == tProcess){\r\n mc = parser.simProcess(mc);\r\n tProcess = parser.nextSimProcessTime();\r\n }\r\n mc.doOneStep();\r\n\r\n if(makeVideo){\r\n if(currentTime%FrameRate ==0){\r\n\r\n vid.addLatticeFrame(mc.getSimSystem().getSystemImg());\r\n makeVideo = vid.isWritten();\r\n }\r\n }\r\n\r\n if((currentTime % 10) ==0){System.out.println(\"t:\"+currentTime+\" M:\"+mc.getM());}\r\n currentTime++;\r\n\r\n\r\n goRun = !(mc.nucleated());\r\n if(mc.getM()<0 && currentTime> 300){goRun=false;}\r\n if(currentTime > maxT){goRun= false;}\r\n }\r\n\r\n if(makeVideo){\r\n vid.writeVideo();\r\n }\r\n }",
"public void startEngine(){\r\n isEngineRunning = true;\r\n System.out.println(\"[i] Engine is running.\");\r\n }",
"public void start()\n {\n }",
"public void start();",
"public void start();",
"public void start();",
"public void start();",
"public void start();",
"public void start();",
"public void start();",
"public void start();",
"public void start();",
"public void start();",
"public void start();",
"public void start();",
"public void runSimulation(WorldDescription world, boolean startPaused) {\r\n \t\tPhysicsLogger.setDefaultLoggingLevel();\r\n \t\t/* Create the simulation*/\r\n \t\tfinal PhysicsSimulation simulation = PhysicsFactory.createSimulator();\r\n \t\t\r\n \t\t/*Set ATRON robot to simulation and assign default controller to it*/\r\n \t\tATRON atron = new ATRON(){\r\n \t\t\tpublic Controller createController() {\r\n \t\t\t\treturn new ATRONControllerDefault() {\r\n \t\t\t\t\tpublic void activate() {\r\n \t\t\t\t\t\t//delay(10000);\r\n \t\t\t\t\t\tsuper.activate();\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\tatron.setGentle();// Currently builder supports only this type of ATRON\r\n \t\t//atron.setRubberRing();\r\n \t\tsimulation.setRobot(atron,\"ATRON\");\r\n \t\tsimulation.setRobot(atron,\"ATRON rubberRing gentle\");\r\n \t\tsimulation.setRobot(atron,\"default\");\r\n \t\t\r\n \t\t/*Set MTRAN robot to simulation and assign default controller to it*/\r\n \t\tsimulation.setRobot(new MTRAN(){\r\n \t\t\tpublic Controller createController() {\r\n \t\t\t\treturn new MTRANControllerDefault() {\r\n \t\t\t\t\tpublic void activate() {\r\n \t\t\t\t\t\t//delay(10000);\r\n \t\t\t\t\t\tsuper.activate();\r\n \t\t\t\t\t}\r\n \t\t\t\t};\r\n \t\t\t}},\"MTRAN\");\r\n \t\t\r\n \t\t/*Set different Odin modules to simulation and assign default controllers to them */\r\n \t\tsimulation.setRobot(new OdinMuscle(){\r\n \t\t\tpublic Controller createController() {\r\n \t\t\t\treturn new OdinControllerDefault() {\r\n \t\t\t\t\tpublic void activate() {\r\n \t\t\t\t\t\t//delay(10000);\r\n \t\t\t\t\t\tsuper.activate();\r\n \t\t\t\t\t}\r\n \t\t\t\t};\r\n \t\t\t}},\"OdinMuscle\");\r\n \t\tsimulation.setRobot(new OdinWheel(){\r\n \t\t\tpublic Controller createController() {\r\n \t\t\t\treturn new OdinControllerDefault();\r\n \t\t\t}},\"OdinWheel\");\r\n \t\tsimulation.setRobot(new OdinHinge(){\r\n \t\t\tpublic Controller createController() {\r\n \t\t\t\treturn new OdinControllerDefault();\r\n \t\t\t}},\"OdinHinge\");\r\n \r\n \t\tsimulation.setRobot(new OdinBattery(){\r\n \t\t\tpublic Controller createController() {\r\n \t\t\t\treturn new OdinControllerDefault();\r\n \t\t\t}},\"OdinBattery\");\r\n \r\n \t\tsimulation.setRobot(new OdinBall(){\r\n \t\t\tpublic Controller createController() {\r\n \t\t\t\treturn new OdinControllerDefault();\r\n \t\t\t}},\"OdinBall\");\r\n \r\n \t\tsimulation.setRobot(new OdinSpring(){\r\n \t\t\tpublic Controller createController() {\r\n \t\t\t\treturn new OdinControllerDefault();\r\n \t\t\t}},\"OdinSpring\");\r\n \r\n \t\tsimulation.setRobot(new OdinTube(){\r\n \t\t\tpublic Controller createController() {\r\n \t\t\t\treturn new OdinControllerDefault();\r\n \t\t\t}},\"OdinTube\");\t\r\n/*\t\t simulation.setRobot(new CKBotStandard(){\r\n \t \tpublic Controller createController() {\r\n \t \t\treturn new CKBotControllerDefault();\r\n\t \t}},\"CKBotStandard\");*/\r\n \t\t\r\n /*Create the world description of simulation and set it to simulation*/\r\n \t\tif(world==null) world = createWorld()\r\n \t\t;\r\n \t\tsimulation.setWorld(world);\r\n \t\t/*Simulation should be in paused state (static)in the beginning*/\r\n \t\tsimulation.setPause(startPaused);\r\n \t\t/* Start the simulation*/\r\n \t\tsimulation.start();\r\n \t}",
"public static void main(String[] args) {\n Simulation sim = new Simulation();\n //runs it.\n sim.Run();\n }",
"public void run(){\n\t\tstartServer();\n\t}",
"public void start() {\n\t\tSystem.out.println(\"BMW Slef-----start\");\n\t}",
"public void startGame() {\n running = true;\n\n Thread t = new Thread(animator);\n t.start();\n\n }",
"@Override\r\n\tpublic void start() {\n\t\tthis.controller.start();\r\n\t}",
"public void start() {\n\n\t}",
"@Override\n\tpublic void startWork() {\n\t\tSystem.out.println(\"Robot is working\");\n\t}",
"@Override\n\tpublic void start()\n\t{\n\t\tarena = \"scenarios/boxpushing/arena/pioneer.controller.arena.txt\"; \n\n\t\t\n\t\tschedule.reset();\n\n\t\tsuper.start();\n\n\t\tresetBehavior();\n\n\t}",
"@Override\n public void run() {\n start(10, 500);\n }",
"public void simulationStarted( SimulationEvent evt )\r\n {\r\n assert sim == evt.getSimulator();\r\n \r\n simTimeSinceUpdate = 0;\r\n repaint();\r\n }",
"public void start() {\n\t\t\n\t}",
"public void start() {\n\t\t\n\t}",
"public void start() {\n }",
"public void run() {\n initRun();\n while (true) {\n this.step();\n }\n }",
"public static void main(String[] args) {\n\t\tnew Simulation();\n\n\t}",
"public void setupSimulation() {\n final Timer timerStatus = new Timer();\n\n TimerTask taskUpdateFood = new TimerTask() {\n @Override\n public void run() {\n terrain.toggleFood();\n }\n };\n timerStatus.schedule(taskUpdateFood, 0, 1000);\n\n startTime = System.currentTimeMillis();\n }",
"public void start(){\n \n boolean continueSimulation = true;\n \n for (int i = 0; i < a; i++){\n threadArray[i].start();\n }\n \n while(continueSimulation == true){ \n updateBuildingManager();\n \n try{\n Thread.sleep(simulatedSecondRate);\n }catch(InterruptedException ex) {\n Thread.currentThread().interrupt();\n }\n \n // printing Simulation output every 10 seconds\n if(SimClock.getTime() % 5 == 0){\n printSimulationState();\n }\n \n SimClock.tick();\n\n /*The simulation ends when the current simulation time is \n greater than the total simulation time defined in \n ElevatorConfig.txt*/ \n \n if(SimClock.getTime() >= totalSimulatedTime){\n\n continueSimulation = false; \n \n // interrupting threads here\n for (int i = 0; i < a; i++){\n threadArray[i].interrupt();\n }\n \n System.out.println();\n System.out.println(\"=========================SIMULATION STOPPED @\" + SimClock.getTime() +\" Simulated Seconds =========================\");\n }\n }\n }",
"public boolean start();",
"@Test\r\n @SuppressWarnings(\"SleepWhileInLoop\")\r\n public void testStartSimulationSession() {\r\n System.out.println(\"startSimulationSession\");\r\n assertNotNull(sm);\r\n assertEquals(SimulationState.READY, sm.getSimulationSessionState(\"test3\"));\r\n \r\n sm.addSimulatorToSession(\"test3\", Simulators.NUATMOS, \"v1\", true);\r\n //sm.addSimulatorToSession(\"test3\", Simulators.DISPERFIRE, true);\r\n //sm.addSimulatorToSession(\"test3\", Simulators.MEB, true);\r\n \r\n boolean result = sm.startSimulationSession(\"test3\", false);\r\n assertTrue(result);\r\n \r\n result = sm.startSimulationSession(\"test5\", false);\r\n assertFalse(result);\r\n \r\n Iterator<? extends ISimulationJobInfo> jobs = sm.getSession(\"test3\").iterator();\r\n \r\n for(ISimulationJobInfo job; jobs.hasNext();) {\r\n job = jobs.next();\r\n assertEquals(job.getRetVal(), 0);\r\n }\r\n }",
"Sample start();",
"@Override\npublic void run() {\n\n while(true){\n \n driveSimulation();\n\n waitSleep(5);\n }\n \n}",
"public void ratCrewStart() {\n printStatus();\n ratCrewGo();\n madeTheRun = true;\n printStatus();\n }",
"private void start() {\n\n\t}",
"public void start()\n {}",
"public void run() {\n\t\t\tJuego.reStart();\n\n\t\t}",
"public void start(){\n\t\tstarted = true;\n\t\tlastTime = System.nanoTime();\n\t}",
"abstract public void start();",
"public void simulationStarted() {\n\t\t// Stop following the mouse while the simulation is running\n\t\tremoveMouseListener(mouseFollower);\n\t\t// Ensure display is up-to-date\n\t\trepaint();\n\t\t// Send repaint messages at regular intervals using the autoUpdater Timer object\n\t\tautoUpdater.restart();\n\t}",
"public void startSimulation() {\r\n \t\tif(animationHolder != null ) {\r\n \t\t\tanimationHolder.stop();\r\n \t\t}\r\n \t\t// if simulation is not in pause state\r\n \t\tif (!stopSimulation.isEnabled()) {\r\n \t\t\t// Asks for confirmation before overwriting previous simulation data\r\n \t\t\tif (model.containsSimulationResults()) {\r\n \t\t\t\t// Find frame to show confirm dialog\r\n \t\t\t\tComponent parent = mainWindow;\r\n \t\t\t\tif (resultsWindow != null && resultsWindow.isFocused()) {\r\n \t\t\t\t\tparent = resultsWindow;\r\n \t\t\t\t}\r\n \r\n\t\t\t\tint resultValue = JOptionPane.showConfirmDialog(parent, \"This operation will overwrite old simulation results. Continue anyway?\",\r\n \t\t\t\t\t\t\"JMT - Warning\", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);\r\n \t\t\t\tif (resultValue == JOptionPane.NO_OPTION) {\r\n \t\t\t\t\treturn;\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t\t// Asks for confirmation if a logger-file exists (and has existing data) [MF08 0.7.4 (Marco Bertoli)]\r\n \t\t\tString[] ln = model.getLoggerNameList();\r\n \t\t\tString ln2 = \"\";\r\n \t\t\tif (ln != null) {\r\n \t\t\t\tif (model.getLoggingGlbParameter(\"autoAppend\")\r\n \t\t\t\t\t\t.equalsIgnoreCase(new Integer(jmt.engine.log.LoggerParameters.LOGGER_AR_ASK).toString())) {\r\n \t\t\t\t\tif (ln.length > 0) {\r\n \t\t\t\t\t\t// Cache the absolute log-path\r\n \t\t\t\t\t\tString logabspath;\r\n \t\t\t\t\t\tif (model.getLoggingGlbParameter(\"path\").equalsIgnoreCase(\"\") || (model.getLoggingGlbParameter(\"path\").equalsIgnoreCase(\".\"))) {\r\n \t\t\t\t\t\t\tlogabspath = new File(\"\").getAbsolutePath() + File.separator;\r\n \t\t\t\t\t\t} else {\r\n \t\t\t\t\t\t\tlogabspath = new File(model.getLoggingGlbParameter(\"path\")).getAbsolutePath() + File.separator;\r\n \t\t\t\t\t\t}\r\n \r\n \t\t\t\t\t\t// Find if the logfiles have data in them:\r\n \t\t\t\t\t\ttry {\r\n \t\t\t\t\t\t\t//Code to remove duplicate file names from the list to obtain a unique list of File names.\r\n \t\t\t\t\t\t\tArrays.sort(ln);\r\n \t\t\t\t\t\t\tint k = 0;\r\n \t\t\t\t\t\t\tfor (int i = 0; i < ln.length; i++){\r\n \t\t\t\t\t\t\t\tif (i > 0 && ln[i].equals(ln[i -1])){\r\n \t\t\t\t\t\t\t\t\tcontinue;\r\n \t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\tln[k++] = ln[i];\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\tString[] unique = new String[k];\r\n \t\t\t\t\t\t\tSystem.arraycopy(ln, 0, unique, 0, k);\r\n \r\n \t\t\t\t\t\t\tfor (String element : unique) {\r\n \t\t\t\t\t\t\t\t// if the files have data, print what will be overwritten\r\n \t\t\t\t\t\t\t\tif (new File(logabspath + element).length() > 0) {\r\n \t\t\t\t\t\t\t\t\t\tln2 = ln2 + element + \", \";\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\t// remove the trailing comma\r\n \t\t\t\t\t\t\tif (ln2 != \"\") {\r\n \t\t\t\t\t\t\t\tln2 = ln2.substring(0, ln2.length() - 2);\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t} catch (Exception e) {\r\n \t\t\t\t\t\t\te.printStackTrace();\r\n \t\t\t\t\t\t}\r\n \r\n \t\t\t\t\t\tif (ln2 != \"\") {\r\n \t\t\t\t\t\t\t// Find frame to show dialog\r\n \t\t\t\t\t\t\tComponent parent = mainWindow;\r\n \t\t\t\t\t\t\tif (resultsWindow != null && resultsWindow.isFocused()) {\r\n \t\t\t\t\t\t\t\tparent = resultsWindow;\r\n \t\t\t\t\t\t\t}\r\n \r\n \t\t\t\t\t\t\tint resultValue = JOptionPane.showConfirmDialog(parent, \"This operation will modify the following logfile(s): \" + ln2\r\n \t\t\t\t\t\t\t\t\t+ \". \" + \"Continue anyway?\", \"JMT - Warning\", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);\r\n \t\t\t\t\t\t\tif (resultValue == JOptionPane.NO_OPTION) {\r\n \t\t\t\t\t\t\t\treturn;\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t} else {\r\n \t\t\t\t\t\t//System.out.println(\"Empty file\");\r\n \t\t\t\t\t}\r\n \t\t\t\t}\r\n \t\t\t} // end confirmation if file exists\r\n \t\t\t// Correct eventual problems on preloading for closed classes\r\n \t\t\tmodel.manageJobs();\r\n \t\t\tmc = new ModelChecker(model, model, model, model, false);\r\n \t\t\tpw = new JModelProblemsWindow(mainWindow, mc, this);\r\n \t\t\tif (!mc.isEverythingOkNormal()) {\r\n \t\t\t\tpw.show();\r\n \t\t\t}\r\n \t\t\tif (mc.isEverythingOkNormal() || ((!mc.isEverythingOkNormal()) && (pw.continued()))) {\r\n \t\t\t\tif (!model.isParametricAnalysisEnabled()) {\r\n \t\t\t\t\ttry {\r\n \t\t\t\t\t\t// Removes previous ResultsWindow\r\n \t\t\t\t\t\tif (resultsWindow != null) {\r\n \t\t\t\t\t\t\tresultsWindow.dispose();\r\n \t\t\t\t\t\t\tshowResults.setEnabled(false);\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\tFile temp = File.createTempFile(\"~JModelSimulation\", \".xml\");\r\n \t\t\t\t\t\ttemp.deleteOnExit();\r\n \t\t\t\t\t\tXMLWriter.writeXML(temp, model);\r\n \t\t\t\t\t\t// Creates results data structure\r\n \t\t\t\t\t\tmodel.setSimulationResults(new ResultsModel(model.getPollingInterval()));\r\n \t\t\t\t\t\tshowResults.setEnabled(true);\r\n \t\t\t\t\t\tdispatcher = new DispatcherThread(this, model, (ResultsModel) model.getSimulationResults());\r\n \t\t\t\t\t\tdispatcher.startSimulation(temp);\r\n \t\t\t\t\t} catch (Exception e) {\r\n \t\t\t\t\t\thandleException(e);\r\n \t\t\t\t\t}\r\n \t\t\t\t} else {\r\n \t\t\t\t\t// Removes previous ResultsWindow\r\n \t\t\t\t\tshowResults.setEnabled(false);\r\n \t\t\t\t\tif (resultsWindow != null) {\r\n \t\t\t\t\t\tresultsWindow.dispose();\r\n \t\t\t\t\t}\r\n \t\t\t\t\tif (progressWindow == null) {\r\n \t\t\t\t\t\tprogressWindow = new PAProgressWindow(mainWindow, simulate, pauseSimulation, stopSimulation, model\r\n \t\t\t\t\t\t\t\t.getParametricAnalysisModel());\r\n \t\t\t\t\t}\r\n \t\t\t\t\tbatchThread = new PADispatcherThread(this, model, progressWindow);\r\n \t\t\t\t\tchangeSimActionsState(false, true, true);\r\n \t\t\t\t\tprogressWindow.initialize(model.getParametricAnalysisModel().getNumberOfSteps());\r\n \t\t\t\t\tprogressWindow.start();\r\n \t\t\t\t\tprogressWindow.show();\r\n \t\t\t\t\tbatchThread.start();\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t} else {\r\n \t\t\tif (!model.isParametricAnalysisEnabled()) {\r\n \t\t\t\tdispatcher.restartSimulation();\r\n \t\t\t} else {\r\n \t\t\t\tbatchThread.restartSimulation();\r\n \t\t\t}\r\n \t\t}\r\n \t}",
"public void startup() {\n\t\tstart();\n }",
"@Override\n\tpublic void start() {\n\t\tSystem.out.println(\"BMW -- start\");\n\t}",
"public void start() {\r\n vcr().start();\t\r\n }",
"public void run() {\n // Main loop:\n // Perform simulation steps of 64 milliseconds\n // and leave the loop when the simulation is over\n while (step(64) != -1) {\n // Read the _distanceSensors:\n // Enter here functions to read sensor data, like:\n // double val = distanceSensor.getValue();\n\n // Process sensor data here\n\n // Enter here functions to send actuator commands, like:\n // led.set(1);\n };\n }",
"void start();",
"void start();",
"void start();",
"void start();",
"void start();",
"void start();",
"void start();",
"void start();",
"void start();",
"void start();",
"void start();",
"void start();",
"void start();",
"void start();",
"void start();",
"public void start() {\n\t\tSystem.out.println(\"BMW start method\");\n\t}",
"private void start() {\r\n\t\t// Clear the log file.\r\n\t\tBPCC_Logger.clearLogFile();\r\n\t\t\r\n\t\t// Initialize BPCC_Util static fields.\r\n\t\tBPCC_Util.initStaticFields();\r\n\t\t\r\n\t\t// Set logging level desired for test.\r\n\t\tBPCC_Util.setLogLevel(LogLevelEnum.DEBUG);\r\n\t\t\r\n\t\t// Initialize class global variables.\r\n\t\tinitVars();\r\n\t\t\r\n\t\tcreateAndShowGUI();\r\n\t}",
"public final void start() {\n logger.info(\"Application started.\");\n try {\n getAttributes();\n\n initSystem();\n\n assertDisplayCreated();\n\n timer = Timer.getTimer();\n \n initGame();\n\n //main loop\n while (!finished && !display.isClosing()) {\n //determine time elapsed since last frame\n updateTime();\n\n //handle input events prior to updating the scene\n // - some applications may want to put this into update of the game state\n InputSystem.update();\n\n //update game state, pass amount of elapsed time\n update(frametime);\n\n //render, do not use interpolation parameter\n render(-1.0f);\n\n //swap buffers\n display.getRenderer().displayBackBuffer();\n\n Thread.yield();\n }\n } catch (Throwable t) {\n logger.logp(Level.SEVERE, this.getClass().toString(), \"start()\", \"Exception in game loop\", t);\n } finally {\n cleanup();\n }\n logger.info(\"Application ending.\");\n\n if (display != null) {\n display.reset();\n }\n quit();\n }",
"public void launch(){\n try{\n System.out.println(\"Main: Creando agentes\");\n \tmap = visualizer.getMapToLoad();\n \tsatelite = new Satelite(id_satelite, map, visualizer);\n \tdrone = new Drone(new AgentID(\"Drone\"), map.getWidth(), map.getHeigh(), id_satelite);\n \tSystem.out.println(\"MAIN : Iniciando agentes...\");\n \tvisualizer.setSatelite(satelite);\n satelite.start();\n drone.start();\n }catch(Exception e){\n \tSystem.err.println(\"Main: Error al crear los agentes\");\n System.exit(-1);\n }\n\t}"
] | [
"0.8298504",
"0.79269475",
"0.7918094",
"0.74981236",
"0.74345666",
"0.72812486",
"0.7271595",
"0.7205596",
"0.7139991",
"0.71319216",
"0.70677936",
"0.70507896",
"0.7007114",
"0.6954787",
"0.68361455",
"0.67832875",
"0.67684954",
"0.67652863",
"0.6760685",
"0.67200065",
"0.6717005",
"0.671059",
"0.67036176",
"0.669529",
"0.66865337",
"0.66830266",
"0.66830266",
"0.66309565",
"0.66294384",
"0.662872",
"0.6607432",
"0.66009265",
"0.65981996",
"0.65717185",
"0.655564",
"0.65521604",
"0.65521604",
"0.65521604",
"0.65521604",
"0.65521604",
"0.65521604",
"0.65521604",
"0.65521604",
"0.65521604",
"0.65521604",
"0.65521604",
"0.65521604",
"0.6543637",
"0.6534725",
"0.6529495",
"0.65257484",
"0.6524298",
"0.6505165",
"0.6502556",
"0.64993054",
"0.64944375",
"0.64937544",
"0.6492755",
"0.6492236",
"0.6492236",
"0.64749503",
"0.64605266",
"0.64570975",
"0.6455187",
"0.6451603",
"0.6444862",
"0.64398795",
"0.6439441",
"0.64389694",
"0.64381707",
"0.64354956",
"0.6434104",
"0.64247656",
"0.64035565",
"0.63977474",
"0.6395211",
"0.6393651",
"0.63848686",
"0.6384156",
"0.63811773",
"0.63800937",
"0.63707227",
"0.63707227",
"0.63707227",
"0.63707227",
"0.63707227",
"0.63707227",
"0.63707227",
"0.63707227",
"0.63707227",
"0.63707227",
"0.63707227",
"0.63707227",
"0.63707227",
"0.63707227",
"0.63707227",
"0.63654184",
"0.63607",
"0.6358835",
"0.6354994"
] | 0.64628863 | 61 |
Demo customisable GUI render | protected void renderGUI(Graphics2D g) {
g.setColor(foreground);
g.drawString("ESC - Exit", 15, 430);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void onRenderGui(RenderArguments arguments);",
"private static void createAndShowGUI() {\n\t\tJFrame.setDefaultLookAndFeelDecorated(true);\n\n\t\tLevelEditor le = new LevelEditor();\n\t}",
"public void run() {\n UIManager.put(\"swing.boldMetal\", Boolean.FALSE);\n\n createAndShowGUI();\n }",
"public void run() {\n UIManager.put(\"swing.boldMetal\", Boolean.FALSE);\n createAndShowGUI();\n }",
"private void displayGUI()\n {\n SpringLayout springLayout = new SpringLayout();\n setLayout(springLayout);\n\n displayTextAreas(springLayout);\n displayButtons(springLayout);\n displayLabels(springLayout);\n displayTables(springLayout);\n //displaySelectedQuestion();\n }",
"public interface GUI {\r\n\r\n public SPLGraph getSoundLevelGraph();\r\n\r\n public int getHeight();\r\n\r\n public int getWidth();\r\n\r\n public float getLabelWidth(String label, boolean antiAlias);\r\n\r\n public float getLabelHeight(String label, boolean antiAlias);\r\n\r\n public void drawLine(NTColor color, float x1, float y1, float x2, float y2, boolean antiAlias, boolean hairline);\r\n\r\n public void drawLabel(String label, NTColor labelColor, float x, float y, boolean antiAlias);\r\n\r\n public void drawSurface(NTColor color, ArrayList<Float> xs, ArrayList<Float> ys, boolean antiAlias);\r\n\r\n }",
"public void run() {\n\t\t\t\tUIManager.put(\"swing.boldMetal\", Boolean.FALSE);\r\n\t\t\t\tcreateAndShowGUI();\r\n\t\t\t}",
"private void setupUI() {\r\n\t\tWindow.setTitle(\"Battle\");\r\n\r\n\t\tVerticalPanel panel = new VerticalPanel();\r\n\t\tpanel.addStyleName(NAME);\r\n\t\tinitWidget(panel);\r\n\t\t\r\n\t\tlabelTitle = new Label(\"Battle\");\r\n\t\tlabelTitle.addStyleName(Styles.page_title);\r\n\t\tpanel.add(labelTitle);\r\n\t\t\r\n\t\tLabel instructions = new Label(\"Click to go!\");\r\n\t\tpanel.add(instructions);\r\n\r\n\t\tHorizontalPanel hPanel = new HorizontalPanel();\r\n\t\tpanel.add(hPanel);\r\n\t\t\r\n\t\tCanvas canvas = Canvas.createIfSupported();\r\n\t\thPanel.add(canvas);\r\n\r\n\t\tVerticalPanel vPanelInfo = new VerticalPanel();\r\n\t\thPanel.add(vPanelInfo);\r\n\t\t\r\n\t\tlabelInfo = new Label();\r\n\t\tlabelInfo.addStyleName(Styles.battle_info);\r\n\t\tvPanelInfo.add(labelInfo);\r\n\t\t\r\n\t\tvPanelInfoHistory = new VerticalPanel();\r\n\t\tvPanelInfoHistory.addStyleName(Styles.battle_info_history);\r\n\t\tvPanelInfo.add(vPanelInfoHistory);\r\n\r\n\t\t\r\n\t\tcanvas.setWidth(width + \"px\");\r\n\t\tcanvas.setHeight(height + \"px\");\r\n\t\tcanvas.setCoordinateSpaceWidth(width);\r\n\t\tcanvas.setCoordinateSpaceHeight(height);\r\n\r\n\t\t//Adding handlers seems to create a performance issue in Java\r\n\t\t//mode, but likely not in javascript\r\n\t\tcanvas.addMouseDownHandler(this);\r\n//\t\tcanvas.addMouseUpHandler(this);\r\n//\t\tcanvas.addMouseMoveHandler(this);\r\n\r\n\t\tcontext2d = canvas.getContext2d();\r\n\r\n\t\tlastUpdate = System.currentTimeMillis();\r\n\t\ttimer = new Timer() {\r\n\t\t\t@Override\r\n\t\t\tpublic void run() {\r\n\t\t\t\tlong now = System.currentTimeMillis();\r\n\t\t\t\tupdate(now - lastUpdate);\r\n\t\t\t\tlastUpdate = now;\r\n\r\n\t\t\t\tdraw();\r\n\t\t\t}\r\n\t\t};\r\n\t\ttimer.scheduleRepeating(1000 / 60);\r\n\t}",
"public void renderGUI(Container drawArea) {\r\n gui.render(drawArea);\r\n }",
"void dynamicRendering();",
"private void createGUI() {\n ResizeGifPanel newContentPane = new ResizeGifPanel();\n newContentPane.setOpaque(true); \n setContentPane(newContentPane); \n }",
"private static void createGUI(){\n DrawingArea drawingArea = new DrawingArea();\n ToolSelect utilityBar = new ToolSelect();\n MenuBar menuBar = new MenuBar();\n JFrame.setDefaultLookAndFeelDecorated(true);\n JFrame frame = new JFrame(\"GUIMk1\");\n frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );\n frame.setLayout(new BorderLayout());\n frame.getContentPane().add(utilityBar, BorderLayout.WEST);\n frame.getContentPane().add(menuBar,BorderLayout.NORTH);\n frame.getContentPane().add(drawingArea);\n frame.setLocationRelativeTo( null );\n frame.setVisible(true);\n frame.pack();\n\n }",
"public void buildGui() {\n\t}",
"private static void createAndShowGUI() {\r\n //Disable boldface controls.\r\n UIManager.put(\"swing.boldMetal\", Boolean.FALSE); \r\n\r\n //Create and set up the window.\r\n JFrame frame = new JFrame(\"Exertion Scripting\");\r\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\r\n //Create and set up the content pane.\r\n NetletEditor newContentPane = new NetletEditor(null);\r\n newContentPane.setOpaque(true); //content panes must be opaque\r\n frame.setContentPane(newContentPane);\r\n\r\n //Display the window.\r\n frame.pack();\r\n frame.setVisible(true);\r\n }",
"private static void createAndShowGUI() {\n Font f = new Font(\"微软雅黑\", 0, 12);\n String names[] = {\"Label\", \"CheckBox\", \"PopupMenu\", \"MenuItem\", \"CheckBoxMenuItem\",\n \"JRadioButtonMenuItem\", \"ComboBox\", \"Button\", \"Tree\", \"ScrollPane\",\n \"TabbedPane\", \"EditorPane\", \"TitledBorder\", \"Menu\", \"TextArea\",\n \"OptionPane\", \"MenuBar\", \"ToolBar\", \"ToggleButton\", \"ToolTip\",\n \"ProgressBar\", \"TableHeader\", \"Panel\", \"List\", \"ColorChooser\",\n \"PasswordField\", \"TextField\", \"Table\", \"Label\", \"Viewport\",\n \"RadioButtonMenuItem\", \"RadioButton\", \"DesktopPane\", \"InternalFrame\"\n };\n for (String item : names) {\n UIManager.put(item + \".font\", f);\n }\n //Create and set up the window.\n JFrame frame = new JFrame(\"AutoCapturePackagesTool\");\n\n String src = \"/optimizationprogram/GUICode/u5.png\";\n Image image = null;\n try {\n image = ImageIO.read(new CaptureGUI().getClass().getResource(src));\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n frame.setIconImage(image);\n //frame.setIconImage(Toolkit.getDefaultToolkit().getImage(src));\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n frame.setResizable(false);\n frame.setLocation(Toolkit.getDefaultToolkit().getScreenSize().width / 2 - 520 / 2,\n Toolkit.getDefaultToolkit().getScreenSize().height / 2 - 420 / 2);\n frame.getContentPane().add(new CaptureGUI());\n //Display the window.\n frame.pack();\n frame.setVisible(true);\n }",
"private GUI()\n {\n makeGUI();\n }",
"public static void main(String[] args) {\n SwingUtilities.invokeLater(new Runnable() {\n public void run() {\n //Turn off metal's use of bold fonts\n UIManager.put(\"swing.boldMetal\", Boolean.FALSE);\n\n createAndShowGUI();\n }\n });\n }",
"private void setUpGUI() {\n \n removePrecursorPeakCombo.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n enzymeTypeCmb.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n useFlankingCmb.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n removePrecursorPeakCombo.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n monoPrecursorCmb.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n peptideListCmb.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n decoyFormatCombo.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n keepTerminalAaCombo.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n removeMethionineCmb.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n exactPvalueCombo.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n spScoreCombo.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n chargesCombo.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n useNeutralLossCmb.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n outputFormatCombo.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n removeTempFoldersCmb.setRenderer(new com.compomics.util.gui.renderers.AlignedListCellRenderer(SwingConstants.CENTER));\n \n minPepLengthTxt.setEditable(editable);\n minPepLengthTxt.setEnabled(editable);\n maxPepLengthTxt.setEditable(editable);\n maxPepLengthTxt.setEnabled(editable);\n minPrecursorMassTxt.setEditable(editable);\n minPrecursorMassTxt.setEnabled(editable);\n maxPrecursorMassTxt.setEditable(editable);\n maxPrecursorMassTxt.setEnabled(editable);\n monoPrecursorCmb.setEnabled(editable);\n removeMethionineCmb.setEnabled(editable);\n //minPtmsPerPeptideTxt.setEditable(editable);\n //minPtmsPerPeptideTxt.setEnabled(editable);\n maxPtmsPerPeptideTxt.setEditable(editable);\n maxPtmsPerPeptideTxt.setEnabled(editable);\n maxVariablePtmsPerTypeTxt.setEditable(editable);\n maxVariablePtmsPerTypeTxt.setEnabled(editable);\n enzymeTypeCmb.setEnabled(editable);\n peptideListCmb.setEnabled(editable);\n decoyFormatCombo.setEnabled(editable);\n keepTerminalAaCombo.setEnabled(editable);\n decoySeedTxt.setEditable(editable);\n decoySeedTxt.setEnabled(editable);\n removeTempFoldersCmb.setEnabled(editable);\n exactPvalueCombo.setEnabled(editable);\n spScoreCombo.setEnabled(editable);\n minSpectrumMzTxt.setEditable(editable);\n minSpectrumMzTxt.setEnabled(editable);\n maxSpectrumMzTxt.setEditable(editable);\n maxSpectrumMzTxt.setEnabled(editable);\n minPeaksTxt.setEditable(editable);\n minPeaksTxt.setEnabled(editable);\n chargesCombo.setEnabled(editable);\n removePrecursorPeakCombo.setEnabled(editable);\n removePrecursorPeakToleranceTxt.setEditable(editable);\n removePrecursorPeakToleranceTxt.setEnabled(editable);\n useFlankingCmb.setEnabled(editable);\n useNeutralLossCmb.setEnabled(editable);\n mzBinWidthTxt.setEditable(editable);\n mzBinWidthTxt.setEnabled(editable);\n mzBinOffsetTxt.setEditable(editable);\n mzBinOffsetTxt.setEnabled(editable);\n numberMatchesTxt.setEditable(editable);\n numberMatchesTxt.setEnabled(editable);\n outputFormatCombo.setEnabled(editable);\n \n }",
"@Override\n public void initGUI() {\n\n }",
"private void renderUI()\n\t{\n\t\ttry\n\t\t{\n\t\t\tFile image = new File(BASE_DIREC + \"foreground.png\");\n\t\t\tforeground = ImageResizer.resizeImage(ImageIO.read(image), scale * BASE_SCALE);\n\t\t}\n\t\tcatch (IOException ioe)\n\t\t{\n\t\t\t// System.err.println(ioe);\n\t\t\t// Oh well\n\t\t}\n\t\t\n\t\ttry\n\t\t{\n\t\t\tFile image = new File(BASE_DIREC + \"continue.png\");\n\t\t\tcontinueImage = ImageResizer.resizeImage(ImageIO.read(image), scale * BASE_SCALE);\n\t\t}\n\t\tcatch (IOException ioe)\n\t\t{\n\t\t\t// System.err.println(ioe);\n\t\t\t// Oh well\n\t\t}\n\t}",
"public static void render()\n {\n JWindow win = new JWindow(); //NOTE is this focusable?\n //sets the layout to add things from top to bottom\n win.getContentPane().setLayout(new BoxLayout(win.getContentPane(), BoxLayout.Y_AXIS));\n win.getContentPane().add(new JScrollPane(aboutApp.editorPane())); //adds HTML text\n JButton close = new JButton(\"Close\"); //creates the close button\n win.getContentPane().add(close);\n close.addActionListener(new ActionListener() //listens for close\n {\n public void actionPerformed(ActionEvent e) //when button is clicked\n {\n win.dispose(); //close window\n }\n });\n win.setSize(new Dimension(500, 500));\n win.setFocusableWindowState(true); //allowa the window to be focused on\n win.setVisible(true); //makes window visible\n }",
"private static void createAndShowGUI()\r\n {\r\n JFrame f = new JFrame(\"Viewer\");\r\n f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n f.getContentPane().setLayout(new BorderLayout());\r\n \r\n JLabel usageLabel = new JLabel(\"<html>\"\r\n + \"Right mouse drags: Translate<br> \"\r\n + \"Left mouse drags: Create selection shape<br>\"\r\n + \" +shift: remove from selection<br>\"\r\n + \" +ctrl: add to selection<br>\"\r\n + \"Left mouse clicks: Select single<br>\"\r\n + \" +ctrl: toggle single selection<br>\"\r\n + \"Mouse wheel: Zoom uniformly<br>\"\r\n + \" +shift: zoom along x<br>\"\r\n + \" +ctrl: zoom along y<br>\"\r\n + \"</html>\");\r\n f.getContentPane().add(usageLabel, BorderLayout.NORTH);\r\n \r\n // Create a viewer, with mouse controls where the rotation is\r\n // disabled (left clicks are intended for the selection here)\r\n Viewer viewer = new Viewer();\r\n viewer.setMouseControl(\r\n MouseControls.createDefault(viewer, false, true));\r\n \r\n // Create the selection model\r\n SelectionModel<Point2D> selectionModel = SelectionModels.create();\r\n selectionModel.addSelectionListener(\r\n new LoggingSelectionListener<Point2D>());\r\n\r\n // Create the painter for the test\r\n ViewerSelectionTestPainter viewerSelectionTestPainter = \r\n new ViewerSelectionTestPainter(selectionModel::isSelected);\r\n \r\n // The painter also serves as the point- and shape based selector.\r\n // Make this clear by assigning it to respective variables\r\n PointBasedSelector<Point2D> pointBasedSelector = \r\n viewerSelectionTestPainter;\r\n ShapeBasedSelector<Point2D> shapeBasedSelector = \r\n viewerSelectionTestPainter;\r\n\r\n // Create a selection handler for clicks, and use it to connect\r\n // the viewer and the selection model\r\n SelectionHandler<Point2D> clickSelectionHandler = \r\n SelectionHandlers.createClick(pointBasedSelector);\r\n clickSelectionHandler.connect(viewer, selectionModel);\r\n \r\n // Create a selection handler for a lasso selection, and use it to \r\n // connect the viewer and the selection model\r\n SelectionHandler<Point2D> lassoSelectionHandler = \r\n SelectionHandlers.createLasso(shapeBasedSelector);\r\n lassoSelectionHandler.connect(viewer, selectionModel);\r\n\r\n // Create a selection handler for rectangles, which can be enabled\r\n // via the config panel\r\n SelectionHandler<Point2D> rectangleSelectionHandler = \r\n SelectionHandlers.createRectangle(shapeBasedSelector);\r\n \r\n viewer.addPainter(\r\n viewerSelectionTestPainter);\r\n f.getContentPane().add(viewer, BorderLayout.CENTER);\r\n\r\n JPanel configPanel = createConfigPanel(viewer, selectionModel, \r\n lassoSelectionHandler, rectangleSelectionHandler);\r\n f.getContentPane().add(configPanel, BorderLayout.EAST);\r\n\r\n JLabel infoLabel = new JLabel(\" \");\r\n f.getContentPane().add(infoLabel, BorderLayout.SOUTH);\r\n \r\n viewer.setPreferredSize(new Dimension(500,500));\r\n f.pack();\r\n viewer.setPreferredSize(null);\r\n f.setLocationRelativeTo(null);\r\n f.setVisible(true);\r\n \r\n viewer.setDisplayedWorldArea(-0.1, -0.1, 1.2, 1.2);\r\n }",
"@Override\n public void simpleInitApp() {\n setDisplayStatView(false);\n setDisplayFps(false);\n\n // just a blue box\n Box mesh = new Box(1, 1, 1);\n Geometry geom = new Geometry(\"Box\", mesh);\n Material mat = new Material(assetManager,\n \"Common/MatDefs/Misc/Unshaded.j3md\");\n mat.setColor(\"Color\", ColorRGBA.Blue);\n geom.setMaterial(mat);\n rootNode.attachChild(geom);\n\n // Display a line of text in the default font on depth layer 0\n guiFont = assetManager.loadFont(\"Interface/Fonts/Default.fnt\");\n distanceText = new BitmapText(guiFont);\n distanceText.setSize(guiFont.getCharSet().getRenderedSize());\n distanceText.move( // x/y coordinates and z = depth layer 0\n settings.getWidth() / 2 + 50,\n distanceText.getLineHeight() + 20,\n 0);\n guiNode.attachChild(distanceText);\n\n // Display a 2D image or icon on depth layer -2\n Picture frame = new Picture(\"User interface frame\");\n frame.setImage(assetManager, \"Interface/frame.png\", false);\n frame.move(settings.getWidth() / 2 - 265, 0, -2);\n frame.setWidth(530);\n frame.setHeight(10);\n guiNode.attachChild(frame);\n\n // Display a 2D image or icon on depth layer -1\n Picture logo = new Picture(\"logo\");\n logo.setImage(assetManager, \"Interface/Monkey.png\", true);\n logo.move(settings.getWidth() / 2 - 47, 2, -1);\n logo.setWidth(95);\n logo.setHeight(75);\n guiNode.attachChild(logo);\n }",
"private void createGUI() {\r\n\r\n cgRect modelSpace = new cgRect(0, 0, 11, 11);\r\n cgRect deviceSpace = new cgRect(0, 0, 600, 600);\r\n\r\n cgTransformation tr = new cgTransformation(modelSpace, deviceSpace, false, false);\r\n\r\n /**\r\n *\r\n */\r\n // The formatter of axis' labels will use default locale and pattern\r\n NumberFormat nf = NumberFormat.getInstance();\r\n\r\n // We will use \"fixed size\" axis renderer for all axes\r\n \r\n // 参数一:标签刻度长度大小 参数二:标签数字长度大小 参数三:数字和刻度之间的距离大小,长度为像素\r\n cgAxisRenderer ar = new cgFixedSizeAxisRenderer(5, 15, 50, nf);\r\n\r\n // ----------------------------------------------------\r\n // First axis - values match the model coordinates,\r\n // model origin is at 0.0\r\n // ----------------------------------------------------\r\n \r\n // 第三个参数为显示的数字数\r\n cgRect bbox1 = new cgRect(0, 0, 11, 1);\r\n TickGenerator tg1 = new NumericTickGenerator(1.0);\r\n cgAxisShape axis1 = new cgAxisShape(cgAxisShape.NORTH, bbox1, tg1, ar);\r\n\r\n cgShapeListLayer layer = new cgShapeListLayer();\r\n\r\n layer.addShape(axis1);\r\n\r\n /**\r\n *\r\n */\r\n // ----------------------------------------------------\r\n // Create grid using regular grid renderer\r\n // ----------------------------------------------------\r\n cgRect bbox = new cgRect(0, 0, 10, 10);\r\n TickGenerator htg = new NumericTickGenerator(1.0);\r\n TickGenerator vtg = new NumericTickGenerator(1.0);\r\n cgGridRenderer gr = new cgRegularGridRenderer();\r\n cgGridShape grid = new cgGridShape(bbox, htg, vtg, gr);\r\n\r\n // ----------------------------------------------------\r\n // Create view\r\n // ----------------------------------------------------\r\n// cgShapeListLayer layer = new cgShapeListLayer();\r\n// layer.addShape( grid );\r\n cgContainerModel model = new cgContainerModel();\r\n model.setBoundingBox(modelSpace);\r\n model.addLayer(layer);\r\n\r\n cgPlotView view = new cgPlotView(model, tr);\r\n\r\n // ----------------------------------------------------\r\n // Create plot\r\n // ----------------------------------------------------\r\n cgPlot plot = new cgPlot(view);\r\n\r\n plot.addScrollbar(cgGenericPlotLayout.SOUTH);\r\n plot.addScrollbar(cgGenericPlotLayout.EAST);\r\n\r\n getContentPane().add(plot);\r\n\r\n // ----------------------------------------------------\r\n // Set up listeners\r\n // ----------------------------------------------------\r\n // Set window listener\r\n addWindowListener(new WindowAdapter() {\r\n public void windowClosing(WindowEvent e) {\r\n System.exit(0);\r\n }\r\n });\r\n }",
"public static void main(String[] args) {\n SwingUtilities.invokeLater(new Runnable() {\n public void run() {\n //Turn off metal's use of bold fonts\n UIManager.put(\"swing.boldMetal\", Boolean.FALSE);\n createAndShowGUI();\n }\n });\n }",
"private static void initAndShowGUI() {\n }",
"private static void createAndShowGUI() {\n\n //Create and set up the window.\n JFrame frame = new JFrame(\"ButtonDemo\");\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n //Create and set up the content pane.\n ButtonDemo newContentPane = new ButtonDemo();\n newContentPane.setOpaque(true); //content panes must be opaque\n frame.setContentPane(newContentPane);\n\n //Display the window.\n frame.pack();\n frame.setVisible(true);\n }",
"public interface SynthUI {\r\n \r\n public SynthContext getContext(JComponent arg0);\r\n\r\n public void paintBorder(SynthContext context, Graphics g, int x,\r\n int y, int w, int h);\r\n\r\n\r\n}",
"private void makeGUI() {\n //Create the canvas and Components for GUI.\n canvas = new Canvas();\n\n canvas.setBounds(0, 0, getWidth(), getHeight());\n getContentPane().setBackground(DrawAttribute.whiteblue);\n searchArea = new JTextField();\n searchArea.setForeground(Color.GRAY);\n searchArea.setText(promptText);\n\n //Make the components for the frame.\n makeComponents();\n addComponentsToLayers();\n }",
"public void initUI() {\n\t\tFlowLayout flow = new FlowLayout();\r\n\t\tthis.setTitle(\"来一波\");\r\n\t\tthis.setSize(960, 720);\r\n\t\tthis.setLayout(flow);\r\n\t\tthis.setLocationRelativeTo(null);\r\n\t\tthis.setDefaultCloseOperation(3);\r\n\t\t\r\n\t\t\r\n\t\tJPanel panel = new JPanel();\r\n\t\tthis.add(panel);\r\n\t\tthis.setBackground(Color.BLACK);\r\n\t\t\r\n\t\tslider1.setName(\"改变大小\");\r\n\t\tslider1.setMinorTickSpacing(20);\r\n\t\tslider1.setPaintTicks(true);\r\n\t\tslider1.setPaintLabels(true);\r\n\t\tthis.add(slider1);\r\n\t\t\r\n\t\tJButton button1 = new JButton(\"导入图片\");\r\n\t\tbutton1.setPreferredSize(new Dimension(100,30));\r\n\t\tthis.add(button1);\r\n\t\t\r\n\t\tJButton button2 = new JButton(\"热感应\");\r\n\t\tbutton2.setPreferredSize(new Dimension(100,30));\r\n\t\tthis.add(button2);\r\n\t\t\r\n\t\tJButton button3 = new JButton(\"模糊化\");\r\n\t\tbutton3.setPreferredSize(new Dimension(100,30));\r\n\t\tthis.add(button3);\r\n\t\t\r\n\t\tJButton button4 = new JButton(\"流行拼接\");\r\n\t\tbutton4.setPreferredSize(new Dimension(100,30));\r\n\t\tthis.add(button4);\r\n\t\t\r\n\t\tJButton button5 = new JButton(\"万花筒\");\r\n\t\tbutton5.setPreferredSize(new Dimension(100,30));\r\n\t\tthis.add(button5);\r\n\t\t\r\n\t\tslider2.setName(\"调整参数\");\r\n\t\tslider2.setMinorTickSpacing(20);\r\n\t\tslider2.setPaintTicks(true);\r\n\t\tslider2.setPaintLabels(true);\r\n\t\tthis.add(slider2);\r\n\t\t\r\n\t\tthis.setVisible(true);\r\n\t\t\r\n\t\tGraphics g = this.getGraphics();//传画笔的操作一定要在设置界面可见后进行\r\n\t\t\r\n\t\tDrawListener ml = new DrawListener(g,this);\r\n\t\tbutton1.addActionListener(ml);\r\n\t\tbutton2.addActionListener(ml);\r\n\t\tbutton3.addActionListener(ml);\r\n\t\tbutton4.addActionListener(ml);\r\n\t\tbutton5.addActionListener(ml);\r\n\t\tslider1.addChangeListener(ml);\r\n\t\tslider2.addChangeListener(ml);\r\n\t\t\r\n\t}",
"@Override\n \tprotected void controlRender(RenderManager rm, ViewPort vp) {\n \n \t}",
"public void render();",
"public static void main(String[] args) {\n Factory.createFactory(\"WinF\").createButton().paint();\n\n\n Factory.createFactory(\"OSXF\").createButton().paint();\n\n }",
"public GUI() {\n\t\t// sets up file choosers\n\t\tsetFileChoosers();\n\t\t// initialises JFrame\n\t\tsetContent();\n\t\t// sets default window attributes\n\t\tthis.setDefaultAttributes();\n\t\t// instantiates controller object\n\t\tsetController();\n\t\t// sets toolbar to go over frame\n\t\tJPopupMenu.setDefaultLightWeightPopupEnabled(false);\n\t\tToolTipManager.sharedInstance().setLightWeightPopupEnabled(false);\n\t\t// sets antialiasing\n\t\t((Graphics2D) this.getGraphics()).setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,\n\t\t\t\tRenderingHints.VALUE_TEXT_ANTIALIAS_ON);\n\t}",
"private static void createAndShowGUI() {\r\n //Create and set up the window.\r\n JFrame frame = new JFrame(\"TableRenderDemo\");\r\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\r\n //Create and set up the content pane.\r\n MatchersTablePanel alignTable = new MatchersTablePanel();\r\n \r\n \r\n frame.setContentPane(alignTable);\r\n\r\n //Display the window.\r\n frame.pack();\r\n frame.setVisible(true);\r\n }",
"public static void showGUI() {\n\t\tDisplay display = Display.getDefault();\n\t\tShell shell = new Shell(display);\n\t\tPaletteComposite inst = new PaletteComposite(shell, SWT.NULL);\n\t\tPoint size = inst.getSize();\n\t\tshell.setLayout(new FillLayout());\n\t\tshell.layout();\n\t\tif(size.x == 0 && size.y == 0) {\n\t\t\tinst.pack();\n\t\t\tshell.pack();\n\t\t} else {\n\t\t\tRectangle shellBounds = shell.computeTrim(0, 0, size.x, size.y);\n\t\t\tshell.setSize(shellBounds.width, shellBounds.height);\n\t\t}\n\t\tshell.open();\n\t\twhile (!shell.isDisposed()) {\n\t\t\tif (!display.readAndDispatch())\n\t\t\t\tdisplay.sleep();\n\t\t}\n\t}",
"@Override\n\t\t\tpublic void run() {\n\t\t\t\t try {\n\t\t\t\t\tUIManager.setLookAndFeel(\"com.seaglasslookandfeel.SeaGlassLookAndFeel\");\n\t\t\t\t} catch (ClassNotFoundException e1) {\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t} catch (InstantiationException e1) {\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t} catch (IllegalAccessException e1) {\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t} catch (UnsupportedLookAndFeelException e1) {\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tsetupLibVLC();\n\t\t\t\t} catch (LibraryNotFoundException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tNative.loadLibrary(RuntimeUtil.getLibVlcLibraryName(), LibVlc.class);\n\t\t\t\t\n\t\t\t\tExtendedFrame frame = new ExtendedFrame();\n\t\t\t\tframe.setResizable(true);\n\t\t\t\tframe.setSize(800, 600);\n\t\t\t\tframe.setMinimumSize(new Dimension(500, 400));\n\t\t\t\tDimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();\n\t\t\t\tframe.setLocationRelativeTo(null);\n\t\t\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\t\t\tframe.setVisible(true);\n\t\t\t\t\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Welcome to Vamix!\\n\\nHope you enjoy using vamix!\\nFor help, please click in the Help menu.\\nRefer to user manual for detailed help.\\n\");\n\t\t\t}",
"@Override\n public void initGui()\n {\n super.initGui();\n }",
"private void initUI() {\n\t\tthis.horizontalLayout = new XdevHorizontalLayout();\n\t\tthis.gridLayout = new XdevGridLayout();\n\t\tthis.button = new XdevButton();\n\t\tthis.button2 = new XdevButton();\n\t\tthis.label = new XdevLabel();\n\n\t\tthis.button.setCaption(\"go to HashdemoView\");\n\t\tthis.button2.setCaption(\"go to CommonView\");\n\t\tthis.label.setValue(\"Go into code tab to view comments\");\n\n\t\tthis.gridLayout.setColumns(2);\n\t\tthis.gridLayout.setRows(2);\n\t\tthis.button.setWidth(200, Unit.PIXELS);\n\t\tthis.button.setHeight(-1, Unit.PIXELS);\n\t\tthis.gridLayout.addComponent(this.button, 0, 0);\n\t\tthis.button2.setWidth(200, Unit.PIXELS);\n\t\tthis.button2.setHeight(-1, Unit.PIXELS);\n\t\tthis.gridLayout.addComponent(this.button2, 1, 0);\n\t\tthis.label.setWidth(100, Unit.PERCENTAGE);\n\t\tthis.label.setHeight(-1, Unit.PIXELS);\n\t\tthis.gridLayout.addComponent(this.label, 0, 1, 1, 1);\n\t\tthis.gridLayout.setComponentAlignment(this.label, Alignment.TOP_CENTER);\n\t\tthis.gridLayout.setSizeUndefined();\n\t\tthis.horizontalLayout.addComponent(this.gridLayout);\n\t\tthis.horizontalLayout.setComponentAlignment(this.gridLayout, Alignment.MIDDLE_CENTER);\n\t\tthis.horizontalLayout.setExpandRatio(this.gridLayout, 10.0F);\n\t\tthis.horizontalLayout.setSizeFull();\n\t\tthis.setContent(this.horizontalLayout);\n\t\tthis.setSizeFull();\n\n\t\tthis.button.addClickListener(event -> this.button_buttonClick(event));\n\t\tthis.button2.addClickListener(event -> this.button2_buttonClick(event));\n\t}",
"private static void createAndShowGUI() {\n //Make sure we have nice window decorations.\n JFrame.setDefaultLookAndFeelDecorated(true);\n\n //Create and set up the window.\n JFrame frame = new JFrame(\"MRALD Color Chooser\");\n\n //Create and set up the content pane.\n JComponent newContentPane = new MraldColorChooser(coloringItems);\n newContentPane.setOpaque(true); //content panes must be opaque\n frame.setContentPane(newContentPane);\n\n //Display the window.\n frame.pack();\n frame.setVisible(true);\n }",
"public Pane buildGuiInDerSchonzeit() {\n\t\tVBox root = new VBox(10); \r\n\t\t// Der Hintergrund des GUI wird mit einem Transparenten Bild erstellt\r\n\t\tImage imageBackground = new Image(getClass().getResource(\"transparent.png\").toExternalForm()); // Ein Image wird erstellt und das Bild übergeben\r\n\t\tBackgroundImage backgroundImage = new BackgroundImage(imageBackground, BackgroundRepeat.NO_REPEAT, BackgroundRepeat.NO_REPEAT, BackgroundPosition.DEFAULT, BackgroundSize.DEFAULT);\r\n\t\tBackground background = new Background(backgroundImage); // Ein Background wird ertsellt und das Bild übergeben\r\n\t\troot.setBackground(background); // Der Hintergrund mit dem Bild wird dem root übergeben\r\n\t\t\r\n\t\t//\r\n\t\t// // Allse verschiedenen Boxen werden erstellt\r\n\t\t//\r\n\t\t\r\n\t\t// HBox für die erste Spalte\r\n\t\tHBox hBoxSpalte1 = new HBox(190);\r\n\t\t// 2mal VBox um Button und Text anzuzeigen \r\n\t\tVBox vBox1Spalte1 = new VBox();\r\n\t\tVBox vBox2Spalte1 = new VBox();\r\n\t\t\r\n\t\t// HBox für 2. Spalte\r\n\t\tHBox hBoxSpalte2 = new HBox(190);\r\n\t\t// 2 VBoxen für Bild und Text\r\n\t\tVBox vbox1Spalte2 = new VBox();\r\n\t\tVBox vbox2Spalte2 = new VBox();\r\n\t\t\r\n\t\t// HBox für die 3.Spalte\r\n\t\tHBox hboxSpalte3 = new HBox(190);\r\n\t\t// 2mal VBox für Bild und Text\r\n\t\tVBox vbox1Spalte3 = new VBox();\r\n\t\tVBox vbox2Spalte3 = new VBox();\r\n\t\t\r\n\t\t// HBox für die 4 Spalte\r\n\t\tHBox hboxSpalte4 = new HBox(190);\r\n\t\t// 2mal VBox für Bild und Text\r\n\t\tVBox vbox1Spalte4 = new VBox();\r\n\t\tVBox vbox2Spalte4 = new VBox();\r\n\t\t\r\n\t\t//\r\n\t\t// Button für die Fische\r\n\t\t//\r\n\t\t\r\n\t\t//Label Bild für Hecht\r\n\t\tLabel hechtbildLabel = new Label(); // Das Label wird erstellt\r\n\t\tImage hechtimage = new Image(getClass().getResource(\"Hecht.png\").toExternalForm()); // Ein Image mit dem Bild wird erstellt\r\n\t\thechtbildLabel.setGraphic(new ImageView(hechtimage)); // Das Bild wird dem Label übergeben\r\n\t\thechtbildLabel.setTranslateX(100); // X-Achse des Labels\r\n\t\t\r\n\t\t// Label Bild Zander\r\n\t\tLabel zanderbildLabel = new Label(); // Das Label wird erstellt\r\n\t\tImage zanderImage = new Image(getClass().getResource(\"Zander.png\").toExternalForm()); // Ein Image mit dem Bild wird erstellt\r\n\t\tzanderbildLabel.setGraphic(new ImageView(zanderImage)); // Das Bild wird dem Label übergeben\r\n\t\tzanderbildLabel.setTranslateX(100); // X-Achse des Labels\r\n\t\t\r\n\t\t// Label Bild Aal\r\n\t\tLabel aalbildLabel = new Label(); // Das Label wird erstellt\r\n\t\tImage aalImage = new Image(getClass().getResource(\"Aal.png\").toExternalForm()); // Ein Image mit dem Bild wird erstellt\r\n\t\taalbildLabel.setGraphic(new ImageView(aalImage)); // Das Bild wird dem Label übergeben\r\n\t\taalbildLabel.setTranslateX(100); // X-Achse des Labels\r\n\t\t\r\n\t\t// Label Bild Aesche\r\n\t\tLabel aeschebildLabel = new Label(); // Das Label wird erstellt\r\n\t\tImage aescheImage = new Image(getClass().getResource(\"Aesche.png\").toExternalForm()); // Ein Image mit dem Bild wird erstellt\r\n\t\taeschebildLabel.setGraphic(new ImageView(aescheImage)); // Das Bild wird dem Label übergeben\r\n\t\taeschebildLabel.setTranslateX(100); // X-Achse des Labels\r\n\t\t\r\n\t\t// Label Bild Barsch\r\n\t\tLabel barschbildLabel = new Label(); // Das Label wird erstellt\r\n\t\tImage barschImage = new Image(getClass().getResource(\"Barsch.png\").toExternalForm()); // Ein Image mit dem Bild wird erstellt\r\n\t\tbarschbildLabel.setGraphic(new ImageView(barschImage)); // Das Bild wird dem Label übergeben\r\n\t\tbarschbildLabel.setTranslateX(100); // X-Achse des Labels\r\n\t\t\r\n\t\t// Label Bild Forelle\r\n\t\tLabel forellebildLabel = new Label(); // Das Label wird erstellt\r\n\t\tImage forelleImage = new Image(getClass().getResource(\"Regenbogenforelle.png\").toExternalForm()); // Ein Image mit dem Bild wird erstellt\r\n\t\tforellebildLabel.setGraphic(new ImageView(forelleImage)); // Das Bild wird dem Label übergeben\r\n\t\tforellebildLabel.setTranslateX(100); // X-Achse des Labels\r\n\t\t\r\n\t\t// Label Bild Schleie\r\n\t\tLabel schleiebildLabel = new Label(); // Das Label wird erstellt\r\n\t\tImage schleieImage = new Image(getClass().getResource(\"Schleie.png\").toExternalForm()); // Ein Image mit dem Bild wird erstellt\r\n\t\tschleiebildLabel.setGraphic(new ImageView(schleieImage)); // Das Bild wird dem Label übergeben\r\n\t\tschleiebildLabel.setTranslateX(100); // X-Achse des Labels\r\n\t\t\r\n\t\t// Label Bild Karpfe\r\n\t\tLabel karpfenbildLabel = new Label(); // Das Label wird erstellt\r\n\t\tImage karpfenImage = new Image(getClass().getResource(\"Schuppenkarpfen.png\").toExternalForm()); // Ein Image mit dem Bild wird erstellt\r\n\t\tkarpfenbildLabel.setGraphic(new ImageView(karpfenImage)); // Das Bild wird dem Label übergeben\r\n\t\tkarpfenbildLabel.setTranslateX(100); // X-Achse des Labels\r\n\t\t\r\n\t\t//\r\n\t\t// Label für die Titel der Fische\r\n\t\t//\r\n\t\t\r\n\t\t// Label Hecht\r\n\t\tLabel hechtlabel = new Label(\"Hecht\"); // Das Label mit dem Namen wird erstellt\r\n\t\thechtlabel.setFont(new Font(30)); // Die Schriftgrösse\r\n\t\thechtlabel.setTranslateX(180); // X-Achse des Labels\r\n\t\t\r\n\t\t//Label Zander\r\n\t\tLabel zanderLabel = new Label(\"Zander\"); // DAs LAabel mit dem Namen wird erstellt\r\n\t\tzanderLabel.setFont(new Font(30)); // Schriftgrösse\r\n\t\tzanderLabel.setTranslateX(160); // X-Achse des Labels\r\n\t\t\r\n\t\t// Label Aal\r\n\t\tLabel aaLabel = new Label(\"Aal\"); // Das Label mit dem Namen wird erstellt\r\n\t\taaLabel.setFont(new Font(30)); // Schriftgrösse\r\n\t\taaLabel.setTranslateX(200); // X-Achse des Labels\r\n\t\t\r\n\t\t// Label Aesche\r\n\t\tLabel aescheLabel = new Label(\"Äsche\"); // Das Label mit dem Namen wird erstellt\r\n\t\taescheLabel.setFont(new Font(30)); // Schriftgrösse\r\n\t\taescheLabel.setTranslateX(180); // X-Achse des Labels\r\n\t\t\r\n\t\t// Label Barsch\r\n\t\tLabel barschLabel = new Label(\"Flussbarsch\"); // Das Label mit dem Namen wird erstellt\r\n\t\tbarschLabel.setFont(new Font(30)); // Schriftgrösse\r\n\t\tbarschLabel.setTranslateX(130); // X-Achse des Labels\r\n\t\t\r\n\t\t// Label Forelle\r\n\t\tLabel forelleLabel = new Label(\"Forelle\"); // Das Label mit dem Namen wird erstellt\r\n\t\tforelleLabel.setFont(new Font(30)); // Schriftgrösse\r\n\t\tforelleLabel.setTranslateX(180); // X-Achse des Labels\r\n\t\t\r\n\t\t// Label Schleie\r\n\t\tLabel schleieLabel = new Label(\"Schleie\"); // Das Label mit dem Namen wird erstellt\r\n\t\tschleieLabel.setFont(new Font(30)); // Schriftgrösse\r\n\t\tschleieLabel.setTranslateX(170); // X-Achse des Labels\r\n\t\t\r\n\t\t// Label Karpfe\r\n\t\tLabel karpfeLabel = new Label(\"Karpfe\"); // Das Label mit dem Namen wird erstellt\r\n\t\tkarpfeLabel.setFont(new Font(30)); // Schriftgrösse\r\n\t\tkarpfeLabel.setTranslateX(170); // X-Achse des Labels\r\n\t\t\r\n\t\t//\r\n\t\t// Label für die Anzeige in der Schonzeit\r\n\t\t//\r\n\t\t\r\n\t\t// Label Schonzeit für Hecht\r\n\t\tLabel schonzeitHechtLabel = new Label(); // Das Label wird erstellt\r\n\t\tschonzeitHechtLabel.setFont(new Font(25)); // Schriftgrösse\r\n\t\tschonzeitHechtLabel.setTranslateX(140); // X-Achse im root\r\n\t\t\r\n\t\t// Label Schonzeit für Zander\r\n\t\tLabel schonzeitZanderLabel = new Label(); // Das Label wird erstellt\r\n\t\tschonzeitZanderLabel.setFont(new Font(25)); // Schriftgrösse\r\n\t\tschonzeitZanderLabel.setTranslateX(140); // X-Achse im root\r\n\t\t\r\n\t\t// Label Schonzeit für Aal\r\n\t\tLabel schonzeitaaLabel = new Label(); // Das Label wird erstellt\r\n\t\tschonzeitaaLabel.setFont(new Font(25)); // Schriftgrösse\r\n\t\tschonzeitaaLabel.setTranslateX(140); // X-Achse im root\r\n\t\t\r\n\t\t// Label Schonzeit für Aesche\r\n\t\tLabel schonzeitaescheLabel = new Label(); // Das Label wird erstellt\r\n\t\tschonzeitaescheLabel.setFont(new Font(25)); // Schriftgrösse\r\n\t\tschonzeitaescheLabel.setTranslateX(140); // X-Achse im root\r\n\t\t\r\n\t\t// Label Schonzeit Barsch\r\n\t\tLabel schonzeitbarschLabel = new Label(); // Das Label wird erstellt\r\n\t\tschonzeitbarschLabel.setFont(new Font(25)); // Schriftgrösse\r\n\t\tschonzeitbarschLabel.setTranslateX(140); // X-Achse im root\r\n\t\t\r\n\t\t// Label Schonzeit für Forelle\r\n\t\tLabel schonzeitforelleLabel = new Label(); // Das Label wird erstellt\r\n\t\tschonzeitforelleLabel.setFont(new Font(25)); // Schriftgrösse\r\n\t\tschonzeitforelleLabel.setTranslateX(140); // X-Achse im root\r\n\t\t\r\n\t\t// Label Schonzeit Schleie\r\n\t\tLabel schonzeitschleieLabel = new Label(); // Das Label wird erstellt\r\n\t\tschonzeitschleieLabel.setFont(new Font(25)); // Schriftgrösse\r\n\t\tschonzeitschleieLabel.setTranslateX(140); // X-Achse im root\r\n\t\t\r\n\t\t// Label Schonzeit Karpfe\r\n\t\tLabel schonzeitkarpfeLabel = new Label(); // Das Label wird erstellt\r\n\t\tschonzeitkarpfeLabel.setFont(new Font(25)); // Schriftgrösse\r\n\t\tschonzeitkarpfeLabel.setTranslateX(140); // X-Achse im root\r\n\r\n\t\t\r\n\t\t// Das Label für die überschrift\r\n\t\tLabel fischeAuswahlLabel = new Label(\"Fische und Ihre Schonzeit\"); // Das Label wird mit dem Namen erstellt\r\n\t\tfischeAuswahlLabel.setFont(new Font(40)); // Schriftgrösse\r\n\t\tfischeAuswahlLabel.setTranslateX(10); // X-Achse des Labels\r\n\t\t\r\n\t\t//\r\n\t\t// // Buttons werden erstellt\r\n\t\t//\r\n\t\t\r\n\t\t// Button zurück Hauptmenu\r\n\t\tButton hauptmenuButton = new Button(\"Hauptmenü\"); // Button wird erstellt und Initialisiert\r\n\t\thauptmenuButton.setMinSize(200, 50); // Die Minimumgrösse wird gesetzt\r\n\t\thauptmenuButton.setTranslateX(345); // X- Achse des Buttons im root\r\n\t\thauptmenuButton.setFont(new Font(25)); // Schriftgrösse des Buttons\r\n\t\t// Zoom in und out wird hinzugefügt\r\n\t\tButtonHandling zoomButtonHandling = new ButtonHandling();\r\n\t\tzoomButtonHandling.zoomIn(hauptmenuButton);\r\n\t\tzoomButtonHandling.zoomOut(hauptmenuButton);\r\n\t\t// Funktion zurück ins Hauptmenü\r\n\t\thauptMenuAufrufen(hauptmenuButton);\r\n\t\t\r\n\t\t//\r\n\t\t// // Aktuelles Datum wird eingelesen um die Fische auf Ihre Schonzeit zu prüfen\r\n\t\t//\r\n\t\t\r\n\t\t// Aktueller Monat wird in der Variablen datumAktuell gespeichert.\r\n\t\tCalendar dateNow = Calendar.getInstance(); // Kalender wird erstellt\r\n\t\tint datum = dateNow.get(Calendar.MONTH) +1; // Der aktuelle Monat wird im Int Initialisiert. +1 Da die Monate ab 0 Beginnen\r\n\t\t// Datum Manuell setzten für Test und Debbug \r\n\t\t//int datum = 1;\r\n\t\t\r\n\t\t//\r\n\t\t// // Die einzelnen VBoxen für die Fische werden je nach Schonzeit gefüllt\r\n\t\t//\r\n\t\t\r\n\t\t// 1. Spalte und 1 Box\r\n\t\tvBox1Spalte1.getChildren().addAll(hechtlabel,hechtbildLabel);// Erste Linie und erste Spalte mit Bild und Text wird dem root übergeben\r\n\t\tif (datum >=1 && datum <= 4) { // Die Schonzeit wird geprüft\r\n\t\t\tschonzeitHechtLabel.setText(\"hat Schonzeit !\"); // Trifft die IF zu wird dieser Text gesetzt\r\n\t\t\tschonzeitHechtLabel.setTextFill(Color.RED); // Die Schrifftfarbe wird auf Rot gesetzt\r\n\t\t}else { // Wen die IF nicht erfüllt ist\r\n\t\t\tschonzeitHechtLabel.setText(\"keine Schonzeit\"); // Trift due IF nicht zu wird dieser Text gesetzt\r\n\t\t\tschonzeitHechtLabel.setTextFill(Color.GREEN); // Die Schriftfarbe wird auf Grün gesetzt\r\n\t\t}\r\n\t\t// Der VBox wird das Label mit den entsprecheneden Einstellungen übergeben\r\n\t\tvBox1Spalte1.getChildren().add(schonzeitHechtLabel);\r\n\t\t\r\n\t\t// 1. Spalte und 2. Box\r\n\t\tvBox2Spalte1.getChildren().addAll(zanderLabel,zanderbildLabel); // Erste Linie und zweite Spalte mit Bild und Text wird dem root übergeben\r\n\t\tif (datum >= 1 && datum <= 4) { // Die Schonzeit wird geprüft\r\n\t\t\tschonzeitZanderLabel.setText(\"hat Schonzeit !\"); // Trifft die IF zu wird dieser Text gesetzt\r\n\t\t\tschonzeitZanderLabel.setTextFill(Color.RED); // Die Schrifftfarbe wird auf Rot gesetzt\r\n\t\t}else { // Wen die IF nicht erfüllt ist\r\n\t\t\tschonzeitZanderLabel.setText(\"keine Schonzeit\"); // Trift due IF nicht zu wird dieser Text gesetzt\r\n\t\t\tschonzeitZanderLabel.setTextFill(Color.GREEN); // Die Schriftfarbe wird auf Grün gesetzt\r\n\t\t}\r\n\t\t// Der VBox wird das Label mit den entsprechenden Einstellungen übergeben\r\n\t\tvBox2Spalte1.getChildren().add(schonzeitZanderLabel);\r\n\t\t\r\n\t\t// 2. Spalte und 1. Box\r\n\t\tvbox1Spalte2.getChildren().addAll(aaLabel,aalbildLabel); // Zweite Linie erste Spalte mit Bild und Text\r\n\t\t// Der Aal hat keine Schonzeit\r\n\t\t\tschonzeitaaLabel.setText(\"keine Schonzeit\"); // Text wird gesetzt\r\n\t\t\tschonzeitaaLabel.setTextFill(Color.GREEN); // Die Schriftfarbe wird auf Grün gesetzt\r\n\t\t// Der VBox wird das Label mit den einstellungen übergeben\t\r\n\t\tvbox1Spalte2.getChildren().add(schonzeitaaLabel);\r\n\t\t\r\n\t\t// 2. Spalte und 2. Box\r\n\t\tvbox2Spalte2.getChildren().addAll(aescheLabel,aeschebildLabel); // Zweite Linie zweite Spalte mit Bild und Text\r\n\t\tif (datum >= 2 && datum <= 4) { // Die Schonzeit wird geprüft\r\n\t\t\tschonzeitaescheLabel.setText(\"hat Schonzeit !\"); // Trifft die IF zu wird dieser Text gesetzt\r\n\t\t\tschonzeitaescheLabel.setTextFill(Color.RED); // Die Schrifftfarbe wird auf Rot gesetzt\r\n\t\t}else { // Wen die IF nicht erfüllt ist\r\n\t\t\tschonzeitaescheLabel.setText(\"keine Schonzeit\"); // Trift due IF nicht zu wird dieser Text gesetzt\r\n\t\t\tschonzeitaescheLabel.setTextFill(Color.GREEN); // Die Schriftfarbe wird auf Grün gesetzt\r\n\t\t}\r\n\t\t// Der VBox wird das Label mit den Einstellungen übergeben\r\n\t\tvbox2Spalte2.getChildren().add(schonzeitaescheLabel);\r\n\t\t\r\n\t\t// 3. Spalte und 1. Box\r\n\t\tvbox1Spalte3.getChildren().addAll(barschLabel,barschbildLabel); // Dritte Linie erste Spalte mit Bild und Text\r\n\t\t// Der Barsch hat keine Schonzeit\r\n\t\t\tschonzeitbarschLabel.setText(\"keine Schonzeit\");\r\n\t\t\tschonzeitbarschLabel.setTextFill(Color.GREEN); // Die Schriftfarbe wird auf Grün gesetzt\r\n\t\t// Der VBox wird das Label mit den Einstellungen übergeben\t\r\n\t\tvbox1Spalte3.getChildren().add(schonzeitbarschLabel);\r\n\t\t\r\n\t\t// 3. Spalte und 2. Box\r\n\t\tvbox2Spalte3.getChildren().addAll(forelleLabel,forellebildLabel); // Dritte Linie zweite Spalte mit Bild und Text\r\n\t\tif (datum >= 3 && datum <= 9) { // Die Schonzeit wird geprüft\r\n\t\t\tschonzeitforelleLabel.setText(\"keine Schonzeit\"); // Trifft die IF zu wird dieser Text gesetzt\r\n\t\t\tschonzeitforelleLabel.setTextFill(Color.GREEN); // Die Schriftfarbe wird auf Grün gesetzt\r\n\t\t}else { // Wen die IF nicht erfüllt ist\r\n\t\t\tschonzeitforelleLabel.setText(\"hat Schonzeit !\"); // Die Schonzeit des Hechtes wird überprüft\r\n\t\t\tschonzeitforelleLabel.setTextFill(Color.RED); // Trift due IF nicht zu wird dieser Text gesetzt\r\n\t\t}\r\n\t\t// Der VBox wird das Label mit den Einstellungen übergeben\r\n\t\tvbox2Spalte3.getChildren().add(schonzeitforelleLabel);\r\n\t\t\r\n\t\t// 4. Spalte und 1. Box\r\n\t\tvbox1Spalte4.getChildren().addAll(schleieLabel,schleiebildLabel); // Vierte Linie erste Spalte mit Bild und Text\r\n\t\t// Die Schleie hat keien Schonzeit\r\n\t\t\tschonzeitschleieLabel.setText(\"keine Schonzeit\"); // Text wird gesetzt\r\n\t\t\tschonzeitschleieLabel.setTextFill(Color.GREEN); // Die Schriftfarbe wird auf Grün gesetzt\r\n\t\t// Der VBox wird das Label mit den Einstellungen übergeben\t\r\n\t\tvbox1Spalte4.getChildren().add(schonzeitschleieLabel);\r\n\t\t\r\n\t\t// 4. Spalte und 2. Box\r\n\t\tvbox2Spalte4.getChildren().addAll(karpfeLabel,karpfenbildLabel); // Vierte Linie zweite Spalte mit Bild und Text\r\n\t\t// Der Karpfe hat keine Schonzeit\r\n\t\t\tschonzeitkarpfeLabel.setText(\"keine Schonzeit\"); // Text wird gesetzt\r\n\t\t\tschonzeitkarpfeLabel.setTextFill(Color.GREEN); // Die Schriftfarbe wird auf Grün gesetzt\r\n\t\t// Der VBox wird das Label mit den Einstellungen übergeben\t\r\n\t\tvbox2Spalte4.getChildren().add(schonzeitkarpfeLabel);\r\n\t\t\r\n\t\t//\r\n\t\t// // Die einzelnen HBoxen werden gefüllt für die Spalten in der Root\r\n\t\t//\r\n\t\thBoxSpalte1.getChildren().addAll(vBox1Spalte1,vBox2Spalte1); // Die erste Spalte wird mit den zwei Boxen gefüllt\r\n\t\t// HBox Spalte 2\r\n\t\thBoxSpalte2.getChildren().addAll(vbox1Spalte2,vbox2Spalte2); // Die zweite Spalte wird mit den zwei Boxen gefüllt\r\n\t\t// Hbox Spalte 3\r\n\t\thboxSpalte3.getChildren().addAll(vbox1Spalte3,vbox2Spalte3); // Die dritte Spalte wird mit den zwei Boxen gefüllt\r\n\t\t// Hbox Spalte 4\r\n\t\thboxSpalte4.getChildren().addAll(vbox1Spalte4,vbox2Spalte4); // Die vierte Spalte wird mit den zwei Boxen gefüllt\r\n\t\t\r\n\t\t// Elemente werden der HauptVBox root hinzugefügt\r\n\t\troot.getChildren().addAll(fischeAuswahlLabel,hBoxSpalte1,hBoxSpalte2,hboxSpalte3,hboxSpalte4,hauptmenuButton); // Alle gefüllten Boxen werden der Hauptbox übergeben\r\n\t\t\r\n\t\t// Das root wird zurückgegeben um Angezeigt zu werden\r\n\t\treturn root;\r\n\t}",
"private static void createAndShowGUI() {\n //Create and set up the window.\n JFrame frame = new JFrame(\"FrameDemo\");\n frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);\n\n //main input TextArea\n JTextArea mainIn = new JTextArea(\"Type your Command here.\", 3, 1);\n \n //main Output Display Displays htmlDocuments\n JTextPane mainOut = new JTextPane(new HTMLDocument());\n mainOut.setPreferredSize(new Dimension(800, 600));\n \n //add components to Pane\n frame.getContentPane().add(mainOut);\n frame.getContentPane().add(mainIn);\n\n //Display the window.\n frame.pack();\n frame.setVisible(true);\n }",
"private void buildGui() {\n nifty = screen.getNifty();\n nifty.setIgnoreKeyboardEvents(true);\n nifty.loadStyleFile(\"nifty-default-styles.xml\");\n nifty.loadControlFile(\"nifty-default-controls.xml\");\n nifty.addScreen(\"Option_Screen\", new ScreenBuilder(\"Options_Screen\") {\n {\n controller((ScreenController) app);\n layer(new LayerBuilder(\"background\") {\n {\n childLayoutCenter();;\n font(\"Interface/Fonts/zombie.fnt\");\n backgroundImage(\"Backgrounds/ZOMBIE1.jpg\");\n visibleToMouse(true);\n }\n });\n layer(new LayerBuilder(\"foreground\") {\n {\n childLayoutOverlay();\n font(\"Interface/Fonts/zombie.fnt\");\n\n panel(new PanelBuilder(\"Switch_Options\") {\n {\n childLayoutVertical();\n control(new ButtonBuilder(\"\", \"Display Settings\") {\n {\n marginTop(\"42%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n interactOnClick(\"goTo(Display_Settings)\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n /*control(new ButtonBuilder(\"\", \"Graphics Settings\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(Graphics_Extension)\");\n }\n });*/\n control(new ButtonBuilder(\"\", \"Sound Settings\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(#Sound_Settings)\");\n }\n });\n control(new ButtonBuilder(\"\", \"Leaderboard\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(Leader_Board)\");\n }\n });\n control(new ButtonBuilder(\"\", \"Logout\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(#Login_Screen)\");\n }\n });\n control(new ButtonBuilder(\"\", \"Quit Game\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"quitGame()\");\n }\n });\n }\n });\n }\n });\n }\n }.build(nifty));\n nifty.addScreen(\"Graphics_Settings\", new ScreenBuilder(\"Graphics_Extension\") {\n {\n controller(settingsControl);\n layer(new LayerBuilder(\"background\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n childLayoutCenter();\n backgroundImage(\"Backgrounds/ZOMBIE1.jpg\");\n visibleToMouse(true);\n }\n });\n layer(new LayerBuilder(\"foreground\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n childLayoutOverlay();\n panel(new PanelBuilder(\"Settings\") {\n {\n childLayoutVertical();\n control(new ButtonBuilder(\"\", \"Display Settings\") {\n {\n marginTop(\"42%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(Display_Settings)\");\n }\n });\n /*control(new ButtonBuilder(\"\", \"Graphics Settings\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });*/\n control(new ButtonBuilder(\"\", \"Sound Settings\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(#Sound_Settings)\");\n }\n });\n control(new ButtonBuilder(\"\", \"Leaderboard\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(Leader_Board)\");\n }\n });\n control(new ButtonBuilder(\"\", \"Logout\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(#Login_Screen)\");\n }\n });\n control(new ButtonBuilder(\"\", \"Quit Game\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"quitGame()\");\n }\n });\n }\n });\n }\n });\n layer(new LayerBuilder(\"Settings\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n childLayoutVertical();\n panel(new PanelBuilder(\"Post_Water_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"40%\");\n marginTop(\"15%\");\n control(new LabelBuilder(\"\", \"Post Water\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n color(\"#ff0000\");\n }\n });\n control(new CheckboxBuilder(\"Post_Water_Button\") {\n {\n marginLeft(\"110%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Water_Reflections_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"40%\");\n marginTop(\"5%\");\n control(new LabelBuilder(\"\", \"Water Reflections\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n color(\"#ff0000\");\n }\n });\n control(new CheckboxBuilder(\"Water_Reflections_Button\") {\n {\n marginLeft(\"45%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Water_Ripples_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"40%\");\n marginTop(\"5%\");\n control(new LabelBuilder(\"\", \"Water Ripples\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n color(\"#ff0000\");\n }\n });\n control(new CheckboxBuilder(\"Water_Ripples_Button\") {\n {\n marginLeft(\"75%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Water_Specular_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"40%\");\n marginTop(\"5%\");\n control(new LabelBuilder(\"\", \"Water Specular\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n color(\"#ff0000\");\n }\n });\n control(new CheckboxBuilder(\"Water_Specular_Button\") {\n {\n marginLeft(\"59%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Water_Foam_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"40%\");\n marginTop(\"5%\");\n control(new LabelBuilder(\"\", \"Water Foam\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n color(\"#ff0000\");\n }\n });\n control(new CheckboxBuilder(\"Water_Foam_Button\") {\n {\n marginLeft(\"93%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Sky_Dome_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"40%\");\n marginTop(\"5%\");\n control(new LabelBuilder(\"\", \"Sky Dome\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n color(\"#ff0000\");\n }\n });\n control(new CheckboxBuilder(\"Sky_Dome_Button\") {\n {\n marginLeft(\"128%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Star_Motion_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"40%\");\n marginTop(\"5%\");\n control(new LabelBuilder(\"\", \"Star Motion\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n color(\"#ff0000\");\n }\n });\n control(new CheckboxBuilder(\"Star_Motion_Button\") {\n {\n marginLeft(\"106%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Cloud_Motion_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"40%\");\n marginTop(\"5%\");\n control(new LabelBuilder(\"\", \"Cloud Motion\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n color(\"#ff0000\");\n }\n });\n control(new CheckboxBuilder(\"Cloud_Motion_Button\") {\n {\n marginLeft(\"87%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Bloom_Light_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"40%\");\n marginTop(\"5%\");\n control(new LabelBuilder(\"\", \"Bloom Lighting\") {\n {\n color(\"#ff0000\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n control(new CheckboxBuilder(\"Bloom_Light_Button\") {\n {\n marginLeft(\"70%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Light_Scatter_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"40%\");\n marginTop(\"5%\");\n control(new LabelBuilder(\"\", \"Light Scatter\") {\n {\n color(\"#ff0000\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n control(new CheckboxBuilder(\"Light_Scatter_Button\") {\n {\n marginLeft(\"90%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Apply_Panel\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n childLayoutHorizontal();\n marginLeft(\"43%\");\n marginTop(\"5%\");\n control(new ButtonBuilder(\"Apply_Button\", \"Apply Settings\") {\n {\n interactOnClick(\"applySettings()\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n }\n });\n }\n });\n }\n }.build(nifty));\n nifty.addScreen(\"Display_Screen\", new ScreenBuilder(\"Display_Settings\") {\n {\n controller(settingsControl);\n layer(new LayerBuilder(\"background\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n childLayoutCenter();;\n backgroundImage(\"Backgrounds/ZOMBIE1.jpg\");\n visibleToMouse(true);\n }\n });\n layer(new LayerBuilder(\"foreground\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n childLayoutOverlay();\n panel(new PanelBuilder(\"Settings\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n childLayoutVertical();\n control(new ButtonBuilder(\"\", \"Display Settings\") {\n {\n marginTop(\"42%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n /*control(new ButtonBuilder(\"\", \"Graphics Settings\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(Graphics_Extension)\");\n }\n });*/\n control(new ButtonBuilder(\"\", \"Sound Settings\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(#Sound_Settings)\");\n }\n });\n control(new ButtonBuilder(\"\", \"Leaderboard\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(Leader_Board)\");\n }\n });\n control(new ButtonBuilder(\"\", \"Logout\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(#Login_Screen)\");\n }\n });\n control(new ButtonBuilder(\"\", \"Quit Game\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"quitGame()\");\n }\n });\n }\n });\n }\n });\n layer(new LayerBuilder(\"Settings\") {\n {\n childLayoutVertical();\n panel(new PanelBuilder(\"Resolution_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"40%\");\n marginTop(\"15%\");\n control(new LabelBuilder(\"\", \"Set Resolution\") {\n {\n color(\"#ff0000\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n control(new ListBoxBuilder(\"Resolution_Opts\") {\n {\n marginLeft(\"4%\");\n marginBottom(\"10%\");\n displayItems(1);\n showVerticalScrollbar();\n hideHorizontalScrollbar();\n selectionModeSingle();\n width(\"10%\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Apply_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"45%\");\n marginTop(\"5%\");\n control(new ButtonBuilder(\"Apply_Button\", \"Apply Settings\") {\n {\n interactOnClick(\"displayApply()\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n }\n });\n }\n });\n }\n }.build(nifty));\n nifty.addScreen(\"Sound Settings\", new ScreenBuilder(\"#Sound_Settings\") {\n {\n controller(settingsControl);\n layer(new LayerBuilder(\"background\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n childLayoutCenter();;\n backgroundImage(\"Backgrounds/ZOMBIE1.jpg\");\n visibleToMouse(true);\n }\n });\n layer(new LayerBuilder(\"foreground\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n childLayoutOverlay();\n panel(new PanelBuilder(\"Settings\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n childLayoutVertical();\n control(new ButtonBuilder(\"\", \"Display Settings\") {\n {\n marginTop(\"42%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(ElementBuilder.Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(Display_Settings)\");\n }\n });\n /*control(new ButtonBuilder(\"\", \"Graphics Settings\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(ElementBuilder.Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(Graphics_Extension)\");\n }\n });*/\n control(new ButtonBuilder(\"\", \"Sound Settings\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(ElementBuilder.Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n control(new ButtonBuilder(\"\", \"Leaderboard\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(ElementBuilder.Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(Leader_Board)\");\n }\n });\n control(new ButtonBuilder(\"\", \"Logout\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(#Login_Screen)\");\n }\n });\n control(new ButtonBuilder(\"\", \"Quit Game\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(ElementBuilder.Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"quitGame()\");\n }\n });\n }\n });\n }\n });\n layer(new LayerBuilder(\"Settings\") {\n {\n childLayoutVertical();\n panel(new PanelBuilder(\"#Master_Volume_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"30%\");\n marginTop(\"35%\");\n control(new LabelBuilder(\"\", \"Master Volume : \") {\n {\n color(\"#ff0000\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n control(new SliderBuilder(\"#Master_Volume\", false) {\n {\n marginLeft(\"20px\");\n min(0);\n max(100);\n width(\"25%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"#Ambient_Volume_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"30%\");\n marginTop(\"8%\");\n control(new LabelBuilder(\"\", \"Ambient Volume : \") {\n {\n color(\"#ff0000\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n control(new SliderBuilder(\"#Ambient_Volume\", false) {\n {\n marginLeft(\"20px\");\n min(0);\n max(100);\n width(\"25%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"#Combat_Volume_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"30%\");\n marginTop(\"8%\");\n control(new LabelBuilder(\"\", \"Combat Volume : \") {\n {\n color(\"#ff0000\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n control(new SliderBuilder(\"#Combat_Volume\", false) {\n {\n marginLeft(\"20px\");\n min(0);\n max(100);\n width(\"25%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"#Dialog_Volume_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"30%\");\n marginTop(\"8%\");\n control(new LabelBuilder(\"\", \"Dialog Volume : \") {\n {\n color(\"#ff0000\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n control(new SliderBuilder(\"#Dialog_Volume\", false) {\n {\n marginLeft(\"20px\");\n min(0);\n max(100);\n width(\"25%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"#Footsteps_Volume_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"30%\");\n marginTop(\"8%\");\n control(new LabelBuilder(\"\", \"Footsteps Volume : \") {\n {\n color(\"#ff0000\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n control(new SliderBuilder(\"#Footsteps_Volume\", false) {\n {\n marginLeft(\"20px\");\n min(0);\n max(100);\n width(\"25%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Apply_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"45%\");\n marginTop(\"5%\");\n control(new ButtonBuilder(\"#Apply_Button\", \"Apply Settings\") {\n {\n interactOnClick(\"soundApply()\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n }\n });\n }\n });\n\n }\n }.build(nifty));\n }",
"protected void drawGUI() {\n batch.draw(background, 0, 0);\n }",
"private void initUI() {\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\trenderer = new LWJGLRenderer();\n\t\t\tgui = new GUI(stateWidget, renderer);\n\t\t\tthemeManager = ThemeManager.createThemeManager(StateWidget.class.getResource(\"gameui.xml\"), renderer);\n\t\t\tgui.applyTheme(themeManager);\n\t\t\t\n\t\t} catch (LWJGLException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"private static void createAndShowUI(){\n JFrame frame = new JFrame(\"TargetTest\");\n TargetTest test = new TargetTest();\n frame.setLayout(new FlowLayout());\n frame.getContentPane().add(test.getMainPanel());\n //frame.getContentPane().add(test.getControlsPanel());\n\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n frame.pack();\n\n frame.setLocationRelativeTo(null);\n\n frame.setVisible(true);\n}",
"public interface GUI {\n\n /**\n * Adds a MouseListener to the GUI.\n * @param mouseListener added to the GUI.\n */\n void addMouseListener(MouseListener mouseListener);\n\n /**\n * Get list link button for other GUIs. \n * @return List of ButtonLink\n */\n List<ButtonLink> getBtnActionLinks();\n\n /**\n * Sets the link identifier of the GUI.\n * @param linkActionGUI link identifier.\n */\n void setMainAction(LinkActionGUI linkActionGUI);\n\n /**\n * Set the boundaries from a rectangle.\n * @param rectangle for borders.\n */\n void setBounds(Rectangle rectangle);\n\n /**\n * Set visibility of the GUI.\n * @param visible for visibility.\n */\n void setVisible(boolean visible);\n\n /**\n * Set background image.\n * @param path of image.\n */\n void setImageBackground(String path);\n\n /**\n * Set the border color and thickness.\n * @param color for border.\n * @param thickness for border.\n */\n void setBorder(Color color, int thickness);\n\n /**\n * Set visibility of the foreground panel of the GUI.\n * @param visible for visibility panel.\n */\n void setVisibleGlassPanel(Visibility visible);\n\n /**\n * Close the GUI and destroyed JFrame.\n */\n void close();\n\n}",
"private static void createAndShowGUI() {\n //Make sure we have nice window decorations.\n JFrame.setDefaultLookAndFeelDecorated(true);\n\n //Create and set up the window.\n JFrame frame = new JFrame(\"TreeExpandEventDemo2\");\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n //Create and set up the content pane.\n JComponent newContentPane = new TreeExpandEventDemo2();\n newContentPane.setOpaque(true); //content panes must be opaque\n frame.setContentPane(newContentPane);\n\n //Display the window.\n frame.pack();\n frame.setVisible(true);\n }",
"@Override\r\n\tprotected void initUI() {\n\r\n\t}",
"public static void createAndShowGui() {\n updateShapes();\n initialiseShapeTurtleLinden();\n Painting painting = new Painting();\n ButtonsController buttonsController = new ButtonsController(painting);\n Buttons buttonPanel = new Buttons(buttonsController);\n buttonsController.turtleInit(turtle, linSys);\n\n JPanel mainPanel = new JPanel(false);\n mainPanel.add(painting);\n mainPanel.add(buttonPanel, BorderLayout.SOUTH);\n\n\n ProdPainter prodPaint = new ProdPainter();\n ProductionsController productionsController = new ProductionsController(shape, prodPaint);\n Productions productions = new Productions(productionsController);\n JPanel productionsTab = new JPanel(false);\n productionsTab.add(productions);\n productionsTab.add(prodPaint);\n\n SettingsController settingsController = new SettingsController(turtle, linSys, shape,\n buttonsController, productionsController);\n settingsController.init();\n Settings settings = new Settings(settingsController);\n JPanel settingsTab = new JPanel(false);\n settingsTab.add(settings);\n\n\n JTabbedPane tabs = new JTabbedPane();\n tabs.addTab(\"Drawing\", mainPanel);\n tabs.addTab(\"Productions\", productionsTab);\n tabs.addTab(\"Settings\", settingsTab);\n\n\n JFrame frame = new JFrame();\n frame.setSize(frameWidth, frameHeight + 120);\n setDefaultLookAndFeelDecorated(true);\n frame.add(tabs);\n frame.setLocationRelativeTo(null);\n frame.setVisible(true);\n\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n }",
"private static void createAndShowGUI() {\n\t\t//Create and set up the window.\n\t\tJFrame frame = new JFrame(\"Color test\");\n\t\tframe.setPreferredSize(new Dimension(700, 700));\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n\t\t//Create and set up the content pane.\n\t\tJComponent newContentPane = new ColorTest();\n\t\tnewContentPane.setOpaque(true); //content panes must be opaque\n\t\tframe.setContentPane(newContentPane);\n\n\t\t//Display the window.\n\t\tframe.pack();\n\t\tframe.setVisible(true);\n\t}",
"private void createUI() {\n\t\tthis.rootPane = new TetrisRootPane(true);\n\t\tthis.controller = new TetrisController(this, rootPane, getWorkingDirectory());\n\t\tthis.listener = new TetrisActionListener(controller, this, rootPane);\n\t\t\n\t\trootPane.setActionListener(listener);\n\t\trootPane.setGameComponents(controller.getGameComponent(), controller.getPreviewComponent());\n\t\trootPane.initialize();\n\t\t\n\t\tPanelBorder border = controller.getPlayer().getPanel().getPanelBorder(\"Tetris v\" + controller.getVersion());\n\t\tborder.setRoundedCorners(true);\n\t\tJPanel panel = new JPanel(new FlowLayout(FlowLayout.CENTER, 0, 0));\n\t\tpanel.setBackground(getBackgroundColor(border.getLineColor()));\n\t\tpanel.setBorder(border);\n\t\tpanel.setPreferredSize(new Dimension(564, 551));\n\t\tpanel.add(rootPane);\n\t\trootPane.addPanelBorder(border, panel);\n\t\t\n\t\tthis.setContentPane(panel);\n\t\tthis.setSize(564, 550);\n\t\t\n\t\tcontroller.initializeUI();\n\t}",
"@Override\r\n protected void controlRender(RenderManager rm, ViewPort vp) {\n }",
"@Override\n\tprotected void controlRender(RenderManager rm, ViewPort vp) {\n\t\t\n\t}",
"protected void createComponents() {\n sampleText = new JTextField(20);\n displayArea = new JLabel(\"\");\n displayArea.setPreferredSize(new Dimension(200, 75));\n displayArea.setMinimumSize(new Dimension(200, 75));\n }",
"@Override\n\tprotected void UpdateUI() {\n\t\t\n\t}",
"@Override\n\tprotected void UpdateUI() {\n\t\t\n\t}",
"public void render() {\r\n\r\n }",
"@SuppressWarnings(\"unchecked\")\n private void create() {\n components.clear();\n\n if (content != null) {\n content.clearChildren();\n }\n else {\n content = new Container();\n content.setInsets(INSETS);\n }\n\n GuiComponent guiComponent = (GuiComponent) getReflectedItem().getValue();\n\n // let the user choose which type of backgroundComponent they want.\n Label label = content.addChild(new Label(\"Type\"), 0, 0);\n label.setTextHAlignment(HAlignment.Right);\n label.setInsets(INSETS);\n Container backgroundTypeContainer = content.addChild(new Container(), 0, 1);\n\n ColorRGBA oldColor = BackgroundUtils.getBackgroundColor(guiComponent);\n\n Button colorOnlyBgButton = backgroundTypeContainer.addChild(new Button(\"Color Only\"), 0, 0);\n colorOnlyBgButton.addClickCommands(source -> {\n if (!(guiComponent instanceof QuadBackgroundComponent)) {\n setValue(new QuadBackgroundComponent(oldColor));\n create();\n }\n });\n\n Button colorAndImageBgButton = backgroundTypeContainer.addChild(new Button(\"Color and Image\"), 0, 1);\n colorAndImageBgButton.addClickCommands(source -> {\n if (!(guiComponent instanceof TbtQuadBackgroundComponent)) {\n setValue(BackgroundComponents.gradient(oldColor));\n create();\n }\n });\n\n if (guiComponent instanceof QuadBackgroundComponent) {\n\n try {\n\n Method getter = QuadBackgroundComponent.class.getDeclaredMethod(\"getColor\");\n Method setter = QuadBackgroundComponent.class.getDeclaredMethod(\"setColor\", ColorRGBA.class);\n\n label = content.addChild(new Label(\"Color\"), 1, 0);\n label.setTextHAlignment(HAlignment.Right);\n label.setInsets(INSETS);\n\n ColorRGBAComponent bgColorComponent = new ColorRGBAComponent(guiComponent, getter, setter);\n content.addChild(bgColorComponent.getPanel(), 1, 1);\n components.add(bgColorComponent);\n\n // margin\n getter = QuadBackgroundComponent.class.getDeclaredMethod(\"getMargin\");\n setter = QuadBackgroundComponent.class.getDeclaredMethod(\"setMargin\", Vector2f.class);\n\n label = content.addChild(new Label(\"Margin\"), 2, 0);\n Vector2fComponent marginComponent = new Vector2fComponent(guiComponent, getter, setter);\n content.addChild(marginComponent.getPanel(), 2, 1);\n components.add(marginComponent);\n\n } catch (NoSuchMethodException e) {\n e.printStackTrace();\n }\n\n }\n else if (guiComponent instanceof TbtQuadBackgroundComponent) {\n\n TbtQuadBackgroundComponent backgroundComponent = (TbtQuadBackgroundComponent) guiComponent;\n\n try {\n Method getter = TbtQuadBackgroundComponent.class.getDeclaredMethod(\"getColor\");\n Method setter = TbtQuadBackgroundComponent.class.getDeclaredMethod(\"setColor\", ColorRGBA.class);\n\n label = content.addChild(new Label(\"Color\"), 1, 0);\n label.setTextHAlignment(HAlignment.Right);\n label.setInsets(INSETS);\n\n ColorRGBAComponent bgColorComponent = new ColorRGBAComponent(guiComponent, getter, setter);\n content.addChild(bgColorComponent.getPanel(), 1, 1);\n components.add(bgColorComponent);\n\n label = content.addChild(new Label(\"Image\"), 2, 0);\n label.setTextHAlignment(HAlignment.Right);\n label.setInsets(INSETS);\n\n Button browseImageButton = content.addChild(new Button(\"Select Background Image...\"), 2, 1);\n browseImageButton.setTextVAlignment(VAlignment.Center);\n browseImageButton.addClickCommands(source -> {\n\n JFileChooser jfc = new JFileChooser(FileSystemView.getFileSystemView().getHomeDirectory());\n jfc.setDialogTitle(\"Select a Background Image...\");\n jfc.setMultiSelectionEnabled(false);\n jfc.setFileSelectionMode(JFileChooser.FILES_ONLY);\n jfc.setAcceptAllFileFilterUsed(false);\n FileNameExtensionFilter filter = new FileNameExtensionFilter(\"PNG Images\", \"png\");\n jfc.addChoosableFileFilter(filter);\n int returnValue = jfc.showOpenDialog(null);\n\n if (returnValue == JFileChooser.APPROVE_OPTION) {\n\n File file = jfc.getSelectedFile();\n\n\n try {\n\n byte[] imageData = Files.readAllBytes(file.toPath());\n byte[] stringData = Base64.getEncoder().encode(imageData);\n\n String imageString = new String(stringData);\n\n // PanelBackground panelBackground = (PanelBackground) getReflectedProperty().getValue();\n // panelBackground.setBase64Image(imageString);\n\n Texture texture = new TextureUtils().fromBase64(imageString);\n\n backgroundComponent.setTexture(texture);\n\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n });\n\n // margin\n getter = TbtQuadBackgroundComponent.class.getDeclaredMethod(\"getMargin\");\n setter = TbtQuadBackgroundComponent.class.getDeclaredMethod(\"setMargin\", Vector2f.class);\n\n label = content.addChild(new Label(\"Margin\"), 3, 0);\n Vector2fComponent marginComponent = new Vector2fComponent(guiComponent, getter, setter);\n content.addChild(marginComponent.getPanel(), 3, 1);\n components.add(marginComponent);\n\n\n } catch (NoSuchMethodException e) {\n e.printStackTrace();\n }\n\n }\n\n//\n// this.content = new RollupPanel(\"\", contentContainer, null);\n// this.content.setOpen(false);\n//\n// // background Image\n// Container bgImageContainer = contentContainer.addChild(new Container(new SpringGridLayout(Axis.Y, Axis.X, FillMode.Last, FillMode.Last)), 0, 0);\n// Label bgImageLabel = bgImageContainer.addChild(new Label(\"Background Image\"), 0, 0);\n// bgImageLabel.setTextVAlignment(VAlignment.Center);\n// bgImageLabel.setInsets(new Insets3f(0.0F, 2.0F, 0.0F, 5.0F));\n// Button browseImageButton = bgImageContainer.addChild(new Button(\"Browse...\"), 0, 1);\n// Button removeImageButton = bgImageContainer.addChild(new Button(\"Remove\"), 0, 2);\n// bgImageContainer.addChild(new Container(), 0, 3);\n//\n// browseImageButton.addClickCommands(source -> {\n//\n// JFileChooser jfc = new JFileChooser(FileSystemView.getFileSystemView().getHomeDirectory());\n// jfc.setDialogTitle(\"Select a Background Image...\");\n// jfc.setMultiSelectionEnabled(false);\n// jfc.setFileSelectionMode(JFileChooser.FILES_ONLY);\n// jfc.setAcceptAllFileFilterUsed(false);\n// FileNameExtensionFilter filter = new FileNameExtensionFilter(\"PNG Images\", \"png\");\n// jfc.addChoosableFileFilter(filter);\n// int returnValue = jfc.showOpenDialog(null);\n//\n// if (returnValue == JFileChooser.APPROVE_OPTION) {\n//\n// File file = jfc.getSelectedFile();\n//\n// try {\n// byte[] imageData = Files.readAllBytes(file.toPath());\n// byte[] stringData = Base64.getEncoder().encode(imageData);\n//\n// String imageString = new String(stringData);\n//\n// PanelBackground panelBackground = (PanelBackground) getReflectedProperty().getValue();\n// panelBackground.setBase64Image(imageString);\n//\n// } catch (IOException e) {\n// e.printStackTrace();\n// }\n// }\n//\n// });\n//\n// removeImageButton.addClickCommands(source -> {\n// PanelBackground panelBackground = (PanelBackground) getReflectedProperty().getValue();\n// panelBackground.setBase64Image(\"\");\n// });\n//\n//\n// try {\n//\n// // color\n// Method get = PanelBackground.class.getMethod(\"getColor\");\n// Method set = PanelBackground.class.getMethod(\"setColor\", ColorRGBA.class);\n//\n// ColorRGBAComponent bgColorComponent = new ColorRGBAComponent(getReflectedProperty().getValue(), get, set);\n// bgColorComponent.setPropertyName(\"Color\");\n// contentContainer.addChild(bgColorComponent.getPanel());\n// components.add(bgColorComponent);\n//\n// // insetTop\n// get = PanelBackground.class.getMethod(\"getInsetTop\");\n// set = PanelBackground.class.getMethod(\"setInsetTop\", int.class);\n//\n// IntComponent insetTopComponent = new IntComponent(getReflectedProperty().getValue(), get, set);\n// insetTopComponent.setPropertyName(\"Inset Top\");\n// contentContainer.addChild(insetTopComponent.getPanel());\n// components.add(insetTopComponent);\n//\n// // insetLeft\n// get = PanelBackground.class.getMethod(\"getInsetLeft\");\n// set = PanelBackground.class.getMethod(\"setInsetLeft\", int.class);\n//\n// IntComponent insetLeftComponent = new IntComponent(getReflectedProperty().getValue(), get, set);\n// insetLeftComponent.setPropertyName(\"Inset Left\");\n// contentContainer.addChild(insetLeftComponent.getPanel());\n// components.add(insetLeftComponent);\n//\n// // insetBottom\n// get = PanelBackground.class.getMethod(\"getInsetBottom\");\n// set = PanelBackground.class.getMethod(\"setInsetBottom\", int.class);\n//\n// IntComponent insetBottomComponent = new IntComponent(getReflectedProperty().getValue(), get, set);\n// insetBottomComponent.setPropertyName(\"Inset Bottom\");\n// contentContainer.addChild(insetBottomComponent.getPanel());\n// components.add(insetBottomComponent);\n//\n// // insetRight\n// get = PanelBackground.class.getMethod(\"getInsetRight\");\n// set = PanelBackground.class.getMethod(\"setInsetRight\", int.class);\n//\n// IntComponent insetRightComponent = new IntComponent(getReflectedProperty().getValue(), get, set);\n// insetRightComponent.setPropertyName(\"Inset Right\");\n// contentContainer.addChild(insetRightComponent.getPanel());\n// components.add(insetRightComponent);\n//\n// // zOffset\n// get = PanelBackground.class.getMethod(\"getzOffset\");\n// set = PanelBackground.class.getMethod(\"setzOffset\", float.class);\n//\n// FloatComponent zOffsetComponent = new FloatComponent(getReflectedProperty().getValue(), get, set);\n// zOffsetComponent.setPropertyName(\"Z-Offset\");\n// contentContainer.addChild(zOffsetComponent.getPanel());\n// components.add(zOffsetComponent);\n//\n// } catch (NoSuchMethodException e) {\n// e.printStackTrace();\n// }\n\n\n }",
"private static void createAndShowGUI() {\n //Create and set up the window.\n //JFrame frame = new JFrame(\"Basics of Color\");\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n \n //Add content to the window.\n frame.add(new ColorBasics(), BorderLayout.CENTER);\n Menu menu = new Menu();\n frame.setJMenuBar(menu.createMenuBar());\n \n //Display the window.\n frame.pack();\n frame.setVisible(true);\n frame.setSize(FRAME_WIDTH, FRAME_HEIGHT);\n }",
"public void drawUI() {\n \n stroke(0);\n textSize(titleH/3);\n textAlign(CENTER, CENTER);\n rectMode(CORNER);\n \n noFill();\n rect(titleX, titleY, titleW, titleH);\n image(logo, 0, 0);\n fill(0);\n text(\"EPBox: Ordinering\", titleX, titleY, titleW, titleH-15);\n \n if (!informationSeen) {\n uielement.informationDialog(\"EPBox: Ordinering\", \"Velkommen til EPBox: Ordinering.\\n\\nHvis det er første gang du kører programmet, bedes du gå igennem opsætning af programmet.\\nMangler du hjælp til dette, kan du gå ind på de relevante menuer, eller konsultere brugsanvisningen.\", \"information\");\n informationSeen = true;\n }\n\n uielement.infoHelpBttnSTART(\"Hvis det er første gang du kører programmet, bedes du gå igennem opsætning af programmet.\\nMangler du hjælp til dette, kan du gå ind på de relevante menuer, eller konsultere brugsanvisningen.\");\n\n }",
"@Override\r\n\tpublic void display() {\n\t\tSystem.out.println(\"This is a rectangle button!\");\r\n\t}",
"private void setupGUI(){\r\n\t\t\r\n\t\tfinal GUIFactory guifactory = GUIFactory.instance();\r\n\t\tfinal MTApplication app = (MTApplication)item.getView().getRenderer();\r\n\t\tfinal float leftiness = app.getWidth()*5/6;\r\n\t\tfinal float xPos = leftiness + 5;\r\n\t\t\r\n\t\t\r\n\t\toverlay = new MTOverlayContainer( app);\r\n\t\titem.getView().getRoot().addChild( overlay);\r\n\t\t\r\n\t\t// _THE_ PANEL \r\n\t\t\r\n\t\tpnlPanel = guifactory.createPanel( leftiness, 0, app.getWidth()-leftiness, app.getHeight(),\"pnlPanel\", overlay);\t\t\t\r\n\t\t\r\n\t\t// INTERACTION PANEL\r\n\t\t\r\n\t\tpnlInteraction = guifactory.createPanel(\r\n\t\t\t\tpnlPanel.getPosition( TransformSpace.GLOBAL),\r\n\t\t\t\tpnlPanel.getWidthXY( TransformSpace.GLOBAL),\r\n\t\t\t\tpnlPanel.getHeightXY( TransformSpace.GLOBAL),\r\n\t\t\t\t\"pnlInteraction\",\r\n\t\t\t\tpnlPanel);\r\n\t\tpnlInteraction.setNoFill( true);\r\n\t\t\r\n\t\t// EDIT PANEL\r\n\t\t\r\n\t\tpnlEdit = guifactory.createPanel(\r\n\t\t\t\tpnlPanel.getPosition( TransformSpace.GLOBAL),\r\n\t\t\t\tpnlPanel.getWidthXY( TransformSpace.GLOBAL),\r\n\t\t\t\tpnlPanel.getHeightXY( TransformSpace.GLOBAL),\r\n\t\t\t\t\"pnlEdit\",\r\n\t\t\t\tpnlPanel);\r\n\t\tpnlEdit.setVisible( false);\r\n\t\tpnlEdit.setNoFill( true);\r\n\t\t\r\n\t\t\r\n\t\t// ITEM NAME TEXTAREA\r\n\t\t\r\n\t\tString itemName = item.getName();\r\n\t\tif(itemName == null || itemName.equals( \"\"))\r\n\t\t\titemName = item.getID();\r\n\t\ttxtItemName = guifactory.createTextArea(itemName, \"txtItemName\", pnlPanel);\r\n\t\ttxtItemName.setPositionGlobal(\r\n\t\t\t\tnew Vector3D(\r\n\t\t\t\t\t\txPos,\r\n\t\t\t\t\t\tpnlPanel.getPosition( TransformSpace.GLOBAL).getY() + 10\t\r\n\t\t\t\t));\r\n\r\n\r\n\t\t// PANEL PICTURE\r\n\r\n\t\tVector3D pnlInteractionPos = pnlInteraction.getPosition( TransformSpace.GLOBAL);\r\n\t\tpnlPicture = guifactory.createPanel( pnlInteractionPos.getX()+50, pnlInteractionPos.getY()+50, 100, 100, \"pnlPicture\", pnlInteraction);\r\n\t\tpnlPicture.setAnchor( PositionAnchor.CENTER);\r\n\t\tpnlPicture.setPositionGlobal(\r\n\t\t\t\tnew Vector3D(\r\n\t\t\t\t\t\tpnlInteractionPos.getX() + pnlInteraction.getWidthXY( TransformSpace.GLOBAL)/2,\r\n\t\t\t\t\t\tpnlInteractionPos.getY() + 50 + pnlPicture.getHeightXY( TransformSpace.GLOBAL)/2\r\n\t\t\t\t));\r\n\t\tpnlPicture.setTexture( GUITextures.instance().getByDevice( DeviceType.getDeviceType( device)));\r\n\t\t\r\n\t\t\r\n\t\t// POWER USAGE TEXTAREA\r\n\t\t\r\n\t\tString powerUsage = \"n/a\";\r\n\t\tif( device.getPowerUsage() != null && device.getPowerUsage().getValue() != null){\r\n\t\t\tpowerUsage = device.getPowerUsage().getValue().toString();\r\n\t\t}\r\n\t\t\r\n\t\ttxtPowerUsage = guifactory.createTextArea( \"Power usage: \" + powerUsage + \" Watts\", \"txtPowerUsage\", pnlInteraction);\r\n\t\ttxtPowerUsage.setPositionGlobal(\r\n\t\t\t\tnew Vector3D(\r\n\t\t\t\t\t\txPos,\r\n\t\t\t\t\t\tpnlInteractionPos.getY() + 140\t\t\r\n\t\t\t\t\t\t));\r\n\t\ttxtPowerUsage.setVisible( false);\r\n\t\t\r\n\t\t\r\n\t\t// ON/OFF BUTTON\r\n\t\t\r\n\t\tbtnOnOff = guifactory.createButton( \"Turn device On/Off\", \"btnOnOff\", pnlInteraction);\r\n\t\tbtnOnOff.setPosition( txtPowerUsage.getPosition( TransformSpace.GLOBAL));\r\n\t\tbtnOnOff.addGestureListener( TapProcessor.class, new BtnOnOffListener());\r\n\t\t\r\n\t\t\r\n\t\t// SUBDEVICE BUTTON PANEL\r\n\t\t\r\n\t\tpnlSubDeviceButtons = guifactory.createPanel(\r\n\t\t\t\tpnlPanel.getPosition( TransformSpace.GLOBAL).getX(),\r\n\t\t\t\tbtnOnOff.getVectorNextToComponent( 10, false).getY(),\r\n\t\t\t\tpnlPanel.getWidthXY( TransformSpace.GLOBAL),\r\n\t\t\t\tdevice.getSubDevice().size() * (btnOnOff.getHeight()+10),\r\n\t\t\t\t\"pnlSubDeviceButtons\",\r\n\t\t\t\tpnlInteraction);\r\n\t\t\r\n\t\t// SUB DEVICE BUTTONS\r\n\t\t\r\n\t\tsubDeviceButtons = new LinkedList<MTButton>();\r\n\t\tfor( int i = 0; i < device.getSubDevice().size(); i++){\r\n\t\t\t\r\n\t\t\tPhysicalDevice subDevice = device.getSubDevice().get( i);\r\n\t\t\t\r\n\t\t\t// get button's caption\r\n\t\t\tString caption = subDevice.getName();\r\n\t\t\tif(caption == null || caption.equals( \"\"))\r\n\t\t\t\tcaption = subDevice.getId();\r\n\t\t\t\r\n\t\t\tMTButton btnSubDevice = guifactory.createButton( caption, \"btnSubDevice_\" + subDevice.getId(), pnlSubDeviceButtons);\r\n\t\t\tbtnSubDevice.setPosition(\r\n\t\t\t\t\tnew Vector3D(\r\n\t\t\t\t\t\txPos,\t\r\n\t\t\t\t\t\tpnlSubDeviceButtons.getPosition( TransformSpace.GLOBAL).getY() + i*(btnSubDevice.getHeight() + 10)\r\n\t\t\t\t\t));\r\n\t\t\t\r\n\t\t\tsubDeviceButtons.add( btnSubDevice);\r\n\t\t\tbtnSubDevice.addGestureListener( TapProcessor.class, new BtnSubDeviceListener( subDevice));\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t// EDIT BUTTON\r\n\t\t\r\n\t\tbtnEdit = guifactory.createButton( \"Edit\", \"btnEdit\", pnlInteraction);\r\n\t\tbtnEdit.setPosition( new Vector3D( xPos, app.getHeight() - 2*btnEdit.getHeight() - 30));\r\n\t\tbtnEdit.addGestureListener( TapProcessor.class, new BtnEditListener());\r\n\t\t\r\n\t\t\r\n\t\t// BUTTON HIDE\r\n\t\t\r\n\t\tbtnHide = guifactory.createButton( \"Hide menu\", \"btnHide\", pnlPanel);\r\n\t\tbtnHide.setPosition( new Vector3D( xPos, app.getHeight() - btnHide.getHeight() - 20));\r\n\t\tbtnHide.addGestureListener( TapProcessor.class, new BtnHideListener());\r\n\t\t\r\n\t\t\r\n\t\t///// EDIT-ELEMENTS /////\r\n\r\n\t\tchkMovePlanar = guifactory.createCheckButton( \"Move planar\", \"chkMovePlanar\", pnlEdit);\r\n\t\tchkMovePlanar.setPosition(\r\n\t\t\t\tnew Vector3D(\r\n\t\t\t\t\t\txPos,\r\n\t\t\t\t\t\ttxtItemName.getPosition( TransformSpace.GLOBAL).getY() + txtItemName.getHeightXY( TransformSpace.GLOBAL)+ 20\t\r\n\t\t\t\t));\r\n\t\tchkMovePlanar.addGestureListener( TapProcessor.class, new ChkMovePlanarListener());\r\n\r\n\t\t\r\n\t\tchkMoveY = guifactory.createCheckButton( \"Move up/down\", \"chkMoveY\", pnlEdit);\r\n\t\tchkMoveY.setPosition( chkMovePlanar.getVectorNextToComponent( 10, false));\r\n\t\tchkMoveY.addGestureListener( TapProcessor.class, new ChkMoveYListener());\r\n\r\n\t\t\r\n\t\tchkRotate = guifactory.createCheckButton( \"Rotate\", \"chkRotate\", pnlEdit);\r\n\t\tchkRotate.setPosition( chkMoveY.getVectorNextToComponent( 10, false));\r\n\t\tchkRotate.addGestureListener( TapProcessor.class, new ChkRotateListener());\r\n\r\n\t\t\r\n\t\tchkScale = guifactory.createCheckButton( \"Scale\", \"chkScale\", pnlEdit);\r\n\t\tchkScale.setPosition( chkRotate.getVectorNextToComponent( 10, false));\r\n\t\tchkScale.addGestureListener( TapProcessor.class, new ChkScaleListener());\r\n\r\n\t\t\r\n\t\tbtnChangeVisualisation = guifactory.createButton( \"Change Style\", \"btnChangeVisualisation\", pnlEdit);\r\n\t\tbtnChangeVisualisation.setPosition( chkScale.getVectorNextToComponent( 10, false));\r\n\t\tbtnChangeVisualisation.addGestureListener( TapProcessor.class, new BtnChangeVisualisationListener());\r\n\t\t\r\n\t\t\r\n\t\tbtnSave = guifactory.createButton( \"Save\", \"btnSave\", pnlEdit);\r\n\t\tbtnSave.setPosition( btnEdit.getPosition());\r\n\t\tbtnSave.addGestureListener( TapProcessor.class, new BtnSaveListener());\r\n\t}",
"@Override\n public void render() { super.render(); }",
"@Override\n\tprotected void initUi() {\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\tSwingUtilities.invokeLater(new Runnable() {\r\n\t\t\tpublic void run() {\r\n\t\t\t\t// Turn off metal's use of bold fonts\r\n\t\t\t\tUIManager.put(\"swing.boldMetal\", Boolean.FALSE);\r\n\t\t\t\tcreateAndShowGUI();\r\n\t\t\t}\r\n\t\t});\r\n\t}",
"private void initSimulateModeView() {\n simulateMode = new Label(\"SIMULATE\");\n simulateMode.setPrefSize(200, 100);\n simulateMode.setFont(Font.font(null, FontWeight.BOLD, 30));\n simulateMode.setTextFill(Color.ORANGE);\n simulateMode.setEffect(getDropShadow());\n }",
"public static void main(String[] args) {\n\t\t SwingUtilities.invokeLater(new Runnable() {\r\n\r\n\t public void run() {\r\n\r\n\t \tCharacterBuilderInterface ex = new CharacterBuilderInterface();\r\n\t ex.setVisible(true);\r\n\t }\r\n\t });\r\n\t}",
"GUIbrain() {\n addMouseListener(this);\n addMouseMotionListener(this);\n createGUI(this);\n }",
"public static void showGUI() {\n Display display = Display.getDefault();\n Shell shell = new Shell(display);\n EntropyUIconfig inst = new EntropyUIconfig(shell, SWT.NULL);\n Point size = inst.getSize();\n shell.setLayout(new FillLayout());\n shell.layout();\n if (size.x == 0 && size.y == 0) {\n inst.pack();\n shell.pack();\n } else {\n Rectangle shellBounds = shell.computeTrim(0, 0, size.x, size.y);\n shell.setSize(shellBounds.width, shellBounds.height);\n }\n shell.open();\n while (!shell.isDisposed()) {\n if (!display.readAndDispatch())\n display.sleep();\n }\n }",
"public static void main(String[] args) {\n \n javax.swing.SwingUtilities.invokeLater(new Runnable() {\n \npublic void run() {\n \n createAndShowGUI(); \n \n}\n \n });\n }",
"private void setupUI() {\n\t\tpanel1 = new JPanel();\n\t\tpanel1.setLayout(new BorderLayout(0, 0));\n\t\tfinal JPanel panel2 = new JPanel();\n\t\tpanel2.setLayout(new FlowLayout(FlowLayout.LEFT, 2, 2));\n\t\tpanel2.setBackground(Color.BLACK);\n\t\tpanel2.setPreferredSize(new Dimension(800, 34));\n\t\tpanel1.add(panel2, BorderLayout.SOUTH);\n\t\tstopButton = new JButton();\n\t\tstopButton.setText(\"STOP\");\n\t\tstopButton.setPreferredSize(new Dimension(82, 30));\n\t\tpanel2.add(stopButton);\n\t\tclsButton = new JButton();\n\t\tclsButton.setPreferredSize(new Dimension(82, 30));\n\t\tclsButton.setText(\"CLS\");\n\t\tpanel2.add(clsButton);\n\t\trunButton = new JButton();\n\t\trunButton.setPreferredSize(new Dimension(82, 30));\n\t\trunButton.setText(\"RUN\");\n\t\tpanel2.add(runButton);\n\t\tcaretLabel = new JLabel();\n\t\tcaretLabel.setPreferredSize(new Dimension(82, 30));\n\t\tcaretLabel.setForeground(Color.pink);\n\t\tpanel2.add(caretLabel);\n\t\tmainTextArea = new ShellTextComponent(this);\n\t\tmainTextArea.setCaretColor(new Color(Colors.COLORS[14]));\n\t\tfinal JScrollPane scrollPane1 = new JScrollPane(mainTextArea);\n\n\t\tpanel1.add(scrollPane1, BorderLayout.CENTER);\n\t\tpanel1.setPreferredSize(new Dimension(800, 600));\n\t}",
"@Override\n protected void controlRender(RenderManager rm, ViewPort vp) {\n }",
"public GUI()\n {\n //Initializes the variables and UI aspects\n UI.initialise();\n UI.addTextField(\"Search Title/Director/Genre\", this::searchEither);\n UI.addButton(\"Add Movie\", this::newMovie);\n UI.addButton(\"Rate Movie\", this::rateMovie);\n UI.addButton(\"Show All Movies\", this::printAll);\n UI.addButton(\"Recommend Movies\", this::recommendMovie);\n UI.setMouseListener(r::manageMouse);\n UI.addButton(\"Quit\", UI::quit);\n \n // Sets the size of the whole window and the divider\n UI.setWindowSize(CANVASWIDTH, CANVASHEIGHT);\n UI.setDivider(0.4);\n this.drawMain();\n }",
"public void visualChange();",
"public Visualize() {\n initComponents();\n \n }",
"public GUI() {\n initComponents();\n this.jComboBox1.setEnabled(false);\n this.jButton2.setEnabled(false);\n this.jButton3.setEnabled(false);\n this.jTextArea1.setEnabled(false);\n getContentPane().setBackground(java.awt.Color.getHSBColor((float) 0.62, (float) 0.55, (float) 0.55));\n }",
"public void render()\r\n\t{\n\t}",
"public GuiController()\n {\n\n DefaultTerminalFactory terminalFactory = new DefaultTerminalFactory();\n PageStack = new ArrayDeque<>(); // Gives us a screen stack\n window = new BasicWindow(\"Just put anything, I don't even care\");\n try\n {\n screen = terminalFactory.createScreen(); //Populates screen\n screen.startScreen(); //Runs screen\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n textGUI = new MultiWindowTextGUI(screen);\n\n }",
"void render(Object rendererTool);",
"private void initUI()\r\n\t{\r\n\t\tthis.label = new Label();\r\n\t\t\r\n\t\tthis.label.setText(\"This view is also saveable\");\r\n\t\t\r\n\t\tthis.label.setSizeUndefined();\r\n\t\tthis.add(this.label);\r\n\t\tthis.setSizeFull();\r\n\t}",
"@Override\n\tpublic void render() {\n\t\t\n\t}",
"public void render() {\n }",
"@Override\n public void simpleRender(RenderManager rm) {\n }",
"@Override\n public void simpleRender(RenderManager rm) {\n }",
"@Override\n public void simpleRender(RenderManager rm) {\n }",
"@Override\n public void simpleRender(RenderManager rm) {\n }",
"@Override\n public void simpleRender(RenderManager rm) {\n }",
"@Override\n public void simpleRender(RenderManager rm) {\n }",
"public void render(CliContext ctx);",
"@Override\r\n\tpublic void render() {\n\t\t\r\n\t}",
"public BasicTextUI() {\n painted = false;\n }",
"@Override\r\n\tpublic void simpleRender(RenderManager rm) {\n\t}",
"private void initUI() {\r\n\t\t//Äußeres Panel\r\n\t\tContainer pane = getContentPane();\r\n\t\tGroupLayout gl = new GroupLayout(pane);\r\n\t\tpane.setLayout(gl);\r\n\t\t//Abstende von den Containern und dem äußeren Rand\r\n\t\tgl.setAutoCreateContainerGaps(true);\r\n\t\tgl.setAutoCreateGaps(true);\r\n\t\t//TextFeld für die Ausgabe\r\n\t\tJTextField output = view.getTextField();\r\n\t\t//Die jeweiligen Panels für die jeweiigen Buttons\r\n\t\tJPanel brackets = view.getBracketPanel();\r\n\t\tJPanel remove = view.getTop2Panel();\r\n\t\tJPanel numbers = view.getNumbersPanel();\r\n\t\tJPanel last = view.getBottomPanel();\r\n\t\t//Anordnung der jeweiligen Panels durch den Layout Manager\r\n\t\tgl.setHorizontalGroup(gl.createParallelGroup().addComponent(output).addComponent(brackets).addComponent(remove).addComponent(numbers).addComponent(last));\r\n\t\tgl.setVerticalGroup(gl.createSequentialGroup().addComponent(output).addComponent(brackets).addComponent(remove).addComponent(numbers).addComponent(last));\r\n\t\tpack();\r\n\t\tsetTitle(\"Basic - Taschenrechner\");\r\n\t\tsetDefaultCloseOperation(EXIT_ON_CLOSE);\r\n\t\tsetResizable(false);\r\n\t}",
"public static void main(String[] args) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\ttry {\r\n\t\t\tString className = UIManager.getCrossPlatformLookAndFeelClassName();\r\n\t\t\tUIManager.setLookAndFeel(className);\r\n\t\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\t\r\n\t\t}\r\n\t\t\tEventQueue.invokeLater(new Runnable() {\r\n\t\t\tpublic void run() {\r\n\t\t\t\t@SuppressWarnings(\"unused\")\r\n\t\t\t\tGUIMemoryCards vista = new GUIMemoryCards();\r\n\t\t\t\t}\r\n\t\t\t});\t\r\n\t}",
"private static void createAndShowGUI() {\r\n //Make sure we have nice window decorations.\r\n JFrame.setDefaultLookAndFeelDecorated(true);\r\n JDialog.setDefaultLookAndFeelDecorated(true);\r\n\r\n //Create and set up the window.\r\n JFrame frame = new SplitPaneDemo2();\r\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\r\n //Display the window.\r\n frame.pack();\r\n frame.setVisible(true);\r\n }",
"public DrawGUI() {\n\n\t\tthis.setTitle(\"Draw 0.2\");\n\t\tsetIconImage(Toolkit.getDefaultToolkit().getImage(\"img/logo.png\"));\n\t\tsetDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n\t\tdrawingContainer = new DrawingContainer();\n\t\tscrollpane = new JScrollPane(drawingContainer);\n\n\t\tcontroller = new DrawingController(this);\n\t\ttools = new ToolBox(controller);\n\t\tcontroller.newDrawing(new Dimension(500, 380));\n\n\t\t// statusBar = new StatusBar();\n\n\t\tgetContentPane().add(tools, BorderLayout.WEST);\n\t\tgetContentPane().add(scrollpane, BorderLayout.CENTER);\n\t\t// getContentPane().add(statusBar, BorderLayout.SOUTH);\n\n\t\tMenuListener mainMenuListener = new MenuListener(controller);\n\t\tJMenuBar mainMenu = new MainMenu(mainMenuListener);\n\t\tthis.setJMenuBar(mainMenu);\n\n\t\tpack();\n\t\tsetVisible(true);\n\n\t}",
"private static void createContents() {\r\n\t\t\r\n\t\tcolorPreview = new Composite(colorUI, SWT.BORDER);\r\n\t\tcolorPreview.setBounds(10, 23, 85, 226);\r\n\t\t\r\n\t\tscRed = new Scale(colorUI, SWT.NONE);\r\n\t\tscRed.setMaximum(255);\r\n\t\tscRed.setMinimum(0);\r\n\t\tscRed.setForeground(SWTResourceManager.getColor(SWT.COLOR_RED));\r\n\t\tscRed.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));\r\n\t\tscRed.setBounds(244, 34, 324, 42);\r\n\t\tscRed.setIncrement(1);\r\n\t\tscRed.setPageIncrement(10);\r\n\t\tscRed.addSelectionListener(new SelectionAdapter(){\r\n\t\t\tpublic void widgetSelected(SelectionEvent e){\r\n\t\t\t\tR = scRed.getSelection();\r\n\t\t\t\tmRed.setText(Integer.toString(scRed.getSelection()));\r\n\t\t\t\tcolorPreview.setBackground(SWTResourceManager.getColor(R, G, B));\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tmRed = new Label(colorUI, SWT.NONE);\r\n\t\tmRed.setAlignment(SWT.RIGHT);\r\n\t\tmRed.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));\r\n\t\tmRed.setBounds(180, 47, 55, 15);\r\n\t\tmRed.setText(\"0\");\r\n\r\n\t\tscGreen = new Scale(colorUI, SWT.NONE);\r\n\t\tscGreen.setMaximum(255);\r\n\t\tscGreen.setMinimum(0);\r\n\t\tscGreen.setForeground(SWTResourceManager.getColor(SWT.COLOR_RED));\r\n\t\tscGreen.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));\r\n\t\tscGreen.setBounds(244, 84, 324, 42);\r\n\t\tscGreen.setIncrement(1);\r\n\t\tscGreen.setPageIncrement(10);\r\n\t\tscGreen.addSelectionListener(new SelectionAdapter(){\r\n\t\t\tpublic void widgetSelected(SelectionEvent e){\r\n\t\t\t\tG = scGreen.getSelection();\r\n\t\t\t\tmGreen.setText(Integer.toString(scGreen.getSelection()));\r\n\t\t\t\tcolorPreview.setBackground(SWTResourceManager.getColor(R, G, B));\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tmGreen = new Label(colorUI, SWT.NONE);\r\n\t\tmGreen.setAlignment(SWT.RIGHT);\r\n\t\tmGreen.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));\r\n\t\tmGreen.setText(\"0\");\r\n\t\tmGreen.setBounds(180, 97, 55, 15);\r\n\t\t\r\n\t\tscBlue = new Scale(colorUI, SWT.NONE);\r\n\t\tscBlue.setMaximum(255);\r\n\t\tscBlue.setMinimum(0);\r\n\t\tscBlue.setForeground(SWTResourceManager.getColor(SWT.COLOR_RED));\r\n\t\tscBlue.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));\r\n\t\tscBlue.setBounds(244, 138, 324, 42);\r\n\t\tscBlue.setIncrement(1);\r\n\t\tscBlue.setPageIncrement(10);\r\n\t\tscBlue.addSelectionListener(new SelectionAdapter(){\r\n\t\t\tpublic void widgetSelected(SelectionEvent e){\r\n\t\t\t\tB = scBlue.getSelection();\r\n\t\t\t\tmBlue.setText(Integer.toString(scBlue.getSelection()));\r\n\t\t\t\tcolorPreview.setBackground(SWTResourceManager.getColor(R, G, B));\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tmBlue = new Label(colorUI, SWT.NONE);\r\n\t\tmBlue.setAlignment(SWT.RIGHT);\r\n\t\tmBlue.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));\r\n\t\tmBlue.setText(\"0\");\r\n\t\tmBlue.setBounds(180, 151, 55, 15);\r\n\t\t\r\n\t\tscAlpha = new Scale(colorUI, SWT.NONE);\r\n\t\tscAlpha.setMaximum(255);\r\n\t\tscAlpha.setMinimum(0);\r\n\t\tscAlpha.setForeground(SWTResourceManager.getColor(SWT.COLOR_RED));\r\n\t\tscAlpha.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));\r\n\t\tscAlpha.setBounds(244, 192, 324, 42);\r\n\t\tscAlpha.setIncrement(1);\r\n\t\tscAlpha.addSelectionListener(new SelectionAdapter(){\r\n\t\t\tpublic void widgetSelected(SelectionEvent e){\r\n\t\t\t\tA = scAlpha.getSelection();\r\n\t\t\t\tmAlpha.setText(Integer.toString(scAlpha.getSelection()));\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tbtnOkay = new Button(colorUI, SWT.NONE);\r\n\t\tbtnOkay.setBounds(300, 261, 80, 30);\r\n\t\tbtnOkay.setText(\"Okay\");\r\n\t\tbtnOkay.addSelectionListener(new SelectionAdapter(){\r\n\t\t\tpublic void widgetSelected(SelectionEvent e){\r\n\t\t\t\tOptions.cr.ColorR = R;\r\n\t\t\t\tOptions.cr.ColorG = G;\r\n\t\t\t\tOptions.cr.ColorB = B;\r\n\t\t\t\tOptions.cr.ColorA = A;\r\n\t\t\t\tOptions.colorPreview.setBackground(SWTResourceManager.getColor(R, G, B));\r\n\t\t\t\tcolorUI.close();\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tbtnCancel = new Button(colorUI, SWT.NONE);\r\n\t\tbtnCancel.setText(\"Cancel\");\r\n\t\tbtnCancel.setBounds(195, 261, 80, 30);\r\n\t\tbtnCancel.addSelectionListener(new SelectionAdapter(){\r\n\t\t\tpublic void widgetSelected(SelectionEvent e){\r\n\t\t\t\tOptions.colorPreview.setBackground(SWTResourceManager.getColor(Options.cr.ColorR, Options.cr.ColorG, Options.cr.ColorB));\r\n\t\t\t\tR = Options.cr.ColorR;\r\n\t\t\t\tG = Options.cr.ColorG;\r\n\t\t\t\tB = Options.cr.ColorB;\r\n\t\t\t\tA = Options.cr.ColorA;\r\n\t\t\t\tcolorUI.close();\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tmAlpha = new Label(colorUI, SWT.NONE);\r\n\t\tmAlpha.setAlignment(SWT.RIGHT);\r\n\t\tmAlpha.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));\r\n\t\tmAlpha.setText(\"0\");\r\n\t\tmAlpha.setBounds(180, 206, 55, 15);\r\n\t\t\r\n\t\tLabel lblRed = new Label(colorUI, SWT.NONE);\r\n\t\tlblRed.setFont(SWTResourceManager.getFont(\"Segoe UI\", 9, SWT.BOLD));\r\n\t\tlblRed.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));\r\n\t\tlblRed.setBounds(123, 47, 55, 15);\r\n\t\tlblRed.setText(\"Red\");\r\n\t\t\r\n\t\tLabel lblGreen = new Label(colorUI, SWT.NONE);\r\n\t\tlblGreen.setFont(SWTResourceManager.getFont(\"Segoe UI\", 9, SWT.BOLD));\r\n\t\tlblGreen.setText(\"Green\");\r\n\t\tlblGreen.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));\r\n\t\tlblGreen.setBounds(123, 97, 55, 15);\r\n\t\t\r\n\t\tLabel lblBlue = new Label(colorUI, SWT.NONE);\r\n\t\tlblBlue.setFont(SWTResourceManager.getFont(\"Segoe UI\", 9, SWT.BOLD));\r\n\t\tlblBlue.setText(\"Blue\");\r\n\t\tlblBlue.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));\r\n\t\tlblBlue.setBounds(123, 151, 55, 15);\r\n\t\t\r\n\t\tLabel lblAlpha = new Label(colorUI, SWT.NONE);\r\n\t\tlblAlpha.setFont(SWTResourceManager.getFont(\"Segoe UI\", 9, SWT.BOLD));\r\n\t\tlblAlpha.setText(\"Alpha\");\r\n\t\tlblAlpha.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));\r\n\t\tlblAlpha.setBounds(123, 206, 55, 15);\r\n\t\t\r\n\t\t\r\n\t}",
"public void initComponents() {\n\t\tscreen = new JTextArea();\r\n screen.setBackground(Color.black);\r\n screen.setForeground(Color.green);\r\n screen.setCaretColor(Color.green);\r\n ConsoleCaret caret = new ConsoleCaret(); //set up custom caret, for looks\r\n caret.setUpdatePolicy(ConsoleCaret.ALWAYS_UPDATE);\r\n screen.setCaret(caret);\r\n screen.setEditable(false);\r\n screen.addKeyListener(this);\r\n screen.setLineWrap(true);\r\n screen.setFocusable(false);\r\n screen.getCaret().setVisible(true);\r\n initFont();\r\n \r\n commandlib = new CommandLib(this); //init command lib\r\n out = new ConsoleWriter(new ConsoleStream(screen), commandlib, prefix);\r\n commandlib.setOutput(out);\r\n scrollPane = new JScrollPane(screen);\r\n scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);\r\n scrollPane.setForeground(Color.green);\r\n scrollPane.setBackground(Color.black);\r\n scrollPane.requestFocus();\r\n scrollPane.addKeyListener(this);\r\n \r\n }",
"protected void setupUI() {\n\n }",
"public void render() {\n uiBatch.begin();\n for (int x = 0; x < uiManager.getUIComponents().size();x++) {\n uiManager.getUIComponent(x).render(uiBatch, Assets.patch);\n }\n if (uiManager.dialogue != null) {\n uiManager.dialogue.render(uiBatch, Assets.patch);\n }\n if (!uiManager.notifications.isEmpty()) {\n uiManager.notifications.get(0).render(uiBatch, Assets.patch);\n }\n uiManager.partyMenu.render(uiBatch, Assets.patch);\n uiBatch.end();\n }"
] | [
"0.69794184",
"0.6751023",
"0.67389184",
"0.669709",
"0.6692281",
"0.664908",
"0.6636192",
"0.6620477",
"0.66143703",
"0.6584928",
"0.65496874",
"0.6487521",
"0.64774096",
"0.6465392",
"0.6461605",
"0.644844",
"0.64181435",
"0.64174014",
"0.6415532",
"0.6408598",
"0.64050096",
"0.6398341",
"0.63902396",
"0.63878345",
"0.63875264",
"0.6386954",
"0.6370405",
"0.6365931",
"0.6365692",
"0.63514465",
"0.63149303",
"0.63079375",
"0.62904334",
"0.62860066",
"0.62765473",
"0.6272801",
"0.6269611",
"0.62572587",
"0.6256495",
"0.6256392",
"0.62373245",
"0.62352717",
"0.6231697",
"0.6227872",
"0.62148094",
"0.62105614",
"0.6207821",
"0.62030023",
"0.61944973",
"0.6194489",
"0.6192665",
"0.6185805",
"0.6185067",
"0.6184588",
"0.61728656",
"0.6168593",
"0.6168593",
"0.6161998",
"0.6157678",
"0.6154623",
"0.61529094",
"0.6151877",
"0.6151573",
"0.6144205",
"0.61407715",
"0.61352617",
"0.61337346",
"0.61238724",
"0.61216664",
"0.6118649",
"0.61092687",
"0.610645",
"0.60988194",
"0.6095485",
"0.6095002",
"0.60898495",
"0.60870874",
"0.60862523",
"0.6084179",
"0.6082987",
"0.6081282",
"0.60770243",
"0.60764456",
"0.60722893",
"0.60722893",
"0.60722893",
"0.60722893",
"0.60722893",
"0.60722893",
"0.6070701",
"0.60670614",
"0.6061062",
"0.6059226",
"0.60587317",
"0.6058602",
"0.605856",
"0.605389",
"0.60525805",
"0.6042141",
"0.6040151",
"0.60397863"
] | 0.0 | -1 |
Draw a line into the demo | protected void drawLineBody(Graphics2D g, Body body, Line line) {
g.setColor(bodyColor);
ROVector2f[] verts = line.getVertices();
g.drawLine(
(int)verts[0].getX(),
(int)verts[0].getY(),
(int)verts[1].getX(),
(int)verts[1].getY());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void drawLine(float x, float y, float x2, float y2, float width, float u, float v, float texW, float texH) {\n throw new NotImplementedException(); // TODO Implement\n }",
"public void drawLine(int x, int y, int x2, int y2, int color);",
"public void drawLine(float[] line) {\n\t\tparent.line(line[0], line[1], line[2], line[3]);\n\t}",
"public void drawLine(float x, float y, float x2, float y2, float width) {\n throw new NotImplementedException(); // TODO Implement\n }",
"public void drawLine(int x1, int y1, int x2, int y2);",
"private void drawLine(double x1, double y1, double x2, double y2) {\r\n\t\tGLine line = new GLine(x1,y1,x2,y2);\r\n\t\tadd(line);\r\n\t}",
"public void drawLine() {\n for(int i=0; i < nCols; i++) {\n System.out.print(\"----\");\n }\n System.out.println(\"\");\n }",
"public void drawLine(float[] line) {\n\t\tline(line[0], line[1], line[2], line[3]);\n\t}",
"public void draw()\n {\n drawLine(x1, y1, x2, y2);\n }",
"private Line addLine() {\n\t\t// Create a new line\n\t\tLine line = new Line(doily.settings.getPenScale(), \n\t\t\t\tdoily.settings.getPenColor(), doily.settings.isReflect());\n\t\tdoily.lines.add(line);\n\t\treturn line;\n\t}",
"private void drawLine(GraphicsContext canvas, Point start, Point end) {\n canvas.strokeLine(\n start.X, start.Y,\n end.X, end.Y\n );\n }",
"public void addPolyLine() {\n abstractEditor.drawNewShape(new ELineDT());\n }",
"private void drawLine(int x1, int y1, int x2, int y2)\n {\n System.out.println(\"Draw a line from x of \" + x1 + \" and y of \" + y1);\n System.out.println(\"to x of \" + x2 + \" and y of \" + y2);\n System.out.println(\"The line color is \" + lineColor);\n System.out.println(\"The width of the line is \" + lineWidth);\n System.out.println(\"Then length of the line is \" + df.format(getLength()) + \"\\n\" );\n }",
"private void drawLine(Vector2 vt1, Vector2 vt2, GLayerGroup pGroup){\n DrawLineLaser.DrawLine(vt1,vt2);\n\n }",
"public void drawLine(Point2D startPoint, Point2D endPoint, double lineStroke, int EndType);",
"public void draw(Graphics g) {\r\n g.drawLine(line.get(0).getX() + 4, line.get(0).getY() + 4, line.get(4).getX() + 4, line.get(4).getY() + 4);\r\n }",
"public void lineDraw(GraphNodeAL<MapPoint> l1, GraphNodeAL<MapPoint> l2) {\n Line l = new Line((int) l1.data.xCo, (int) l1.data.yCo, (int) l2.data.xCo, (int) l2.data.yCo);\n l.setTranslateX(mapImage.getLayoutX());\n l.setTranslateY(mapImage.getLayoutY());\n ((Pane) mapImage.getParent()).getChildren().add(l);\n }",
"public void makeLine() {\n \t\tList<Pellet> last_two = new LinkedList<Pellet>();\n \t\tlast_two.add(current_cycle.get(current_cycle.size() - 2));\n \t\tlast_two.add(current_cycle.get(current_cycle.size() - 1));\n \n \t\tPrimitive line = new Primitive(GL_LINES, last_two);\n \t\tMain.geometry.add(line);\n \n \t\tActionTracker.newPolygonLine(line);\n \t}",
"private void drawLine(Vector3 point1, Vector3 point2, Node n) {\n\n Node nodeForLine= new Node();\n nodeForLine.setName(LINE_STRING);\n //First, find the vector extending between the two points and define a look rotation\n //in terms of this Vector.\n final Vector3 difference = Vector3.subtract(point1, point2);\n final Vector3 directionFromTopToBottom = difference.normalized();\n final Quaternion rotationFromAToB =\n Quaternion.lookRotation(directionFromTopToBottom, Vector3.up());\n MaterialFactory.makeTransparentWithColor(getApplicationContext(), new Color(this.colorLine.x, this.colorLine.y, this.colorLine.z,this.alphaColor))\n .thenAccept(\n material -> {\n /* Then, create a rectangular prism, using ShapeFactory.makeCube() and use the difference vector\n to extend to the necessary length. */\n ModelRenderable model = ShapeFactory.makeCube(\n new Vector3(this.sizeLine, this.sizeLine, difference.length()),\n Vector3.zero(), material);\n /* Last, set the world rotation of the node to the rotation calculated earlier and set the world position to\n the midpoint between the given points . */\n\n nodeForLine.setParent(n);\n\n\n nodeForLine.setRenderable(model);\n nodeForLine.setWorldPosition(Vector3.add(point1, point2).scaled(.5f));\n nodeForLine.setWorldRotation(rotationFromAToB);\n }\n );\n\n }",
"private void lineColor() {\n\n\t}",
"public void renderLine (Graphics g)\r\n {\r\n if (glyph.getContourBox()\r\n .intersects(g.getClipBounds())) {\r\n getLine(); // To make sure the line has been computed\r\n\r\n Point start = glyph.getLag()\r\n .switchRef(\r\n new Point(\r\n getStart(),\r\n (int) Math.rint(line.yAt((double) getStart()))),\r\n null);\r\n Point stop = glyph.getLag()\r\n .switchRef(\r\n new Point(\r\n getStop() + 1,\r\n (int) Math.rint(line.yAt((double) getStop() + 1))),\r\n null);\r\n g.drawLine(start.x, start.y, stop.x, stop.y);\r\n }\r\n }",
"public void drawOneLine(float x1, float y1,float x2,float y2){\n \tGL11.glBegin(GL11.GL_LINES);\n \tGL11.glVertex2f(x1,y1);\n \tGL11.glVertex2f(x2,y2);\n \tGL11.glEnd();\n }",
"void drawLine(int startx,int starty,int endx,int endy,ImageView imageView){\n imageView.setVisibility(View.VISIBLE);\n Bitmap bitmap = Bitmap.createBitmap(getWindowManager().getDefaultDisplay().getWidth(),getWindowManager().getDefaultDisplay().getHeight(),Bitmap.Config.ARGB_8888);\n Canvas canvas = new Canvas(bitmap);\n imageView.setImageBitmap(bitmap);\n\n Paint paint = new Paint();\n paint.setColor(Color.RED);\n paint.setStrokeWidth(20);\n paint.setStyle(Paint.Style.STROKE);\n\n canvas.drawLine(startx,starty,endx,endy,paint);\n\n //animates the drawing to fade in\n Animation animation = new AlphaAnimation(0.0f,1.0f);\n animation.setDuration(4000);\n imageView.startAnimation(animation);\n }",
"public void draw() {\r\n /* DO NOT MODIFY */\r\n StdDraw.point(x, y);\r\n }",
"public void draw() {\n /* DO NOT MODIFY */\n StdDraw.point(x, y);\n }",
"public void draw() {\n /* DO NOT MODIFY */\n StdDraw.point(x, y);\n }",
"public void draw() {\n /* DO NOT MODIFY */\n StdDraw.point(x, y);\n }",
"public void draw() {\n /* DO NOT MODIFY */\n StdDraw.point(x, y);\n }",
"public void drawLine(int x0, int y0, int x1, int y1) {\n \t\tmyCanvas.drawLine(x0, y0, x1, y1, myPaint);\n \t}",
"private void drawLine(Graphics g, int x1, int y1, int x2, int y2) {\n int d = 0;\n\n int dx = Math.abs(x2 - x1);\n int dy = Math.abs(y2 - y1);\n\n int dx2 = 2 * dx; // slope scaling factors to\n int dy2 = 2 * dy; // avoid floating point\n\n int ix = x1 < x2 ? 1 : -1; // increment direction\n int iy = y1 < y2 ? 1 : -1;\n\n int x = x1;\n int y = y1;\n\n if (dx >= dy) {\n while (true) {\n plot(g, x, y);\n if (x == x2)\n break;\n x += ix;\n d += dy2;\n if (d > dx) {\n y += iy;\n d -= dx2;\n }\n }\n } else {\n while (true) {\n plot(g, x, y);\n if (y == y2)\n break;\n y += iy;\n d += dx2;\n if (d > dy) {\n x += ix;\n d -= dy2;\n }\n }\n }\n }",
"private void drawLines()\n {\n getBackground().setColor( Color.BLACK );\n \n for( int i = 200; i < getWidth(); i += 200 )\n {\n getBackground().drawLine(i, 0, i, getHeight() );\n getBackground().drawLine(0, i, getWidth(), i);\n }\n \n Greenfoot.start();\n }",
"public static void writeLine(Model model, int x1, int y1, int x2, int y2, char colour) {\n int xLength = model.getWidth();\n int yLength = model.getHeight();\n\n if (x1 > xLength || x2 > xLength || y1 > yLength || y2 > yLength) {\n System.out.println(String.format(\"Couldn't create line inside current simpleCanvas width: %d, height: %d\", xLength, yLength));\n return;\n }\n\n // Simple optimization if the line are orthogonal x or y.\n if (x1 == x2 || y1 == y2) {\n for (int i = Math.min(x1, x2); i <= Math.max(x1, x2); i++)\n for (int j = Math.min(y1, y2); j <= Math.max(y1, y2); j++)\n model.set(i, j, colour);\n } else {\n // try to draw line from left to write\n // To do this we should find min x coordinate\n int startx, starty, endx, endy;\n if (x1 < x2) {\n startx = x1;\n starty = y1;\n endx = x2;\n endy = y2;\n } else {\n startx = x2;\n starty = y2;\n endx = x1;\n endy = y1;\n }\n\n model.set(startx, starty, colour);\n model.set(endx, endy, colour);\n\n if (y1 < y2) {\n // Find line equation of the line\n // (y - y1)/(y2-y1) = (x - x1)/(x2 - x1)\n // y - y1 = (x - x1)(y2-y1)/(x2 - x1)\n // y = y1 + (x - x1)(y2-y1)/(x2 - x1)\n int newX = startx;\n int newY = starty;\n while (newX < endx && newY <= endy) {\n //TODO optimize coefficient\n double newYcompare = findY(newX + 1, startx, starty, endx, endy);\n\n if (newYcompare == newY + 1) {\n newY++;\n newX++;\n model.set(newX, newY, colour);\n model.set(newX, newY - 1, colour);\n } else if (newYcompare < newY + 1) {\n newX++;\n model.set(newX, newY, colour);\n } else {\n newY++;\n model.set(newX, newY, colour);\n }\n }\n } else {\n // Find line equation of the line\n // (x - x1)/(x2 - x1) = (y - y1)/(y2-y1)\n // (x - x1) = (y - y1)(x2 - x1)/(y2-y1)\n // x = x1 + (y - y1)(x2 - x1)/(y2-y1)\n int newX = startx;\n int newY = starty;\n while (newX <= endx && newY > endy) {\n //TODO optimize coefficient\n double newXcompare = findX(newY - 1, startx, starty, endx, endy);\n\n if (newXcompare == newX + 1) {\n newY--;\n newX++;\n model.set(newX, newY, colour);\n // array[newX - 2][newY - 1] = colour;\n model.set(newX, newY + 1, colour);\n } else if (newXcompare < newX + 1) {\n newY--;\n model.set(newX, newY, colour);\n } else {\n newX++;\n model.set(newX, newY, colour);\n }\n }\n }\n }\n }",
"public void draw()\r\n\t{\r\n\t\tsynchronized (lines)\r\n\t\t{\r\n\t\t\tfor(int i = lines.size()-1; i >= 0; i--)\r\n\t\t\t{\r\n\t\t\t\tlines.get(i).draw();\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void drawLine(int i, int y1, int j, int y2, Paint paint) {\n\t\t\n\t}",
"private void drawLines() {\n int min = BORDER_SIZE;\n int max = PANEL_SIZE - min;\n int pos = min;\n g2.setColor(LINE_COLOR);\n for (int i = 0; i <= GUI.SIZE[1]; i++) {\n g2.setStroke(new BasicStroke(i % GUI.SIZE[0] == 0 ? 5 : 3));\n g2.drawLine(min, pos, max, pos);\n g2.drawLine(pos, min, pos, max);\n pos += CELL_SIZE;\n }\n }",
"Line createLine();",
"public void drawLine(double x0, double y0, double x1, double y1, int red, int green, int blue){\n\t\tif( x0 > x1 ) {\n\t\t\tdouble xt = x0 ; x0 = x1 ; x1 = xt ;\n\t\t\tdouble yt = y0 ; y0 = y1 ; y1 = yt ;\n\t\t}\n\t\t\n\t\tdouble a = y1-y0;\n\t\tdouble b = -(x1-x0);\n\t\tdouble c = x1*y0 - x0*y1;\n\n\t\t\tif(y0<y1){ // Octant 1 or 2\n\t\t\t\tif( (y1-y0) <= (x1-x0) ) { //Octant 1\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t// Calculate initial x and initial y\n\t\t\t\t\tint x = (int)Math.round(x0);\n\t\t\t\t\tint y = (int)Math.round((-a*x-c)/b);\n\t\t\t\t\t\n\t\t\t\t\tdouble d = a*(x+1) + b*(y+0.5) + c;\n\t\t\t\t\t\n\t\t\t\t\t// Do we need to go E or SE\n\t\t\t\t\twhile(x<=Math.round(x1)){\n\t\t\t\t\t\tRenderer.setPixel(x, y, red, green, blue);\n\t\t\t\t\t\tif(d<0){\n\t\t\t\t\t\t\td = d+a;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\td = d+a+b;\n\t\t\t\t\t\t\ty = y+1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tx = x+1;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} else { // Octant 2\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t// Calculate initial x and initial y\n\t\t\t\t\tint y = (int)Math.round(y0);\n\t\t\t\t\tint x = (int)Math.round((-b*y-c)/a);\n\t\t\t\n\t\t\t\t\tdouble d = a*(x+0.5) + b*(y+1) + c;\n\t\t\t\t\t\n\t\t\t\t\t// Do we need to go SE or S\t\t\t\t\t\n\t\t\t\t\twhile(y<=Math.round(y1)){\n\t\t\t\t\t\tRenderer.setPixel(x, y, red, green, blue);\n\t\t\t\t\t\tif(d>0){\n\t\t\t\t\t\t\td = d+b; \n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\td = d+a+b;\n\t\t\t\t\t\t\tx = x+1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ty = y+1;\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else { // Octant 7 or 8\n\t\t\t\tif( (y0-y1) <= (x1-x0) ) { // Octant 8\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tint x = (int)Math.round(x0);\n\t\t\t\t\tint y = (int)Math.round((-a*x-c)/b);\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tdouble d = a*(x+1) + b*(y-0.5) + c;\n\t\t\t\t\t\n\t\t\t\t\t// Do we need to go E or NE\t\t\t\t\t\n\t\t\t\t\twhile(x<=Math.round(x1)){\n\t\t\t\t\t\tRenderer.setPixel(x, y, red, green, blue);\n\t\t\t\t\t\tif(d>0){ \n\t\t\t\t\t\t\td = d+a;\n\t\t\t\t\t\t} else { \n\t\t\t\t\t\t\td = d+a-b;\n\t\t\t\t\t\t\ty = y-1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tx = x+1;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} else { //Octant 7\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tint y = (int)Math.round(y0);\n\t\t\t\t\tint x = (int)Math.round((-b*y-c)/a);\n\t\t\t\t\t\n\t\t\t\t\tdouble d = a*(x+0.5) + b*(y-1) + c;\n\t\t\t\t\t\n\t\t\t\t\t// Do we need to go NE or N\n\t\t\t\t\twhile(y>=Math.round(y1)){\n\t\t\t\t\t\tRenderer.setPixel(x, y, red, green, blue);\n\t\t\t\t\t\tif(d<0){\n\t\t\t\t\t\t\td = d-b; \n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\td = d+a-b;\n\t\t\t\t\t\t\tx = x+1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ty = y-1;\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\t\n\t\t}",
"public void draw() {\n\t\tp.pushStyle();\n\t\t{\n\t\t\tp.rectMode(PConstants.CORNER);\n\t\t\tp.fill(360, 0, 70, 180);\n\t\t\tp.rect(60f, 50f, p.width - 110f, p.height * 2f * 0.33f - 50f);\n\t\t\tp.rect(60f, p.height * 2f * 0.33f + 50f, p.width - 110f, p.height * 0.33f - 130f);\n\t\t}\n\t\tp.popStyle();\n\n\t\tlineChart.draw(40f, 40f, p.width - 80f, p.height * 2f * 0.33f - 30f);\n\t\tlineChart2.draw(40f, p.height * 2f * 0.33f + 45f, p.width - 80f, p.height * 0.33f - 110f);\n\t\t//p.line(x1, y1, x2, y2);\n\n\t}",
"@FXML\n public void drawXButtonPressed()\n {\n //get the GraphicsContent, which is used to draw on the canvas\n GraphicsContext gc = clearCanvasAndGetGraphicsContext();\n\n //draw line from top corner to bottom corner\n gc.strokeLine(\n 0,\n 0,\n canvas.getWidth(),\n canvas.getHeight()\n );\n\n //draw line from bottom left corner to upper right corner\n gc.strokeLine(\n 0,\n canvas.getHeight(),\n canvas.getWidth(),\n 0\n );\n }",
"@Override\n public void render() {\n Gdx.gl.glClearColor(0, 0, 0, 1);\n Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);\n // Then we start our shapeRenderer batch, this time with ShapeType.Line\n shapeRenderer.begin(ShapeType.Line);\n // A Simple white line\n shapeRenderer.setColor(Color.WHITE);\n shapeRenderer.line(0, 0, 100, 100);\n // We can set different colors using two methods. We can use constants like so.\n shapeRenderer.setColor(Color.MAGENTA);\n shapeRenderer.line(10, 0, 110, 100);\n // We can also set a color using RGBA values\n shapeRenderer.setColor(0, 1, 0, 1);\n shapeRenderer.line(20, 0, 120, 100);\n // We can also do fancy things like gradients\n shapeRenderer.line(30, 0, 130, 100, Color.BLUE, Color.RED);\n // The last interesting thing we can do is draw a bunch of connected line segments using polyline\n // First we set up the list of vertices, where the even positions are x coordinates, and the odd positions are the y coordinates\n float[] verticies = {100, 200, 300, 300, 200, 300, 300, 200};\n shapeRenderer.polyline(verticies);\n // Finally, as always, we end the batch\n shapeRenderer.end();\n }",
"public void MakeLine() {\n\t\tLineButton = new JButton(\n\t\t\t\tnew ImageIcon(getClass().getResource(GetLineChartImage())));\n\t\tLineButton.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent evt) {\n\t\t\t\tGetHost().instructionText.setVisible(false);\n\t\t\t\tGetHost().ExportEnabled();\n\t\t\t\t\n\t\t\t\tif(GetHost().GetTitle() == UNSET) {\n\t\t\t\t\tGetHost().LeftPanelContent(new LineChart(\n\t\t\t\t\tGetHost().GetGraphData(), \n\t\t\t\t\t\"Line Chart\", \n\t\t\t\t\tGetHost().GetColourScheme(),GetHost()));\n\t\t\t\t}else {\n\t\t\t\t\tGetHost().LeftPanelContent(new LineChart(\n\t\t\t\t\tGetHost().GetGraphData(), \n\t\t\t\t\tGetHost().GetTitle(), \n\t\t\t\t\tGetHost().GetColourScheme(),GetHost()));\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t});\n\t\t\n\t\tChartTypeInterface.add(LineButton);\n\t}",
"public void drawLine(int x1, int y1, int x2, int y2){\n int a1 = new Coordinate2D(x1, y1).getPixelPointX();\n int b1 = new Coordinate2D(x1, y1).getPixelPointY();\n int a2 = new Coordinate2D(x2, y2).getPixelPointX();\n int b2 = new Coordinate2D(x2, y2).getPixelPointY();\n graphics2D.drawLine(a1, b1, a2, b2);\n }",
"public DrawLineGraph()\n\t{\n\t\tframe = new JFrame();\n\t\tframe.setTitle(\"Line Graph\");\n\t\tframe.setSize(600,400);\n\t\tframe.setLayout(new BorderLayout());\n\t\tframe.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);\n\t\t\n\t\tseries = new XYSeries(\"Cross Entropy Cost Function\");\n\t\tXYSeriesCollection dataset = new XYSeriesCollection(series);\n\t\tchart = ChartFactory.createXYLineChart(\"Cross Entropy Cost Function\", \"Epoch\", \"Error\", dataset);\n\t\tframe.add(new ChartPanel(chart), BorderLayout.CENTER);\n\t\t\n\n\t}",
"@Override\r\n\tpublic void draw() {\n\t\tSystem.out.println(\"Triangle was drawing.\");\r\n\t\tSystem.out.println(\"new line\");\r\n\t\tSystem.out.println(\"second line \");\r\n\t\t//add comments\r\n\t\t// add more comments \r\n\t}",
"public void drawLine(int x, int y, int x2, int y2, int color){\n int dy = y - y2;\n int dx = x - x2;\n int fraction, stepx, stepy;\n\n if(dy < 0){\n dy = -dy;\n stepy = -1;\n }else{\n stepy = 1;\n }\n if(dx < 0){\n dx = -dx;\n stepx = -1;\n }else{\n stepx = 1;\n }\n dy <<= 1;\n dx <<= 1;\n\n set(x, y, color);\n\n if(dx > dy){\n fraction = dy - (dx >> 1);\n while(x != x2){\n if(fraction >= 0){\n y += stepy;\n fraction -= dx;\n }\n x += stepx;\n fraction += dy;\n set(x, y, color);\n }\n }else{\n fraction = dx - (dy >> 1);\n while(y != y2){\n if(fraction >= 0){\n x += stepx;\n fraction -= dy;\n }\n y += stepy;\n fraction += dx;\n set(x, y, color);\n }\n }\n }",
"void showLine(int[] xy1, int[] xy2, int width, char col) {\r\n\t\tgc.setStroke(colFromChar(col)); // set the stroke colour\r\n\t\tgc.setLineWidth(width);\r\n\t\tgc.strokeLine(xy1[0], xy1[1], xy2[0], xy2[1]); // draw line\r\n\t}",
"public void drawLine(int x1, int y1, int x2, int y2 , Graphics g) {\r\n \tfloat dY, dX;\r\n \tfloat x,y;\r\n \tdX = x2-x1;\r\n \tdY = y2-y1;\r\n \tx = x1;\r\n \ty = y1;\r\n \t\t\t\r\n \tfloat range = Math.max(Math.abs(dX), Math.abs(dY));\r\n \tdY = dY/range;\r\n \tdX = dX/range;\r\n \t\r\n \tfor (int i =0 ; i < range ; i++ ) { \r\n \t\tg.drawRect(Math.round(x), Math.round(y),1,1);\r\n \t\tx = x + dX;\r\n \t\ty = y + dY;\r\n \t}\r\n\r\n \t\r\n }",
"public void drawLine(double startx, double starty, double endx, double endy, Color color) {\n\t\tgc.setStroke(color);\n\t\tgc.strokeLine(startx,starty,endx,endy);\n\t}",
"@Override\n public void lineTo(double x, double y) {\n graphicsEnvironmentImpl.lineTo(canvas, x, y);\n }",
"private void drawLine(KdNode kdNode, double x0, double x1, double y0, double y1) {\n if (kdNode.dimension) { // True, or node is vertical\n StdDraw.setPenColor(Color.red);\n StdDraw.line(kdNode.point.x(), y0, kdNode.point.x(), y1);\n if (kdNode.left != null) drawLine(kdNode.left, x0, kdNode.point.x(), y0, y1);\n if (kdNode.right != null) drawLine(kdNode.right, kdNode.point.x(), x1, y0, y1);\n }\n else { // False, or node is horizontal\n StdDraw.setPenColor(Color.blue);\n StdDraw.line(x0, kdNode.point.y(), x1, kdNode.point.y());\n if (kdNode.left != null) drawLine(kdNode.left, x0, x1, y0, kdNode.point.y());\n if (kdNode.right != null) drawLine(kdNode.right, x0, x1, kdNode.point.y(), y1);\n }\n\n }",
"public static void renderLine(double startx , double starty , double endx , double endy) {\n\t\t//Find out what rendering mode to use\n\t\tif (! Settings.Android && Settings.Video.OpenGL)\n\t\t\t//Render a line using OpenGL\n\t\t\tBasicRendererOpenGL.renderLine(startx , starty , endx , endy);\n\t\telse if (! Settings.Android && ! Settings.Video.OpenGL)\n\t\t\t//Render a line using Java\n\t\t\tBasicRendererJava.renderLine(startx , starty , endx , endy);\n\t\telse if (Settings.Android && ! Settings.Video.OpenGL)\n\t\t\t//Render a line using Android\n\t\t\tBasicRendererAndroid.renderLine(startx , starty , endx , endy);\n\t}",
"@Override\n public void draw(Graphics g) {\n g.setColor(Color.BLACK);\n g.drawLine(startingPoint.x, startingPoint.y, endingPoint.x, endingPoint.y);\n }",
"public BasicLinePix() {\r\n\t\tsetTitle(\"Basic Line Pix 1.0\");\r\n\t\tsetDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tContainer cp = getContentPane();\r\n\t\tcp.setLayout(new BorderLayout());\r\n\t\teh = new EventHandler();\r\n\t\tdrawingPanel = makeDrawingPanel();\r\n\t\tdrawingPanel.addMouseListener(eh);\r\n\t\tdrawingPanel.addMouseMotionListener(eh);\r\n\t\tJPanel statusBar = createStatusBar();\r\n\t\tcp.add(drawingPanel, BorderLayout.CENTER);\r\n\t\tcp.add(statusBar, BorderLayout.SOUTH);\r\n\t\tbuildMenu();\r\n\t\tpack();\r\n\t}",
"public static void drawLines(Pane pane) {\n\n for (int i = 0; i < 4; i++) {\n Line lineH = new Line(0, i * 150, 450, i * 150);\n lineH.setStroke(Color.DARKGRAY);\n lineH.setStrokeWidth(3);\n pane.getChildren().add(lineH);\n\n Line lineV = new Line(i * 150, 0, i * 150, 450);\n lineV.setStroke(Color.DARKGRAY);\n lineV.setStrokeWidth(3);\n pane.getChildren().add(lineV);\n }\n }",
"public GLGraphics drawLine(float x, float y, float x2, float y2) {\n\t\tstats.incLine();\n\t\tgl.glBegin(GL.GL_LINES);\n\t\tgl.glVertex3f(x, y, z);\n\t\tgl.glVertex3f(x2, y2, z);\n\t\tgl.glEnd();\n\t\treturn this;\n\t}",
"public abstract void lineTo(double x, double y);",
"private void drawLine(int x, int y, int x1, int y1, int count, Color color) {\n\n // draw a line if count is greater than 0\n if (count > 0) {\n\n NscLine newLine = new NscLine(x+count, y, x1+count, y1);\n newLine.setForeground(color);\n add(newLine);\n \n // ensure we repaint the window\n repaint();\n\n // recursively call this method, decreasing count each time\n drawLine(x, y, x1, y1, count-1, color);\n\n }\n\n }",
"private void drawHorizontalLines(){\r\n\r\n\t\tdouble x1 = START_X;\r\n\t\tdouble x2 = getWidth();\r\n\t\tdouble y1 = GRAPH_MARGIN_SIZE;\r\n\t\tdouble y2 = y1;\r\n\r\n\t\tdrawLine(x1,y1,x2,y2);\r\n\r\n\t\tdouble newY1 = getHeight() - y1;\r\n\t\tdouble newY2 = newY1;\r\n\r\n\t\tdrawLine(x1,newY1,x2,newY2);\r\n\t}",
"@Override\n\tpublic void drawLine(Vector3f from, Vector3f to, Vector3f color) {\n\n\t\tfloat[] positions = new float[6];\n\t\tpositions[0] = from.x;\n\t\tpositions[1] = from.y;\n\t\tpositions[2] = from.z;\n\n\t\tpositions[3] = to.x;\n\t\tpositions[4] = to.y;\n\t\tpositions[5] = to.z;\n\n\t\t// Create a rawmodel to store the line\n\t\tRawModel model = Globals.getLoader().loadToVAO(positions, 3);\n\n\t\tshader.start();\n\t\tshader.loadProjectionMatrix(Globals.getRenderer().getProjectionMatrix());\n\t\tshader.loadViewMatrix(Globals.getActiveCamera());\n\t\tGL30.glBindVertexArray(model.getVaoID());\n\n\t\tGL20.glEnableVertexAttribArray(0);\n\t\tGL11.glDrawArrays(GL11.GL_LINES, 0, 6);\n\t\tGL20.glDisableVertexAttribArray(0);\n\t\tGL30.glBindVertexArray(0);\n\t\tshader.stop();\n\t\tmodel.cleanUp();\n\n\t}",
"private void drawLine( Graphics2D g2, Point2D.Double p1, Point2D.Double p2, Color colour )\r\n {\r\n drawLine( g2, p1, p2, colour, DEFAULT_STROKE );\r\n }",
"protected abstract void lineTo(final float x, final float y);",
"public void drawLine(int x1, int y1, int x2, int y2) {\n canvas.drawLine(x1, y1, x2, y2, paint);\n }",
"public Vector2d getLineNormal(Line2d line)\n\t{\n\n\t\tthis.color = Color.BLACK;\n\t\t\n\n//\t\tDraw2DApplet da = new Draw2DApplet(this);\n//\t\tthis.display();\n\n\t\tVector2d dir = new Vector2d(line.getDirection());\n\t\tVector2d nDir = new Vector2d(-dir.y, dir.x);\n\t\tVector2d negDir = new Vector2d();\n\t\tnegDir.negate(nDir);\n\t\tVector2d sc = new Vector2d(nDir);\n\t\tsc.scale(20. * GeometryConstants.EPSILON);\n\t\tfinal Point2d mp = line.pointOnLine(line.getLength()/2);\n\t\tmp.add(sc);\n\t\tList points = getPoints();\n\t\tfinal int n = points.size();\n\t\tfinal double[] xp = new double[n];\n\t\tfinal double[] yp = new double[n];\n//\t\tSystem.out.println(\">>>>>>>>>> mpoint is: \" + mp);\n\t\tfor(int i = 0; i < n; i++) \n\t\t{\n\t\t\tPoint2d point = (Point2d) points.get(i);\n\t\t\txp[i] = point.x;\n\t\t\typ[i] = point.y;\n//\t\t\tSystem.out.println(\"-------------- point\" + i + \" is: \" + xp[i] + \", \" + yp[i]);\n\t\t}\n/*\t\tViewObject vo = new ViewObject () {\n\t\t\tpublic LinkedList getDrawList () {\n\t\t\t\tLinkedList list = new LinkedList(); \n\t\t\t\tfor (int i = 0; i <n-1; i++) {\n\t\t\t\t\tlist.add(new Line2D.Double (xp[i], yp[i], xp[i+1], yp[i+1]));\n\t\t\t\t}\n\t\t\t\tlist.add (new Ellipse2D.Double(mp.x, mp.y, mp.x+0.2, mp.y+0.2));\n\t\t\t\treturn list;\n\t\t\t}\n\t\t};\n\t\tvo.setApplet (new Draw2DApplet(vo));\n\t\tvo.display();*/\n\t\t try {\n\t\t\treturn Polygon2d.isPointInside(xp, yp, mp.x, mp.y)? negDir: nDir;\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t} \n\t}",
"public void lineTo(int x, int y){\n paint.setColor(Color.parseColor(\"#000000\"));\n //ToDo: implement line drawing here\n\n canvas.drawLine(lastX, lastY, x, y, paint);\n lastX = x;\n lastY = y;\n Log.d(\"Canvas Element\", \"drawing line from: \" + lastX + \", \" + lastY +\",\" + \" to: \" + x +\", \" + y);\n }",
"private void drawLine( Graphics2D g2, Point2D.Double p1, Point2D.Double p2, Color colour, Stroke strk )\r\n {\r\n double x1 = translateX( p1.getX() );\r\n double y1 = translateY( p1.getY() );\r\n \r\n double x2 = translateX( p2.getX() );\r\n double y2 = translateY( p2.getY() );\r\n \r\n Line2D.Double line = new Line2D.Double( x1, y1, x2, y2 );\r\n \r\n g2.setStroke( strk );\r\n \r\n g2.setColor( colour );\r\n g2.draw( line );\r\n }",
"void addLine(int index, Coordinate start, Coordinate end);",
"public void onOutputLineAdded(Window window, OutputLine line) {\n\t\t\t\n\t\t\tlinesLayout.addLine(line);\n\t\t}",
"public void drawLines(float[] sDebugLines, Paint paint) {\n\t\t\n\t}",
"public void computeLine ()\r\n {\r\n line = new BasicLine();\r\n\r\n for (GlyphSection section : glyph.getMembers()) {\r\n StickSection ss = (StickSection) section;\r\n line.includeLine(ss.getLine());\r\n }\r\n\r\n if (logger.isFineEnabled()) {\r\n logger.fine(\r\n line + \" pointNb=\" + line.getNumberOfPoints() +\r\n \" meanDistance=\" + (float) line.getMeanDistance());\r\n }\r\n }",
"@Override\n public void drawFigure(Graphics2D g) {\n\n g.setPaint(figurePaint);\n g.fillRect(X, Y, width, height);\n g.setColor(lineColor);\n g.setStroke(new BasicStroke(2));\n g.drawRect(X,Y,width,height);\n }",
"public void paintLine(Point2D pt1, Point2D pt2, Graphics graphics) {\n Graphics2D g = (Graphics2D) graphics;\n g.setXORMode(java.awt.Color.lightGray);\n g.setColor(java.awt.Color.darkGray);\n if (pt1 != null && pt2 != null) {\n // the line connecting the segments\n OMLine cLine = new OMLine((float) pt1.getY(), (float) pt1.getX(), (float) pt2.getY(), (float) pt2.getX(), lineType);\n // get the map projection\n Projection proj = theMap.getProjection();\n // prepare the line for rendering\n cLine.generate(proj);\n // render the line graphic\n cLine.render(g);\n }\n }",
"public void draw() {\n \n // TODO\n }",
"@Override\n \t\t\t\tpublic void doCreateLineParticle() {\n \n \t\t\t\t}",
"private static void addLine(String[] input) throws NumberFormatException, IncorrectParametersException{\n if (input.length == 5){\n try{\n int x1 = Integer.parseInt(input[1]); \n int y1 = Integer.parseInt(input[2]);\n int x2 = Integer.parseInt(input[3]); \n int y2 = Integer.parseInt(input[4]);\n try{\n canvas.createLine(x1, y1, x2, y2);\n System.out.println(canvas.render());\n } catch (NullPointerException ex) {\n System.out.println(\"Initialise a new canvas first!\");\n }\n } catch (NumberFormatException ex) {\n System.out.println(\"HELP: to create a new line enter `L x1 y1 x2 y2`\");\n }\n } else {\n System.out.println(\"HELP: to create a new line enter `L x1 y1 x2 y2`\");\n throw new IncorrectParametersException(\"\");\n }\n }",
"public void startDraw(Vector2 point){\n path.add(point);\n }",
"public static void showLine(Stage primaryStage) {\n Scene scene = new Scene(new LinePane(), 200, 200);\n primaryStage.setTitle(\"ShowLine\"); // Set the stage title\n primaryStage.setScene(scene); // Place the scene in the stage\n primaryStage.show(); // Display the stage\n }",
"@Override\n\tpublic void drow(int w, int h, Color color) {\n\t\tSystem.out.println(\"drow Line : \" + w + \" \" + h + \" \" + color );\n\t}",
"public void drawTo(Point that) {\r\n /* DO NOT MODIFY */\r\n StdDraw.line(this.x, this.y, that.x, that.y);\r\n }",
"private static void lineTo(float x, float y) {\n setPenDown();\n mPivotX = mPenX = x;\n mPivotY = mPenY = y;\n mPath.lineTo(x * mScale, y * mScale);\n elements.add(\n new PathElement(ElementType.kCGPathElementAddLineToPoint, new Point[] {new Point(x, y)}));\n }",
"public void draw() {\n StdDraw.clear();\n StdDraw.setPenColor(StdDraw.BLACK);\n StdDraw.setXscale(-drawLength * 0.1, drawLength * 1.2);\n StdDraw.setYscale(-drawLength * 0.65, drawLength * 0.65);\n StdDraw.line(0, 0, drawLength, 0);\n StdDraw.text(-drawLength * 0.05, 0, \"0\");\n StdDraw.text(drawLength * 1.1, 0, Integer.toString(size()));\n }",
"public void drawTo(Point that) {\n /* DO NOT MODIFY */\n StdDraw.line(this.x, this.y, that.x, that.y);\n }",
"public void drawTo(Point that) {\n /* DO NOT MODIFY */\n StdDraw.line(this.x, this.y, that.x, that.y);\n }",
"public void drawTo(Point that) {\n /* DO NOT MODIFY */\n StdDraw.line(this.x, this.y, that.x, that.y);\n }",
"public void drawTo(Point that) {\n /* DO NOT MODIFY */\n StdDraw.line(this.x, this.y, that.x, that.y);\n }",
"public Line()\n\t{\n\t\tthis(1.0f, 1.0f, 0.0f);\n\t}",
"@FXML\n public void drawLPatternButtonPressed()\n {\n GraphicsContext gc = clearCanvasAndGetGraphicsContext();\n\n // loop to draw lines for each number of lines\n for(int i = 0; i <= lines; i++) {\n\n // draw L shape in bottom left\n gc.strokeLine(\n 0,\n (canvas.getHeight()/lines)*i,\n (canvas.getWidth()/lines)*i,\n canvas.getHeight()\n );\n\n }\n }",
"@Override\n public void drawLine(String id, Location start, Location end, double weight, Color color, boolean screenCoords) {\n drawLine(id, start, end, weight, color, false, screenCoords);\n }",
"protected void paintGutterLine(Graphics gfx, int line, int x) {\n int y = ta.lineToY(line) + fm.getLeading() + fm.getMaxDescent();\n gfx.setColor(ta.gutterLineColor);\n gfx.drawLine(ta.getGutterWidth(), y, ta.getGutterWidth(),\n y + fm.getHeight());\n }",
"private void drawVector(Vector2 v, float x, float y, float scayl, ShapeRenderer sr) {\n float arrowsize = 4;\n sr.begin(ShapeRenderer.ShapeType.Line);\n // Translate to location to render vector\n sr.setColor(0,0,0,.5f);\n sr.identity();\n sr.translate(x,y,0);\n // Call vector heading function to get direction (note that pointing to the right is a heading of 0) and rotate\n sr.rotate(0,0,1,v.angle());\n // Calculate length of vector & scale it to be bigger or smaller if necessary\n float len = scayl;\n // Draw three lines to make an arrow (draw pointing up since we've rotate to the proper direction)\n sr.line(0,0,len,0);\n //line(len,0,len-arrowsize,+arrowsize/2);\n //line(len,0,len-arrowsize,-arrowsize/2);\n sr.end();\n }",
"@Override\n public void drawLine(String id, Location start, Location end, double weight, Color color, boolean arrow, boolean screenCoords) {\n if(screenCoords) {\n start = convToImageCoords(start);\n end = convToImageCoords(end);\n }\n Line l = new Line(id, start, end, weight, color, arrow);\n lineMap.put(id, l);\n render();\n }",
"public void drawTo(Point that) {\n StdDraw.line(this.x, this.y, that.x, that.y);\n }",
"private void renderLine(Feature feature, LineSymbolizer symbolizer) {\n if (symbolizer.getStroke() == null) {\n return;\n }\n \n Stroke stroke = symbolizer.getStroke();\n applyStroke(graphics, stroke, feature);\n \n String geomName = symbolizer.geometryPropertyName();\n Geometry geom = findGeometry(feature, geomName);\n \n if ((geom == null) || geom.isEmpty()) {\n return;\n }\n \n Shape path = createPath(geom);\n \n if (stroke.getGraphicStroke() == null) {\n graphics.draw(path);\n } else {\n // set up the graphic stroke\n drawWithGraphicStroke(graphics, path, stroke.getGraphicStroke(), feature);\n }\n }",
"private void drawTimeLineForLine(Graphics2D g2d, RenderContext myrc, Line2D line, \n Composite full, Composite trans,\n int tl_x0, int tl_x1, int tl_w, int tl_y0, int tl_h, \n long ts0, long ts1) {\n g2d.setComposite(full); \n\t// Parametric formula for line\n double dx = line.getX2() - line.getX1(), dy = line.getY2() - line.getY1();\n\tdouble len = Utils.length(dx,dy);\n\tif (len < 0.001) len = 0.001; dx = dx/len; dy = dy/len; double pdx = dy, pdy = -dx;\n\tif (pdy < 0.0) { pdy = -pdy; pdx = -pdx; } // Always point down\n double gather_x = line.getX1() + dx*len/2 + pdx*40, gather_y = line.getY1() + dy*len/2 + pdy*40;\n\n\t// Find the bundles, for this with timestamps, construct the timeline\n\tSet<Bundle> set = myrc.line_to_bundles.get(line);\n\tIterator<Bundle> itb = set.iterator(); double x_sum = 0.0; int x_samples = 0;\n while (itb.hasNext()) {\n\t Bundle bundle = itb.next();\n\t if (bundle.hasTime()) { x_sum += (int) (tl_x0 + (tl_w*(bundle.ts0() - ts0))/(ts1 - ts0)); x_samples++; }\n }\n\tif (x_samples == 0) return;\n\tdouble x_avg = x_sum/x_samples;\n ColorScale timing_marks_cs = RTColorManager.getTemporalColorScale();\n itb = set.iterator();\n\twhile (itb.hasNext()) { \n\t Bundle bundle = itb.next();\n\n\t if (bundle.hasTime()) {\n double ratio = ((double) (bundle.ts0() - ts0))/((double) (ts1 - ts0));\n\t g2d.setColor(timing_marks_cs.at((float) ratio));\n\n\t int xa = (int) (tl_x0 + (tl_w*(bundle.ts0() - ts0))/(ts1 - ts0));\n // g2d.setComposite(full); \n g2d.draw(line);\n\t if (bundle.hasDuration()) {\n int xb = (int) (tl_x0 + (tl_w*(bundle.ts1() - ts0))/(ts1 - ts0)); \n double r = (tl_h-2)/2;\n g2d.fill(new Ellipse2D.Double(xa-r,tl_y0-tl_h/2-r,2*r,2*r));\n g2d.fill(new Ellipse2D.Double(xb-r,tl_y0-tl_h/2-r,2*r,2*r));\n if (xa != xb) g2d.fill(new Rectangle2D.Double(xa, tl_y0-tl_h/2-r, xb-xa, 2*r));\n\t if (xa != xb) { g2d.drawLine(xa,tl_y0-tl_h,xb,tl_y0); g2d.drawLine(xa,tl_y0, xb,tl_y0); }\n\t }\n\t g2d.drawLine(xa,tl_y0-tl_h,xa,tl_y0); // Make it slightly higher at the start\n double x0 = line.getX1() + dx * len * 0.1 + dx * len * 0.8 * ratio,\n\t y0 = line.getY1() + dy * len * 0.1 + dy * len * 0.8 * ratio;\n\t g2d.draw(new CubicCurve2D.Double(x0, y0, \n x0 + pdx*10, y0 + pdy*10,\n gather_x - pdx*10, gather_y - pdy*10,\n gather_x, gather_y));\n g2d.draw(new CubicCurve2D.Double(gather_x, gather_y, \n\t gather_x + pdx*40, gather_y + pdy*40,\n\t\t\t\t\t x_avg, tl_y0 - 10*tl_h, \n\t x_avg, tl_y0 - 8*tl_h));\n g2d.draw(new CubicCurve2D.Double(x_avg, tl_y0 - 8*tl_h,\n (x_avg+xa)/2, tl_y0 - 6*tl_h,\n xa, tl_y0 - 2*tl_h,\n xa, tl_y0 - tl_h/2));\n }\n\t}\n }",
"public Polyline drawLine(Star one, Star two)\r\n\t{\t\t\r\n\t\treturn lang.newPolyline(new Offset[] { getStarPosition(one.x, one.y), getStarPosition(two.x, two.y) }, \"line\" + one.toString() + two.toString(), null, connectionLines);\r\n\t}",
"public SeirpinskiLine() {\n this.depth = DEFAULT_DEPTH;\n this.scale = DEFAULT_SCALE;\n this.mode = DEFAULT_MODE;\n\n setUpGUI();\n repaint();\n }",
"public void drawLine(Point[] Points,String lineNames){\n\t\tfloat x1 = Points[0].x;\r\n\t\tfloat y1 = Points[0].y;\r\n\t\tfloat x2 = Points[1].x;\r\n\t\tfloat y2 = Points[1].y;\r\n//\t\tString paramLineNames = Arrays.asList(lineNames).toString();\r\n\t\tJSXController.getInstance().invoke(\"createPath\", x1 + \"\",y1 + \"\",x2 + \"\",y2 + \"\",lineNames);\r\n\t}",
"@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\t\tclicks++;\n\t\t\n\t\tif(clicks % 2 != 0) {\n\t\t\tstart = new Point2D(e.getX(), e.getY());\n\t\t\tend = new Point2D(e.getX(), e.getY());\n\t\t\tline = new Line(colorProvider, start, end);\n\t\t\tmodel.add(line);\n\t\t}\n\t}",
"public void draw(Graphics2D g){\r\n g.setColor(Color.WHITE);\r\n g.setStroke(new BasicStroke(1));\r\n g.draw(new Line2D.Float(p1, p2));\r\n }",
"public void setLineWidth(float lineWidth);",
"public void draw(final Panel panel) {\n panel.drawLine(startPoint, finalPoint, contur);\n }"
] | [
"0.7581963",
"0.7345342",
"0.7322442",
"0.7316437",
"0.7283681",
"0.7195594",
"0.7128319",
"0.71223164",
"0.7007562",
"0.69608897",
"0.6954981",
"0.69355565",
"0.6935093",
"0.68789685",
"0.6836608",
"0.68347704",
"0.6815199",
"0.676553",
"0.675021",
"0.6749691",
"0.6730221",
"0.67246634",
"0.66941243",
"0.6693225",
"0.66576886",
"0.66576886",
"0.66576886",
"0.66576886",
"0.66054046",
"0.66045505",
"0.6573235",
"0.6569874",
"0.654277",
"0.6542046",
"0.6527604",
"0.65053993",
"0.6504133",
"0.6476861",
"0.6469326",
"0.6456413",
"0.6455003",
"0.64403456",
"0.643966",
"0.64357436",
"0.6429489",
"0.6426295",
"0.6414205",
"0.64034605",
"0.640181",
"0.63984203",
"0.6383039",
"0.6380783",
"0.63725644",
"0.6371496",
"0.6364984",
"0.6362835",
"0.6353826",
"0.63501364",
"0.6336095",
"0.63322586",
"0.63144404",
"0.62913096",
"0.62777996",
"0.6276085",
"0.6268083",
"0.6264386",
"0.62567776",
"0.6253757",
"0.62533236",
"0.62501407",
"0.62254643",
"0.6224451",
"0.6202534",
"0.61909044",
"0.61827195",
"0.618131",
"0.6177913",
"0.61672765",
"0.6154646",
"0.61517483",
"0.6145338",
"0.6145338",
"0.6145338",
"0.6145338",
"0.6133978",
"0.61242086",
"0.6117943",
"0.61154526",
"0.6111928",
"0.6110209",
"0.61014247",
"0.6099423",
"0.60968584",
"0.608866",
"0.6087387",
"0.6085868",
"0.6078774",
"0.6068245",
"0.60662043",
"0.606314"
] | 0.6279186 | 62 |
Name of this element that generator uses. | public String getGName()
{
return generatorName;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic String name() {\n\n\t\treturn NAME;\n\t}",
"@Override\n public String getName() {\n return name();\n }",
"public String name() {\n this.use();\n\n return name;\n }",
"@Override\r\n\tprotected String getName() {\n\t\treturn NAME;\r\n\t}",
"@Override\n\t\t\tpublic String getName() {\n\t\t\t\treturn name;\n\t\t\t}",
"String getNameElement();",
"@Override\n public String getName() {\n return this.name();\n }",
"@Override\n public String getName() {\n return name();\n }",
"@Override\r\n\tpublic String Name() {\n\t\treturn Name;\r\n\t}",
"public String getElementName() {\n return elementName;\n }",
"public String getElementName() {\r\n\t\treturn elementName;\r\n\t}",
"public String getElementName() {\r\n\t\treturn elementName;\r\n\t}",
"public String getName() {\r\n \treturn this.getClass().getName();\r\n }",
"@Override\n public String getName() {\n return this.getClass().getSimpleName();\n }",
"public String getName() {\n\t\treturn this.toString();\n\t}",
"public String getElementName()\n {\n return ELEMENT_NAME;\n }",
"public String elementName() {\n return _element;\n }",
"public String elementName() {\n return _element;\n }",
"@Override\r\n\tpublic String getName() {\n\t\treturn name;\r\n\t}",
"public String getName() { \n\t\treturn getNameElement().getValue();\n\t}",
"public String getName() { \n\t\treturn getNameElement().getValue();\n\t}",
"public String getName() { \n\t\treturn getNameElement().getValue();\n\t}",
"public final String name() {\n\t\treturn name;\n\t}",
"@Override\r\n\tpublic String getName() {\r\n\t\treturn name;\r\n\t}",
"@Override\r\n public String getName() {\r\n return NAME;\r\n }",
"private String name() {\r\n return cls.getSimpleName() + '.' + mth;\r\n }",
"public String getElementalName() {\n\t\treturn elementalName;\n\t}",
"@Nullable\n public String getName() {\n return getElement().getName();\n }",
"@Override\n\tpublic String getName() {\n\t\treturn super.getName();\n\t}",
"@Override\n\tpublic String getName() {\n\t\treturn super.getName();\n\t}",
"@Override\r\n\tpublic String getName() {\n\t\treturn this.name;\r\n\t}",
"@Override\n public String name() {\n return this._name;\n }",
"@Override\n public String getName() {\n return NAME;\n }",
"@Override\n public String getName() {\n return NAME;\n }",
"@Override\n public String getName() {\n return NAME;\n }",
"@Override\n public String name() {\n return this.name;\n }",
"@Override\n public String name() {\n return name;\n }",
"@Override\n\tpublic String getName() {\n\t\treturn name;\n\t}",
"@Override\n\tpublic String getName() {\n\t\treturn name;\n\t}",
"@Override\n\tpublic String getName() {\n\t\treturn name;\n\t}",
"@Override\n\tpublic String getName() {\n\t\treturn name;\n\t}",
"@Override\n\tpublic String getName() {\n\t\treturn name;\n\t}",
"@Override\n\tpublic String getName() {\n\t\treturn name;\n\t}",
"@Override\n\tpublic String getName() {\n\t\treturn name;\n\t}",
"@Override\n\tpublic String getName() {\n\t\treturn name;\n\t}",
"@Override\n\tpublic String getName() {\n\t\treturn name;\n\t}",
"@Override\n public String getName() {\n return name;\n }",
"@Override \n public String getName() {\n return NAME;\n }",
"public String getName() {\r\n return this.name();\r\n }",
"@Override\n\tpublic String getName() {\n\n\t\treturn name;\n\t}",
"public String getName() {\n return element.getNodeName();\n }",
"@Override\n\tpublic String getName()\n\t{\n\t\treturn super.getName();\n\t}",
"@Override public String getName() {\n return name;\n }",
"public String name() {\r\n\t\treturn this.name;\r\n\t}",
"@Override\n public String getName() {\n\n return name;\n }",
"@Override\n\t\tfinal public String getName() {\n\t\t\treturn this.Name;\n\t\t}",
"public String getName() {\n return instance.getName();\n }",
"public String getName() {\n return instance.getName();\n }",
"public String getName() {\n return instance.getName();\n }",
"public String getName() {\n return instance.getName();\n }",
"public final String name() {\n return name;\n }",
"@Override\n\tpublic String getName() {\n\t\treturn this.name;\n\t}",
"@Override\n\tpublic String getName() {\n\t\treturn this.name;\n\t}",
"@Override\n public String getName() {\n return name;\n }",
"@Override\n public String getName() {\n return name;\n }",
"@Override\n public String getName() {\n return name;\n }",
"@Override\n public String getName() {\n return name;\n }",
"@Override\n public String getName() {\n return name;\n }",
"@Override\n public String getName() {\n return name;\n }",
"@Override\n public String getName() {\n return name;\n }",
"@Override\n public String getName() {\n return name;\n }",
"@Override\n public String getName() {\n return this.name;\n }",
"public String getName() {\n return \"\";\n }",
"public String getName() {\n return \"\";\n }",
"public String toString()\n {\n return elementName;\n }",
"public String getName() {\n\t}",
"@Override\n public String getName()\n {\n return name;\n }",
"@Override\n\tpublic String getName() {\n\t\treturn name + instanceName;\n\t}",
"protected final String name() {\n return name;\n }",
"public String name() {\n\t\treturn this.name;\n\t}",
"protected String getName() {\n\t\treturn name;\n\t}",
"protected String getName() {\n\t\treturn name;\n\t}",
"@Override\n public String getName() {\n return this.name;\n }",
"@Override\r\n\tpublic String getName() \r\n\t{\r\n\t\treturn this._name;\r\n\t}",
"@Override\n\tpublic String getName() {\n\t\treturn this.name;\n\t\t\n\t}",
"private String getName() {\n\t\treturn name;\n\t}",
"@Override\r\n\tpublic String getName() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\treturn name;\r\n\t}",
"public String getName (){\n\t\treturn name;\n\t}",
"public String getName() {\r\n\t\treturn GDAssemblerUI.getText(UI_TEXT);\r\n\t}",
"public ElementName getElementName() {\n\t\treturn elementName;\n\t}",
"public final String name ()\r\n {\r\n return _name;\r\n }",
"@Override\n public String getName() {\n return name;\n }",
"@Override\n public String getName() {\n return name;\n }",
"public java.lang.String getName();",
"public String getName() {\r\n\t\treturn NAME;\r\n\t}",
"public Object getName() {\n\t\treturn null;\n\t}",
"public String getElementVarName() {\r\n\t\treturn elementVarName;\r\n\t}",
"public String getName() {\r\n\t\treturn name.get();\r\n\t}",
"public String getName() {\n return NAME;\n }",
"public String getName () {\r\n\t\treturn name;\r\n\t}",
"public synchronized Identifier getName() {\n if (name == null) {\n // lazy initialization !?\n name = Identifier.create(\"\"); // NOI18N\n }\n return name;\n }"
] | [
"0.75344944",
"0.75225264",
"0.7512193",
"0.7471153",
"0.745341",
"0.7437818",
"0.74226975",
"0.7369087",
"0.7362245",
"0.73568904",
"0.73448116",
"0.73448116",
"0.7343878",
"0.7341637",
"0.7332018",
"0.7326277",
"0.7325094",
"0.7325094",
"0.73154616",
"0.7313209",
"0.7313209",
"0.7313209",
"0.7298284",
"0.7293849",
"0.72805744",
"0.72614855",
"0.72603285",
"0.7238209",
"0.7236096",
"0.7236096",
"0.72216547",
"0.72197294",
"0.72154313",
"0.72154313",
"0.72154313",
"0.7213099",
"0.72083616",
"0.72059524",
"0.72059524",
"0.72059524",
"0.72059524",
"0.72059524",
"0.72059524",
"0.72059524",
"0.72059524",
"0.72059524",
"0.7201538",
"0.7199245",
"0.7188897",
"0.7185838",
"0.71640944",
"0.71605843",
"0.71545523",
"0.71487916",
"0.71373725",
"0.7127533",
"0.71253455",
"0.7123831",
"0.7123831",
"0.7123831",
"0.712106",
"0.7118945",
"0.7118945",
"0.71152973",
"0.71152973",
"0.71152973",
"0.71152973",
"0.71152973",
"0.71152973",
"0.71152973",
"0.71152973",
"0.7110359",
"0.7109006",
"0.7109006",
"0.7103751",
"0.7096787",
"0.70914966",
"0.7088765",
"0.70884895",
"0.70827705",
"0.70807505",
"0.70807505",
"0.7069591",
"0.70677376",
"0.7066246",
"0.7065176",
"0.70641893",
"0.7063006",
"0.70617133",
"0.70612794",
"0.7058328",
"0.7048027",
"0.7048027",
"0.7041887",
"0.7038614",
"0.7031746",
"0.7031293",
"0.70304555",
"0.70272225",
"0.70210785",
"0.7020389"
] | 0.0 | -1 |
Sets the name of this element that generator uses. | public void setGName(String generatorName)
{
this.generatorName = generatorName;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void setName(String name) {\n this._name = name;\n }",
"public void setName(String v){\n\t\ttry{\n\t\tsetProperty(SCHEMA_ELEMENT_NAME + \"/name\",v);\n\t\t_Name=null;\n\t\t} catch (Exception e1) {logger.error(e1);}\n\t}",
"@Override\r\n\tpublic void setName(String name) {\n\t\tthis.name = name;\r\n\t}",
"protected void setName(String name) {\n this.name = name;\n }",
"@Override\n public void setName(String name) {\n this.name = name;\n }",
"@Override\n public void setName(String name) {\n this.name = name;\n }",
"@Override\n public void setName(String name) {\n this.name = name;\n }",
"@Override\n public void setName(String name) {\n this.name = name;\n }",
"public void setName(String name) {\n\t\tName = name;\n\t}",
"@Override\n\tpublic void setName(String name) {\n\t\tthis.name = name;\n\t}",
"protected void setName(String name) {\r\n this.name = name;\r\n }",
"public void setName (String name) {\n this.name = name;\n }",
"public void setName (String name) {\n this.name = name;\n }",
"public void setName (String name) {\n this.name = name;\n }",
"public void setName(String name) {\n this.name = name;\n this.box.getElement().setAttribute(\"name\", name);\n }",
"public void setName (String name) {\r\n\t\tthis.name = name;\r\n\t}",
"public void setName(String name){\r\n\t\tthis.name = name;\r\n\t}",
"public void setName(String name){\r\n\t\tthis.name = name;\r\n\t}",
"public void setName(String name){\r\n\t\tthis.name = name;\r\n\t}",
"public void setName(String name) {\r\n this.name = name;\r\n }",
"public void setName(String name) {\r\n this.name = name;\r\n }",
"public void setName(String name) {\r\n this.name = name;\r\n }",
"public void setName (String name) {\n this.name = name;\n }",
"@Override\n\tpublic void setName(String name) {\n\t\tthis.name = name;\n\n\t}",
"public void setName(String name) {\r\n\t\t_name = name;\r\n\t}",
"public void setName(String name) {\n\t this.name = name;\n\t }",
"public void setName( String name ) {\n this.name = name;\n }",
"public void setName(String name) {\r\n this.name = name;\r\n }",
"public void setName(String inName)\n {\n name = inName;\n }",
"public void setName(String name) {\r\n this.name = name;\r\n }",
"public void setName(String name) {\r\n this.name = name;\r\n }",
"public void setName(String name) {\r\n this.name = name;\r\n }",
"public void setName(String name) {\r\n this.name = name;\r\n }",
"public void setName(String name) {\r\n this.name = name;\r\n }",
"public void setName(String name) {\r\n this.name = name;\r\n }",
"public void setName(String name) {\r\n this.name = name;\r\n }",
"public void setName(String name) {\r\n this.name = name;\r\n }",
"public void setName(String name) {\r\n this.name = name;\r\n }",
"public void setName(String name) {\r\n this.name = name;\r\n }",
"public void setName(String name) {\r\n this.name = name;\r\n }",
"public void setName(String name) {\r\n this.name = name;\r\n }",
"public void setName(String name) {\r\n this.name = name;\r\n }",
"public void setName(String name) {\r\n this.name = name;\r\n }",
"public void setName(String name) {\r\n this.name = name;\r\n }",
"public void setName(String name) {\r\n this.name = name;\r\n }",
"public void setName(String name) {\r\n this.name = name;\r\n }",
"public void setName(String name) {\r\n this.name = name;\r\n }",
"public void setName(String name) {\r\n this.name = name;\r\n }",
"public void setName(String nameIn) {\n name = nameIn;\n }",
"public final void setName(String name) {_name = name;}",
"public void setName(String name) {\n this.name = name;\n }",
"public void setName(String name) {\n _name = name;\n }",
"public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}",
"public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}",
"public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}",
"public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}",
"public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}",
"public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}",
"public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}",
"public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}",
"public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}",
"public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}",
"public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}",
"public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}",
"public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}",
"public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}",
"public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}",
"public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}",
"public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}",
"public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}",
"public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}",
"public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}",
"public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}",
"public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}",
"public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}",
"public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}",
"public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}",
"public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}",
"public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}",
"public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}",
"public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}",
"public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}",
"public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}",
"protected void setName(final String name) {\r\n\t\tthis.name = name;\r\n\t}",
"public void setName(String name){\n\t\tthis.name = name;\n\t}",
"public void setName(String name){\n\t\tthis.name = name;\n\t}",
"public void setName(String name){\n\t\tthis.name = name;\n\t}",
"public void setName(String name) {\t\t\r\n\t\tthis.name = name;\t\t\r\n\t}",
"public void setName(String name) {\n this.name = name;\n }",
"public void setName(String name) {\n this.name = name;\n }",
"public void setName(String name) {\n this.name = name;\n }",
"public void setName(String name) {\n this.name = name;\n }",
"public final void setName(String name) {\n\t\tthis.name = name;\n\t}",
"public void setName(String name) {\n\t\t\tthis.name = name;\n\t\t}",
"public void setName(String name) {\n\t\t\tthis.name = name;\n\t\t}",
"public void setName(String name) {\r\n \t\tthis.name = name;\r\n \t}",
"public void setName( String name )\n {\n this.name = name;\n }",
"public void setName( String name )\n {\n this.name = name;\n }",
"public void setName(String name)\n {\n this.name = name;\n }",
"public void setName(String name) {\r\r\n\t\tthis.name = name;\r\r\n\t}",
"public void setName(String name){\n \t\tthis.name = name;\n \t}"
] | [
"0.7594354",
"0.7590935",
"0.7590593",
"0.7582813",
"0.75691384",
"0.75691384",
"0.75681025",
"0.75681025",
"0.75510204",
"0.7534168",
"0.7530042",
"0.7515804",
"0.7515804",
"0.7515804",
"0.751091",
"0.7509245",
"0.75018656",
"0.75018656",
"0.75018656",
"0.7494676",
"0.7494676",
"0.7494676",
"0.7491314",
"0.7490876",
"0.74884987",
"0.74868274",
"0.7481515",
"0.7480725",
"0.7479508",
"0.7475511",
"0.7475511",
"0.7475511",
"0.7475511",
"0.7475511",
"0.7475511",
"0.7475511",
"0.7475511",
"0.7475511",
"0.7475511",
"0.7475511",
"0.7475511",
"0.7475511",
"0.7475511",
"0.7475511",
"0.7475511",
"0.7475511",
"0.7475511",
"0.7475511",
"0.7473435",
"0.746715",
"0.7462727",
"0.74627244",
"0.74604654",
"0.74604654",
"0.74604654",
"0.74604654",
"0.74604654",
"0.74604654",
"0.74604654",
"0.74604654",
"0.74604654",
"0.74604654",
"0.74604654",
"0.74604654",
"0.74604654",
"0.74604654",
"0.74604654",
"0.74604654",
"0.74604654",
"0.74604654",
"0.74604654",
"0.74604654",
"0.74604654",
"0.74604654",
"0.74604654",
"0.74604654",
"0.74604654",
"0.74604654",
"0.74604654",
"0.74604654",
"0.74604654",
"0.74604654",
"0.74604654",
"0.74588853",
"0.74550015",
"0.74550015",
"0.74550015",
"0.7454815",
"0.7452637",
"0.7452637",
"0.7452637",
"0.7452637",
"0.74502295",
"0.7448843",
"0.7448843",
"0.74459106",
"0.7442681",
"0.7442681",
"0.74394804",
"0.7437246",
"0.74346286"
] | 0.0 | -1 |
Sets the encoding of the provided form to UTF8, see for details. | public void addUtf8Charset(final Form form) {
FormElement.as(form.getElement()).setAcceptCharset("UTF-8");
final Hidden field = new Hidden();
field.setName("utf8char");
field.setValue("\u8482");
form.add(field);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void setCharacterEncoding(String arg0) {\n\n }",
"public void setEncoding(String e) {\n\t\tthis.encoding = e;\n\t}",
"public void setEncoding (String encoding) {\n this.encoding = encoding;\n }",
"public void setEncoding(String encoding) {\r\n this.encoding = encoding;\r\n }",
"public void setEncoding(String encoding) {\n this.encoding = encoding;\n }",
"public void setEncoding(String encoding) {\n this.encoding = encoding;\n }",
"public void setEncoding(String encoding) {\n this.encoding = encoding;\n }",
"public void setInputEncoding(String inputEncoding) {\r\n this.inputEncoding = inputEncoding;\r\n }",
"public void setEncoding(Encoding encoding) {\n this.encoding = encoding;\n }",
"@Override\n\t\tpublic void setCharacterEncoding(String env) throws UnsupportedEncodingException {\n\t\t\t\n\t\t}",
"public void setEncoding(String encoding) {\n this.encoding = encoding;\n }",
"@Override\n\tpublic void setCharacterEncoding(String env) throws UnsupportedEncodingException {\n\t\t\n\t}",
"public void setEncoding(String encoding) {\n\t\tthis.encoding = encoding;\n\t}",
"public void setCharacterEncoding(String s) {\n\n\t}",
"public ConvertToUTF8() {\n initComponents();\n }",
"Builder addEncoding(String value);",
"public void setEncoding(String encoding) {\n this.encoding = encoding == null ? null : encoding.trim();\n }",
"public void setFileEncoding(String s) {\n if (s == null) fileEncoding = \"\";\n else fileEncoding = s;\n }",
"public void setEncoding(String encoding)\n\t\t{\n\t\t\tm_encoding = encoding;\n\t\t}",
"public void convertToUTF8() {\n FileInputStream istream = null;\n Writer out = null;\n try {\n istream = new FileInputStream(path);\n BufferedInputStream in = new BufferedInputStream(istream);\n CharsetDecoder charsetDecoder = Charset.forName(\"UTF-8\").newDecoder();\n charsetDecoder.onMalformedInput(CodingErrorAction.REPLACE);\n charsetDecoder.onUnmappableCharacter(CodingErrorAction.REPLACE);\n Reader inputReader = new InputStreamReader(in, charsetDecoder);\n StringWriter writer = new StringWriter();\n IOUtils.copy(inputReader, writer);\n String theString = writer.toString();\n FileUtils.deleteQuietly(new File(path));\n out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path), \"UTF-8\"));\n out.write(theString);\n out.close();\n// System.out.println(\"\");\n } catch (FileNotFoundException ex) {\n logger.error(\"Error converting the file to utf8\", ex);\n } catch (IOException ex) {\n logger.error(\"Error converting the file to utf8\", ex);\n } finally {\n try {\n if (out != null) {\n out.close();\n }\n if (istream != null) {\n istream.close();\n }\n } catch (IOException ex) {\n logger.error(\"Error converting the file to utf8\", ex);\n }\n }\n\n }",
"Charset getEncoding();",
"protected final void setEncoding( String encoding )\n throws SAXException\n {\n if ( _inputSource.getByteStream() != null ) {\n if ( ! encoding.equalsIgnoreCase( _inputSource.getEncoding() ) ) {\n _inputSource.setEncoding( encoding );\n try {\n _reader = new InputStreamReader( new BufferedInputStream( _inputSource.getByteStream() ), encoding );\n } catch ( UnsupportedEncodingException except ) {\n error( WELL_FORMED, format( \"Parser014\", encoding ) );\n }\n }\n }\n else\n if ( isWarning() && _inputSource.getEncoding() != null &&\n ! encoding.equalsIgnoreCase( _inputSource.getEncoding() ) )\n warning( format( \"Parser015\", _inputSource.getEncoding(), encoding ) ); \n }",
"public void setEncodingSettings(java.lang.String value) {\r\n\t\tBase.set(this.model, this.getResource(), ENCODINGSETTINGS, value);\r\n\t}",
"public void setCharset(String string) {\n\t\t\r\n\t}",
"public static String isoToUTF8(String value) throws Exception{\n \treturn value;\n\t}",
"public void setCharset(String charset) {\n this.charset = charset;\n }",
"String getEncoding();",
"public void setCharacterEncoding(String charset) {\n this.response.setCharacterEncoding(charset);\n }",
"public final void encodeUtf8(CharSequence in, ByteBuffer out) {\n if (out.hasArray()) {\n int offset = out.arrayOffset();\n out.position(Utf8.encode(in, out.array(), out.position() + offset, out.remaining()) - offset);\n } else if (out.isDirect()) {\n encodeUtf8Direct(in, out);\n } else {\n encodeUtf8Default(in, out);\n }\n }",
"@Override\n public String getCharacterEncoding() {\n return null;\n }",
"protected String getUTF8Str(String str) throws UnsupportedEncodingException {\n return new String(str.getBytes(\"iso-8859-1\"), \"utf-8\");\r\n }",
"public void setEncoding(String encoding) throws UnsupportedEncodingException {\r\n\t\tmessage = new String(messageData, encoding);\r\n\t\tthis.encoding = encoding;\r\n\t}",
"public void setValueCharset(String valueCharset) {\n this.valueCharset = valueCharset;\n }",
"@DatabaseChangeProperty(exampleValue = \"utf8\")\n public String getEncoding() {\n return encoding;\n }",
"public void setContentEncoding(String charsetName) {\n setProperty(CONTENT_ENCODING, charsetName);\n }",
"public void setContentEncoding(String charsetName) {\n setProperty(CONTENT_ENCODING, charsetName);\n }",
"Builder addEncodings(String value);",
"protected void setEncoding() {\n\t\tthis.defaultContentType = getProperty(CONTENT_TYPE_KEY, DEFAULT_CONTENT_TYPE);\n\n\t\tString encoding = getProperty(RuntimeConstants.OUTPUT_ENCODING, DEFAULT_OUTPUT_ENCODING);\n\n\t\t// For non Latin-1 encodings, ensure that the charset is\n\t\t// included in the Content-Type header.\n\t\tif (!DEFAULT_OUTPUT_ENCODING.equalsIgnoreCase(encoding)) {\n\t\t\tint index = defaultContentType.lastIndexOf(\"charset\");\n\t\t\tif (index < 0) {\n\t\t\t\t// the charset specifier is not yet present in header.\n\t\t\t\t// append character encoding to default content-type\n\t\t\t\tthis.defaultContentType += \"; charset=\" + encoding;\n\t\t\t} else {\n\t\t\t\t// The user may have configuration issues.\n\t\t\t\tlog.info(\"Charset was already specified in the Content-Type property.Output encoding property will be ignored.\");\n\t\t\t}\n\t\t}\n\n\t\tlog.debug(\"Default Content-Type is: {}\", defaultContentType);\n\t}",
"public String getEncoding() {\n return encoding;\n }",
"public void setEncoding(String encoding) {\r\n\t\tcheckHeaderGeneration();\r\n\t\tthis.encoding = encoding;\r\n\t}",
"public String getEncoding () {\n return encoding;\n }",
"public abstract void encodeUtf8Direct(CharSequence charSequence, ByteBuffer byteBuffer);",
"@BrowserSupport({BrowserType.FIREFOX_2P})\r\n\t@DOMSupport(DomLevel.THREE)\r\n\t@Property String getInputEncoding();",
"public void setAudioEncoding(String s) {\n audioEncoding = s;\n }",
"public EncodingOptions getEncodingOptions();",
"public String getEncoding() {\n \t return null;\n \t }",
"public String getEncoding() {\n \t return null;\n \t }",
"@Override // com.google.protobuf.Utf8.Processor\n public void encodeUtf8Direct(CharSequence in, ByteBuffer out) {\n encodeUtf8Default(in, out);\n }",
"public void setContentEncoding(String ceString) {\n/* */ BasicHeader basicHeader;\n/* 155 */ Header h = null;\n/* 156 */ if (ceString != null) {\n/* 157 */ basicHeader = new BasicHeader(\"Content-Encoding\", ceString);\n/* */ }\n/* 159 */ setContentEncoding((Header)basicHeader);\n/* */ }",
"static void setCorrectStdOutEncoding(@Nonnull GeneralCommandLine commandLine, @Nonnull Project project) {\n final Charset defaultCharset = EncodingProjectManager.getInstance(project).getDefaultCharset();\n commandLine.setCharset(defaultCharset);\n setPythonIOEncoding(commandLine.getEnvironment(), defaultCharset.name());\n }",
"public String getEncoding() {\n return encoding;\n }",
"public String getEncoding() {\n return encoding;\n }",
"public String getEncoding() {\n return encoding;\n }",
"public String encode(String str, String charsetName) throws UnsupportedEncodingException {\n/* 230 */ if (str == null) {\n/* 231 */ return null;\n/* */ }\n/* 233 */ return StringUtils.newStringUsAscii(encode(str.getBytes(charsetName)));\n/* */ }",
"public void setInputEncoding(org.apache.xmlbeans.XmlAnySimpleType inputEncoding)\n {\n generatedSetterHelperImpl(inputEncoding, INPUTENCODING$16, 0, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_SINGLETON);\n }",
"public String getDeclaredEncoding();",
"@Accessor(qualifier = \"encoding\", type = Accessor.Type.SETTER)\n\tpublic void setEncoding(final EncodingEnum value)\n\t{\n\t\tgetPersistenceContext().setPropertyValue(ENCODING, value);\n\t}",
"public void setContents(String contents, String encoding)\n throws VlException\n {\n byte[] bytes;\n\n try\n {\n bytes = contents.getBytes(encoding);\n setContents(bytes);\n return;\n }\n catch (UnsupportedEncodingException e)\n {\n Global.errorPrintf(this,\"***Error: Exception:%s\\n\",e);\n e.printStackTrace();\n\n throw (new VlException(\"Encoding not supported:\" + encoding, e));\n }\n\n }",
"public String getStringEncoding()\n\t{\n\t\treturn \"utf-8\";\n\t}",
"@Override\n\t\tpublic String getCharacterEncoding() {\n\t\t\treturn null;\n\t\t}",
"void setCharset(String charset) {\n\t\tthis.charset = charset;\n\t}",
"public String getEncoding() {\n return null;\n }",
"@Override\n\tpublic String getCharacterEncoding() {\n\t\treturn null;\n\t}",
"EncodingEnum getEncoding();",
"public void setCharSet(byte charset)\n {\n font.setCharset(charset);\n }",
"public interface ExtraEncoding {\n \n /**\n * Converts an Unicode string to a byte array according to some encoding.\n * @param text the Unicode string\n * @param encoding the requested encoding. It's mainly of use if the same class\n * supports more than one encoding.\n * @return the conversion or <CODE>null</CODE> if no conversion is supported\n */ \n public byte[] charToByte(String text, String encoding);\n \n /**\n * Converts an Unicode char to a byte array according to some encoding.\n * @param char1 the Unicode char\n * @param encoding the requested encoding. It's mainly of use if the same class\n * supports more than one encoding.\n * @return the conversion or <CODE>null</CODE> if no conversion is supported\n */ \n public byte[] charToByte(char char1, String encoding);\n \n /**\n * Converts a byte array to an Unicode string according to some encoding.\n * @param b the input byte array\n * @param encoding the requested encoding. It's mainly of use if the same class\n * supports more than one encoding.\n * @return the conversion or <CODE>null</CODE> if no conversion is supported\n */\n public String byteToChar(byte b[], String encoding); \n}",
"private void setFormatedTextBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n formatedText_ = value.toStringUtf8();\n }",
"public void testSetEncoding_Normal() throws Exception {\n ByteArrayOutputStream aos = new ByteArrayOutputStream();\n StreamHandler h = new StreamHandler(aos, new MockFormatter());\n h.setEncoding(\"iso-8859-1\");\n assertEquals(\"iso-8859-1\", h.getEncoding());\n LogRecord r = new LogRecord(Level.INFO, \"\\u6881\\u884D\\u8F69\");\n h.publish(r);\n h.flush();\n\n byte[] bytes = encoder.encode(\n CharBuffer.wrap(\"MockFormatter_Head\" + \"\\u6881\\u884D\\u8F69\"))\n .array();\n assertTrue(Arrays.equals(bytes, aos.toByteArray()));\n }",
"public String getEncoding() {\n return encoding;\n }",
"protected void setEncodingsFromOptions(ThreadContext context, RubyHash options) {\n if (options == null || options.isNil()) return;\n \n EncodingOption encodingOption = extractEncodingOptions(options);\n \n if (encodingOption == null) return;\n \n externalEncoding = encodingOption.externalEncoding;\n if (encodingOption.internalEncoding == externalEncoding) return;\n internalEncoding = encodingOption.internalEncoding;\n }",
"public String getUtf(){\n return utf;\n }",
"public static String convertToUTF8(String s) {\n String out = null;\n try {\n out = new String(s.getBytes(\"UTF-8\"), \"ISO-8859-1\");\n } catch (java.io.UnsupportedEncodingException e) {\n return null;\n }\n return out;\n }",
"public String getJavaEncoding();",
"@java.lang.Override\n public int getEncodingValue() {\n return encoding_;\n }",
"public void testSetEncoding_FlushBeforeSetting() throws Exception {\n ByteArrayOutputStream aos = new ByteArrayOutputStream();\n StreamHandler h = new StreamHandler(aos, new MockFormatter());\n LogRecord r = new LogRecord(Level.INFO, \"abcd\");\n h.publish(r);\n assertFalse(aos.toString().indexOf(\"abcd\") > 0);\n h.setEncoding(\"iso-8859-1\");\n assertTrue(aos.toString().indexOf(\"abcd\") > 0);\n }",
"public String getEncoding() {\r\n\t\treturn encoding;\r\n\t}",
"public static Charset getUtf8Charset(){\n\t\tif(utf8 == null){\n\t\t\tutf8 = Charset.forName(\"UTF-8\");\n\t\t}\n\t\treturn utf8;\n\t}",
"@Test\n\tpublic void testJsonEncoding() throws IOException {\n\t\tvalidateEncodingHandling(\"UTF16BE.json\", Charsets.UTF_16BE, \"The\\uD801\\uDC37 Na\\uD834\\uDD1Em\\uD834\\uDD1Ee\\uD801\\uDC37\");\n\t\tvalidateEncodingHandling(\"ISO8859-1.json\", Charsets.ISO_8859_1, \"³ for ?, ¿ for ?\");\n\t\t// Reading ISO8859-1 as UTF8 will result in mapping errors. This is expected and can't be avoided if the wrong encoding has been specified.\n\t\tvalidateEncodingHandling(\"ISO8859-1.json\", Charsets.UTF_8, \"� for ?, � for ?\");\n\t}",
"public static String convertFromUTF8(String s) {\n String out = null;\n try {\n out = new String(s.getBytes(\"ISO-8859-1\"), \"UTF-8\");\n } catch (Exception e) {\n\n return null;\n }\n return out;\n }",
"public static String convertToUTF8(String s) {\n\n String out = null;\n\n try {\n\n out = new String(s.getBytes(\"UTF-8\"), \"ISO-8859-1\");\n\n } catch (java.io.UnsupportedEncodingException e) {\n\n return null;\n }\n\n return out;\n }",
"private void suggestsUtF8CharsetWhenUsingPlatformDefaultCharset(OutputStream os) {\n OutputStreamWriter outputStreamWriter = new OutputStreamWriter(os, StandardCharsets.UTF_8);\n }",
"@XmlAttribute\r\n public String getInputEncoding() {\r\n return inputEncoding;\r\n }",
"public void setFileEncoding(String fileEncoding) {\n this.fileEncoding = fileEncoding;\n }",
"public static void setEncodingSettings(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, java.lang.String value) {\r\n\t\tBase.set(model, instanceResource, ENCODINGSETTINGS, value);\r\n\t}",
"public void setContentEncoding(Header contentEncoding) {\n/* 143 */ this.contentEncoding = contentEncoding;\n/* */ }",
"@SuppressWarnings(\"unused\")\n public static void setRuntimeEncoding() throws IllegalAccessException, NoSuchFieldException {\n System.setProperty(\"file.encoding\", \"UTF-8\");\n Field charset = Charset.class.getDeclaredField(\"defaultCharset\");\n charset.setAccessible(true);\n charset.set(null, null);\n }",
"public EncodeAndDecodeStrings() {}",
"public String getEncoding() {\n\t\treturn encoding;\n\t}",
"@Test\r\n public void testValidEncodings() {\r\n assertThatInputIsValid(\"\");\r\n assertThatInputIsValid(\"UTF8\");\r\n assertThatInputIsValid(\"UTF-8\");\r\n assertThatInputIsValid(\"CP1252\");\r\n assertThatInputIsValid(\"ISO-8859-1\");\r\n assertThatInputIsValid(\"ISO-8859-5\");\r\n assertThatInputIsValid(\"ISO-8859-9\");\r\n }",
"public void setC8(java.lang.String c8)\n {\n this.c8 = c8;\n }",
"public static String GetUtfString(String strTran) throws UnsupportedEncodingException {\n\n if(strTran.equals(new String(strTran.getBytes(\"iso8859-1\"), \"iso8859-1\")))\n {\n strTran=new String(strTran.getBytes(\"iso8859-1\"),\"utf-8\");\n }\n return strTran;\n }",
"private void setContentType(String contentType) throws IOException {\n if (localEncoding !=\"\"){ return; } // Don't change Encoding Twice\n StringTokenizer tok = new StringTokenizer(contentType,\";\");\n if (tok.countTokens()<2){ return;}\n tok.nextToken();\n String var = tok.nextToken(\"=\");\n if (var.length()<1){ return; }\n if (var.charAt(0)==';'){ var = var.substring(1); }\n int j=0;\n for(int i=0; i<var.length();i++){\n if (var.charAt(i)==' '){ j++;} else { break;}\n }\n var = var.substring(j);\n if (!var.equalsIgnoreCase(\"charset\")){ return;}\n String charSet = tok.nextToken();\n if (charSet.equals(characterEncoding)){ return; } // Already correct Encoding\n if (inputStream == null){\n throw new IOException(\"HTML Parser called with Reader cannot change Encoding\");\n }\n if (! (inputStream instanceof OpenByteArrayInputStream) ){\n throw new IOException(\"HTML Parser not called with OpenByteArrayInputStream\");\n }\n OpenByteArrayInputStream obais = (OpenByteArrayInputStream) inputStream;\n byte[] buf = obais.getBuffer();\n int length = obais.getLength();\n int offset = obais.getOffset();\n reader.close();\n obais.close();\n obais = new OpenByteArrayInputStream(buf,offset,length);\n inputStream = obais;\n try {\n reader = new BufferedReader(new InputStreamReader(obais,charSet),1024);\n } catch (UnsupportedEncodingException e){\n Logging.warning(\"Unknown charset \"+charSet+\" parsing with default ISO-8859-1 charSet\");\n System.err.println(\"Unknown charset \"+charSet+\" parsing with default ISO-8859-1 charSet\");\n reader = new BufferedReader(new InputStreamReader(obais),1024);\n charSet = \"iso-8859-1\";\n }\n Logging.info(\"Changed Encoding to \"+charSet);\n System.err.println(\"Changed Encoding to \"+charSet);\n reset();\n characterEncoding = charSet;\n localEncoding = charSet;\n // We will restart reading the file from the beginning\n return;\n }",
"public String getEncoding() {\r\n return \"B\";\r\n }",
"public static String patchCharsetEncoding(String encoding) {\n \n // return the system default encoding\n if ((encoding == null) || (encoding.length() < 3)) return Charset.defaultCharset().name();\n \n // trim encoding string\n encoding = encoding.trim();\n \n // fix upper/lowercase\n encoding = encoding.toUpperCase();\n if (encoding.startsWith(\"SHIFT\")) return \"Shift_JIS\";\n if (encoding.startsWith(\"BIG\")) return \"Big5\";\n // all other names but such with \"windows\" use uppercase\n if (encoding.startsWith(\"WINDOWS\")) encoding = \"windows\" + encoding.substring(7);\n if (encoding.startsWith(\"MACINTOSH\")) encoding = \"MacRoman\";\n \n // fix wrong fill characters\n encoding = patternUnderline.matcher(encoding).replaceAll(\"-\");\n \n if (encoding.matches(\"GB[_-]?2312([-_]80)?\")) return \"GB2312\";\n if (encoding.matches(\".*UTF[-_]?8.*\")) return \"UTF-8\";\n if (encoding.startsWith(\"US\")) return \"US-ASCII\";\n if (encoding.startsWith(\"KOI\")) return \"KOI8-R\";\n \n // patch missing '-'\n if (encoding.startsWith(\"windows\") && encoding.length() > 7) {\n final char c = encoding.charAt(7);\n if ((c >= '0') && (c <= '9')) {\n encoding = \"windows-\" + encoding.substring(7);\n }\n }\n \n if (encoding.startsWith(\"ISO\")) {\n // patch typos\n if (encoding.length() > 3) {\n final char c = encoding.charAt(3);\n if ((c >= '0') && (c <= '9')) {\n encoding = \"ISO-\" + encoding.substring(3);\n }\n }\n if (encoding.length() > 8) {\n final char c = encoding.charAt(8);\n if ((c >= '0') && (c <= '9')) {\n encoding = encoding.substring(0, 8) + \"-\" + encoding.substring(8); \n } \n }\n }\n \n // patch wrong name\n if (encoding.startsWith(\"ISO-8559\")) {\n // popular typo\n encoding = \"ISO-8859\" + encoding.substring(8);\n }\n \n // converting cp\\d{4} -> windows-\\d{4}\n if (encoding.matches(\"CP([_-])?125[0-8]\")) {\n final char c = encoding.charAt(2);\n if ((c >= '0') && (c <= '9')) {\n encoding = \"windows-\" + encoding.substring(2);\n } else {\n encoding = \"windows\" + encoding.substring(2);\n }\n }\n \n return encoding;\n }",
"private JTextField getJTextFieldCharset() {\r\n\t\tif (jTextFieldCharset == null) {\r\n\t\t\tjTextFieldCharset = new JTextField();\r\n\t\t\tjTextFieldCharset.setBounds(new Rectangle(78, 86, 81, 23));\r\n\t\t\tjTextFieldCharset.setText(\"GB2312\");\r\n\t\t}\r\n\t\treturn jTextFieldCharset;\r\n\t}",
"public void setText(String s) throws UnsupportedEncodingException {\n\t\tthis.text = s.getBytes(\"Cp437\");\n\t}",
"public void setCharSet(int charset)\n {\n byte cs = (byte)charset;\n if(charset > 127) {\n cs = (byte)(charset-256);\n }\n setCharSet(cs);\n }",
"@java.lang.Override\n public int getEncodingValue() {\n return encoding_;\n }",
"@Override\n public boolean isUnicode()\n {\n return true;\n }",
"protected ISO8859_1()\r\n {\r\n }"
] | [
"0.70636505",
"0.678441",
"0.67341614",
"0.6520358",
"0.6492588",
"0.6492588",
"0.6492588",
"0.6410615",
"0.6401564",
"0.63979053",
"0.63487613",
"0.6311029",
"0.6218237",
"0.6199833",
"0.61421365",
"0.61173296",
"0.60688233",
"0.6014917",
"0.5982307",
"0.587319",
"0.58522457",
"0.58454984",
"0.5825871",
"0.5813176",
"0.5808163",
"0.57861066",
"0.57305175",
"0.56945235",
"0.56929433",
"0.5692859",
"0.56625885",
"0.5653612",
"0.5649826",
"0.5634351",
"0.56279904",
"0.56279904",
"0.5611133",
"0.560824",
"0.5607514",
"0.5602713",
"0.5581351",
"0.5554098",
"0.553136",
"0.5525013",
"0.5522006",
"0.55195403",
"0.55195403",
"0.5518004",
"0.5516355",
"0.5464178",
"0.54545933",
"0.54545933",
"0.54545933",
"0.5447747",
"0.5445235",
"0.54314214",
"0.5413391",
"0.5411988",
"0.54113084",
"0.54112035",
"0.5401576",
"0.5399942",
"0.53991187",
"0.5385288",
"0.5374954",
"0.53746504",
"0.5368971",
"0.5362724",
"0.53537893",
"0.534883",
"0.5337742",
"0.5324406",
"0.5318927",
"0.5316632",
"0.5303734",
"0.53014296",
"0.5280266",
"0.5276127",
"0.52748686",
"0.52729946",
"0.5244946",
"0.5239524",
"0.521572",
"0.5207468",
"0.5202238",
"0.5197246",
"0.5196298",
"0.517998",
"0.5175646",
"0.5166104",
"0.5162706",
"0.5160358",
"0.51547205",
"0.5115782",
"0.51055557",
"0.51008886",
"0.5096681",
"0.50841343",
"0.5083397",
"0.5081768"
] | 0.7001476 | 1 |
/ access modifiers changed from: protected / renamed from: a | public <T> T mo2521a(MetadataField<T> metadataField) {
return metadataField.mo2717c(this.f379nE, this.f381qU, this.f380nH);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\t\t\t\tpublic void a() {\n\n\t\t\t\t}",
"@Override\r\n\tpublic void a() {\n\t\t\r\n\t}",
"@Override\n\tpublic void a() {\n\t\t\n\t}",
"protected m a(String name) {\n/* 42 */ return this.a.get(name);\n/* */ }",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\r\n\tpublic void a1() {\n\t\t\r\n\t}",
"@Override\n\tpublic void aaa() {\n\t\t\n\t}",
"@Override\n\tpublic void A() {\n\t\t\n\t}",
"@Override\n\tpublic void A() {\n\t\t\n\t}",
"@Override\n protected void prot() {\n }",
"public b a()\r\n/* 12: */ {\r\n/* 13:13 */ return this.a;\r\n/* 14: */ }",
"public abstract String a();",
"public /* bridge */ /* synthetic */ void mo55094a() {\n super.mo55094a();\n }",
"public void a() {\r\n }",
"public void a() {\n ((a) this.a).a();\n }",
"@Override\n public void b() {\n }",
"public abstract void m15813a();",
"@Override\r\n\tpublic void smthAbstr() {\n\t\t\r\n\t}",
"public abstract void mo70713b();",
"private abstract void privateabstract();",
"public final /* bridge */ /* synthetic */ void mo43566a() {\n super.mo43566a();\n }",
"public abstract void mo27464a();",
"public abstract Object mo26777y();",
"public np a()\r\n/* 33: */ {\r\n/* 34:49 */ return this.b;\r\n/* 35: */ }",
"public interface AbstractC23925a {\n /* renamed from: a */\n void mo105476a();\n }",
"public abstract Object mo1771a();",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void b() {\n\n\t}",
"public interface AbstractC17367b {\n /* renamed from: a */\n void mo84655a();\n }",
"public void a() {\n }",
"public void a() {\n }",
"private stendhal() {\n\t}",
"public void b() {\r\n }",
"public abstract void mo30696a();",
"public abstract void mo102899a();",
"public b[] a() {\n/* 95 */ return this.a;\n/* */ }",
"public abstract void mo3994a();",
"public final void mo51373a() {\n }",
"public abstract T a();",
"public String a()\r\n/* 25: */ {\r\n/* 26:171 */ return \"dig.\" + this.a;\r\n/* 27: */ }",
"public static void a() {\n\n }",
"public void mo38117a() {\n }",
"public int a()\r\n/* 64: */ {\r\n/* 65:70 */ return this.a;\r\n/* 66: */ }",
"public abstract void mo27386d();",
"public interface AbstractC1645a {\n /* renamed from: a */\n String mo17375a();\n }",
"public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"public abstract void mo4359a();",
"public void m23075a() {\n }",
"public void b() {\n }",
"public void b() {\n }",
"public abstract int a();",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"void m1864a() {\r\n }",
"public abstract void afvuren();",
"public abstract void mo27385c();",
"@Override\n public void perish() {\n \n }",
"public abstract void mo56925d();",
"protected void h() {}",
"protected b(int mb) {\n/* 87 */ this.b = mb;\n/* */ }",
"public interface AbstractC10485b {\n /* renamed from: a */\n void mo64153a(boolean z);\n }",
"public abstract void mo35054b();",
"public String i() {\n/* 44 */ return this.a.toString();\n/* */ }",
"public abstract void mo53562a(C18796a c18796a);",
"@Override // g.i.a.a\n /* Code decompiled incorrectly, please refer to instructions dump. */\n public void a(android.view.View r18, android.content.Context r19, android.database.Cursor r20) {\n /*\n // Method dump skipped, instructions count: 441\n */\n throw new UnsupportedOperationException(\"Method not decompiled: g.b.g.t0.a(android.view.View, android.content.Context, android.database.Cursor):void\");\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}",
"public abstract void alimentarse();",
"public void mo4359a() {\n }",
"public interface C34379a {\n /* renamed from: a */\n void mo46242a(bmc bmc);\n }",
"public abstract String mo118046b();",
"protected void a(dh paramdh) {}",
"public interface AbstractC6461g {\n /* renamed from: a */\n String mo42332a();\n}",
"public abstract void mo45765b();",
"public abstract BoundType a();",
"public void mo2740a() {\n }",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"public static a c() {\n }",
"public interface C1423a {\n /* renamed from: a */\n void mo6888a(int i);\n }",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"public void a(ik paramik)\r\n/* 59: */ {\r\n/* 60:66 */ paramik.a(this);\r\n/* 61: */ }",
"public int b()\r\n/* 45: */ {\r\n/* 46: 58 */ g();\r\n/* 47: */ \r\n/* 48: 60 */ return super.b();\r\n/* 49: */ }",
"public Set a()\r\n/* 44: */ {\r\n/* 45: 47 */ return this.e;\r\n/* 46: */ }",
"public abstract Object mo1185b();",
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void b2() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"public void mo9848a() {\n }",
"private final void i() {\n }",
"private interface C0257a {\n /* renamed from: a */\n float mo196a(ViewGroup viewGroup, View view);\n\n /* renamed from: b */\n float mo195b(ViewGroup viewGroup, View view);\n }",
"public abstract void mo6549b();",
"public void mo6944a() {\n }",
"public void mo12930a() {\n }",
"public abstract void a(StringBuilder sb);",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"public abstract void mo1184a(Object obj);",
"public static void main(String[] args) {\r\n\t\t//A obj = new A(); //A cannot be resolved to a type...try to access the class A method in thz class -- error \r\n\t // obj.i = 80; //here..The field A.i is not visible...it, allow as to create the object, but still it is not allow as to access thev & m, bcoz if we dont specify anything-- default(V & M) so it only accessible within the package.\r\n\t\r\n\t // obj.j = 90; //The field A.j is not visible -- error, cant access since it is protected.\r\n\t // obj.flow(); //The method flow() from the type A is not visible, cant access since it is protected.\r\n\t \r\n\t B obj1 = new B(); //extended class A, so we can access its V and M here.\r\n\t obj1.j = 70;\r\n\t obj1.flow();\r\n\t \r\n\t A obj3 = new A(); // here no need to extend class A , just create obj for A class and access it, bcoz it is \"public\".\r\n\t obj3.D = 100;\r\n\t obj3.sub();\r\n\t}",
"public void mo21825b() {\n }",
"public interface C0237a {\n /* renamed from: a */\n void mo1791a(String str);\n }",
"public abstract boolean a();"
] | [
"0.75464964",
"0.73093235",
"0.71735907",
"0.692263",
"0.68435764",
"0.6787232",
"0.67364866",
"0.6659923",
"0.6635336",
"0.6635336",
"0.65571475",
"0.65408033",
"0.65371394",
"0.6500136",
"0.6494878",
"0.6494545",
"0.6485399",
"0.6476603",
"0.64670885",
"0.6403744",
"0.6394189",
"0.63858354",
"0.63791156",
"0.6359318",
"0.635862",
"0.63452816",
"0.6342364",
"0.6338125",
"0.6318679",
"0.6308252",
"0.6302185",
"0.6302185",
"0.6297184",
"0.6286423",
"0.6281061",
"0.6277148",
"0.62757826",
"0.62720114",
"0.6261936",
"0.6259821",
"0.62542534",
"0.62433994",
"0.6240186",
"0.62257165",
"0.62044704",
"0.6188935",
"0.61817116",
"0.6180415",
"0.6169017",
"0.6164467",
"0.6156291",
"0.6156291",
"0.6153341",
"0.6152147",
"0.61438286",
"0.6107348",
"0.6106999",
"0.6105938",
"0.61047196",
"0.61005807",
"0.60873705",
"0.60854256",
"0.60787046",
"0.60570186",
"0.6056411",
"0.60460806",
"0.6044947",
"0.6044947",
"0.6043863",
"0.604216",
"0.60415447",
"0.6019007",
"0.6006512",
"0.6003148",
"0.59860367",
"0.59761965",
"0.5969308",
"0.5968431",
"0.59634477",
"0.5958228",
"0.595593",
"0.59471744",
"0.5946021",
"0.59442663",
"0.59337384",
"0.5933126",
"0.59321463",
"0.5931256",
"0.5929537",
"0.5924491",
"0.59230584",
"0.591813",
"0.5916826",
"0.5914802",
"0.5913617",
"0.59135664",
"0.58989006",
"0.5897495",
"0.5892505",
"0.5891249",
"0.58905417"
] | 0.0 | -1 |
/ renamed from: cK | public Metadata freeze() {
MetadataBundle cX = MetadataBundle.m557cX();
for (MetadataField a : C0249c.m575cW()) {
a.mo2715a(this.f379nE, cX, this.f381qU, this.f380nH);
}
return new C0180b(cX);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void kk12() {\n\n\t}",
"public void func_70295_k_() {}",
"@Override\n\tpublic void KYCMandate() {\n\t\t\n\t}",
"public boolean k_()\r\n/* 450: */ {\r\n/* 451:464 */ return false;\r\n/* 452: */ }",
"private static void cajas() {\n\t\t\n\t}",
"public void mo21786K() {\n }",
"@Override\n\tpublic void ccc() {\n\t\t\n\t}",
"java.lang.String getCit();",
"zzkf(zzkc zzkc, zzgz zzgz) {\n super(zzgz);\n this.zza = zzkc;\n }",
"public void mo12628c() {\n }",
"private final zzgy zzgb() {\n }",
"java.lang.String getCdkey();",
"void mo1942k();",
"void mo88524c();",
"void mo12638c();",
"void mo21072c();",
"public static void c0() {\n\t}",
"List<C1114c> mo5886k(String str);",
"void mo57278c();",
"C2841w mo7234g();",
"private CZ()\n {\n }",
"java.lang.String getContKey();",
"java.lang.String getC3();",
"public void mo1403c() {\n }",
"public interface C0094dk {\n /* renamed from: a */\n boolean mo1311a(KeyEvent keyEvent);\n}",
"public ECP getPublicKGCKey(){return pkS;}",
"public void setKcUnit(String kcUnit) {\n this.kcUnit = kcUnit;\n }",
"private void setKey() {\n\t\t \n\t}",
"void mo17012c();",
"public void mo97906c() {\n }",
"void mo67924c();",
"String getNameKeySpace();",
"private void m91737K() {\n String str = this.f73944a;\n boolean z = true;\n if (this.f73953m != 1) {\n z = false;\n }\n C28141am.m92411a(new C28311ag(str, z), new C28312ah(this.f73949f.hashCode()), this.f73944a);\n }",
"public cvt(cwk paramcwk)\r\n/* 24: */ {\r\n/* 25: 29 */ this.f = paramcwk;\r\n/* 26: */ }",
"public final void zzjk() {\n }",
"void mo17021c();",
"private CollationKey() { }",
"void mo12648a(C3676k kVar);",
"dkk mo4508f();",
"public static void CC2_1() {\n\t}",
"public long getprefx(long cnumber, int k) {\n if (thesize(cnumber) > k) {\n String num = cnumber + \"\";\n return Long.parseLong(num.substring(0, k));\n }\n return cnumber;\n }",
"C key();",
"public void bewegeKamel(Charakter charakter);",
"public void mo5348a(C0275kc kcVar, C0283kk kkVar) {\n throw null;\n }",
"int getNumCyc();",
"public final String aCK() {\n return NAME;\n }",
"C12017a mo41088c();",
"private C31767e m51447k(C0026g c0026g) {\n AppMethodBeat.m2504i(122720);\n C25052j.m39376p(c0026g, \"newAnnotations\");\n C31767e c31767e = new C31767e(this.BKv, this.BKw, this.BKx, c0026g, this.BEI);\n AppMethodBeat.m2505o(122720);\n return c31767e;\n }",
"public ECP getKGCRandomKey(){return R;}",
"public interface C0335c {\n }",
"void mo72114c();",
"public static void mmcc() {\n\t}",
"public boolean controllo(String c,int k) {\r\n\t\tString r=\"#\";\r\n\t\tfor(int i=0;i<c.length();i++) {\r\n\t\t\tif(!c.contains(r)) return false;\r\n\t\t}\r\n\t\treturn true;\r\n\t\t}",
"public String getClerk() {\n\t\treturn clerk;\n\t}",
"void mo80457c();",
"public static void c3() {\n\t}",
"void mo28717a(zzc zzc);",
"C1458cs mo7613iS();",
"private USI_KICKO() {}",
"String mo20731c();",
"boolean hasCdkey();",
"void mo1493c();",
"public interface C24717ak {\n}",
"public static void mcdc() {\n\t}",
"protected String getKey(int index)\n/* */ {\n/* 1425 */ return null;\n/* */ }",
"C1436ck mo7614jh();",
"K()//k class constructer not available in L as initializlers do not involve in inheritance\n\t{\n\t\t//super(); by default compiler will create super()\n\t\tSystem.out.println(\"K()\");\n\t}",
"public interface C0939c {\n }",
"C3676k mo12649b();",
"String getCmt();",
"public String getPKCClass();",
"public void getK_Gelisir(){\n K_Gelistir();\r\n }",
"public Kristik(){\n key = \"\";\n blockLen = key.length();\n }",
"public abstract C0690a mo9258k(String str);",
"public abstract void mo2624j();",
"public void a(cvk paramcvk)\r\n/* 76: */ {\r\n/* 77: 95 */ c();\r\n/* 78: */ }",
"interface C1403bj {\n /* renamed from: iS */\n C1458cs mo7613iS();\n\n /* renamed from: jh */\n C1436ck mo7614jh();\n}",
"public String getBKC098() {\n return BKC098;\n }",
"public interface C11910c {\n}",
"String getCpushares();",
"C15430g mo56154a();",
"public abstract void mo27385c();",
"static int type_of_cz(String passed){\n\t\treturn 1;\n\t}",
"C3577c mo19678C();",
"public final void mo11687c() {\n }",
"void mo5290b(C5102c c5102c);",
"protected abstract long mo1602b(C2175k c2175k);",
"abstract String mo1748c();",
"@Override\n protected long advanceH(final long k) {\n return 5 * k - 2;\n }",
"public void setKcUnitName(String kcUnitName) {\n this.kcUnitName = kcUnitName;\n }",
"public String getCHUNGCHI_KHAC()\n {\n return this.CHUNGCHI_KHAC;\n }",
"void mo5289a(C5102c c5102c);",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"String getShortNameKey();",
"public void mo5361b(C0275kc kcVar) {\n throw null;\n }",
"public void mo5099c() {\n }",
"public void setClerk(String clerk) {\n\t\tthis.clerk = clerk;\n\t}",
"public interface C8843g {\n}",
"public native void keyType(char c);",
"public String getKcUnit() {\n return kcUnit;\n }",
"protected String xCB() { return StShohinKonyuCB.class.getName(); }"
] | [
"0.71249956",
"0.6418828",
"0.6157778",
"0.6113327",
"0.60654926",
"0.6008948",
"0.59595776",
"0.59212637",
"0.590179",
"0.58810395",
"0.5880694",
"0.58655196",
"0.583764",
"0.5831816",
"0.5792939",
"0.57632774",
"0.57472837",
"0.5708392",
"0.5690201",
"0.5683454",
"0.5644428",
"0.5619024",
"0.5612447",
"0.56108093",
"0.5585526",
"0.558544",
"0.5565466",
"0.5563608",
"0.55142236",
"0.5508803",
"0.5506666",
"0.55013806",
"0.5491966",
"0.5481294",
"0.54785275",
"0.54665536",
"0.5460415",
"0.5450991",
"0.5444658",
"0.5441504",
"0.54401016",
"0.54390013",
"0.5433306",
"0.5417344",
"0.54108006",
"0.5407148",
"0.5406614",
"0.5405389",
"0.53976434",
"0.53913134",
"0.53877044",
"0.53855234",
"0.53774357",
"0.5369858",
"0.5365784",
"0.53579324",
"0.5349645",
"0.53482103",
"0.5347534",
"0.53432196",
"0.53341454",
"0.53287166",
"0.532445",
"0.5314169",
"0.5311734",
"0.5305944",
"0.5304171",
"0.53035104",
"0.53013885",
"0.5299144",
"0.52917916",
"0.5279505",
"0.52792585",
"0.5269513",
"0.5267627",
"0.5265432",
"0.526363",
"0.52557814",
"0.52484727",
"0.5243333",
"0.52366924",
"0.5231489",
"0.52314824",
"0.5231336",
"0.5229627",
"0.5203986",
"0.5202485",
"0.5183259",
"0.5171358",
"0.5165638",
"0.5162965",
"0.51557297",
"0.51541966",
"0.51503193",
"0.5146422",
"0.51461214",
"0.51435167",
"0.51390105",
"0.51341134",
"0.51324654",
"0.5131948"
] | 0.0 | -1 |
This method was generated by MyBatis Generator. This method corresponds to the database table stone_balance | public StoneBalanceExample() {
oredCriteria = new ArrayList<Criteria>();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int baldown(double newbalance, Long accountno, Long broaccno, Double bramt) throws Exception{\n\tint j=DbConnect.getStatement().executeUpdate(\"update account set balance=\"+newbalance+\" where accno=\"+accountno+\"\");\r\n\tint i=DbConnect.getStatement().executeUpdate(\"update account set balance=balance+\"+bramt+\" where accno=\"+broaccno+\"\");\r\n\treturn i;\r\n}",
"public int balup(double newbalance, Long accountno, Long broaccno, Double bramt) throws Exception{\n\tint j=DbConnect.getStatement().executeUpdate(\"update account set balance=\"+newbalance+\" where accno=\"+accountno+\"\");\r\n\tint i=DbConnect.getStatement().executeUpdate(\"update account set balance=balance+\"+bramt+\" where accno=\"+broaccno+\"\");\r\n\treturn i;\r\n}",
"private void listBalances() {\n\t\t\r\n\t}",
"public Money getTotalBalance();",
"private void updateDatabaseAccountBalance() {\n\t\tString sql = \"UPDATE account SET balance = \" + this.balance + \" \";\n\t\tsql += \"WHERE accountID = '\" + this.accountID + \"';\";\n\n\t\tDbUtilities db = new MySqlUtilities();\n\t\tdb.executeQuery(sql);\n\t}",
"public ResultSet retBalance(Long userid) throws SQLException {\n\trs=DbConnect.getStatement().executeQuery(\"Select balance from account where accno=\"+userid+\"\");\r\n\treturn rs;\r\n}",
"@Override\r\n\tpublic double showbalanceDao() {\n\t\t\r\n\t\treturn temp.getCustBal();\r\n\t}",
"public String getBalance() {\n return this.balance;\n }",
"public int getBalance() {\n return this.balance;\n\n }",
"public void withdraw(String accountNumber, int amount) {\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp, ll;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\tint lastBalance;\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\ttry{\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql = \"select balance,userId from \"+this.name+\" where accountNumber=?\";\n\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\tps.setString(1, accountNumber.toString());\n\t\tResultSet rs = ps.executeQuery();\n\t\tint nowBalance = 0;\n\t\tString id = \"\";\n\t\twhile(rs.next()) { \n\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\tid = rs.getString(\"userId\");\n\t\t}\n\t\tif (nowBalance<amount) {\n\t\t\tSystem.out.println(\"No Balance\");\n\t\t\treturn;\n\t\t}\n\t\tlastBalance = nowBalance - amount;\n\t\t//System.out.println(lastBalance);\n\t\t\n\t\tString sql1 = \"UPDATE \"+this.name+\" SET balance=? where accountNumber=?\";\n\t\tpp = (PreparedStatement) conn.prepareStatement(sql1);\n\t\tpp.setInt(1, lastBalance);\n\t\tpp.setString(2, accountNumber.toString());\n\t\tpp.executeUpdate();\n\t\t\n\t\tString logs = \"withdraw : \"+ amount+\" / balance: \"+String.valueOf(lastBalance);\n\t\tString sql11 = \"insert into \"+id+\" (log) values (?)\";\n\t\tll = (PreparedStatement) conn.prepareStatement(sql11);\n\t\tll.setString(1, logs);\n\t\tll.executeUpdate();\n\t\tSystem.out.println(\"Ypu got $\"+String.valueOf(amount));\n\t\t\n\t\t}catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t\t\n\t}",
"Balance[] findAllByBankAccount_Id(Long id);",
"double getBalance();",
"double getBalance();",
"public int getBalance()\n {\n return balance;\n }",
"public double getBalance()\n \n {\n \n return balance;\n \n }",
"public double getBalance(){\n return this.balance;\r\n }",
"@Override\n\tpublic double queryBalance(int accNo) {\n\t\treturn 0;\n\t}",
"public void wire(String accountNumber,int bankNumber, String toAccountNumber, int amount) {\n\t\t\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp, ll, lp, ls, mm, nn;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\tint lastBalance;\n\t\tint tolastBalance;\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\ttry{\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql = \"select balance,userId from \"+this.name+\" where accountNumber=?\";\n\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\tps.setString(1, accountNumber.toString());\n\t\tResultSet rs = ps.executeQuery();\n\t\tint nowBalance = 0;\n\t\tString id = \"\";\n\t\twhile(rs.next()) { \n\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\tid = rs.getString(\"userId\");\n\t\t}\n\t\tif (nowBalance<amount) {\n\t\t\tSystem.out.println(\"No Balance\");\n\t\t\treturn;\n\t\t}\n\t\tlastBalance = nowBalance - amount;\n\t\t//System.out.println(lastBalance);\n\t\tString sql1 = \"UPDATE \"+this.name+\" SET balance=? where accountNumber=?\";\n\t\tls = (PreparedStatement) conn.prepareStatement(sql1);\n\t\tls.setInt(1, lastBalance);\n\t\tls.setString(2, accountNumber.toString());\n\t\tls.executeUpdate();\n\t\t\n\t\t\n\t\t\n\t\t//to account\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql3 = \"select bankName from bank where bankNumber=?\";\n\t\tll= (PreparedStatement) conn.prepareStatement(sql3);\n\t\tll.setString(1, String.valueOf(bankNumber).toString());\n\t\tResultSet rs3 = ll.executeQuery();\n\t\tString toname = \"\";\n\t\twhile(rs3.next()) { \n\t\t\ttoname=rs3.getString(\"bankName\");\n\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tString sql4 = \"select balance,userId from \"+toname+\" where accountNumber=?\";\n\t\tpp= (PreparedStatement) conn.prepareStatement(sql4);\n\t\tpp.setString(1, accountNumber.toString());\n\t\tResultSet rs4 = pp.executeQuery();\n\t\tint tonowBalance = 0;\n\t\tString toid = \"\";\n\t\twhile(rs4.next()) { \n\t\t\ttonowBalance=rs4.getInt(\"balance\");\n\t\t\ttoid = rs4.getString(\"userId\");\n\t\t}\n\t\t\n\t\ttolastBalance = tonowBalance + amount;\n\t\t//System.out.println(lastBalance);\n\t\tString sql5 = \"UPDATE \"+toname+\" SET balance=? where accountNumber=?\";\n\t\tlp = (PreparedStatement) conn.prepareStatement(sql5);\n\t\tlp.setInt(1, tolastBalance);\n\t\tlp.setString(2, toAccountNumber.toString());\n\t\tlp.executeUpdate();\n\t\t\n\t\t\n\t\t//log\n\t\tString logs = \"wired : \"+ amount+\" to \"+toAccountNumber+\"/ balance: \"+String.valueOf(lastBalance);\n\t\tString sql11 = \"insert into \"+id+\" (log) values (?)\";\n\t\tmm = (PreparedStatement) conn.prepareStatement(sql11);\n\t\tmm.setString(1, logs);\n\t\tmm.executeUpdate();\n\t\tSystem.out.println(\"You wired $\"+String.valueOf(amount));\n\t\t\n\t\tString logs1 = \"get : \"+ amount+\" from \" +accountNumber+ \"/ balance: \"+String.valueOf(tolastBalance);\n\t\tString sql12 = \"insert into \"+toid+\" (log) values (?)\";\n\t\tnn = (PreparedStatement) conn.prepareStatement(sql12);\n\t\tnn.setString(1, logs1);\n\t\tnn.executeUpdate();\n\t\tSystem.out.println(\"You got $\"+String.valueOf(amount));\n\t\t\n\t\t\n\t\t}catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t}",
"public double getBalance(){\n return balance;\n }",
"public double getBalance(){\n return balance;\r\n }",
"public Integer getBalance() {\n return balance;\n }",
"public Integer getBalance() {\n return balance;\n }",
"public long getBalance() {\n\t\n\treturn balance;\n}",
"public int getBalance() {\n return balance;\n }",
"public int getBalance() {\n return balance;\n }",
"public void setBalance(Integer balance) {\n this.balance = balance;\n }",
"public void setBalance(Integer balance) {\n this.balance = balance;\n }",
"public BigDecimal getBalance() {\n return balance;\n }",
"public BigDecimal getBalance() {\n return balance;\n }",
"public void setBalance(BigDecimal balance) {\n this.balance = balance;\n }",
"public void setBalance(BigDecimal balance) {\n this.balance = balance;\n }",
"public double getBalance(){\r\n\t\treturn balance;\r\n\t}",
"public float getBalance()\r\n\t{\n\t\ttry\r\n\t\t{\r\n\t\t\tDBConnection ToDB = new DBConnection(); //Have a connection to the DB\r\n\t\t\tConnection DBConn = ToDB.openConn();\r\n\t\t\tStatement Stmt = DBConn.createStatement();\r\n\t\t\tString SQL_Command = \"SELECT Balance FROM SavingsAccount WHERE SavingsAccountNumber ='\"+SavingsAccountNumber+\"'\"; //SQL query command for Balance\r\n\t\t\tResultSet Rslt = Stmt.executeQuery(SQL_Command);\r\n\t\t\twhile (Rslt.next())\r\n\t\t\t{\r\n\t\t\t\tBalance = Rslt.getFloat(1);\r\n\t\t\t}\r\n\t\t\tStmt.close();\r\n\t\t\tToDB.closeConn();\r\n\t\t}\r\n\t\tcatch(SQLException e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"SQLException: \" + e);\r\n\t\t\twhile (e != null)\r\n\t\t\t{ System.out.println(\"SQLState: \" + e.getSQLState());\r\n\t\t\t\tSystem.out.println(\"Message: \" + e.getMessage());\r\n\t\t\t\tSystem.out.println(\"Vendor: \" + e.getErrorCode());\r\n\t\t\t\te = e.getNextException();\r\n\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (Exception e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Exception: \" + e);\r\n\t\t\te.printStackTrace ();\r\n\t\t}\r\n\t\treturn Balance;\r\n\t}",
"private void updateBalance(int balance) throws SQLException {\n\t\tupdateBalanceStatement.clearParameters();\n\t\tupdateBalanceStatement.setInt(1, balance);\n\t\tupdateBalanceStatement.setString(2, this.username);\n\t\tupdateBalanceStatement.executeUpdate();\n\t}",
"public long getBalance() {\n return this.balance;\n }",
"public String balance() {\n\t\treturn this.apiCall(\"balance\", \"\", \"\", true);\n\t}",
"@Override\n\tpublic double getAccountBalance(final int bankAccountId, final String vcDate, final Connection connection)\n\t{\n\t\tdouble opeAvailable = 0, totalAvailable = 0;\n\t\ttry {\n\n\t\t\tfinal StringBuilder str = new StringBuilder(\"SELECT case when sum(openingDebitBalance) = null then 0\")\n\t\t\t\t\t.append(\" ELSE sum(openingDebitBalance) end - case when sum(openingCreditBalance) = null then 0\")\n\t\t\t\t\t.append(\" else sum(openingCreditBalance) end AS \\\"openingBalance\\\" \")\n\t\t\t\t\t.append(\"FROM transactionSummary WHERE financialYearId=( SELECT id FROM financialYear WHERE startingDate <= ?\")\n\t\t\t\t\t.append(\"AND endingDate >= ?) AND glCodeId =(select glcodeid from bankaccount where id= ?)\");\n\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\tLOGGER.info(str);\n\t\t\tQuery pst = persistenceService.getSession().createSQLQuery(str.toString());\n\t\t\tpst.setString(0, vcDate);\n\t\t\tpst.setString(1, vcDate);\n\t\t\tpst.setInteger(2, bankAccountId);\n\t\t\tList<Object[]> rset = pst.list();\n\t\t\tfor (final Object[] element : rset)\n\t\t\t\topeAvailable = Double.parseDouble(element[0].toString());\n\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\tLOGGER.info(\"opening balance \" + opeAvailable);\n\n\t\t\tfinal StringBuilder str1 = new StringBuilder(\"SELECT (case when sum(gl.debitAmount) = null then 0\")\n\t\t\t\t\t.append(\" else sum(gl.debitAmount) end - case when sum(gl.creditAmount) = null then 0\")\n\t\t\t\t\t.append(\" else sum(gl.creditAmount) end) + \").append(opeAvailable).append(\"\")\n\t\t\t\t\t.append(\" as \\\"totalAmount\\\" FROM generalLedger gl, voucherHeader vh WHERE vh.id = gl.voucherHeaderId\")\n\t\t\t\t\t.append(\" AND gl.glCodeid = (select glcodeid from bankaccount where id= ?) AND \")\n\t\t\t\t\t.append(\" vh.voucherDate >=( SELECT TO_CHAR(startingDate, 'dd-Mon-yyyy')\")\n\t\t\t\t\t.append(\" FROM financialYear WHERE startingDate <= ? AND endingDate >= ?) AND vh.voucherDate <= ?\");\n\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\tLOGGER.info(str1);\n\t\t\tpst = persistenceService.getSession().createSQLQuery(str1.toString());\n\t\t\tpst.setInteger(0, bankAccountId);\n\t\t\tpst.setString(1, vcDate);\n\t\t\tpst.setString(2, vcDate);\n\t\t\tpst.setString(3, vcDate);\n\t\t\trset = pst.list();\n\t\t\tfor (final Object[] element : rset) {\n\t\t\t\ttotalAvailable = Double.parseDouble(element[0].toString());\n\t\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\t\tLOGGER.info(\"total balance \" + totalAvailable);\n\t\t\t}\n\n\t\t} catch (final HibernateException e) {\n\t\t\tLOGGER.error(\" could not get Bankbalance \" + e.toString(), e);\n\t\t\tthrow new HibernateException(e.toString());\n\t\t}\n\t\treturn totalAvailable;\n\t}",
"public void setBalance( long balance ) {\r\n this.balance = balance;\r\n }",
"public double getBalance(){\n return balance;\n }",
"public double getBalance(){\n return balance;\n }",
"public double getBalance()\n {\n return balance;\n }",
"public BankAccount(int balance) {\n\n this.balance = balance;\n\n }",
"public void setBalance(int balance) {\r\n\t\tif(0<=balance&&balance<=1000000) {\r\n\t\tthis.balance = balance;\r\n\t}else{\r\n\t\t System.out.println(\"잘못 입력하셨습니다. 현재 잔고는 \"+this.balance+\"입니다\");\r\n\t}\r\n \r\n}",
"public void setBalance(float balance) {\n this.balance = balance;\n }",
"@Override\r\n\tpublic Double getBalance( Integer id) {\n\t\tString sql = \"SELECT balance FROM buyers WHERE id = ?;\";\r\n\t\treturn jdbcTemplate.queryForObject( sql, Double.class, id);\r\n\t}",
"public float showBalance() {\n\t\treturn dao.showBalance();\r\n\t}",
"public double getBalance(){\n\t\treturn balance;\n\t}",
"public double getBalance() {\n return balance;\n }",
"public Double getBalance() {\r\n return balance;\r\n }",
"void setManageTransactionBalance(String balance);",
"public String getBalance() {\n return balance;\n }",
"public static void getAcountsBalance(int value) {\n\t\t\t\n\t\t\taccounts.clear();\n\n\t\t\tString query = \"select account.accID, accType, balance, dateCreated, fName, lName \" + \n\t\t \"from ser322.account,ser322.customer \" + \n\t\t \"WHERE customer.accID = account.accID AND balance =\" + value;\n\t\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\tStatement stmt = con.getConnection().createStatement();\n\t\t\t ResultSet rs = stmt.executeQuery(query);\n\t\t while (rs.next()) {\n\t\t \taccounts.addElement(new Account(rs.getInt(\"accID\"),rs.getString(\"accType\"),\n\t\t \t\t\t rs.getFloat(\"balance\"),rs.getDate(\"dateCreated\"), rs.getString(\"fName\"), rs.getString(\"lName\")));\n\t\t \n\t\t }\n\t\t \n\t\t } catch (SQLException e ) {\n\t\t \tSystem.out.println(\"QUERY WRONG - getAcountsBalance\");\n\t\t }\n\t\n\t\t}",
"public BaseJson<BigDecimal> wallet_balance() throws Exception {\n String s = main(\"wallet_balance\",\"[]\");\n return JsonHelper.jsonStr2Obj(s, BaseJson.class);\n }",
"public Double getBalance(){\n Double sum = 0.0;\n // Mencari balance dompet dari transaksi dengan cara menghitung total transaksi\n for (Transaction transaction : transactions) {\n sum += transaction.getAmount().doubleValue();\n }\n return sum;\n }",
"public Account(){\n this.id = 0;\n this.balance = 0;\n this.annualInterestRate = 0;\n this.dateCreated = new Date();\n }",
"public void setBalance(){\n balance.setBalance();\n }",
"@java.lang.Override\n public com.google.protobuf.ByteString\n getBalanceBytes() {\n java.lang.Object ref = balance_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n balance_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"double getBalance(UUID name);",
"Databank getBank();",
"public double getBal() {\n\t\t return balance;\r\n\t }",
"@Override\r\npublic void checkBalance() {\n\t\r\n}",
"public void setBalance(java.math.BigDecimal balance) {\n this.balance = balance;\n }",
"public int getBalance() {\n\t\treturn balance;\n\t}",
"public int getBalance() {\n return total_bal;\n }",
"public int getPropertyBalance();",
"public BankAccount getAccountBalanceRepo(String accountNr){\n String sql = \"SELECT * FROM bankaccount WHERE accountnr = :accountnr\";\n Map paramMap = new HashMap();\n paramMap.put(\"accountnr\", accountNr);\n BankAccount result = jdbcTemplate.queryForObject(sql, paramMap, new AccountRowMapper());\n return result;\n }",
"private int getBalance() throws SQLException {\n\t\tgetBalanceStatement.clearParameters();\n\t\tgetBalanceStatement.setString(1, this.username);\n\t\tResultSet result = getBalanceStatement.executeQuery();\n\t\tresult.next();\n\t\tint out = result.getInt(1);\n\t\tresult.close();\n\t\treturn out;\n\t}",
"public BankAccount findAccountById(int currentBankID) throws SQLException;",
"public void deposit(double amount) {\n balance += amount;\n \n try {\n \n Class.forName(\"net.ucanaccess.jdbc.UcanaccessDriver\");\n \n // Load Driver\n String connURL=\"jdbc:ucanaccess://c:/Users/Ellen/Documents/CIST2373/ChattBankMDB.mdb\";\n \n // Get Connection\n Connection con = DriverManager.getConnection(connURL);\n \n // Create Statement\n Statement stmt = con.createStatement();\n \n // Create sql string \n String sql = \"Update Accounts set Balance = \"+getBalance()+ \n \" where AcctNo='\"+getAcctNo()+\"'\";\n \n // Check for properly formed sql\n System.out.println(sql);\n \n // Execute Statement\n int n = stmt.executeUpdate(sql);\n if (n == 1)\n System.out.println(\"Update was successful!\");\n else\n System.out.println(\"Update failed!\"); \n \n // Close Connection\n con.close(); \n } //end try\n \n catch (Exception err) {\n System.out.println(\"Error: \" + err);\n } //end catch\n }",
"public BankAccount() {\r\n\t\tbalance=0;\r\n\t\t\r\n\t}",
"public void initializeBalance() {\n try {\n Connection connection = connect();\n\n PreparedStatement createBalanceTable = connection.prepareStatement(\"CREATE TABLE IF NOT EXISTS balance (\"\n + \"id INTEGER PRIMARY KEY,\"\n + \"user_username varchar(100),\"\n + \"amount float, \"\n + \"time varchar,\"\n + \"FOREIGN KEY (user_username) REFERENCES User(username));\"\n );\n createBalanceTable.execute();\n createBalanceTable.close();\n connection.close();\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }",
"public void showAccountBalance(){\n balance();\n\n }",
"public void balance(){\n\t\tnamesTree.balance();\n\t\taccountNumbersTree.balance();\n\t}",
"public double getBalance() {\n return this.balance;\n }",
"public Balance() {\r\n value = BigDecimal.ZERO;\r\n }",
"public void setBalance(final int balance)\n {\n this.balance = balance;\n }",
"public double getBalance() {\n return balance;\n }",
"public double getBalance() {\n return balance;\n }",
"public double getBalance() {\n return balance;\n }",
"public double getBalance() {\n return balance;\n }",
"public float getBalance() {\n return balance;\n }",
"private double getBalance() { return balance; }",
"public Double getBalance() {\n return null;\n }",
"public void setBalance(double balance){\n\t\tthis.balance = balance;\n\t}",
"public double getBalance()\r\n\t{\r\n\t\treturn balance;\t\t\r\n\t}",
"BigDecimal getOpeningDebitBalance();",
"BigDecimal getOpeningDebitBalance();",
"public com.google.protobuf.ByteString\n getBalanceBytes() {\n java.lang.Object ref = balance_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n balance_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public void InitializeBalance(BigDecimal valor){\n \r\n ChekingAccount chekAc=pRepository.GetChekingAccount();\r\n chekAc.setSaldoInicial(valor);\r\n pRepository.SaveChekingAccount(chekAc);\r\n \r\n }",
"Account(int balance) {\n if(balance <0) this.balance=0;\n this.balance = balance;\n }",
"public void updateBalance(String mobileNo,int balance)\n\t{\n\t\tContext ctx;\n\t\ttry {\n\t\t\tctx = new InitialContext();\n\t\t\n\t\t\n\t\t DataSource ds=(DataSource)ctx.lookup(\"java:OracleDS\");\n\t\t\tConnection con=ds.getConnection();\n\t\t\tStatement stmt=con.createStatement();\n\t\t\t\n\t\t\tstmt.executeUpdate(\"update mobile set balance=\"+balance+\" where mobileno=\"+mobileNo);\n\t\t\tcon.close();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Error in connection with Database :\"+e.getMessage());\n\t\t\t\n\t\t}\n\t\t\n\t}",
"public int balance(String accountNumber, String userId) {\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\t\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\t\n\t\ttry{\n\t\t\t//connect to database\n\t\t\tconn=DriverManager.getConnection(url, username, password);\n\t\t\tString sql = \"select balance from \"+this.name+\" where accountNumber=?\";\n\t\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\t\tps.setString(1, accountNumber.toString());\n\t\t\tResultSet rs = ps.executeQuery();\n\t\t\tint nowBalance = 0;\n\t\t\twhile(rs.next()) { \n\t\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\t}\n\t\t\t\n\t\t\tString logs = \"Checked balance: \"+String.valueOf(nowBalance);\n\t\t\tString sql1 = \"insert into \"+userId+\" (log) values (?)\";\n\t\t\tpp = (PreparedStatement) conn.prepareStatement(sql1);\n\t\t\tpp.setString(1, logs);\n\t\t\tpp.executeUpdate();\n\t\t\t\n\t\t\treturn nowBalance;\n\t\t} catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t\t\n\t}",
"public double getBalance()\n {\n return startingBalance;\n }",
"public void deposit(String accountNumber, int amount) {\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp, ll;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\tint lastBalance;\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\ttry{\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql = \"select balance,userId from \"+this.name+\" where accountNumber=?\";\n\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\tps.setString(1, accountNumber.toString());\n\t\tResultSet rs = ps.executeQuery();\n\t\tint nowBalance = 0;\n\t\tString id = \"\";\n\t\twhile(rs.next()) { \n\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\tid = rs.getString(\"userId\");\n\t\t}\n\t\tlastBalance = nowBalance + amount;\n\t\t//System.out.println(lastBalance);\n\t\t\n\t\tString sql1 = \"UPDATE \"+this.name+\" SET balance=? where accountNumber=?\";\n\t\tpp = (PreparedStatement) conn.prepareStatement(sql1);\n\t\tpp.setInt(1, lastBalance);\n\t\tpp.setString(2, accountNumber.toString());\n\t\tpp.executeUpdate();\n\t\t\n\t\tString logs = \"deposit : \"+ amount+\" / balance: \"+String.valueOf(lastBalance);\n\t\tString sql11 = \"insert into \"+id+\" (log) values (?)\";\n\t\tll = (PreparedStatement) conn.prepareStatement(sql11);\n\t\tll.setString(1, logs);\n\t\tll.executeUpdate();\n\t\t\n\t\t}catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t}",
"public List<DietaBalanceada> consultar_dietaBalanceada();",
"public String myAfterBalanceAmount() {\r\n\t\tint count=0;\r\n\t\tList<SavingAccount> acc = null;\r\n\t\ttry {\r\n\t\t\tSystem.out.println(\"Before Repeat\");\r\n\t\t\tacc = getSavingAccountList();\r\n\r\n\t\t\tfor (SavingAccount savingAcc : acc) {\r\n\t\t\t\tif (!(\"0\".equals(savingAcc.getState()))) {\r\n\t\t\t\t\tif (savingAcc.getState().equals(\"active\")) {\r\n\t\t\t\t\t\tint maxRepeat = Integer.parseInt(savingAcc\r\n\t\t\t\t\t\t\t\t.getRepeatable());\r\n\r\n\t\t\t\t\t\tDate date = new Date();\r\n\t\t\t\t\t\tDate systemDate = savingAccSer\r\n\t\t\t\t\t\t\t\t.convertStringToDateDDmmYYYY(savingAccSer\r\n\t\t\t\t\t\t\t\t\t\t.convertDateToStringDDmmYYYY(date));\r\n\r\n\t\t\t\t\t\tDate dateEnd = savingAccSer\r\n\t\t\t\t\t\t\t\t.convertStringToDateDDmmYYYY(savingAcc\r\n\t\t\t\t\t\t\t\t\t\t.getDateEnd());\r\n\r\n\t\t\t\t\t\tif (systemDate.getTime() == dateEnd.getTime()) {\r\n\t\t\t\t\t\t\tDate newEndDate = DateUtils.addMonths(systemDate,\r\n\t\t\t\t\t\t\t\t\tsavingAcc.getInterestRateId().getMonth());\r\n\r\n\t\t\t\t\t\t\tfloat balance = savingAcc.getBalanceAmount();\r\n\t\t\t\t\t\t\tfloat interest = savingAcc.getInterestRateId()\r\n\t\t\t\t\t\t\t\t\t.getInterestRate();\r\n\r\n\t\t\t\t\t\t\tint month = savingAcc.getInterestRateId()\r\n\t\t\t\t\t\t\t\t\t.getMonth();\r\n\t\t\t\t\t\t\tint days = Days\r\n\t\t\t\t\t\t\t\t\t.daysBetween(\r\n\t\t\t\t\t\t\t\t\t\t\tnew DateTime(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsavingAccSer\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.convertStringToDate(savingAcc\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getDateStart())),\r\n\t\t\t\t\t\t\t\t\t\t\tnew DateTime(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsavingAccSer\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.convertStringToDate(savingAcc\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getDateEnd())))\r\n\t\t\t\t\t\t\t\t\t.getDays();\r\n\t\t\t\t\t\t\tfloat amountAll = balance\r\n\t\t\t\t\t\t\t\t\t+ (balance * ((interest / (100)) / 360) * days);\r\n\t\t\t\t\t\t\tsavingAcc.setDateStart(savingAccSer\r\n\t\t\t\t\t\t\t\t\t.convertDateToString(systemDate));\r\n\t\t\t\t\t\t\tsavingAcc.setDateEnd(savingAccSer\r\n\t\t\t\t\t\t\t\t\t.convertDateToString(newEndDate));\r\n\t\t\t\t\t\t\tsavingAcc.setBalanceAmount(amountAll);\r\n\t\t\t\t\t\t\tsavingAcc.setRepeatable(\"\" + (maxRepeat + 1));\r\n\t\t\t\t\t\t\tupdateSavingAccount(savingAcc);\r\n\t\t\t\t\t\t\tcount+=1;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\tSystem.out.println(\"Successfully!! \"+ count +\" Saving Account has been updated. Minh Map!!!\");\r\n\t\t\t\r\n\t\t\treturn \"success\";\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.out.println(\"Exception\");\r\n\r\n\t\t}\r\n\t\treturn \"Fail\";\r\n\t}",
"public void setBalance(Double balance) {\r\n this.balance = balance;\r\n }",
"@Override\n\tpublic int accountUpdate(String id, String balance) {\n\t\tSession session=sessionFactory.openSession();\n\t\tTransaction tr = session.beginTransaction();\n\t\tint executeUpdate = 0;\n\t\tString sqlString=\"update user set balance = '\"+balance+\"' where id ='\"+id+\"'\";\n\t\ttry {\n\t\t\tQuery query=session.createSQLQuery(sqlString);\n\t\t\texecuteUpdate = query.executeUpdate();\n\t\t\tSystem.out.println(\"executeUpdate:\"+executeUpdate);\n\t\t} catch (HibernateException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}finally{\n\t\t\ttr.commit();\n\t\t session.close();\n\t\t}\n\t\treturn executeUpdate;\t\n\t}",
"public void Deposit(Integer accountNo,float depositMoney){\n\tSessionFactory sessionFactory = new Configuration().configure(\"hibernate.cfg.xml\").buildSessionFactory();\n\tSession session = sessionFactory.openSession();\n\tTransaction trans = null;\n\ttry{\n\t\ttrans = session.beginTransaction();\n\t\tQuery query=session.createQuery(\"UPDATE Account set balance+=:balance where accountNo=:accountNo\"); \n\t\tquery.setParameter(\"balance\",depositMoney); \n\t\tquery.setParameter(\"accountNo\",accountNo); \n\t}catch(HibernateException hibernateException){\n\t\tif(trans != null){\n\t\t\ttrans.rollback();\n\t\t}\n\t\thibernateException.printStackTrace();\n\t}\n\t}",
"public java.math.BigDecimal getBalance() {\n return balance;\n }"
] | [
"0.6257401",
"0.6254438",
"0.6161535",
"0.6054013",
"0.60082215",
"0.5993809",
"0.5983186",
"0.5981287",
"0.5967813",
"0.5967191",
"0.5949743",
"0.59459656",
"0.59459656",
"0.59297687",
"0.5890412",
"0.587308",
"0.5872259",
"0.584036",
"0.5810854",
"0.57962006",
"0.579471",
"0.579471",
"0.5792875",
"0.5790713",
"0.5790713",
"0.5778891",
"0.5778891",
"0.5769552",
"0.5769552",
"0.5763822",
"0.5763822",
"0.5744492",
"0.57258487",
"0.57236683",
"0.5708359",
"0.5703243",
"0.5699339",
"0.5697645",
"0.5681245",
"0.56788135",
"0.56700957",
"0.5661688",
"0.5659845",
"0.5659348",
"0.5655676",
"0.5647027",
"0.56466496",
"0.56428343",
"0.5629093",
"0.5627635",
"0.56273925",
"0.56242955",
"0.56076217",
"0.5603623",
"0.56021035",
"0.5597103",
"0.5582562",
"0.5580238",
"0.557578",
"0.5575343",
"0.55698454",
"0.5568917",
"0.5568167",
"0.55664366",
"0.5562932",
"0.5556589",
"0.5544964",
"0.55375737",
"0.55369264",
"0.5523909",
"0.5521524",
"0.55192953",
"0.5518451",
"0.55162275",
"0.551352",
"0.5511489",
"0.5506484",
"0.5506484",
"0.5506484",
"0.5506484",
"0.5505282",
"0.55038494",
"0.54992586",
"0.54967123",
"0.54953766",
"0.54940236",
"0.54940236",
"0.5489175",
"0.5486224",
"0.54800606",
"0.54754776",
"0.54734373",
"0.5469201",
"0.5468912",
"0.5467371",
"0.5465251",
"0.54636157",
"0.54497653",
"0.542471",
"0.5408221"
] | 0.55804604 | 57 |
This method was generated by MyBatis Generator. This method corresponds to the database table stone_balance | public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int baldown(double newbalance, Long accountno, Long broaccno, Double bramt) throws Exception{\n\tint j=DbConnect.getStatement().executeUpdate(\"update account set balance=\"+newbalance+\" where accno=\"+accountno+\"\");\r\n\tint i=DbConnect.getStatement().executeUpdate(\"update account set balance=balance+\"+bramt+\" where accno=\"+broaccno+\"\");\r\n\treturn i;\r\n}",
"public int balup(double newbalance, Long accountno, Long broaccno, Double bramt) throws Exception{\n\tint j=DbConnect.getStatement().executeUpdate(\"update account set balance=\"+newbalance+\" where accno=\"+accountno+\"\");\r\n\tint i=DbConnect.getStatement().executeUpdate(\"update account set balance=balance+\"+bramt+\" where accno=\"+broaccno+\"\");\r\n\treturn i;\r\n}",
"private void listBalances() {\n\t\t\r\n\t}",
"public Money getTotalBalance();",
"private void updateDatabaseAccountBalance() {\n\t\tString sql = \"UPDATE account SET balance = \" + this.balance + \" \";\n\t\tsql += \"WHERE accountID = '\" + this.accountID + \"';\";\n\n\t\tDbUtilities db = new MySqlUtilities();\n\t\tdb.executeQuery(sql);\n\t}",
"public ResultSet retBalance(Long userid) throws SQLException {\n\trs=DbConnect.getStatement().executeQuery(\"Select balance from account where accno=\"+userid+\"\");\r\n\treturn rs;\r\n}",
"@Override\r\n\tpublic double showbalanceDao() {\n\t\t\r\n\t\treturn temp.getCustBal();\r\n\t}",
"public String getBalance() {\n return this.balance;\n }",
"public int getBalance() {\n return this.balance;\n\n }",
"public void withdraw(String accountNumber, int amount) {\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp, ll;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\tint lastBalance;\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\ttry{\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql = \"select balance,userId from \"+this.name+\" where accountNumber=?\";\n\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\tps.setString(1, accountNumber.toString());\n\t\tResultSet rs = ps.executeQuery();\n\t\tint nowBalance = 0;\n\t\tString id = \"\";\n\t\twhile(rs.next()) { \n\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\tid = rs.getString(\"userId\");\n\t\t}\n\t\tif (nowBalance<amount) {\n\t\t\tSystem.out.println(\"No Balance\");\n\t\t\treturn;\n\t\t}\n\t\tlastBalance = nowBalance - amount;\n\t\t//System.out.println(lastBalance);\n\t\t\n\t\tString sql1 = \"UPDATE \"+this.name+\" SET balance=? where accountNumber=?\";\n\t\tpp = (PreparedStatement) conn.prepareStatement(sql1);\n\t\tpp.setInt(1, lastBalance);\n\t\tpp.setString(2, accountNumber.toString());\n\t\tpp.executeUpdate();\n\t\t\n\t\tString logs = \"withdraw : \"+ amount+\" / balance: \"+String.valueOf(lastBalance);\n\t\tString sql11 = \"insert into \"+id+\" (log) values (?)\";\n\t\tll = (PreparedStatement) conn.prepareStatement(sql11);\n\t\tll.setString(1, logs);\n\t\tll.executeUpdate();\n\t\tSystem.out.println(\"Ypu got $\"+String.valueOf(amount));\n\t\t\n\t\t}catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t\t\n\t}",
"Balance[] findAllByBankAccount_Id(Long id);",
"double getBalance();",
"double getBalance();",
"public int getBalance()\n {\n return balance;\n }",
"public double getBalance()\n \n {\n \n return balance;\n \n }",
"public double getBalance(){\n return this.balance;\r\n }",
"@Override\n\tpublic double queryBalance(int accNo) {\n\t\treturn 0;\n\t}",
"public void wire(String accountNumber,int bankNumber, String toAccountNumber, int amount) {\n\t\t\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp, ll, lp, ls, mm, nn;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\tint lastBalance;\n\t\tint tolastBalance;\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\ttry{\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql = \"select balance,userId from \"+this.name+\" where accountNumber=?\";\n\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\tps.setString(1, accountNumber.toString());\n\t\tResultSet rs = ps.executeQuery();\n\t\tint nowBalance = 0;\n\t\tString id = \"\";\n\t\twhile(rs.next()) { \n\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\tid = rs.getString(\"userId\");\n\t\t}\n\t\tif (nowBalance<amount) {\n\t\t\tSystem.out.println(\"No Balance\");\n\t\t\treturn;\n\t\t}\n\t\tlastBalance = nowBalance - amount;\n\t\t//System.out.println(lastBalance);\n\t\tString sql1 = \"UPDATE \"+this.name+\" SET balance=? where accountNumber=?\";\n\t\tls = (PreparedStatement) conn.prepareStatement(sql1);\n\t\tls.setInt(1, lastBalance);\n\t\tls.setString(2, accountNumber.toString());\n\t\tls.executeUpdate();\n\t\t\n\t\t\n\t\t\n\t\t//to account\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql3 = \"select bankName from bank where bankNumber=?\";\n\t\tll= (PreparedStatement) conn.prepareStatement(sql3);\n\t\tll.setString(1, String.valueOf(bankNumber).toString());\n\t\tResultSet rs3 = ll.executeQuery();\n\t\tString toname = \"\";\n\t\twhile(rs3.next()) { \n\t\t\ttoname=rs3.getString(\"bankName\");\n\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tString sql4 = \"select balance,userId from \"+toname+\" where accountNumber=?\";\n\t\tpp= (PreparedStatement) conn.prepareStatement(sql4);\n\t\tpp.setString(1, accountNumber.toString());\n\t\tResultSet rs4 = pp.executeQuery();\n\t\tint tonowBalance = 0;\n\t\tString toid = \"\";\n\t\twhile(rs4.next()) { \n\t\t\ttonowBalance=rs4.getInt(\"balance\");\n\t\t\ttoid = rs4.getString(\"userId\");\n\t\t}\n\t\t\n\t\ttolastBalance = tonowBalance + amount;\n\t\t//System.out.println(lastBalance);\n\t\tString sql5 = \"UPDATE \"+toname+\" SET balance=? where accountNumber=?\";\n\t\tlp = (PreparedStatement) conn.prepareStatement(sql5);\n\t\tlp.setInt(1, tolastBalance);\n\t\tlp.setString(2, toAccountNumber.toString());\n\t\tlp.executeUpdate();\n\t\t\n\t\t\n\t\t//log\n\t\tString logs = \"wired : \"+ amount+\" to \"+toAccountNumber+\"/ balance: \"+String.valueOf(lastBalance);\n\t\tString sql11 = \"insert into \"+id+\" (log) values (?)\";\n\t\tmm = (PreparedStatement) conn.prepareStatement(sql11);\n\t\tmm.setString(1, logs);\n\t\tmm.executeUpdate();\n\t\tSystem.out.println(\"You wired $\"+String.valueOf(amount));\n\t\t\n\t\tString logs1 = \"get : \"+ amount+\" from \" +accountNumber+ \"/ balance: \"+String.valueOf(tolastBalance);\n\t\tString sql12 = \"insert into \"+toid+\" (log) values (?)\";\n\t\tnn = (PreparedStatement) conn.prepareStatement(sql12);\n\t\tnn.setString(1, logs1);\n\t\tnn.executeUpdate();\n\t\tSystem.out.println(\"You got $\"+String.valueOf(amount));\n\t\t\n\t\t\n\t\t}catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t}",
"public double getBalance(){\n return balance;\n }",
"public double getBalance(){\n return balance;\r\n }",
"public Integer getBalance() {\n return balance;\n }",
"public Integer getBalance() {\n return balance;\n }",
"public long getBalance() {\n\t\n\treturn balance;\n}",
"public int getBalance() {\n return balance;\n }",
"public int getBalance() {\n return balance;\n }",
"public void setBalance(Integer balance) {\n this.balance = balance;\n }",
"public void setBalance(Integer balance) {\n this.balance = balance;\n }",
"public BigDecimal getBalance() {\n return balance;\n }",
"public BigDecimal getBalance() {\n return balance;\n }",
"public void setBalance(BigDecimal balance) {\n this.balance = balance;\n }",
"public void setBalance(BigDecimal balance) {\n this.balance = balance;\n }",
"public double getBalance(){\r\n\t\treturn balance;\r\n\t}",
"public float getBalance()\r\n\t{\n\t\ttry\r\n\t\t{\r\n\t\t\tDBConnection ToDB = new DBConnection(); //Have a connection to the DB\r\n\t\t\tConnection DBConn = ToDB.openConn();\r\n\t\t\tStatement Stmt = DBConn.createStatement();\r\n\t\t\tString SQL_Command = \"SELECT Balance FROM SavingsAccount WHERE SavingsAccountNumber ='\"+SavingsAccountNumber+\"'\"; //SQL query command for Balance\r\n\t\t\tResultSet Rslt = Stmt.executeQuery(SQL_Command);\r\n\t\t\twhile (Rslt.next())\r\n\t\t\t{\r\n\t\t\t\tBalance = Rslt.getFloat(1);\r\n\t\t\t}\r\n\t\t\tStmt.close();\r\n\t\t\tToDB.closeConn();\r\n\t\t}\r\n\t\tcatch(SQLException e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"SQLException: \" + e);\r\n\t\t\twhile (e != null)\r\n\t\t\t{ System.out.println(\"SQLState: \" + e.getSQLState());\r\n\t\t\t\tSystem.out.println(\"Message: \" + e.getMessage());\r\n\t\t\t\tSystem.out.println(\"Vendor: \" + e.getErrorCode());\r\n\t\t\t\te = e.getNextException();\r\n\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (Exception e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Exception: \" + e);\r\n\t\t\te.printStackTrace ();\r\n\t\t}\r\n\t\treturn Balance;\r\n\t}",
"private void updateBalance(int balance) throws SQLException {\n\t\tupdateBalanceStatement.clearParameters();\n\t\tupdateBalanceStatement.setInt(1, balance);\n\t\tupdateBalanceStatement.setString(2, this.username);\n\t\tupdateBalanceStatement.executeUpdate();\n\t}",
"public long getBalance() {\n return this.balance;\n }",
"public String balance() {\n\t\treturn this.apiCall(\"balance\", \"\", \"\", true);\n\t}",
"@Override\n\tpublic double getAccountBalance(final int bankAccountId, final String vcDate, final Connection connection)\n\t{\n\t\tdouble opeAvailable = 0, totalAvailable = 0;\n\t\ttry {\n\n\t\t\tfinal StringBuilder str = new StringBuilder(\"SELECT case when sum(openingDebitBalance) = null then 0\")\n\t\t\t\t\t.append(\" ELSE sum(openingDebitBalance) end - case when sum(openingCreditBalance) = null then 0\")\n\t\t\t\t\t.append(\" else sum(openingCreditBalance) end AS \\\"openingBalance\\\" \")\n\t\t\t\t\t.append(\"FROM transactionSummary WHERE financialYearId=( SELECT id FROM financialYear WHERE startingDate <= ?\")\n\t\t\t\t\t.append(\"AND endingDate >= ?) AND glCodeId =(select glcodeid from bankaccount where id= ?)\");\n\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\tLOGGER.info(str);\n\t\t\tQuery pst = persistenceService.getSession().createSQLQuery(str.toString());\n\t\t\tpst.setString(0, vcDate);\n\t\t\tpst.setString(1, vcDate);\n\t\t\tpst.setInteger(2, bankAccountId);\n\t\t\tList<Object[]> rset = pst.list();\n\t\t\tfor (final Object[] element : rset)\n\t\t\t\topeAvailable = Double.parseDouble(element[0].toString());\n\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\tLOGGER.info(\"opening balance \" + opeAvailable);\n\n\t\t\tfinal StringBuilder str1 = new StringBuilder(\"SELECT (case when sum(gl.debitAmount) = null then 0\")\n\t\t\t\t\t.append(\" else sum(gl.debitAmount) end - case when sum(gl.creditAmount) = null then 0\")\n\t\t\t\t\t.append(\" else sum(gl.creditAmount) end) + \").append(opeAvailable).append(\"\")\n\t\t\t\t\t.append(\" as \\\"totalAmount\\\" FROM generalLedger gl, voucherHeader vh WHERE vh.id = gl.voucherHeaderId\")\n\t\t\t\t\t.append(\" AND gl.glCodeid = (select glcodeid from bankaccount where id= ?) AND \")\n\t\t\t\t\t.append(\" vh.voucherDate >=( SELECT TO_CHAR(startingDate, 'dd-Mon-yyyy')\")\n\t\t\t\t\t.append(\" FROM financialYear WHERE startingDate <= ? AND endingDate >= ?) AND vh.voucherDate <= ?\");\n\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\tLOGGER.info(str1);\n\t\t\tpst = persistenceService.getSession().createSQLQuery(str1.toString());\n\t\t\tpst.setInteger(0, bankAccountId);\n\t\t\tpst.setString(1, vcDate);\n\t\t\tpst.setString(2, vcDate);\n\t\t\tpst.setString(3, vcDate);\n\t\t\trset = pst.list();\n\t\t\tfor (final Object[] element : rset) {\n\t\t\t\ttotalAvailable = Double.parseDouble(element[0].toString());\n\t\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\t\tLOGGER.info(\"total balance \" + totalAvailable);\n\t\t\t}\n\n\t\t} catch (final HibernateException e) {\n\t\t\tLOGGER.error(\" could not get Bankbalance \" + e.toString(), e);\n\t\t\tthrow new HibernateException(e.toString());\n\t\t}\n\t\treturn totalAvailable;\n\t}",
"public void setBalance( long balance ) {\r\n this.balance = balance;\r\n }",
"public double getBalance(){\n return balance;\n }",
"public double getBalance(){\n return balance;\n }",
"public double getBalance()\n {\n return balance;\n }",
"public BankAccount(int balance) {\n\n this.balance = balance;\n\n }",
"public void setBalance(int balance) {\r\n\t\tif(0<=balance&&balance<=1000000) {\r\n\t\tthis.balance = balance;\r\n\t}else{\r\n\t\t System.out.println(\"잘못 입력하셨습니다. 현재 잔고는 \"+this.balance+\"입니다\");\r\n\t}\r\n \r\n}",
"public void setBalance(float balance) {\n this.balance = balance;\n }",
"@Override\r\n\tpublic Double getBalance( Integer id) {\n\t\tString sql = \"SELECT balance FROM buyers WHERE id = ?;\";\r\n\t\treturn jdbcTemplate.queryForObject( sql, Double.class, id);\r\n\t}",
"public float showBalance() {\n\t\treturn dao.showBalance();\r\n\t}",
"public double getBalance(){\n\t\treturn balance;\n\t}",
"public double getBalance() {\n return balance;\n }",
"public Double getBalance() {\r\n return balance;\r\n }",
"public String getBalance() {\n return balance;\n }",
"void setManageTransactionBalance(String balance);",
"public static void getAcountsBalance(int value) {\n\t\t\t\n\t\t\taccounts.clear();\n\n\t\t\tString query = \"select account.accID, accType, balance, dateCreated, fName, lName \" + \n\t\t \"from ser322.account,ser322.customer \" + \n\t\t \"WHERE customer.accID = account.accID AND balance =\" + value;\n\t\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\tStatement stmt = con.getConnection().createStatement();\n\t\t\t ResultSet rs = stmt.executeQuery(query);\n\t\t while (rs.next()) {\n\t\t \taccounts.addElement(new Account(rs.getInt(\"accID\"),rs.getString(\"accType\"),\n\t\t \t\t\t rs.getFloat(\"balance\"),rs.getDate(\"dateCreated\"), rs.getString(\"fName\"), rs.getString(\"lName\")));\n\t\t \n\t\t }\n\t\t \n\t\t } catch (SQLException e ) {\n\t\t \tSystem.out.println(\"QUERY WRONG - getAcountsBalance\");\n\t\t }\n\t\n\t\t}",
"public BaseJson<BigDecimal> wallet_balance() throws Exception {\n String s = main(\"wallet_balance\",\"[]\");\n return JsonHelper.jsonStr2Obj(s, BaseJson.class);\n }",
"public Double getBalance(){\n Double sum = 0.0;\n // Mencari balance dompet dari transaksi dengan cara menghitung total transaksi\n for (Transaction transaction : transactions) {\n sum += transaction.getAmount().doubleValue();\n }\n return sum;\n }",
"public Account(){\n this.id = 0;\n this.balance = 0;\n this.annualInterestRate = 0;\n this.dateCreated = new Date();\n }",
"public void setBalance(){\n balance.setBalance();\n }",
"@java.lang.Override\n public com.google.protobuf.ByteString\n getBalanceBytes() {\n java.lang.Object ref = balance_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n balance_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public StoneBalanceExample() {\n oredCriteria = new ArrayList<Criteria>();\n }",
"double getBalance(UUID name);",
"Databank getBank();",
"public double getBal() {\n\t\t return balance;\r\n\t }",
"@Override\r\npublic void checkBalance() {\n\t\r\n}",
"public int getBalance() {\n\t\treturn balance;\n\t}",
"public void setBalance(java.math.BigDecimal balance) {\n this.balance = balance;\n }",
"public int getBalance() {\n return total_bal;\n }",
"public int getPropertyBalance();",
"public BankAccount getAccountBalanceRepo(String accountNr){\n String sql = \"SELECT * FROM bankaccount WHERE accountnr = :accountnr\";\n Map paramMap = new HashMap();\n paramMap.put(\"accountnr\", accountNr);\n BankAccount result = jdbcTemplate.queryForObject(sql, paramMap, new AccountRowMapper());\n return result;\n }",
"private int getBalance() throws SQLException {\n\t\tgetBalanceStatement.clearParameters();\n\t\tgetBalanceStatement.setString(1, this.username);\n\t\tResultSet result = getBalanceStatement.executeQuery();\n\t\tresult.next();\n\t\tint out = result.getInt(1);\n\t\tresult.close();\n\t\treturn out;\n\t}",
"public BankAccount findAccountById(int currentBankID) throws SQLException;",
"public void deposit(double amount) {\n balance += amount;\n \n try {\n \n Class.forName(\"net.ucanaccess.jdbc.UcanaccessDriver\");\n \n // Load Driver\n String connURL=\"jdbc:ucanaccess://c:/Users/Ellen/Documents/CIST2373/ChattBankMDB.mdb\";\n \n // Get Connection\n Connection con = DriverManager.getConnection(connURL);\n \n // Create Statement\n Statement stmt = con.createStatement();\n \n // Create sql string \n String sql = \"Update Accounts set Balance = \"+getBalance()+ \n \" where AcctNo='\"+getAcctNo()+\"'\";\n \n // Check for properly formed sql\n System.out.println(sql);\n \n // Execute Statement\n int n = stmt.executeUpdate(sql);\n if (n == 1)\n System.out.println(\"Update was successful!\");\n else\n System.out.println(\"Update failed!\"); \n \n // Close Connection\n con.close(); \n } //end try\n \n catch (Exception err) {\n System.out.println(\"Error: \" + err);\n } //end catch\n }",
"public BankAccount() {\r\n\t\tbalance=0;\r\n\t\t\r\n\t}",
"public void initializeBalance() {\n try {\n Connection connection = connect();\n\n PreparedStatement createBalanceTable = connection.prepareStatement(\"CREATE TABLE IF NOT EXISTS balance (\"\n + \"id INTEGER PRIMARY KEY,\"\n + \"user_username varchar(100),\"\n + \"amount float, \"\n + \"time varchar,\"\n + \"FOREIGN KEY (user_username) REFERENCES User(username));\"\n );\n createBalanceTable.execute();\n createBalanceTable.close();\n connection.close();\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }",
"public void showAccountBalance(){\n balance();\n\n }",
"public void balance(){\n\t\tnamesTree.balance();\n\t\taccountNumbersTree.balance();\n\t}",
"public double getBalance() {\n return this.balance;\n }",
"public Balance() {\r\n value = BigDecimal.ZERO;\r\n }",
"public void setBalance(final int balance)\n {\n this.balance = balance;\n }",
"public double getBalance() {\n return balance;\n }",
"public double getBalance() {\n return balance;\n }",
"public double getBalance() {\n return balance;\n }",
"public double getBalance() {\n return balance;\n }",
"public float getBalance() {\n return balance;\n }",
"private double getBalance() { return balance; }",
"public Double getBalance() {\n return null;\n }",
"public double getBalance()\r\n\t{\r\n\t\treturn balance;\t\t\r\n\t}",
"public void setBalance(double balance){\n\t\tthis.balance = balance;\n\t}",
"BigDecimal getOpeningDebitBalance();",
"BigDecimal getOpeningDebitBalance();",
"public com.google.protobuf.ByteString\n getBalanceBytes() {\n java.lang.Object ref = balance_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n balance_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public void InitializeBalance(BigDecimal valor){\n \r\n ChekingAccount chekAc=pRepository.GetChekingAccount();\r\n chekAc.setSaldoInicial(valor);\r\n pRepository.SaveChekingAccount(chekAc);\r\n \r\n }",
"Account(int balance) {\n if(balance <0) this.balance=0;\n this.balance = balance;\n }",
"public void updateBalance(String mobileNo,int balance)\n\t{\n\t\tContext ctx;\n\t\ttry {\n\t\t\tctx = new InitialContext();\n\t\t\n\t\t\n\t\t DataSource ds=(DataSource)ctx.lookup(\"java:OracleDS\");\n\t\t\tConnection con=ds.getConnection();\n\t\t\tStatement stmt=con.createStatement();\n\t\t\t\n\t\t\tstmt.executeUpdate(\"update mobile set balance=\"+balance+\" where mobileno=\"+mobileNo);\n\t\t\tcon.close();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Error in connection with Database :\"+e.getMessage());\n\t\t\t\n\t\t}\n\t\t\n\t}",
"public int balance(String accountNumber, String userId) {\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\t\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\t\n\t\ttry{\n\t\t\t//connect to database\n\t\t\tconn=DriverManager.getConnection(url, username, password);\n\t\t\tString sql = \"select balance from \"+this.name+\" where accountNumber=?\";\n\t\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\t\tps.setString(1, accountNumber.toString());\n\t\t\tResultSet rs = ps.executeQuery();\n\t\t\tint nowBalance = 0;\n\t\t\twhile(rs.next()) { \n\t\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\t}\n\t\t\t\n\t\t\tString logs = \"Checked balance: \"+String.valueOf(nowBalance);\n\t\t\tString sql1 = \"insert into \"+userId+\" (log) values (?)\";\n\t\t\tpp = (PreparedStatement) conn.prepareStatement(sql1);\n\t\t\tpp.setString(1, logs);\n\t\t\tpp.executeUpdate();\n\t\t\t\n\t\t\treturn nowBalance;\n\t\t} catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t\t\n\t}",
"public double getBalance()\n {\n return startingBalance;\n }",
"public void deposit(String accountNumber, int amount) {\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp, ll;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\tint lastBalance;\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\ttry{\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql = \"select balance,userId from \"+this.name+\" where accountNumber=?\";\n\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\tps.setString(1, accountNumber.toString());\n\t\tResultSet rs = ps.executeQuery();\n\t\tint nowBalance = 0;\n\t\tString id = \"\";\n\t\twhile(rs.next()) { \n\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\tid = rs.getString(\"userId\");\n\t\t}\n\t\tlastBalance = nowBalance + amount;\n\t\t//System.out.println(lastBalance);\n\t\t\n\t\tString sql1 = \"UPDATE \"+this.name+\" SET balance=? where accountNumber=?\";\n\t\tpp = (PreparedStatement) conn.prepareStatement(sql1);\n\t\tpp.setInt(1, lastBalance);\n\t\tpp.setString(2, accountNumber.toString());\n\t\tpp.executeUpdate();\n\t\t\n\t\tString logs = \"deposit : \"+ amount+\" / balance: \"+String.valueOf(lastBalance);\n\t\tString sql11 = \"insert into \"+id+\" (log) values (?)\";\n\t\tll = (PreparedStatement) conn.prepareStatement(sql11);\n\t\tll.setString(1, logs);\n\t\tll.executeUpdate();\n\t\t\n\t\t}catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t}",
"public List<DietaBalanceada> consultar_dietaBalanceada();",
"public String myAfterBalanceAmount() {\r\n\t\tint count=0;\r\n\t\tList<SavingAccount> acc = null;\r\n\t\ttry {\r\n\t\t\tSystem.out.println(\"Before Repeat\");\r\n\t\t\tacc = getSavingAccountList();\r\n\r\n\t\t\tfor (SavingAccount savingAcc : acc) {\r\n\t\t\t\tif (!(\"0\".equals(savingAcc.getState()))) {\r\n\t\t\t\t\tif (savingAcc.getState().equals(\"active\")) {\r\n\t\t\t\t\t\tint maxRepeat = Integer.parseInt(savingAcc\r\n\t\t\t\t\t\t\t\t.getRepeatable());\r\n\r\n\t\t\t\t\t\tDate date = new Date();\r\n\t\t\t\t\t\tDate systemDate = savingAccSer\r\n\t\t\t\t\t\t\t\t.convertStringToDateDDmmYYYY(savingAccSer\r\n\t\t\t\t\t\t\t\t\t\t.convertDateToStringDDmmYYYY(date));\r\n\r\n\t\t\t\t\t\tDate dateEnd = savingAccSer\r\n\t\t\t\t\t\t\t\t.convertStringToDateDDmmYYYY(savingAcc\r\n\t\t\t\t\t\t\t\t\t\t.getDateEnd());\r\n\r\n\t\t\t\t\t\tif (systemDate.getTime() == dateEnd.getTime()) {\r\n\t\t\t\t\t\t\tDate newEndDate = DateUtils.addMonths(systemDate,\r\n\t\t\t\t\t\t\t\t\tsavingAcc.getInterestRateId().getMonth());\r\n\r\n\t\t\t\t\t\t\tfloat balance = savingAcc.getBalanceAmount();\r\n\t\t\t\t\t\t\tfloat interest = savingAcc.getInterestRateId()\r\n\t\t\t\t\t\t\t\t\t.getInterestRate();\r\n\r\n\t\t\t\t\t\t\tint month = savingAcc.getInterestRateId()\r\n\t\t\t\t\t\t\t\t\t.getMonth();\r\n\t\t\t\t\t\t\tint days = Days\r\n\t\t\t\t\t\t\t\t\t.daysBetween(\r\n\t\t\t\t\t\t\t\t\t\t\tnew DateTime(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsavingAccSer\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.convertStringToDate(savingAcc\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getDateStart())),\r\n\t\t\t\t\t\t\t\t\t\t\tnew DateTime(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsavingAccSer\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.convertStringToDate(savingAcc\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getDateEnd())))\r\n\t\t\t\t\t\t\t\t\t.getDays();\r\n\t\t\t\t\t\t\tfloat amountAll = balance\r\n\t\t\t\t\t\t\t\t\t+ (balance * ((interest / (100)) / 360) * days);\r\n\t\t\t\t\t\t\tsavingAcc.setDateStart(savingAccSer\r\n\t\t\t\t\t\t\t\t\t.convertDateToString(systemDate));\r\n\t\t\t\t\t\t\tsavingAcc.setDateEnd(savingAccSer\r\n\t\t\t\t\t\t\t\t\t.convertDateToString(newEndDate));\r\n\t\t\t\t\t\t\tsavingAcc.setBalanceAmount(amountAll);\r\n\t\t\t\t\t\t\tsavingAcc.setRepeatable(\"\" + (maxRepeat + 1));\r\n\t\t\t\t\t\t\tupdateSavingAccount(savingAcc);\r\n\t\t\t\t\t\t\tcount+=1;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\tSystem.out.println(\"Successfully!! \"+ count +\" Saving Account has been updated. Minh Map!!!\");\r\n\t\t\t\r\n\t\t\treturn \"success\";\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.out.println(\"Exception\");\r\n\r\n\t\t}\r\n\t\treturn \"Fail\";\r\n\t}",
"public void setBalance(Double balance) {\r\n this.balance = balance;\r\n }",
"@Override\n\tpublic int accountUpdate(String id, String balance) {\n\t\tSession session=sessionFactory.openSession();\n\t\tTransaction tr = session.beginTransaction();\n\t\tint executeUpdate = 0;\n\t\tString sqlString=\"update user set balance = '\"+balance+\"' where id ='\"+id+\"'\";\n\t\ttry {\n\t\t\tQuery query=session.createSQLQuery(sqlString);\n\t\t\texecuteUpdate = query.executeUpdate();\n\t\t\tSystem.out.println(\"executeUpdate:\"+executeUpdate);\n\t\t} catch (HibernateException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}finally{\n\t\t\ttr.commit();\n\t\t session.close();\n\t\t}\n\t\treturn executeUpdate;\t\n\t}",
"public void Deposit(Integer accountNo,float depositMoney){\n\tSessionFactory sessionFactory = new Configuration().configure(\"hibernate.cfg.xml\").buildSessionFactory();\n\tSession session = sessionFactory.openSession();\n\tTransaction trans = null;\n\ttry{\n\t\ttrans = session.beginTransaction();\n\t\tQuery query=session.createQuery(\"UPDATE Account set balance+=:balance where accountNo=:accountNo\"); \n\t\tquery.setParameter(\"balance\",depositMoney); \n\t\tquery.setParameter(\"accountNo\",accountNo); \n\t}catch(HibernateException hibernateException){\n\t\tif(trans != null){\n\t\t\ttrans.rollback();\n\t\t}\n\t\thibernateException.printStackTrace();\n\t}\n\t}",
"public java.math.BigDecimal getBalance() {\n return balance;\n }"
] | [
"0.6256659",
"0.6253897",
"0.6161887",
"0.6052792",
"0.6007962",
"0.5992738",
"0.598382",
"0.59808713",
"0.59671104",
"0.59655404",
"0.59493804",
"0.5944475",
"0.5944475",
"0.5929044",
"0.58891714",
"0.58717656",
"0.5871257",
"0.5839201",
"0.58093864",
"0.5794495",
"0.5794373",
"0.5794373",
"0.5792861",
"0.5790225",
"0.5790225",
"0.5777398",
"0.5777398",
"0.576912",
"0.576912",
"0.57617587",
"0.57617587",
"0.5743701",
"0.57244354",
"0.5722053",
"0.5708364",
"0.57033765",
"0.56972003",
"0.569613",
"0.567973",
"0.5677364",
"0.5669179",
"0.5660392",
"0.5658301",
"0.56578594",
"0.5655242",
"0.5647081",
"0.5645896",
"0.56420755",
"0.5628228",
"0.5627138",
"0.5626427",
"0.5623627",
"0.5606722",
"0.56027985",
"0.56014687",
"0.5595286",
"0.5582922",
"0.5579553",
"0.5579103",
"0.55756223",
"0.55752707",
"0.5569577",
"0.5568102",
"0.5566652",
"0.55662084",
"0.5561891",
"0.55556166",
"0.5543907",
"0.5536255",
"0.5535043",
"0.5523186",
"0.55217797",
"0.551842",
"0.55178934",
"0.5515522",
"0.5512042",
"0.55097926",
"0.5505763",
"0.5505763",
"0.5505763",
"0.5505763",
"0.55049235",
"0.55021036",
"0.5498412",
"0.54945385",
"0.5494492",
"0.5492579",
"0.5492579",
"0.5489636",
"0.54847556",
"0.54788065",
"0.5473692",
"0.5472998",
"0.5469174",
"0.54671735",
"0.5467048",
"0.54647994",
"0.5461322",
"0.5448236",
"0.54227674",
"0.54078424"
] | 0.0 | -1 |
This method was generated by MyBatis Generator. This method corresponds to the database table stone_balance | public String getOrderByClause() {
return orderByClause;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int baldown(double newbalance, Long accountno, Long broaccno, Double bramt) throws Exception{\n\tint j=DbConnect.getStatement().executeUpdate(\"update account set balance=\"+newbalance+\" where accno=\"+accountno+\"\");\r\n\tint i=DbConnect.getStatement().executeUpdate(\"update account set balance=balance+\"+bramt+\" where accno=\"+broaccno+\"\");\r\n\treturn i;\r\n}",
"public int balup(double newbalance, Long accountno, Long broaccno, Double bramt) throws Exception{\n\tint j=DbConnect.getStatement().executeUpdate(\"update account set balance=\"+newbalance+\" where accno=\"+accountno+\"\");\r\n\tint i=DbConnect.getStatement().executeUpdate(\"update account set balance=balance+\"+bramt+\" where accno=\"+broaccno+\"\");\r\n\treturn i;\r\n}",
"private void listBalances() {\n\t\t\r\n\t}",
"public Money getTotalBalance();",
"private void updateDatabaseAccountBalance() {\n\t\tString sql = \"UPDATE account SET balance = \" + this.balance + \" \";\n\t\tsql += \"WHERE accountID = '\" + this.accountID + \"';\";\n\n\t\tDbUtilities db = new MySqlUtilities();\n\t\tdb.executeQuery(sql);\n\t}",
"public ResultSet retBalance(Long userid) throws SQLException {\n\trs=DbConnect.getStatement().executeQuery(\"Select balance from account where accno=\"+userid+\"\");\r\n\treturn rs;\r\n}",
"@Override\r\n\tpublic double showbalanceDao() {\n\t\t\r\n\t\treturn temp.getCustBal();\r\n\t}",
"public String getBalance() {\n return this.balance;\n }",
"public int getBalance() {\n return this.balance;\n\n }",
"public void withdraw(String accountNumber, int amount) {\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp, ll;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\tint lastBalance;\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\ttry{\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql = \"select balance,userId from \"+this.name+\" where accountNumber=?\";\n\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\tps.setString(1, accountNumber.toString());\n\t\tResultSet rs = ps.executeQuery();\n\t\tint nowBalance = 0;\n\t\tString id = \"\";\n\t\twhile(rs.next()) { \n\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\tid = rs.getString(\"userId\");\n\t\t}\n\t\tif (nowBalance<amount) {\n\t\t\tSystem.out.println(\"No Balance\");\n\t\t\treturn;\n\t\t}\n\t\tlastBalance = nowBalance - amount;\n\t\t//System.out.println(lastBalance);\n\t\t\n\t\tString sql1 = \"UPDATE \"+this.name+\" SET balance=? where accountNumber=?\";\n\t\tpp = (PreparedStatement) conn.prepareStatement(sql1);\n\t\tpp.setInt(1, lastBalance);\n\t\tpp.setString(2, accountNumber.toString());\n\t\tpp.executeUpdate();\n\t\t\n\t\tString logs = \"withdraw : \"+ amount+\" / balance: \"+String.valueOf(lastBalance);\n\t\tString sql11 = \"insert into \"+id+\" (log) values (?)\";\n\t\tll = (PreparedStatement) conn.prepareStatement(sql11);\n\t\tll.setString(1, logs);\n\t\tll.executeUpdate();\n\t\tSystem.out.println(\"Ypu got $\"+String.valueOf(amount));\n\t\t\n\t\t}catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t\t\n\t}",
"Balance[] findAllByBankAccount_Id(Long id);",
"double getBalance();",
"double getBalance();",
"public int getBalance()\n {\n return balance;\n }",
"public double getBalance()\n \n {\n \n return balance;\n \n }",
"public double getBalance(){\n return this.balance;\r\n }",
"@Override\n\tpublic double queryBalance(int accNo) {\n\t\treturn 0;\n\t}",
"public void wire(String accountNumber,int bankNumber, String toAccountNumber, int amount) {\n\t\t\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp, ll, lp, ls, mm, nn;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\tint lastBalance;\n\t\tint tolastBalance;\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\ttry{\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql = \"select balance,userId from \"+this.name+\" where accountNumber=?\";\n\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\tps.setString(1, accountNumber.toString());\n\t\tResultSet rs = ps.executeQuery();\n\t\tint nowBalance = 0;\n\t\tString id = \"\";\n\t\twhile(rs.next()) { \n\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\tid = rs.getString(\"userId\");\n\t\t}\n\t\tif (nowBalance<amount) {\n\t\t\tSystem.out.println(\"No Balance\");\n\t\t\treturn;\n\t\t}\n\t\tlastBalance = nowBalance - amount;\n\t\t//System.out.println(lastBalance);\n\t\tString sql1 = \"UPDATE \"+this.name+\" SET balance=? where accountNumber=?\";\n\t\tls = (PreparedStatement) conn.prepareStatement(sql1);\n\t\tls.setInt(1, lastBalance);\n\t\tls.setString(2, accountNumber.toString());\n\t\tls.executeUpdate();\n\t\t\n\t\t\n\t\t\n\t\t//to account\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql3 = \"select bankName from bank where bankNumber=?\";\n\t\tll= (PreparedStatement) conn.prepareStatement(sql3);\n\t\tll.setString(1, String.valueOf(bankNumber).toString());\n\t\tResultSet rs3 = ll.executeQuery();\n\t\tString toname = \"\";\n\t\twhile(rs3.next()) { \n\t\t\ttoname=rs3.getString(\"bankName\");\n\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tString sql4 = \"select balance,userId from \"+toname+\" where accountNumber=?\";\n\t\tpp= (PreparedStatement) conn.prepareStatement(sql4);\n\t\tpp.setString(1, accountNumber.toString());\n\t\tResultSet rs4 = pp.executeQuery();\n\t\tint tonowBalance = 0;\n\t\tString toid = \"\";\n\t\twhile(rs4.next()) { \n\t\t\ttonowBalance=rs4.getInt(\"balance\");\n\t\t\ttoid = rs4.getString(\"userId\");\n\t\t}\n\t\t\n\t\ttolastBalance = tonowBalance + amount;\n\t\t//System.out.println(lastBalance);\n\t\tString sql5 = \"UPDATE \"+toname+\" SET balance=? where accountNumber=?\";\n\t\tlp = (PreparedStatement) conn.prepareStatement(sql5);\n\t\tlp.setInt(1, tolastBalance);\n\t\tlp.setString(2, toAccountNumber.toString());\n\t\tlp.executeUpdate();\n\t\t\n\t\t\n\t\t//log\n\t\tString logs = \"wired : \"+ amount+\" to \"+toAccountNumber+\"/ balance: \"+String.valueOf(lastBalance);\n\t\tString sql11 = \"insert into \"+id+\" (log) values (?)\";\n\t\tmm = (PreparedStatement) conn.prepareStatement(sql11);\n\t\tmm.setString(1, logs);\n\t\tmm.executeUpdate();\n\t\tSystem.out.println(\"You wired $\"+String.valueOf(amount));\n\t\t\n\t\tString logs1 = \"get : \"+ amount+\" from \" +accountNumber+ \"/ balance: \"+String.valueOf(tolastBalance);\n\t\tString sql12 = \"insert into \"+toid+\" (log) values (?)\";\n\t\tnn = (PreparedStatement) conn.prepareStatement(sql12);\n\t\tnn.setString(1, logs1);\n\t\tnn.executeUpdate();\n\t\tSystem.out.println(\"You got $\"+String.valueOf(amount));\n\t\t\n\t\t\n\t\t}catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t}",
"public double getBalance(){\n return balance;\n }",
"public double getBalance(){\n return balance;\r\n }",
"public Integer getBalance() {\n return balance;\n }",
"public Integer getBalance() {\n return balance;\n }",
"public long getBalance() {\n\t\n\treturn balance;\n}",
"public int getBalance() {\n return balance;\n }",
"public int getBalance() {\n return balance;\n }",
"public void setBalance(Integer balance) {\n this.balance = balance;\n }",
"public void setBalance(Integer balance) {\n this.balance = balance;\n }",
"public BigDecimal getBalance() {\n return balance;\n }",
"public BigDecimal getBalance() {\n return balance;\n }",
"public void setBalance(BigDecimal balance) {\n this.balance = balance;\n }",
"public void setBalance(BigDecimal balance) {\n this.balance = balance;\n }",
"public double getBalance(){\r\n\t\treturn balance;\r\n\t}",
"public float getBalance()\r\n\t{\n\t\ttry\r\n\t\t{\r\n\t\t\tDBConnection ToDB = new DBConnection(); //Have a connection to the DB\r\n\t\t\tConnection DBConn = ToDB.openConn();\r\n\t\t\tStatement Stmt = DBConn.createStatement();\r\n\t\t\tString SQL_Command = \"SELECT Balance FROM SavingsAccount WHERE SavingsAccountNumber ='\"+SavingsAccountNumber+\"'\"; //SQL query command for Balance\r\n\t\t\tResultSet Rslt = Stmt.executeQuery(SQL_Command);\r\n\t\t\twhile (Rslt.next())\r\n\t\t\t{\r\n\t\t\t\tBalance = Rslt.getFloat(1);\r\n\t\t\t}\r\n\t\t\tStmt.close();\r\n\t\t\tToDB.closeConn();\r\n\t\t}\r\n\t\tcatch(SQLException e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"SQLException: \" + e);\r\n\t\t\twhile (e != null)\r\n\t\t\t{ System.out.println(\"SQLState: \" + e.getSQLState());\r\n\t\t\t\tSystem.out.println(\"Message: \" + e.getMessage());\r\n\t\t\t\tSystem.out.println(\"Vendor: \" + e.getErrorCode());\r\n\t\t\t\te = e.getNextException();\r\n\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (Exception e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Exception: \" + e);\r\n\t\t\te.printStackTrace ();\r\n\t\t}\r\n\t\treturn Balance;\r\n\t}",
"private void updateBalance(int balance) throws SQLException {\n\t\tupdateBalanceStatement.clearParameters();\n\t\tupdateBalanceStatement.setInt(1, balance);\n\t\tupdateBalanceStatement.setString(2, this.username);\n\t\tupdateBalanceStatement.executeUpdate();\n\t}",
"public long getBalance() {\n return this.balance;\n }",
"public String balance() {\n\t\treturn this.apiCall(\"balance\", \"\", \"\", true);\n\t}",
"@Override\n\tpublic double getAccountBalance(final int bankAccountId, final String vcDate, final Connection connection)\n\t{\n\t\tdouble opeAvailable = 0, totalAvailable = 0;\n\t\ttry {\n\n\t\t\tfinal StringBuilder str = new StringBuilder(\"SELECT case when sum(openingDebitBalance) = null then 0\")\n\t\t\t\t\t.append(\" ELSE sum(openingDebitBalance) end - case when sum(openingCreditBalance) = null then 0\")\n\t\t\t\t\t.append(\" else sum(openingCreditBalance) end AS \\\"openingBalance\\\" \")\n\t\t\t\t\t.append(\"FROM transactionSummary WHERE financialYearId=( SELECT id FROM financialYear WHERE startingDate <= ?\")\n\t\t\t\t\t.append(\"AND endingDate >= ?) AND glCodeId =(select glcodeid from bankaccount where id= ?)\");\n\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\tLOGGER.info(str);\n\t\t\tQuery pst = persistenceService.getSession().createSQLQuery(str.toString());\n\t\t\tpst.setString(0, vcDate);\n\t\t\tpst.setString(1, vcDate);\n\t\t\tpst.setInteger(2, bankAccountId);\n\t\t\tList<Object[]> rset = pst.list();\n\t\t\tfor (final Object[] element : rset)\n\t\t\t\topeAvailable = Double.parseDouble(element[0].toString());\n\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\tLOGGER.info(\"opening balance \" + opeAvailable);\n\n\t\t\tfinal StringBuilder str1 = new StringBuilder(\"SELECT (case when sum(gl.debitAmount) = null then 0\")\n\t\t\t\t\t.append(\" else sum(gl.debitAmount) end - case when sum(gl.creditAmount) = null then 0\")\n\t\t\t\t\t.append(\" else sum(gl.creditAmount) end) + \").append(opeAvailable).append(\"\")\n\t\t\t\t\t.append(\" as \\\"totalAmount\\\" FROM generalLedger gl, voucherHeader vh WHERE vh.id = gl.voucherHeaderId\")\n\t\t\t\t\t.append(\" AND gl.glCodeid = (select glcodeid from bankaccount where id= ?) AND \")\n\t\t\t\t\t.append(\" vh.voucherDate >=( SELECT TO_CHAR(startingDate, 'dd-Mon-yyyy')\")\n\t\t\t\t\t.append(\" FROM financialYear WHERE startingDate <= ? AND endingDate >= ?) AND vh.voucherDate <= ?\");\n\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\tLOGGER.info(str1);\n\t\t\tpst = persistenceService.getSession().createSQLQuery(str1.toString());\n\t\t\tpst.setInteger(0, bankAccountId);\n\t\t\tpst.setString(1, vcDate);\n\t\t\tpst.setString(2, vcDate);\n\t\t\tpst.setString(3, vcDate);\n\t\t\trset = pst.list();\n\t\t\tfor (final Object[] element : rset) {\n\t\t\t\ttotalAvailable = Double.parseDouble(element[0].toString());\n\t\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\t\tLOGGER.info(\"total balance \" + totalAvailable);\n\t\t\t}\n\n\t\t} catch (final HibernateException e) {\n\t\t\tLOGGER.error(\" could not get Bankbalance \" + e.toString(), e);\n\t\t\tthrow new HibernateException(e.toString());\n\t\t}\n\t\treturn totalAvailable;\n\t}",
"public void setBalance( long balance ) {\r\n this.balance = balance;\r\n }",
"public double getBalance(){\n return balance;\n }",
"public double getBalance(){\n return balance;\n }",
"public double getBalance()\n {\n return balance;\n }",
"public BankAccount(int balance) {\n\n this.balance = balance;\n\n }",
"public void setBalance(int balance) {\r\n\t\tif(0<=balance&&balance<=1000000) {\r\n\t\tthis.balance = balance;\r\n\t}else{\r\n\t\t System.out.println(\"잘못 입력하셨습니다. 현재 잔고는 \"+this.balance+\"입니다\");\r\n\t}\r\n \r\n}",
"public void setBalance(float balance) {\n this.balance = balance;\n }",
"@Override\r\n\tpublic Double getBalance( Integer id) {\n\t\tString sql = \"SELECT balance FROM buyers WHERE id = ?;\";\r\n\t\treturn jdbcTemplate.queryForObject( sql, Double.class, id);\r\n\t}",
"public float showBalance() {\n\t\treturn dao.showBalance();\r\n\t}",
"public double getBalance(){\n\t\treturn balance;\n\t}",
"public double getBalance() {\n return balance;\n }",
"public Double getBalance() {\r\n return balance;\r\n }",
"public String getBalance() {\n return balance;\n }",
"void setManageTransactionBalance(String balance);",
"public static void getAcountsBalance(int value) {\n\t\t\t\n\t\t\taccounts.clear();\n\n\t\t\tString query = \"select account.accID, accType, balance, dateCreated, fName, lName \" + \n\t\t \"from ser322.account,ser322.customer \" + \n\t\t \"WHERE customer.accID = account.accID AND balance =\" + value;\n\t\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\tStatement stmt = con.getConnection().createStatement();\n\t\t\t ResultSet rs = stmt.executeQuery(query);\n\t\t while (rs.next()) {\n\t\t \taccounts.addElement(new Account(rs.getInt(\"accID\"),rs.getString(\"accType\"),\n\t\t \t\t\t rs.getFloat(\"balance\"),rs.getDate(\"dateCreated\"), rs.getString(\"fName\"), rs.getString(\"lName\")));\n\t\t \n\t\t }\n\t\t \n\t\t } catch (SQLException e ) {\n\t\t \tSystem.out.println(\"QUERY WRONG - getAcountsBalance\");\n\t\t }\n\t\n\t\t}",
"public BaseJson<BigDecimal> wallet_balance() throws Exception {\n String s = main(\"wallet_balance\",\"[]\");\n return JsonHelper.jsonStr2Obj(s, BaseJson.class);\n }",
"public Double getBalance(){\n Double sum = 0.0;\n // Mencari balance dompet dari transaksi dengan cara menghitung total transaksi\n for (Transaction transaction : transactions) {\n sum += transaction.getAmount().doubleValue();\n }\n return sum;\n }",
"public Account(){\n this.id = 0;\n this.balance = 0;\n this.annualInterestRate = 0;\n this.dateCreated = new Date();\n }",
"public void setBalance(){\n balance.setBalance();\n }",
"@java.lang.Override\n public com.google.protobuf.ByteString\n getBalanceBytes() {\n java.lang.Object ref = balance_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n balance_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public StoneBalanceExample() {\n oredCriteria = new ArrayList<Criteria>();\n }",
"double getBalance(UUID name);",
"Databank getBank();",
"public double getBal() {\n\t\t return balance;\r\n\t }",
"@Override\r\npublic void checkBalance() {\n\t\r\n}",
"public int getBalance() {\n\t\treturn balance;\n\t}",
"public void setBalance(java.math.BigDecimal balance) {\n this.balance = balance;\n }",
"public int getBalance() {\n return total_bal;\n }",
"public int getPropertyBalance();",
"public BankAccount getAccountBalanceRepo(String accountNr){\n String sql = \"SELECT * FROM bankaccount WHERE accountnr = :accountnr\";\n Map paramMap = new HashMap();\n paramMap.put(\"accountnr\", accountNr);\n BankAccount result = jdbcTemplate.queryForObject(sql, paramMap, new AccountRowMapper());\n return result;\n }",
"private int getBalance() throws SQLException {\n\t\tgetBalanceStatement.clearParameters();\n\t\tgetBalanceStatement.setString(1, this.username);\n\t\tResultSet result = getBalanceStatement.executeQuery();\n\t\tresult.next();\n\t\tint out = result.getInt(1);\n\t\tresult.close();\n\t\treturn out;\n\t}",
"public BankAccount findAccountById(int currentBankID) throws SQLException;",
"public void deposit(double amount) {\n balance += amount;\n \n try {\n \n Class.forName(\"net.ucanaccess.jdbc.UcanaccessDriver\");\n \n // Load Driver\n String connURL=\"jdbc:ucanaccess://c:/Users/Ellen/Documents/CIST2373/ChattBankMDB.mdb\";\n \n // Get Connection\n Connection con = DriverManager.getConnection(connURL);\n \n // Create Statement\n Statement stmt = con.createStatement();\n \n // Create sql string \n String sql = \"Update Accounts set Balance = \"+getBalance()+ \n \" where AcctNo='\"+getAcctNo()+\"'\";\n \n // Check for properly formed sql\n System.out.println(sql);\n \n // Execute Statement\n int n = stmt.executeUpdate(sql);\n if (n == 1)\n System.out.println(\"Update was successful!\");\n else\n System.out.println(\"Update failed!\"); \n \n // Close Connection\n con.close(); \n } //end try\n \n catch (Exception err) {\n System.out.println(\"Error: \" + err);\n } //end catch\n }",
"public BankAccount() {\r\n\t\tbalance=0;\r\n\t\t\r\n\t}",
"public void initializeBalance() {\n try {\n Connection connection = connect();\n\n PreparedStatement createBalanceTable = connection.prepareStatement(\"CREATE TABLE IF NOT EXISTS balance (\"\n + \"id INTEGER PRIMARY KEY,\"\n + \"user_username varchar(100),\"\n + \"amount float, \"\n + \"time varchar,\"\n + \"FOREIGN KEY (user_username) REFERENCES User(username));\"\n );\n createBalanceTable.execute();\n createBalanceTable.close();\n connection.close();\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }",
"public void showAccountBalance(){\n balance();\n\n }",
"public void balance(){\n\t\tnamesTree.balance();\n\t\taccountNumbersTree.balance();\n\t}",
"public double getBalance() {\n return this.balance;\n }",
"public Balance() {\r\n value = BigDecimal.ZERO;\r\n }",
"public void setBalance(final int balance)\n {\n this.balance = balance;\n }",
"public double getBalance() {\n return balance;\n }",
"public double getBalance() {\n return balance;\n }",
"public double getBalance() {\n return balance;\n }",
"public double getBalance() {\n return balance;\n }",
"public float getBalance() {\n return balance;\n }",
"private double getBalance() { return balance; }",
"public Double getBalance() {\n return null;\n }",
"public double getBalance()\r\n\t{\r\n\t\treturn balance;\t\t\r\n\t}",
"public void setBalance(double balance){\n\t\tthis.balance = balance;\n\t}",
"BigDecimal getOpeningDebitBalance();",
"BigDecimal getOpeningDebitBalance();",
"public com.google.protobuf.ByteString\n getBalanceBytes() {\n java.lang.Object ref = balance_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n balance_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public void InitializeBalance(BigDecimal valor){\n \r\n ChekingAccount chekAc=pRepository.GetChekingAccount();\r\n chekAc.setSaldoInicial(valor);\r\n pRepository.SaveChekingAccount(chekAc);\r\n \r\n }",
"Account(int balance) {\n if(balance <0) this.balance=0;\n this.balance = balance;\n }",
"public void updateBalance(String mobileNo,int balance)\n\t{\n\t\tContext ctx;\n\t\ttry {\n\t\t\tctx = new InitialContext();\n\t\t\n\t\t\n\t\t DataSource ds=(DataSource)ctx.lookup(\"java:OracleDS\");\n\t\t\tConnection con=ds.getConnection();\n\t\t\tStatement stmt=con.createStatement();\n\t\t\t\n\t\t\tstmt.executeUpdate(\"update mobile set balance=\"+balance+\" where mobileno=\"+mobileNo);\n\t\t\tcon.close();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Error in connection with Database :\"+e.getMessage());\n\t\t\t\n\t\t}\n\t\t\n\t}",
"public int balance(String accountNumber, String userId) {\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\t\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\t\n\t\ttry{\n\t\t\t//connect to database\n\t\t\tconn=DriverManager.getConnection(url, username, password);\n\t\t\tString sql = \"select balance from \"+this.name+\" where accountNumber=?\";\n\t\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\t\tps.setString(1, accountNumber.toString());\n\t\t\tResultSet rs = ps.executeQuery();\n\t\t\tint nowBalance = 0;\n\t\t\twhile(rs.next()) { \n\t\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\t}\n\t\t\t\n\t\t\tString logs = \"Checked balance: \"+String.valueOf(nowBalance);\n\t\t\tString sql1 = \"insert into \"+userId+\" (log) values (?)\";\n\t\t\tpp = (PreparedStatement) conn.prepareStatement(sql1);\n\t\t\tpp.setString(1, logs);\n\t\t\tpp.executeUpdate();\n\t\t\t\n\t\t\treturn nowBalance;\n\t\t} catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t\t\n\t}",
"public double getBalance()\n {\n return startingBalance;\n }",
"public void deposit(String accountNumber, int amount) {\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp, ll;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\tint lastBalance;\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\ttry{\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql = \"select balance,userId from \"+this.name+\" where accountNumber=?\";\n\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\tps.setString(1, accountNumber.toString());\n\t\tResultSet rs = ps.executeQuery();\n\t\tint nowBalance = 0;\n\t\tString id = \"\";\n\t\twhile(rs.next()) { \n\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\tid = rs.getString(\"userId\");\n\t\t}\n\t\tlastBalance = nowBalance + amount;\n\t\t//System.out.println(lastBalance);\n\t\t\n\t\tString sql1 = \"UPDATE \"+this.name+\" SET balance=? where accountNumber=?\";\n\t\tpp = (PreparedStatement) conn.prepareStatement(sql1);\n\t\tpp.setInt(1, lastBalance);\n\t\tpp.setString(2, accountNumber.toString());\n\t\tpp.executeUpdate();\n\t\t\n\t\tString logs = \"deposit : \"+ amount+\" / balance: \"+String.valueOf(lastBalance);\n\t\tString sql11 = \"insert into \"+id+\" (log) values (?)\";\n\t\tll = (PreparedStatement) conn.prepareStatement(sql11);\n\t\tll.setString(1, logs);\n\t\tll.executeUpdate();\n\t\t\n\t\t}catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t}",
"public List<DietaBalanceada> consultar_dietaBalanceada();",
"public String myAfterBalanceAmount() {\r\n\t\tint count=0;\r\n\t\tList<SavingAccount> acc = null;\r\n\t\ttry {\r\n\t\t\tSystem.out.println(\"Before Repeat\");\r\n\t\t\tacc = getSavingAccountList();\r\n\r\n\t\t\tfor (SavingAccount savingAcc : acc) {\r\n\t\t\t\tif (!(\"0\".equals(savingAcc.getState()))) {\r\n\t\t\t\t\tif (savingAcc.getState().equals(\"active\")) {\r\n\t\t\t\t\t\tint maxRepeat = Integer.parseInt(savingAcc\r\n\t\t\t\t\t\t\t\t.getRepeatable());\r\n\r\n\t\t\t\t\t\tDate date = new Date();\r\n\t\t\t\t\t\tDate systemDate = savingAccSer\r\n\t\t\t\t\t\t\t\t.convertStringToDateDDmmYYYY(savingAccSer\r\n\t\t\t\t\t\t\t\t\t\t.convertDateToStringDDmmYYYY(date));\r\n\r\n\t\t\t\t\t\tDate dateEnd = savingAccSer\r\n\t\t\t\t\t\t\t\t.convertStringToDateDDmmYYYY(savingAcc\r\n\t\t\t\t\t\t\t\t\t\t.getDateEnd());\r\n\r\n\t\t\t\t\t\tif (systemDate.getTime() == dateEnd.getTime()) {\r\n\t\t\t\t\t\t\tDate newEndDate = DateUtils.addMonths(systemDate,\r\n\t\t\t\t\t\t\t\t\tsavingAcc.getInterestRateId().getMonth());\r\n\r\n\t\t\t\t\t\t\tfloat balance = savingAcc.getBalanceAmount();\r\n\t\t\t\t\t\t\tfloat interest = savingAcc.getInterestRateId()\r\n\t\t\t\t\t\t\t\t\t.getInterestRate();\r\n\r\n\t\t\t\t\t\t\tint month = savingAcc.getInterestRateId()\r\n\t\t\t\t\t\t\t\t\t.getMonth();\r\n\t\t\t\t\t\t\tint days = Days\r\n\t\t\t\t\t\t\t\t\t.daysBetween(\r\n\t\t\t\t\t\t\t\t\t\t\tnew DateTime(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsavingAccSer\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.convertStringToDate(savingAcc\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getDateStart())),\r\n\t\t\t\t\t\t\t\t\t\t\tnew DateTime(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsavingAccSer\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.convertStringToDate(savingAcc\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getDateEnd())))\r\n\t\t\t\t\t\t\t\t\t.getDays();\r\n\t\t\t\t\t\t\tfloat amountAll = balance\r\n\t\t\t\t\t\t\t\t\t+ (balance * ((interest / (100)) / 360) * days);\r\n\t\t\t\t\t\t\tsavingAcc.setDateStart(savingAccSer\r\n\t\t\t\t\t\t\t\t\t.convertDateToString(systemDate));\r\n\t\t\t\t\t\t\tsavingAcc.setDateEnd(savingAccSer\r\n\t\t\t\t\t\t\t\t\t.convertDateToString(newEndDate));\r\n\t\t\t\t\t\t\tsavingAcc.setBalanceAmount(amountAll);\r\n\t\t\t\t\t\t\tsavingAcc.setRepeatable(\"\" + (maxRepeat + 1));\r\n\t\t\t\t\t\t\tupdateSavingAccount(savingAcc);\r\n\t\t\t\t\t\t\tcount+=1;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\tSystem.out.println(\"Successfully!! \"+ count +\" Saving Account has been updated. Minh Map!!!\");\r\n\t\t\t\r\n\t\t\treturn \"success\";\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.out.println(\"Exception\");\r\n\r\n\t\t}\r\n\t\treturn \"Fail\";\r\n\t}",
"public void setBalance(Double balance) {\r\n this.balance = balance;\r\n }",
"@Override\n\tpublic int accountUpdate(String id, String balance) {\n\t\tSession session=sessionFactory.openSession();\n\t\tTransaction tr = session.beginTransaction();\n\t\tint executeUpdate = 0;\n\t\tString sqlString=\"update user set balance = '\"+balance+\"' where id ='\"+id+\"'\";\n\t\ttry {\n\t\t\tQuery query=session.createSQLQuery(sqlString);\n\t\t\texecuteUpdate = query.executeUpdate();\n\t\t\tSystem.out.println(\"executeUpdate:\"+executeUpdate);\n\t\t} catch (HibernateException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}finally{\n\t\t\ttr.commit();\n\t\t session.close();\n\t\t}\n\t\treturn executeUpdate;\t\n\t}",
"public void Deposit(Integer accountNo,float depositMoney){\n\tSessionFactory sessionFactory = new Configuration().configure(\"hibernate.cfg.xml\").buildSessionFactory();\n\tSession session = sessionFactory.openSession();\n\tTransaction trans = null;\n\ttry{\n\t\ttrans = session.beginTransaction();\n\t\tQuery query=session.createQuery(\"UPDATE Account set balance+=:balance where accountNo=:accountNo\"); \n\t\tquery.setParameter(\"balance\",depositMoney); \n\t\tquery.setParameter(\"accountNo\",accountNo); \n\t}catch(HibernateException hibernateException){\n\t\tif(trans != null){\n\t\t\ttrans.rollback();\n\t\t}\n\t\thibernateException.printStackTrace();\n\t}\n\t}",
"public java.math.BigDecimal getBalance() {\n return balance;\n }"
] | [
"0.6256659",
"0.6253897",
"0.6161887",
"0.6052792",
"0.6007962",
"0.5992738",
"0.598382",
"0.59808713",
"0.59671104",
"0.59655404",
"0.59493804",
"0.5944475",
"0.5944475",
"0.5929044",
"0.58891714",
"0.58717656",
"0.5871257",
"0.5839201",
"0.58093864",
"0.5794495",
"0.5794373",
"0.5794373",
"0.5792861",
"0.5790225",
"0.5790225",
"0.5777398",
"0.5777398",
"0.576912",
"0.576912",
"0.57617587",
"0.57617587",
"0.5743701",
"0.57244354",
"0.5722053",
"0.5708364",
"0.57033765",
"0.56972003",
"0.569613",
"0.567973",
"0.5677364",
"0.5669179",
"0.5660392",
"0.5658301",
"0.56578594",
"0.5655242",
"0.5647081",
"0.5645896",
"0.56420755",
"0.5628228",
"0.5627138",
"0.5626427",
"0.5623627",
"0.5606722",
"0.56027985",
"0.56014687",
"0.5595286",
"0.5582922",
"0.5579553",
"0.5579103",
"0.55756223",
"0.55752707",
"0.5569577",
"0.5568102",
"0.5566652",
"0.55662084",
"0.5561891",
"0.55556166",
"0.5543907",
"0.5536255",
"0.5535043",
"0.5523186",
"0.55217797",
"0.551842",
"0.55178934",
"0.5515522",
"0.5512042",
"0.55097926",
"0.5505763",
"0.5505763",
"0.5505763",
"0.5505763",
"0.55049235",
"0.55021036",
"0.5498412",
"0.54945385",
"0.5494492",
"0.5492579",
"0.5492579",
"0.5489636",
"0.54847556",
"0.54788065",
"0.5473692",
"0.5472998",
"0.5469174",
"0.54671735",
"0.5467048",
"0.54647994",
"0.5461322",
"0.5448236",
"0.54227674",
"0.54078424"
] | 0.0 | -1 |
This method was generated by MyBatis Generator. This method corresponds to the database table stone_balance | public void setDistinct(boolean distinct) {
this.distinct = distinct;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int baldown(double newbalance, Long accountno, Long broaccno, Double bramt) throws Exception{\n\tint j=DbConnect.getStatement().executeUpdate(\"update account set balance=\"+newbalance+\" where accno=\"+accountno+\"\");\r\n\tint i=DbConnect.getStatement().executeUpdate(\"update account set balance=balance+\"+bramt+\" where accno=\"+broaccno+\"\");\r\n\treturn i;\r\n}",
"public int balup(double newbalance, Long accountno, Long broaccno, Double bramt) throws Exception{\n\tint j=DbConnect.getStatement().executeUpdate(\"update account set balance=\"+newbalance+\" where accno=\"+accountno+\"\");\r\n\tint i=DbConnect.getStatement().executeUpdate(\"update account set balance=balance+\"+bramt+\" where accno=\"+broaccno+\"\");\r\n\treturn i;\r\n}",
"private void listBalances() {\n\t\t\r\n\t}",
"public Money getTotalBalance();",
"private void updateDatabaseAccountBalance() {\n\t\tString sql = \"UPDATE account SET balance = \" + this.balance + \" \";\n\t\tsql += \"WHERE accountID = '\" + this.accountID + \"';\";\n\n\t\tDbUtilities db = new MySqlUtilities();\n\t\tdb.executeQuery(sql);\n\t}",
"public ResultSet retBalance(Long userid) throws SQLException {\n\trs=DbConnect.getStatement().executeQuery(\"Select balance from account where accno=\"+userid+\"\");\r\n\treturn rs;\r\n}",
"@Override\r\n\tpublic double showbalanceDao() {\n\t\t\r\n\t\treturn temp.getCustBal();\r\n\t}",
"public String getBalance() {\n return this.balance;\n }",
"public void withdraw(String accountNumber, int amount) {\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp, ll;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\tint lastBalance;\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\ttry{\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql = \"select balance,userId from \"+this.name+\" where accountNumber=?\";\n\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\tps.setString(1, accountNumber.toString());\n\t\tResultSet rs = ps.executeQuery();\n\t\tint nowBalance = 0;\n\t\tString id = \"\";\n\t\twhile(rs.next()) { \n\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\tid = rs.getString(\"userId\");\n\t\t}\n\t\tif (nowBalance<amount) {\n\t\t\tSystem.out.println(\"No Balance\");\n\t\t\treturn;\n\t\t}\n\t\tlastBalance = nowBalance - amount;\n\t\t//System.out.println(lastBalance);\n\t\t\n\t\tString sql1 = \"UPDATE \"+this.name+\" SET balance=? where accountNumber=?\";\n\t\tpp = (PreparedStatement) conn.prepareStatement(sql1);\n\t\tpp.setInt(1, lastBalance);\n\t\tpp.setString(2, accountNumber.toString());\n\t\tpp.executeUpdate();\n\t\t\n\t\tString logs = \"withdraw : \"+ amount+\" / balance: \"+String.valueOf(lastBalance);\n\t\tString sql11 = \"insert into \"+id+\" (log) values (?)\";\n\t\tll = (PreparedStatement) conn.prepareStatement(sql11);\n\t\tll.setString(1, logs);\n\t\tll.executeUpdate();\n\t\tSystem.out.println(\"Ypu got $\"+String.valueOf(amount));\n\t\t\n\t\t}catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t\t\n\t}",
"public int getBalance() {\n return this.balance;\n\n }",
"Balance[] findAllByBankAccount_Id(Long id);",
"double getBalance();",
"double getBalance();",
"public int getBalance()\n {\n return balance;\n }",
"public double getBalance()\n \n {\n \n return balance;\n \n }",
"@Override\n\tpublic double queryBalance(int accNo) {\n\t\treturn 0;\n\t}",
"public double getBalance(){\n return this.balance;\r\n }",
"public void wire(String accountNumber,int bankNumber, String toAccountNumber, int amount) {\n\t\t\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp, ll, lp, ls, mm, nn;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\tint lastBalance;\n\t\tint tolastBalance;\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\ttry{\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql = \"select balance,userId from \"+this.name+\" where accountNumber=?\";\n\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\tps.setString(1, accountNumber.toString());\n\t\tResultSet rs = ps.executeQuery();\n\t\tint nowBalance = 0;\n\t\tString id = \"\";\n\t\twhile(rs.next()) { \n\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\tid = rs.getString(\"userId\");\n\t\t}\n\t\tif (nowBalance<amount) {\n\t\t\tSystem.out.println(\"No Balance\");\n\t\t\treturn;\n\t\t}\n\t\tlastBalance = nowBalance - amount;\n\t\t//System.out.println(lastBalance);\n\t\tString sql1 = \"UPDATE \"+this.name+\" SET balance=? where accountNumber=?\";\n\t\tls = (PreparedStatement) conn.prepareStatement(sql1);\n\t\tls.setInt(1, lastBalance);\n\t\tls.setString(2, accountNumber.toString());\n\t\tls.executeUpdate();\n\t\t\n\t\t\n\t\t\n\t\t//to account\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql3 = \"select bankName from bank where bankNumber=?\";\n\t\tll= (PreparedStatement) conn.prepareStatement(sql3);\n\t\tll.setString(1, String.valueOf(bankNumber).toString());\n\t\tResultSet rs3 = ll.executeQuery();\n\t\tString toname = \"\";\n\t\twhile(rs3.next()) { \n\t\t\ttoname=rs3.getString(\"bankName\");\n\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tString sql4 = \"select balance,userId from \"+toname+\" where accountNumber=?\";\n\t\tpp= (PreparedStatement) conn.prepareStatement(sql4);\n\t\tpp.setString(1, accountNumber.toString());\n\t\tResultSet rs4 = pp.executeQuery();\n\t\tint tonowBalance = 0;\n\t\tString toid = \"\";\n\t\twhile(rs4.next()) { \n\t\t\ttonowBalance=rs4.getInt(\"balance\");\n\t\t\ttoid = rs4.getString(\"userId\");\n\t\t}\n\t\t\n\t\ttolastBalance = tonowBalance + amount;\n\t\t//System.out.println(lastBalance);\n\t\tString sql5 = \"UPDATE \"+toname+\" SET balance=? where accountNumber=?\";\n\t\tlp = (PreparedStatement) conn.prepareStatement(sql5);\n\t\tlp.setInt(1, tolastBalance);\n\t\tlp.setString(2, toAccountNumber.toString());\n\t\tlp.executeUpdate();\n\t\t\n\t\t\n\t\t//log\n\t\tString logs = \"wired : \"+ amount+\" to \"+toAccountNumber+\"/ balance: \"+String.valueOf(lastBalance);\n\t\tString sql11 = \"insert into \"+id+\" (log) values (?)\";\n\t\tmm = (PreparedStatement) conn.prepareStatement(sql11);\n\t\tmm.setString(1, logs);\n\t\tmm.executeUpdate();\n\t\tSystem.out.println(\"You wired $\"+String.valueOf(amount));\n\t\t\n\t\tString logs1 = \"get : \"+ amount+\" from \" +accountNumber+ \"/ balance: \"+String.valueOf(tolastBalance);\n\t\tString sql12 = \"insert into \"+toid+\" (log) values (?)\";\n\t\tnn = (PreparedStatement) conn.prepareStatement(sql12);\n\t\tnn.setString(1, logs1);\n\t\tnn.executeUpdate();\n\t\tSystem.out.println(\"You got $\"+String.valueOf(amount));\n\t\t\n\t\t\n\t\t}catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t}",
"public double getBalance(){\n return balance;\n }",
"public double getBalance(){\n return balance;\r\n }",
"public Integer getBalance() {\n return balance;\n }",
"public Integer getBalance() {\n return balance;\n }",
"public long getBalance() {\n\t\n\treturn balance;\n}",
"public int getBalance() {\n return balance;\n }",
"public int getBalance() {\n return balance;\n }",
"public void setBalance(Integer balance) {\n this.balance = balance;\n }",
"public void setBalance(Integer balance) {\n this.balance = balance;\n }",
"public BigDecimal getBalance() {\n return balance;\n }",
"public BigDecimal getBalance() {\n return balance;\n }",
"public void setBalance(BigDecimal balance) {\n this.balance = balance;\n }",
"public void setBalance(BigDecimal balance) {\n this.balance = balance;\n }",
"public double getBalance(){\r\n\t\treturn balance;\r\n\t}",
"public float getBalance()\r\n\t{\n\t\ttry\r\n\t\t{\r\n\t\t\tDBConnection ToDB = new DBConnection(); //Have a connection to the DB\r\n\t\t\tConnection DBConn = ToDB.openConn();\r\n\t\t\tStatement Stmt = DBConn.createStatement();\r\n\t\t\tString SQL_Command = \"SELECT Balance FROM SavingsAccount WHERE SavingsAccountNumber ='\"+SavingsAccountNumber+\"'\"; //SQL query command for Balance\r\n\t\t\tResultSet Rslt = Stmt.executeQuery(SQL_Command);\r\n\t\t\twhile (Rslt.next())\r\n\t\t\t{\r\n\t\t\t\tBalance = Rslt.getFloat(1);\r\n\t\t\t}\r\n\t\t\tStmt.close();\r\n\t\t\tToDB.closeConn();\r\n\t\t}\r\n\t\tcatch(SQLException e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"SQLException: \" + e);\r\n\t\t\twhile (e != null)\r\n\t\t\t{ System.out.println(\"SQLState: \" + e.getSQLState());\r\n\t\t\t\tSystem.out.println(\"Message: \" + e.getMessage());\r\n\t\t\t\tSystem.out.println(\"Vendor: \" + e.getErrorCode());\r\n\t\t\t\te = e.getNextException();\r\n\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (Exception e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Exception: \" + e);\r\n\t\t\te.printStackTrace ();\r\n\t\t}\r\n\t\treturn Balance;\r\n\t}",
"private void updateBalance(int balance) throws SQLException {\n\t\tupdateBalanceStatement.clearParameters();\n\t\tupdateBalanceStatement.setInt(1, balance);\n\t\tupdateBalanceStatement.setString(2, this.username);\n\t\tupdateBalanceStatement.executeUpdate();\n\t}",
"public long getBalance() {\n return this.balance;\n }",
"public String balance() {\n\t\treturn this.apiCall(\"balance\", \"\", \"\", true);\n\t}",
"@Override\n\tpublic double getAccountBalance(final int bankAccountId, final String vcDate, final Connection connection)\n\t{\n\t\tdouble opeAvailable = 0, totalAvailable = 0;\n\t\ttry {\n\n\t\t\tfinal StringBuilder str = new StringBuilder(\"SELECT case when sum(openingDebitBalance) = null then 0\")\n\t\t\t\t\t.append(\" ELSE sum(openingDebitBalance) end - case when sum(openingCreditBalance) = null then 0\")\n\t\t\t\t\t.append(\" else sum(openingCreditBalance) end AS \\\"openingBalance\\\" \")\n\t\t\t\t\t.append(\"FROM transactionSummary WHERE financialYearId=( SELECT id FROM financialYear WHERE startingDate <= ?\")\n\t\t\t\t\t.append(\"AND endingDate >= ?) AND glCodeId =(select glcodeid from bankaccount where id= ?)\");\n\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\tLOGGER.info(str);\n\t\t\tQuery pst = persistenceService.getSession().createSQLQuery(str.toString());\n\t\t\tpst.setString(0, vcDate);\n\t\t\tpst.setString(1, vcDate);\n\t\t\tpst.setInteger(2, bankAccountId);\n\t\t\tList<Object[]> rset = pst.list();\n\t\t\tfor (final Object[] element : rset)\n\t\t\t\topeAvailable = Double.parseDouble(element[0].toString());\n\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\tLOGGER.info(\"opening balance \" + opeAvailable);\n\n\t\t\tfinal StringBuilder str1 = new StringBuilder(\"SELECT (case when sum(gl.debitAmount) = null then 0\")\n\t\t\t\t\t.append(\" else sum(gl.debitAmount) end - case when sum(gl.creditAmount) = null then 0\")\n\t\t\t\t\t.append(\" else sum(gl.creditAmount) end) + \").append(opeAvailable).append(\"\")\n\t\t\t\t\t.append(\" as \\\"totalAmount\\\" FROM generalLedger gl, voucherHeader vh WHERE vh.id = gl.voucherHeaderId\")\n\t\t\t\t\t.append(\" AND gl.glCodeid = (select glcodeid from bankaccount where id= ?) AND \")\n\t\t\t\t\t.append(\" vh.voucherDate >=( SELECT TO_CHAR(startingDate, 'dd-Mon-yyyy')\")\n\t\t\t\t\t.append(\" FROM financialYear WHERE startingDate <= ? AND endingDate >= ?) AND vh.voucherDate <= ?\");\n\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\tLOGGER.info(str1);\n\t\t\tpst = persistenceService.getSession().createSQLQuery(str1.toString());\n\t\t\tpst.setInteger(0, bankAccountId);\n\t\t\tpst.setString(1, vcDate);\n\t\t\tpst.setString(2, vcDate);\n\t\t\tpst.setString(3, vcDate);\n\t\t\trset = pst.list();\n\t\t\tfor (final Object[] element : rset) {\n\t\t\t\ttotalAvailable = Double.parseDouble(element[0].toString());\n\t\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\t\tLOGGER.info(\"total balance \" + totalAvailable);\n\t\t\t}\n\n\t\t} catch (final HibernateException e) {\n\t\t\tLOGGER.error(\" could not get Bankbalance \" + e.toString(), e);\n\t\t\tthrow new HibernateException(e.toString());\n\t\t}\n\t\treturn totalAvailable;\n\t}",
"public void setBalance( long balance ) {\r\n this.balance = balance;\r\n }",
"public double getBalance(){\n return balance;\n }",
"public double getBalance(){\n return balance;\n }",
"public double getBalance()\n {\n return balance;\n }",
"public BankAccount(int balance) {\n\n this.balance = balance;\n\n }",
"public void setBalance(int balance) {\r\n\t\tif(0<=balance&&balance<=1000000) {\r\n\t\tthis.balance = balance;\r\n\t}else{\r\n\t\t System.out.println(\"잘못 입력하셨습니다. 현재 잔고는 \"+this.balance+\"입니다\");\r\n\t}\r\n \r\n}",
"public void setBalance(float balance) {\n this.balance = balance;\n }",
"@Override\r\n\tpublic Double getBalance( Integer id) {\n\t\tString sql = \"SELECT balance FROM buyers WHERE id = ?;\";\r\n\t\treturn jdbcTemplate.queryForObject( sql, Double.class, id);\r\n\t}",
"public float showBalance() {\n\t\treturn dao.showBalance();\r\n\t}",
"public double getBalance(){\n\t\treturn balance;\n\t}",
"public double getBalance() {\n return balance;\n }",
"public Double getBalance() {\r\n return balance;\r\n }",
"void setManageTransactionBalance(String balance);",
"public String getBalance() {\n return balance;\n }",
"public static void getAcountsBalance(int value) {\n\t\t\t\n\t\t\taccounts.clear();\n\n\t\t\tString query = \"select account.accID, accType, balance, dateCreated, fName, lName \" + \n\t\t \"from ser322.account,ser322.customer \" + \n\t\t \"WHERE customer.accID = account.accID AND balance =\" + value;\n\t\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\tStatement stmt = con.getConnection().createStatement();\n\t\t\t ResultSet rs = stmt.executeQuery(query);\n\t\t while (rs.next()) {\n\t\t \taccounts.addElement(new Account(rs.getInt(\"accID\"),rs.getString(\"accType\"),\n\t\t \t\t\t rs.getFloat(\"balance\"),rs.getDate(\"dateCreated\"), rs.getString(\"fName\"), rs.getString(\"lName\")));\n\t\t \n\t\t }\n\t\t \n\t\t } catch (SQLException e ) {\n\t\t \tSystem.out.println(\"QUERY WRONG - getAcountsBalance\");\n\t\t }\n\t\n\t\t}",
"public BaseJson<BigDecimal> wallet_balance() throws Exception {\n String s = main(\"wallet_balance\",\"[]\");\n return JsonHelper.jsonStr2Obj(s, BaseJson.class);\n }",
"public Double getBalance(){\n Double sum = 0.0;\n // Mencari balance dompet dari transaksi dengan cara menghitung total transaksi\n for (Transaction transaction : transactions) {\n sum += transaction.getAmount().doubleValue();\n }\n return sum;\n }",
"public Account(){\n this.id = 0;\n this.balance = 0;\n this.annualInterestRate = 0;\n this.dateCreated = new Date();\n }",
"public void setBalance(){\n balance.setBalance();\n }",
"@java.lang.Override\n public com.google.protobuf.ByteString\n getBalanceBytes() {\n java.lang.Object ref = balance_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n balance_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public StoneBalanceExample() {\n oredCriteria = new ArrayList<Criteria>();\n }",
"double getBalance(UUID name);",
"Databank getBank();",
"public double getBal() {\n\t\t return balance;\r\n\t }",
"@Override\r\npublic void checkBalance() {\n\t\r\n}",
"public int getBalance() {\n\t\treturn balance;\n\t}",
"public void setBalance(java.math.BigDecimal balance) {\n this.balance = balance;\n }",
"public int getBalance() {\n return total_bal;\n }",
"public int getPropertyBalance();",
"public BankAccount getAccountBalanceRepo(String accountNr){\n String sql = \"SELECT * FROM bankaccount WHERE accountnr = :accountnr\";\n Map paramMap = new HashMap();\n paramMap.put(\"accountnr\", accountNr);\n BankAccount result = jdbcTemplate.queryForObject(sql, paramMap, new AccountRowMapper());\n return result;\n }",
"private int getBalance() throws SQLException {\n\t\tgetBalanceStatement.clearParameters();\n\t\tgetBalanceStatement.setString(1, this.username);\n\t\tResultSet result = getBalanceStatement.executeQuery();\n\t\tresult.next();\n\t\tint out = result.getInt(1);\n\t\tresult.close();\n\t\treturn out;\n\t}",
"public BankAccount findAccountById(int currentBankID) throws SQLException;",
"public void deposit(double amount) {\n balance += amount;\n \n try {\n \n Class.forName(\"net.ucanaccess.jdbc.UcanaccessDriver\");\n \n // Load Driver\n String connURL=\"jdbc:ucanaccess://c:/Users/Ellen/Documents/CIST2373/ChattBankMDB.mdb\";\n \n // Get Connection\n Connection con = DriverManager.getConnection(connURL);\n \n // Create Statement\n Statement stmt = con.createStatement();\n \n // Create sql string \n String sql = \"Update Accounts set Balance = \"+getBalance()+ \n \" where AcctNo='\"+getAcctNo()+\"'\";\n \n // Check for properly formed sql\n System.out.println(sql);\n \n // Execute Statement\n int n = stmt.executeUpdate(sql);\n if (n == 1)\n System.out.println(\"Update was successful!\");\n else\n System.out.println(\"Update failed!\"); \n \n // Close Connection\n con.close(); \n } //end try\n \n catch (Exception err) {\n System.out.println(\"Error: \" + err);\n } //end catch\n }",
"public void initializeBalance() {\n try {\n Connection connection = connect();\n\n PreparedStatement createBalanceTable = connection.prepareStatement(\"CREATE TABLE IF NOT EXISTS balance (\"\n + \"id INTEGER PRIMARY KEY,\"\n + \"user_username varchar(100),\"\n + \"amount float, \"\n + \"time varchar,\"\n + \"FOREIGN KEY (user_username) REFERENCES User(username));\"\n );\n createBalanceTable.execute();\n createBalanceTable.close();\n connection.close();\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }",
"public BankAccount() {\r\n\t\tbalance=0;\r\n\t\t\r\n\t}",
"public void showAccountBalance(){\n balance();\n\n }",
"public void balance(){\n\t\tnamesTree.balance();\n\t\taccountNumbersTree.balance();\n\t}",
"public double getBalance() {\n return this.balance;\n }",
"public Balance() {\r\n value = BigDecimal.ZERO;\r\n }",
"public void setBalance(final int balance)\n {\n this.balance = balance;\n }",
"public double getBalance() {\n return balance;\n }",
"public double getBalance() {\n return balance;\n }",
"public double getBalance() {\n return balance;\n }",
"public double getBalance() {\n return balance;\n }",
"public float getBalance() {\n return balance;\n }",
"private double getBalance() { return balance; }",
"public Double getBalance() {\n return null;\n }",
"public void setBalance(double balance){\n\t\tthis.balance = balance;\n\t}",
"public double getBalance()\r\n\t{\r\n\t\treturn balance;\t\t\r\n\t}",
"BigDecimal getOpeningDebitBalance();",
"BigDecimal getOpeningDebitBalance();",
"public com.google.protobuf.ByteString\n getBalanceBytes() {\n java.lang.Object ref = balance_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n balance_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public void InitializeBalance(BigDecimal valor){\n \r\n ChekingAccount chekAc=pRepository.GetChekingAccount();\r\n chekAc.setSaldoInicial(valor);\r\n pRepository.SaveChekingAccount(chekAc);\r\n \r\n }",
"Account(int balance) {\n if(balance <0) this.balance=0;\n this.balance = balance;\n }",
"public void updateBalance(String mobileNo,int balance)\n\t{\n\t\tContext ctx;\n\t\ttry {\n\t\t\tctx = new InitialContext();\n\t\t\n\t\t\n\t\t DataSource ds=(DataSource)ctx.lookup(\"java:OracleDS\");\n\t\t\tConnection con=ds.getConnection();\n\t\t\tStatement stmt=con.createStatement();\n\t\t\t\n\t\t\tstmt.executeUpdate(\"update mobile set balance=\"+balance+\" where mobileno=\"+mobileNo);\n\t\t\tcon.close();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Error in connection with Database :\"+e.getMessage());\n\t\t\t\n\t\t}\n\t\t\n\t}",
"public int balance(String accountNumber, String userId) {\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\t\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\t\n\t\ttry{\n\t\t\t//connect to database\n\t\t\tconn=DriverManager.getConnection(url, username, password);\n\t\t\tString sql = \"select balance from \"+this.name+\" where accountNumber=?\";\n\t\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\t\tps.setString(1, accountNumber.toString());\n\t\t\tResultSet rs = ps.executeQuery();\n\t\t\tint nowBalance = 0;\n\t\t\twhile(rs.next()) { \n\t\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\t}\n\t\t\t\n\t\t\tString logs = \"Checked balance: \"+String.valueOf(nowBalance);\n\t\t\tString sql1 = \"insert into \"+userId+\" (log) values (?)\";\n\t\t\tpp = (PreparedStatement) conn.prepareStatement(sql1);\n\t\t\tpp.setString(1, logs);\n\t\t\tpp.executeUpdate();\n\t\t\t\n\t\t\treturn nowBalance;\n\t\t} catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t\t\n\t}",
"public List<DietaBalanceada> consultar_dietaBalanceada();",
"public void deposit(String accountNumber, int amount) {\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp, ll;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\tint lastBalance;\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\ttry{\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql = \"select balance,userId from \"+this.name+\" where accountNumber=?\";\n\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\tps.setString(1, accountNumber.toString());\n\t\tResultSet rs = ps.executeQuery();\n\t\tint nowBalance = 0;\n\t\tString id = \"\";\n\t\twhile(rs.next()) { \n\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\tid = rs.getString(\"userId\");\n\t\t}\n\t\tlastBalance = nowBalance + amount;\n\t\t//System.out.println(lastBalance);\n\t\t\n\t\tString sql1 = \"UPDATE \"+this.name+\" SET balance=? where accountNumber=?\";\n\t\tpp = (PreparedStatement) conn.prepareStatement(sql1);\n\t\tpp.setInt(1, lastBalance);\n\t\tpp.setString(2, accountNumber.toString());\n\t\tpp.executeUpdate();\n\t\t\n\t\tString logs = \"deposit : \"+ amount+\" / balance: \"+String.valueOf(lastBalance);\n\t\tString sql11 = \"insert into \"+id+\" (log) values (?)\";\n\t\tll = (PreparedStatement) conn.prepareStatement(sql11);\n\t\tll.setString(1, logs);\n\t\tll.executeUpdate();\n\t\t\n\t\t}catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t}",
"public double getBalance()\n {\n return startingBalance;\n }",
"public String myAfterBalanceAmount() {\r\n\t\tint count=0;\r\n\t\tList<SavingAccount> acc = null;\r\n\t\ttry {\r\n\t\t\tSystem.out.println(\"Before Repeat\");\r\n\t\t\tacc = getSavingAccountList();\r\n\r\n\t\t\tfor (SavingAccount savingAcc : acc) {\r\n\t\t\t\tif (!(\"0\".equals(savingAcc.getState()))) {\r\n\t\t\t\t\tif (savingAcc.getState().equals(\"active\")) {\r\n\t\t\t\t\t\tint maxRepeat = Integer.parseInt(savingAcc\r\n\t\t\t\t\t\t\t\t.getRepeatable());\r\n\r\n\t\t\t\t\t\tDate date = new Date();\r\n\t\t\t\t\t\tDate systemDate = savingAccSer\r\n\t\t\t\t\t\t\t\t.convertStringToDateDDmmYYYY(savingAccSer\r\n\t\t\t\t\t\t\t\t\t\t.convertDateToStringDDmmYYYY(date));\r\n\r\n\t\t\t\t\t\tDate dateEnd = savingAccSer\r\n\t\t\t\t\t\t\t\t.convertStringToDateDDmmYYYY(savingAcc\r\n\t\t\t\t\t\t\t\t\t\t.getDateEnd());\r\n\r\n\t\t\t\t\t\tif (systemDate.getTime() == dateEnd.getTime()) {\r\n\t\t\t\t\t\t\tDate newEndDate = DateUtils.addMonths(systemDate,\r\n\t\t\t\t\t\t\t\t\tsavingAcc.getInterestRateId().getMonth());\r\n\r\n\t\t\t\t\t\t\tfloat balance = savingAcc.getBalanceAmount();\r\n\t\t\t\t\t\t\tfloat interest = savingAcc.getInterestRateId()\r\n\t\t\t\t\t\t\t\t\t.getInterestRate();\r\n\r\n\t\t\t\t\t\t\tint month = savingAcc.getInterestRateId()\r\n\t\t\t\t\t\t\t\t\t.getMonth();\r\n\t\t\t\t\t\t\tint days = Days\r\n\t\t\t\t\t\t\t\t\t.daysBetween(\r\n\t\t\t\t\t\t\t\t\t\t\tnew DateTime(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsavingAccSer\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.convertStringToDate(savingAcc\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getDateStart())),\r\n\t\t\t\t\t\t\t\t\t\t\tnew DateTime(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsavingAccSer\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.convertStringToDate(savingAcc\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getDateEnd())))\r\n\t\t\t\t\t\t\t\t\t.getDays();\r\n\t\t\t\t\t\t\tfloat amountAll = balance\r\n\t\t\t\t\t\t\t\t\t+ (balance * ((interest / (100)) / 360) * days);\r\n\t\t\t\t\t\t\tsavingAcc.setDateStart(savingAccSer\r\n\t\t\t\t\t\t\t\t\t.convertDateToString(systemDate));\r\n\t\t\t\t\t\t\tsavingAcc.setDateEnd(savingAccSer\r\n\t\t\t\t\t\t\t\t\t.convertDateToString(newEndDate));\r\n\t\t\t\t\t\t\tsavingAcc.setBalanceAmount(amountAll);\r\n\t\t\t\t\t\t\tsavingAcc.setRepeatable(\"\" + (maxRepeat + 1));\r\n\t\t\t\t\t\t\tupdateSavingAccount(savingAcc);\r\n\t\t\t\t\t\t\tcount+=1;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\tSystem.out.println(\"Successfully!! \"+ count +\" Saving Account has been updated. Minh Map!!!\");\r\n\t\t\t\r\n\t\t\treturn \"success\";\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.out.println(\"Exception\");\r\n\r\n\t\t}\r\n\t\treturn \"Fail\";\r\n\t}",
"public void setBalance(Double balance) {\r\n this.balance = balance;\r\n }",
"@Override\n\tpublic int accountUpdate(String id, String balance) {\n\t\tSession session=sessionFactory.openSession();\n\t\tTransaction tr = session.beginTransaction();\n\t\tint executeUpdate = 0;\n\t\tString sqlString=\"update user set balance = '\"+balance+\"' where id ='\"+id+\"'\";\n\t\ttry {\n\t\t\tQuery query=session.createSQLQuery(sqlString);\n\t\t\texecuteUpdate = query.executeUpdate();\n\t\t\tSystem.out.println(\"executeUpdate:\"+executeUpdate);\n\t\t} catch (HibernateException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}finally{\n\t\t\ttr.commit();\n\t\t session.close();\n\t\t}\n\t\treturn executeUpdate;\t\n\t}",
"public void Deposit(Integer accountNo,float depositMoney){\n\tSessionFactory sessionFactory = new Configuration().configure(\"hibernate.cfg.xml\").buildSessionFactory();\n\tSession session = sessionFactory.openSession();\n\tTransaction trans = null;\n\ttry{\n\t\ttrans = session.beginTransaction();\n\t\tQuery query=session.createQuery(\"UPDATE Account set balance+=:balance where accountNo=:accountNo\"); \n\t\tquery.setParameter(\"balance\",depositMoney); \n\t\tquery.setParameter(\"accountNo\",accountNo); \n\t}catch(HibernateException hibernateException){\n\t\tif(trans != null){\n\t\t\ttrans.rollback();\n\t\t}\n\t\thibernateException.printStackTrace();\n\t}\n\t}",
"public java.math.BigDecimal getBalance() {\n return balance;\n }"
] | [
"0.6254246",
"0.6251309",
"0.61570585",
"0.60492665",
"0.60057724",
"0.5992073",
"0.5980547",
"0.5977196",
"0.59642655",
"0.5963503",
"0.59486586",
"0.5940858",
"0.5940858",
"0.59254086",
"0.58854914",
"0.5869225",
"0.58683485",
"0.5837839",
"0.5806156",
"0.5791228",
"0.57907706",
"0.57907706",
"0.5789064",
"0.5786519",
"0.5786519",
"0.5774691",
"0.5774691",
"0.5765082",
"0.5765082",
"0.5758692",
"0.5758692",
"0.5740032",
"0.57227457",
"0.57202905",
"0.570451",
"0.56995517",
"0.5696218",
"0.5693933",
"0.5676445",
"0.5674041",
"0.566554",
"0.5657456",
"0.5655087",
"0.565498",
"0.5653004",
"0.5643857",
"0.56422824",
"0.5638485",
"0.5624594",
"0.56236255",
"0.5623417",
"0.5622009",
"0.5602906",
"0.56001335",
"0.55997765",
"0.55917853",
"0.55788296",
"0.55772203",
"0.5576971",
"0.557337",
"0.557114",
"0.5564688",
"0.55644137",
"0.5563821",
"0.5562173",
"0.5559716",
"0.55548126",
"0.55420464",
"0.5535851",
"0.5533963",
"0.55212945",
"0.5519972",
"0.5514862",
"0.5514407",
"0.5511833",
"0.5508671",
"0.5507144",
"0.55020714",
"0.55020714",
"0.55020714",
"0.55020714",
"0.5500946",
"0.5498619",
"0.5494768",
"0.5491949",
"0.5490798",
"0.5488625",
"0.5488625",
"0.54857177",
"0.54815656",
"0.54763603",
"0.54732734",
"0.5471391",
"0.5466189",
"0.54660946",
"0.5464866",
"0.5460848",
"0.5458931",
"0.5447544",
"0.542226",
"0.5403921"
] | 0.0 | -1 |
This method was generated by MyBatis Generator. This method corresponds to the database table stone_balance | public boolean isDistinct() {
return distinct;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int baldown(double newbalance, Long accountno, Long broaccno, Double bramt) throws Exception{\n\tint j=DbConnect.getStatement().executeUpdate(\"update account set balance=\"+newbalance+\" where accno=\"+accountno+\"\");\r\n\tint i=DbConnect.getStatement().executeUpdate(\"update account set balance=balance+\"+bramt+\" where accno=\"+broaccno+\"\");\r\n\treturn i;\r\n}",
"public int balup(double newbalance, Long accountno, Long broaccno, Double bramt) throws Exception{\n\tint j=DbConnect.getStatement().executeUpdate(\"update account set balance=\"+newbalance+\" where accno=\"+accountno+\"\");\r\n\tint i=DbConnect.getStatement().executeUpdate(\"update account set balance=balance+\"+bramt+\" where accno=\"+broaccno+\"\");\r\n\treturn i;\r\n}",
"private void listBalances() {\n\t\t\r\n\t}",
"public Money getTotalBalance();",
"private void updateDatabaseAccountBalance() {\n\t\tString sql = \"UPDATE account SET balance = \" + this.balance + \" \";\n\t\tsql += \"WHERE accountID = '\" + this.accountID + \"';\";\n\n\t\tDbUtilities db = new MySqlUtilities();\n\t\tdb.executeQuery(sql);\n\t}",
"public ResultSet retBalance(Long userid) throws SQLException {\n\trs=DbConnect.getStatement().executeQuery(\"Select balance from account where accno=\"+userid+\"\");\r\n\treturn rs;\r\n}",
"@Override\r\n\tpublic double showbalanceDao() {\n\t\t\r\n\t\treturn temp.getCustBal();\r\n\t}",
"public String getBalance() {\n return this.balance;\n }",
"public int getBalance() {\n return this.balance;\n\n }",
"public void withdraw(String accountNumber, int amount) {\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp, ll;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\tint lastBalance;\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\ttry{\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql = \"select balance,userId from \"+this.name+\" where accountNumber=?\";\n\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\tps.setString(1, accountNumber.toString());\n\t\tResultSet rs = ps.executeQuery();\n\t\tint nowBalance = 0;\n\t\tString id = \"\";\n\t\twhile(rs.next()) { \n\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\tid = rs.getString(\"userId\");\n\t\t}\n\t\tif (nowBalance<amount) {\n\t\t\tSystem.out.println(\"No Balance\");\n\t\t\treturn;\n\t\t}\n\t\tlastBalance = nowBalance - amount;\n\t\t//System.out.println(lastBalance);\n\t\t\n\t\tString sql1 = \"UPDATE \"+this.name+\" SET balance=? where accountNumber=?\";\n\t\tpp = (PreparedStatement) conn.prepareStatement(sql1);\n\t\tpp.setInt(1, lastBalance);\n\t\tpp.setString(2, accountNumber.toString());\n\t\tpp.executeUpdate();\n\t\t\n\t\tString logs = \"withdraw : \"+ amount+\" / balance: \"+String.valueOf(lastBalance);\n\t\tString sql11 = \"insert into \"+id+\" (log) values (?)\";\n\t\tll = (PreparedStatement) conn.prepareStatement(sql11);\n\t\tll.setString(1, logs);\n\t\tll.executeUpdate();\n\t\tSystem.out.println(\"Ypu got $\"+String.valueOf(amount));\n\t\t\n\t\t}catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t\t\n\t}",
"Balance[] findAllByBankAccount_Id(Long id);",
"double getBalance();",
"double getBalance();",
"public int getBalance()\n {\n return balance;\n }",
"public double getBalance()\n \n {\n \n return balance;\n \n }",
"public double getBalance(){\n return this.balance;\r\n }",
"@Override\n\tpublic double queryBalance(int accNo) {\n\t\treturn 0;\n\t}",
"public void wire(String accountNumber,int bankNumber, String toAccountNumber, int amount) {\n\t\t\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp, ll, lp, ls, mm, nn;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\tint lastBalance;\n\t\tint tolastBalance;\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\ttry{\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql = \"select balance,userId from \"+this.name+\" where accountNumber=?\";\n\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\tps.setString(1, accountNumber.toString());\n\t\tResultSet rs = ps.executeQuery();\n\t\tint nowBalance = 0;\n\t\tString id = \"\";\n\t\twhile(rs.next()) { \n\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\tid = rs.getString(\"userId\");\n\t\t}\n\t\tif (nowBalance<amount) {\n\t\t\tSystem.out.println(\"No Balance\");\n\t\t\treturn;\n\t\t}\n\t\tlastBalance = nowBalance - amount;\n\t\t//System.out.println(lastBalance);\n\t\tString sql1 = \"UPDATE \"+this.name+\" SET balance=? where accountNumber=?\";\n\t\tls = (PreparedStatement) conn.prepareStatement(sql1);\n\t\tls.setInt(1, lastBalance);\n\t\tls.setString(2, accountNumber.toString());\n\t\tls.executeUpdate();\n\t\t\n\t\t\n\t\t\n\t\t//to account\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql3 = \"select bankName from bank where bankNumber=?\";\n\t\tll= (PreparedStatement) conn.prepareStatement(sql3);\n\t\tll.setString(1, String.valueOf(bankNumber).toString());\n\t\tResultSet rs3 = ll.executeQuery();\n\t\tString toname = \"\";\n\t\twhile(rs3.next()) { \n\t\t\ttoname=rs3.getString(\"bankName\");\n\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tString sql4 = \"select balance,userId from \"+toname+\" where accountNumber=?\";\n\t\tpp= (PreparedStatement) conn.prepareStatement(sql4);\n\t\tpp.setString(1, accountNumber.toString());\n\t\tResultSet rs4 = pp.executeQuery();\n\t\tint tonowBalance = 0;\n\t\tString toid = \"\";\n\t\twhile(rs4.next()) { \n\t\t\ttonowBalance=rs4.getInt(\"balance\");\n\t\t\ttoid = rs4.getString(\"userId\");\n\t\t}\n\t\t\n\t\ttolastBalance = tonowBalance + amount;\n\t\t//System.out.println(lastBalance);\n\t\tString sql5 = \"UPDATE \"+toname+\" SET balance=? where accountNumber=?\";\n\t\tlp = (PreparedStatement) conn.prepareStatement(sql5);\n\t\tlp.setInt(1, tolastBalance);\n\t\tlp.setString(2, toAccountNumber.toString());\n\t\tlp.executeUpdate();\n\t\t\n\t\t\n\t\t//log\n\t\tString logs = \"wired : \"+ amount+\" to \"+toAccountNumber+\"/ balance: \"+String.valueOf(lastBalance);\n\t\tString sql11 = \"insert into \"+id+\" (log) values (?)\";\n\t\tmm = (PreparedStatement) conn.prepareStatement(sql11);\n\t\tmm.setString(1, logs);\n\t\tmm.executeUpdate();\n\t\tSystem.out.println(\"You wired $\"+String.valueOf(amount));\n\t\t\n\t\tString logs1 = \"get : \"+ amount+\" from \" +accountNumber+ \"/ balance: \"+String.valueOf(tolastBalance);\n\t\tString sql12 = \"insert into \"+toid+\" (log) values (?)\";\n\t\tnn = (PreparedStatement) conn.prepareStatement(sql12);\n\t\tnn.setString(1, logs1);\n\t\tnn.executeUpdate();\n\t\tSystem.out.println(\"You got $\"+String.valueOf(amount));\n\t\t\n\t\t\n\t\t}catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t}",
"public double getBalance(){\n return balance;\n }",
"public double getBalance(){\n return balance;\r\n }",
"public Integer getBalance() {\n return balance;\n }",
"public Integer getBalance() {\n return balance;\n }",
"public long getBalance() {\n\t\n\treturn balance;\n}",
"public int getBalance() {\n return balance;\n }",
"public int getBalance() {\n return balance;\n }",
"public void setBalance(Integer balance) {\n this.balance = balance;\n }",
"public void setBalance(Integer balance) {\n this.balance = balance;\n }",
"public BigDecimal getBalance() {\n return balance;\n }",
"public BigDecimal getBalance() {\n return balance;\n }",
"public void setBalance(BigDecimal balance) {\n this.balance = balance;\n }",
"public void setBalance(BigDecimal balance) {\n this.balance = balance;\n }",
"public double getBalance(){\r\n\t\treturn balance;\r\n\t}",
"public float getBalance()\r\n\t{\n\t\ttry\r\n\t\t{\r\n\t\t\tDBConnection ToDB = new DBConnection(); //Have a connection to the DB\r\n\t\t\tConnection DBConn = ToDB.openConn();\r\n\t\t\tStatement Stmt = DBConn.createStatement();\r\n\t\t\tString SQL_Command = \"SELECT Balance FROM SavingsAccount WHERE SavingsAccountNumber ='\"+SavingsAccountNumber+\"'\"; //SQL query command for Balance\r\n\t\t\tResultSet Rslt = Stmt.executeQuery(SQL_Command);\r\n\t\t\twhile (Rslt.next())\r\n\t\t\t{\r\n\t\t\t\tBalance = Rslt.getFloat(1);\r\n\t\t\t}\r\n\t\t\tStmt.close();\r\n\t\t\tToDB.closeConn();\r\n\t\t}\r\n\t\tcatch(SQLException e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"SQLException: \" + e);\r\n\t\t\twhile (e != null)\r\n\t\t\t{ System.out.println(\"SQLState: \" + e.getSQLState());\r\n\t\t\t\tSystem.out.println(\"Message: \" + e.getMessage());\r\n\t\t\t\tSystem.out.println(\"Vendor: \" + e.getErrorCode());\r\n\t\t\t\te = e.getNextException();\r\n\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (Exception e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Exception: \" + e);\r\n\t\t\te.printStackTrace ();\r\n\t\t}\r\n\t\treturn Balance;\r\n\t}",
"private void updateBalance(int balance) throws SQLException {\n\t\tupdateBalanceStatement.clearParameters();\n\t\tupdateBalanceStatement.setInt(1, balance);\n\t\tupdateBalanceStatement.setString(2, this.username);\n\t\tupdateBalanceStatement.executeUpdate();\n\t}",
"public long getBalance() {\n return this.balance;\n }",
"public String balance() {\n\t\treturn this.apiCall(\"balance\", \"\", \"\", true);\n\t}",
"@Override\n\tpublic double getAccountBalance(final int bankAccountId, final String vcDate, final Connection connection)\n\t{\n\t\tdouble opeAvailable = 0, totalAvailable = 0;\n\t\ttry {\n\n\t\t\tfinal StringBuilder str = new StringBuilder(\"SELECT case when sum(openingDebitBalance) = null then 0\")\n\t\t\t\t\t.append(\" ELSE sum(openingDebitBalance) end - case when sum(openingCreditBalance) = null then 0\")\n\t\t\t\t\t.append(\" else sum(openingCreditBalance) end AS \\\"openingBalance\\\" \")\n\t\t\t\t\t.append(\"FROM transactionSummary WHERE financialYearId=( SELECT id FROM financialYear WHERE startingDate <= ?\")\n\t\t\t\t\t.append(\"AND endingDate >= ?) AND glCodeId =(select glcodeid from bankaccount where id= ?)\");\n\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\tLOGGER.info(str);\n\t\t\tQuery pst = persistenceService.getSession().createSQLQuery(str.toString());\n\t\t\tpst.setString(0, vcDate);\n\t\t\tpst.setString(1, vcDate);\n\t\t\tpst.setInteger(2, bankAccountId);\n\t\t\tList<Object[]> rset = pst.list();\n\t\t\tfor (final Object[] element : rset)\n\t\t\t\topeAvailable = Double.parseDouble(element[0].toString());\n\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\tLOGGER.info(\"opening balance \" + opeAvailable);\n\n\t\t\tfinal StringBuilder str1 = new StringBuilder(\"SELECT (case when sum(gl.debitAmount) = null then 0\")\n\t\t\t\t\t.append(\" else sum(gl.debitAmount) end - case when sum(gl.creditAmount) = null then 0\")\n\t\t\t\t\t.append(\" else sum(gl.creditAmount) end) + \").append(opeAvailable).append(\"\")\n\t\t\t\t\t.append(\" as \\\"totalAmount\\\" FROM generalLedger gl, voucherHeader vh WHERE vh.id = gl.voucherHeaderId\")\n\t\t\t\t\t.append(\" AND gl.glCodeid = (select glcodeid from bankaccount where id= ?) AND \")\n\t\t\t\t\t.append(\" vh.voucherDate >=( SELECT TO_CHAR(startingDate, 'dd-Mon-yyyy')\")\n\t\t\t\t\t.append(\" FROM financialYear WHERE startingDate <= ? AND endingDate >= ?) AND vh.voucherDate <= ?\");\n\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\tLOGGER.info(str1);\n\t\t\tpst = persistenceService.getSession().createSQLQuery(str1.toString());\n\t\t\tpst.setInteger(0, bankAccountId);\n\t\t\tpst.setString(1, vcDate);\n\t\t\tpst.setString(2, vcDate);\n\t\t\tpst.setString(3, vcDate);\n\t\t\trset = pst.list();\n\t\t\tfor (final Object[] element : rset) {\n\t\t\t\ttotalAvailable = Double.parseDouble(element[0].toString());\n\t\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\t\tLOGGER.info(\"total balance \" + totalAvailable);\n\t\t\t}\n\n\t\t} catch (final HibernateException e) {\n\t\t\tLOGGER.error(\" could not get Bankbalance \" + e.toString(), e);\n\t\t\tthrow new HibernateException(e.toString());\n\t\t}\n\t\treturn totalAvailable;\n\t}",
"public void setBalance( long balance ) {\r\n this.balance = balance;\r\n }",
"public double getBalance(){\n return balance;\n }",
"public double getBalance(){\n return balance;\n }",
"public double getBalance()\n {\n return balance;\n }",
"public BankAccount(int balance) {\n\n this.balance = balance;\n\n }",
"public void setBalance(int balance) {\r\n\t\tif(0<=balance&&balance<=1000000) {\r\n\t\tthis.balance = balance;\r\n\t}else{\r\n\t\t System.out.println(\"잘못 입력하셨습니다. 현재 잔고는 \"+this.balance+\"입니다\");\r\n\t}\r\n \r\n}",
"public void setBalance(float balance) {\n this.balance = balance;\n }",
"@Override\r\n\tpublic Double getBalance( Integer id) {\n\t\tString sql = \"SELECT balance FROM buyers WHERE id = ?;\";\r\n\t\treturn jdbcTemplate.queryForObject( sql, Double.class, id);\r\n\t}",
"public float showBalance() {\n\t\treturn dao.showBalance();\r\n\t}",
"public double getBalance(){\n\t\treturn balance;\n\t}",
"public double getBalance() {\n return balance;\n }",
"public Double getBalance() {\r\n return balance;\r\n }",
"void setManageTransactionBalance(String balance);",
"public String getBalance() {\n return balance;\n }",
"public static void getAcountsBalance(int value) {\n\t\t\t\n\t\t\taccounts.clear();\n\n\t\t\tString query = \"select account.accID, accType, balance, dateCreated, fName, lName \" + \n\t\t \"from ser322.account,ser322.customer \" + \n\t\t \"WHERE customer.accID = account.accID AND balance =\" + value;\n\t\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\tStatement stmt = con.getConnection().createStatement();\n\t\t\t ResultSet rs = stmt.executeQuery(query);\n\t\t while (rs.next()) {\n\t\t \taccounts.addElement(new Account(rs.getInt(\"accID\"),rs.getString(\"accType\"),\n\t\t \t\t\t rs.getFloat(\"balance\"),rs.getDate(\"dateCreated\"), rs.getString(\"fName\"), rs.getString(\"lName\")));\n\t\t \n\t\t }\n\t\t \n\t\t } catch (SQLException e ) {\n\t\t \tSystem.out.println(\"QUERY WRONG - getAcountsBalance\");\n\t\t }\n\t\n\t\t}",
"public BaseJson<BigDecimal> wallet_balance() throws Exception {\n String s = main(\"wallet_balance\",\"[]\");\n return JsonHelper.jsonStr2Obj(s, BaseJson.class);\n }",
"public Double getBalance(){\n Double sum = 0.0;\n // Mencari balance dompet dari transaksi dengan cara menghitung total transaksi\n for (Transaction transaction : transactions) {\n sum += transaction.getAmount().doubleValue();\n }\n return sum;\n }",
"public Account(){\n this.id = 0;\n this.balance = 0;\n this.annualInterestRate = 0;\n this.dateCreated = new Date();\n }",
"public void setBalance(){\n balance.setBalance();\n }",
"@java.lang.Override\n public com.google.protobuf.ByteString\n getBalanceBytes() {\n java.lang.Object ref = balance_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n balance_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public StoneBalanceExample() {\n oredCriteria = new ArrayList<Criteria>();\n }",
"double getBalance(UUID name);",
"Databank getBank();",
"public double getBal() {\n\t\t return balance;\r\n\t }",
"@Override\r\npublic void checkBalance() {\n\t\r\n}",
"public void setBalance(java.math.BigDecimal balance) {\n this.balance = balance;\n }",
"public int getBalance() {\n\t\treturn balance;\n\t}",
"public int getBalance() {\n return total_bal;\n }",
"public int getPropertyBalance();",
"public BankAccount getAccountBalanceRepo(String accountNr){\n String sql = \"SELECT * FROM bankaccount WHERE accountnr = :accountnr\";\n Map paramMap = new HashMap();\n paramMap.put(\"accountnr\", accountNr);\n BankAccount result = jdbcTemplate.queryForObject(sql, paramMap, new AccountRowMapper());\n return result;\n }",
"private int getBalance() throws SQLException {\n\t\tgetBalanceStatement.clearParameters();\n\t\tgetBalanceStatement.setString(1, this.username);\n\t\tResultSet result = getBalanceStatement.executeQuery();\n\t\tresult.next();\n\t\tint out = result.getInt(1);\n\t\tresult.close();\n\t\treturn out;\n\t}",
"public BankAccount findAccountById(int currentBankID) throws SQLException;",
"public void deposit(double amount) {\n balance += amount;\n \n try {\n \n Class.forName(\"net.ucanaccess.jdbc.UcanaccessDriver\");\n \n // Load Driver\n String connURL=\"jdbc:ucanaccess://c:/Users/Ellen/Documents/CIST2373/ChattBankMDB.mdb\";\n \n // Get Connection\n Connection con = DriverManager.getConnection(connURL);\n \n // Create Statement\n Statement stmt = con.createStatement();\n \n // Create sql string \n String sql = \"Update Accounts set Balance = \"+getBalance()+ \n \" where AcctNo='\"+getAcctNo()+\"'\";\n \n // Check for properly formed sql\n System.out.println(sql);\n \n // Execute Statement\n int n = stmt.executeUpdate(sql);\n if (n == 1)\n System.out.println(\"Update was successful!\");\n else\n System.out.println(\"Update failed!\"); \n \n // Close Connection\n con.close(); \n } //end try\n \n catch (Exception err) {\n System.out.println(\"Error: \" + err);\n } //end catch\n }",
"public BankAccount() {\r\n\t\tbalance=0;\r\n\t\t\r\n\t}",
"public void initializeBalance() {\n try {\n Connection connection = connect();\n\n PreparedStatement createBalanceTable = connection.prepareStatement(\"CREATE TABLE IF NOT EXISTS balance (\"\n + \"id INTEGER PRIMARY KEY,\"\n + \"user_username varchar(100),\"\n + \"amount float, \"\n + \"time varchar,\"\n + \"FOREIGN KEY (user_username) REFERENCES User(username));\"\n );\n createBalanceTable.execute();\n createBalanceTable.close();\n connection.close();\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }",
"public void showAccountBalance(){\n balance();\n\n }",
"public void balance(){\n\t\tnamesTree.balance();\n\t\taccountNumbersTree.balance();\n\t}",
"public double getBalance() {\n return this.balance;\n }",
"public Balance() {\r\n value = BigDecimal.ZERO;\r\n }",
"public void setBalance(final int balance)\n {\n this.balance = balance;\n }",
"public double getBalance() {\n return balance;\n }",
"public double getBalance() {\n return balance;\n }",
"public double getBalance() {\n return balance;\n }",
"public double getBalance() {\n return balance;\n }",
"public float getBalance() {\n return balance;\n }",
"private double getBalance() { return balance; }",
"public Double getBalance() {\n return null;\n }",
"public void setBalance(double balance){\n\t\tthis.balance = balance;\n\t}",
"public double getBalance()\r\n\t{\r\n\t\treturn balance;\t\t\r\n\t}",
"BigDecimal getOpeningDebitBalance();",
"BigDecimal getOpeningDebitBalance();",
"public com.google.protobuf.ByteString\n getBalanceBytes() {\n java.lang.Object ref = balance_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n balance_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public void InitializeBalance(BigDecimal valor){\n \r\n ChekingAccount chekAc=pRepository.GetChekingAccount();\r\n chekAc.setSaldoInicial(valor);\r\n pRepository.SaveChekingAccount(chekAc);\r\n \r\n }",
"Account(int balance) {\n if(balance <0) this.balance=0;\n this.balance = balance;\n }",
"public void updateBalance(String mobileNo,int balance)\n\t{\n\t\tContext ctx;\n\t\ttry {\n\t\t\tctx = new InitialContext();\n\t\t\n\t\t\n\t\t DataSource ds=(DataSource)ctx.lookup(\"java:OracleDS\");\n\t\t\tConnection con=ds.getConnection();\n\t\t\tStatement stmt=con.createStatement();\n\t\t\t\n\t\t\tstmt.executeUpdate(\"update mobile set balance=\"+balance+\" where mobileno=\"+mobileNo);\n\t\t\tcon.close();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Error in connection with Database :\"+e.getMessage());\n\t\t\t\n\t\t}\n\t\t\n\t}",
"public int balance(String accountNumber, String userId) {\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\t\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\t\n\t\ttry{\n\t\t\t//connect to database\n\t\t\tconn=DriverManager.getConnection(url, username, password);\n\t\t\tString sql = \"select balance from \"+this.name+\" where accountNumber=?\";\n\t\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\t\tps.setString(1, accountNumber.toString());\n\t\t\tResultSet rs = ps.executeQuery();\n\t\t\tint nowBalance = 0;\n\t\t\twhile(rs.next()) { \n\t\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\t}\n\t\t\t\n\t\t\tString logs = \"Checked balance: \"+String.valueOf(nowBalance);\n\t\t\tString sql1 = \"insert into \"+userId+\" (log) values (?)\";\n\t\t\tpp = (PreparedStatement) conn.prepareStatement(sql1);\n\t\t\tpp.setString(1, logs);\n\t\t\tpp.executeUpdate();\n\t\t\t\n\t\t\treturn nowBalance;\n\t\t} catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t\t\n\t}",
"public double getBalance()\n {\n return startingBalance;\n }",
"public void deposit(String accountNumber, int amount) {\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp, ll;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\tint lastBalance;\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\ttry{\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql = \"select balance,userId from \"+this.name+\" where accountNumber=?\";\n\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\tps.setString(1, accountNumber.toString());\n\t\tResultSet rs = ps.executeQuery();\n\t\tint nowBalance = 0;\n\t\tString id = \"\";\n\t\twhile(rs.next()) { \n\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\tid = rs.getString(\"userId\");\n\t\t}\n\t\tlastBalance = nowBalance + amount;\n\t\t//System.out.println(lastBalance);\n\t\t\n\t\tString sql1 = \"UPDATE \"+this.name+\" SET balance=? where accountNumber=?\";\n\t\tpp = (PreparedStatement) conn.prepareStatement(sql1);\n\t\tpp.setInt(1, lastBalance);\n\t\tpp.setString(2, accountNumber.toString());\n\t\tpp.executeUpdate();\n\t\t\n\t\tString logs = \"deposit : \"+ amount+\" / balance: \"+String.valueOf(lastBalance);\n\t\tString sql11 = \"insert into \"+id+\" (log) values (?)\";\n\t\tll = (PreparedStatement) conn.prepareStatement(sql11);\n\t\tll.setString(1, logs);\n\t\tll.executeUpdate();\n\t\t\n\t\t}catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t}",
"public List<DietaBalanceada> consultar_dietaBalanceada();",
"public String myAfterBalanceAmount() {\r\n\t\tint count=0;\r\n\t\tList<SavingAccount> acc = null;\r\n\t\ttry {\r\n\t\t\tSystem.out.println(\"Before Repeat\");\r\n\t\t\tacc = getSavingAccountList();\r\n\r\n\t\t\tfor (SavingAccount savingAcc : acc) {\r\n\t\t\t\tif (!(\"0\".equals(savingAcc.getState()))) {\r\n\t\t\t\t\tif (savingAcc.getState().equals(\"active\")) {\r\n\t\t\t\t\t\tint maxRepeat = Integer.parseInt(savingAcc\r\n\t\t\t\t\t\t\t\t.getRepeatable());\r\n\r\n\t\t\t\t\t\tDate date = new Date();\r\n\t\t\t\t\t\tDate systemDate = savingAccSer\r\n\t\t\t\t\t\t\t\t.convertStringToDateDDmmYYYY(savingAccSer\r\n\t\t\t\t\t\t\t\t\t\t.convertDateToStringDDmmYYYY(date));\r\n\r\n\t\t\t\t\t\tDate dateEnd = savingAccSer\r\n\t\t\t\t\t\t\t\t.convertStringToDateDDmmYYYY(savingAcc\r\n\t\t\t\t\t\t\t\t\t\t.getDateEnd());\r\n\r\n\t\t\t\t\t\tif (systemDate.getTime() == dateEnd.getTime()) {\r\n\t\t\t\t\t\t\tDate newEndDate = DateUtils.addMonths(systemDate,\r\n\t\t\t\t\t\t\t\t\tsavingAcc.getInterestRateId().getMonth());\r\n\r\n\t\t\t\t\t\t\tfloat balance = savingAcc.getBalanceAmount();\r\n\t\t\t\t\t\t\tfloat interest = savingAcc.getInterestRateId()\r\n\t\t\t\t\t\t\t\t\t.getInterestRate();\r\n\r\n\t\t\t\t\t\t\tint month = savingAcc.getInterestRateId()\r\n\t\t\t\t\t\t\t\t\t.getMonth();\r\n\t\t\t\t\t\t\tint days = Days\r\n\t\t\t\t\t\t\t\t\t.daysBetween(\r\n\t\t\t\t\t\t\t\t\t\t\tnew DateTime(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsavingAccSer\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.convertStringToDate(savingAcc\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getDateStart())),\r\n\t\t\t\t\t\t\t\t\t\t\tnew DateTime(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsavingAccSer\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.convertStringToDate(savingAcc\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getDateEnd())))\r\n\t\t\t\t\t\t\t\t\t.getDays();\r\n\t\t\t\t\t\t\tfloat amountAll = balance\r\n\t\t\t\t\t\t\t\t\t+ (balance * ((interest / (100)) / 360) * days);\r\n\t\t\t\t\t\t\tsavingAcc.setDateStart(savingAccSer\r\n\t\t\t\t\t\t\t\t\t.convertDateToString(systemDate));\r\n\t\t\t\t\t\t\tsavingAcc.setDateEnd(savingAccSer\r\n\t\t\t\t\t\t\t\t\t.convertDateToString(newEndDate));\r\n\t\t\t\t\t\t\tsavingAcc.setBalanceAmount(amountAll);\r\n\t\t\t\t\t\t\tsavingAcc.setRepeatable(\"\" + (maxRepeat + 1));\r\n\t\t\t\t\t\t\tupdateSavingAccount(savingAcc);\r\n\t\t\t\t\t\t\tcount+=1;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\tSystem.out.println(\"Successfully!! \"+ count +\" Saving Account has been updated. Minh Map!!!\");\r\n\t\t\t\r\n\t\t\treturn \"success\";\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.out.println(\"Exception\");\r\n\r\n\t\t}\r\n\t\treturn \"Fail\";\r\n\t}",
"public void setBalance(Double balance) {\r\n this.balance = balance;\r\n }",
"@Override\n\tpublic int accountUpdate(String id, String balance) {\n\t\tSession session=sessionFactory.openSession();\n\t\tTransaction tr = session.beginTransaction();\n\t\tint executeUpdate = 0;\n\t\tString sqlString=\"update user set balance = '\"+balance+\"' where id ='\"+id+\"'\";\n\t\ttry {\n\t\t\tQuery query=session.createSQLQuery(sqlString);\n\t\t\texecuteUpdate = query.executeUpdate();\n\t\t\tSystem.out.println(\"executeUpdate:\"+executeUpdate);\n\t\t} catch (HibernateException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}finally{\n\t\t\ttr.commit();\n\t\t session.close();\n\t\t}\n\t\treturn executeUpdate;\t\n\t}",
"public void Deposit(Integer accountNo,float depositMoney){\n\tSessionFactory sessionFactory = new Configuration().configure(\"hibernate.cfg.xml\").buildSessionFactory();\n\tSession session = sessionFactory.openSession();\n\tTransaction trans = null;\n\ttry{\n\t\ttrans = session.beginTransaction();\n\t\tQuery query=session.createQuery(\"UPDATE Account set balance+=:balance where accountNo=:accountNo\"); \n\t\tquery.setParameter(\"balance\",depositMoney); \n\t\tquery.setParameter(\"accountNo\",accountNo); \n\t}catch(HibernateException hibernateException){\n\t\tif(trans != null){\n\t\t\ttrans.rollback();\n\t\t}\n\t\thibernateException.printStackTrace();\n\t}\n\t}",
"public java.math.BigDecimal getBalance() {\n return balance;\n }"
] | [
"0.6257401",
"0.6254438",
"0.6161535",
"0.6054013",
"0.60082215",
"0.5993809",
"0.5983186",
"0.5981287",
"0.5967813",
"0.5967191",
"0.5949743",
"0.59459656",
"0.59459656",
"0.59297687",
"0.5890412",
"0.587308",
"0.5872259",
"0.584036",
"0.5810854",
"0.57962006",
"0.579471",
"0.579471",
"0.5792875",
"0.5790713",
"0.5790713",
"0.5778891",
"0.5778891",
"0.5769552",
"0.5769552",
"0.5763822",
"0.5763822",
"0.5744492",
"0.57258487",
"0.57236683",
"0.5708359",
"0.5703243",
"0.5699339",
"0.5697645",
"0.5681245",
"0.56788135",
"0.56700957",
"0.5661688",
"0.5659845",
"0.5659348",
"0.5655676",
"0.5647027",
"0.56466496",
"0.56428343",
"0.5629093",
"0.5627635",
"0.56273925",
"0.56242955",
"0.56076217",
"0.5603623",
"0.56021035",
"0.5597103",
"0.5582562",
"0.55804604",
"0.5580238",
"0.557578",
"0.5575343",
"0.55698454",
"0.5568917",
"0.5568167",
"0.55664366",
"0.5562932",
"0.5556589",
"0.5544964",
"0.55375737",
"0.55369264",
"0.5523909",
"0.5521524",
"0.55192953",
"0.5518451",
"0.55162275",
"0.551352",
"0.5511489",
"0.5506484",
"0.5506484",
"0.5506484",
"0.5506484",
"0.5505282",
"0.55038494",
"0.54992586",
"0.54967123",
"0.54953766",
"0.54940236",
"0.54940236",
"0.5489175",
"0.5486224",
"0.54800606",
"0.54754776",
"0.54734373",
"0.5469201",
"0.5468912",
"0.5467371",
"0.5465251",
"0.54636157",
"0.54497653",
"0.542471",
"0.5408221"
] | 0.0 | -1 |
This method was generated by MyBatis Generator. This method corresponds to the database table stone_balance | public List<Criteria> getOredCriteria() {
return oredCriteria;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int baldown(double newbalance, Long accountno, Long broaccno, Double bramt) throws Exception{\n\tint j=DbConnect.getStatement().executeUpdate(\"update account set balance=\"+newbalance+\" where accno=\"+accountno+\"\");\r\n\tint i=DbConnect.getStatement().executeUpdate(\"update account set balance=balance+\"+bramt+\" where accno=\"+broaccno+\"\");\r\n\treturn i;\r\n}",
"public int balup(double newbalance, Long accountno, Long broaccno, Double bramt) throws Exception{\n\tint j=DbConnect.getStatement().executeUpdate(\"update account set balance=\"+newbalance+\" where accno=\"+accountno+\"\");\r\n\tint i=DbConnect.getStatement().executeUpdate(\"update account set balance=balance+\"+bramt+\" where accno=\"+broaccno+\"\");\r\n\treturn i;\r\n}",
"private void listBalances() {\n\t\t\r\n\t}",
"public Money getTotalBalance();",
"private void updateDatabaseAccountBalance() {\n\t\tString sql = \"UPDATE account SET balance = \" + this.balance + \" \";\n\t\tsql += \"WHERE accountID = '\" + this.accountID + \"';\";\n\n\t\tDbUtilities db = new MySqlUtilities();\n\t\tdb.executeQuery(sql);\n\t}",
"public ResultSet retBalance(Long userid) throws SQLException {\n\trs=DbConnect.getStatement().executeQuery(\"Select balance from account where accno=\"+userid+\"\");\r\n\treturn rs;\r\n}",
"@Override\r\n\tpublic double showbalanceDao() {\n\t\t\r\n\t\treturn temp.getCustBal();\r\n\t}",
"public String getBalance() {\n return this.balance;\n }",
"public int getBalance() {\n return this.balance;\n\n }",
"public void withdraw(String accountNumber, int amount) {\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp, ll;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\tint lastBalance;\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\ttry{\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql = \"select balance,userId from \"+this.name+\" where accountNumber=?\";\n\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\tps.setString(1, accountNumber.toString());\n\t\tResultSet rs = ps.executeQuery();\n\t\tint nowBalance = 0;\n\t\tString id = \"\";\n\t\twhile(rs.next()) { \n\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\tid = rs.getString(\"userId\");\n\t\t}\n\t\tif (nowBalance<amount) {\n\t\t\tSystem.out.println(\"No Balance\");\n\t\t\treturn;\n\t\t}\n\t\tlastBalance = nowBalance - amount;\n\t\t//System.out.println(lastBalance);\n\t\t\n\t\tString sql1 = \"UPDATE \"+this.name+\" SET balance=? where accountNumber=?\";\n\t\tpp = (PreparedStatement) conn.prepareStatement(sql1);\n\t\tpp.setInt(1, lastBalance);\n\t\tpp.setString(2, accountNumber.toString());\n\t\tpp.executeUpdate();\n\t\t\n\t\tString logs = \"withdraw : \"+ amount+\" / balance: \"+String.valueOf(lastBalance);\n\t\tString sql11 = \"insert into \"+id+\" (log) values (?)\";\n\t\tll = (PreparedStatement) conn.prepareStatement(sql11);\n\t\tll.setString(1, logs);\n\t\tll.executeUpdate();\n\t\tSystem.out.println(\"Ypu got $\"+String.valueOf(amount));\n\t\t\n\t\t}catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t\t\n\t}",
"Balance[] findAllByBankAccount_Id(Long id);",
"double getBalance();",
"double getBalance();",
"public int getBalance()\n {\n return balance;\n }",
"public double getBalance()\n \n {\n \n return balance;\n \n }",
"public double getBalance(){\n return this.balance;\r\n }",
"@Override\n\tpublic double queryBalance(int accNo) {\n\t\treturn 0;\n\t}",
"public void wire(String accountNumber,int bankNumber, String toAccountNumber, int amount) {\n\t\t\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp, ll, lp, ls, mm, nn;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\tint lastBalance;\n\t\tint tolastBalance;\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\ttry{\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql = \"select balance,userId from \"+this.name+\" where accountNumber=?\";\n\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\tps.setString(1, accountNumber.toString());\n\t\tResultSet rs = ps.executeQuery();\n\t\tint nowBalance = 0;\n\t\tString id = \"\";\n\t\twhile(rs.next()) { \n\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\tid = rs.getString(\"userId\");\n\t\t}\n\t\tif (nowBalance<amount) {\n\t\t\tSystem.out.println(\"No Balance\");\n\t\t\treturn;\n\t\t}\n\t\tlastBalance = nowBalance - amount;\n\t\t//System.out.println(lastBalance);\n\t\tString sql1 = \"UPDATE \"+this.name+\" SET balance=? where accountNumber=?\";\n\t\tls = (PreparedStatement) conn.prepareStatement(sql1);\n\t\tls.setInt(1, lastBalance);\n\t\tls.setString(2, accountNumber.toString());\n\t\tls.executeUpdate();\n\t\t\n\t\t\n\t\t\n\t\t//to account\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql3 = \"select bankName from bank where bankNumber=?\";\n\t\tll= (PreparedStatement) conn.prepareStatement(sql3);\n\t\tll.setString(1, String.valueOf(bankNumber).toString());\n\t\tResultSet rs3 = ll.executeQuery();\n\t\tString toname = \"\";\n\t\twhile(rs3.next()) { \n\t\t\ttoname=rs3.getString(\"bankName\");\n\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tString sql4 = \"select balance,userId from \"+toname+\" where accountNumber=?\";\n\t\tpp= (PreparedStatement) conn.prepareStatement(sql4);\n\t\tpp.setString(1, accountNumber.toString());\n\t\tResultSet rs4 = pp.executeQuery();\n\t\tint tonowBalance = 0;\n\t\tString toid = \"\";\n\t\twhile(rs4.next()) { \n\t\t\ttonowBalance=rs4.getInt(\"balance\");\n\t\t\ttoid = rs4.getString(\"userId\");\n\t\t}\n\t\t\n\t\ttolastBalance = tonowBalance + amount;\n\t\t//System.out.println(lastBalance);\n\t\tString sql5 = \"UPDATE \"+toname+\" SET balance=? where accountNumber=?\";\n\t\tlp = (PreparedStatement) conn.prepareStatement(sql5);\n\t\tlp.setInt(1, tolastBalance);\n\t\tlp.setString(2, toAccountNumber.toString());\n\t\tlp.executeUpdate();\n\t\t\n\t\t\n\t\t//log\n\t\tString logs = \"wired : \"+ amount+\" to \"+toAccountNumber+\"/ balance: \"+String.valueOf(lastBalance);\n\t\tString sql11 = \"insert into \"+id+\" (log) values (?)\";\n\t\tmm = (PreparedStatement) conn.prepareStatement(sql11);\n\t\tmm.setString(1, logs);\n\t\tmm.executeUpdate();\n\t\tSystem.out.println(\"You wired $\"+String.valueOf(amount));\n\t\t\n\t\tString logs1 = \"get : \"+ amount+\" from \" +accountNumber+ \"/ balance: \"+String.valueOf(tolastBalance);\n\t\tString sql12 = \"insert into \"+toid+\" (log) values (?)\";\n\t\tnn = (PreparedStatement) conn.prepareStatement(sql12);\n\t\tnn.setString(1, logs1);\n\t\tnn.executeUpdate();\n\t\tSystem.out.println(\"You got $\"+String.valueOf(amount));\n\t\t\n\t\t\n\t\t}catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t}",
"public double getBalance(){\n return balance;\n }",
"public double getBalance(){\n return balance;\r\n }",
"public Integer getBalance() {\n return balance;\n }",
"public Integer getBalance() {\n return balance;\n }",
"public long getBalance() {\n\t\n\treturn balance;\n}",
"public int getBalance() {\n return balance;\n }",
"public int getBalance() {\n return balance;\n }",
"public void setBalance(Integer balance) {\n this.balance = balance;\n }",
"public void setBalance(Integer balance) {\n this.balance = balance;\n }",
"public BigDecimal getBalance() {\n return balance;\n }",
"public BigDecimal getBalance() {\n return balance;\n }",
"public void setBalance(BigDecimal balance) {\n this.balance = balance;\n }",
"public void setBalance(BigDecimal balance) {\n this.balance = balance;\n }",
"public double getBalance(){\r\n\t\treturn balance;\r\n\t}",
"public float getBalance()\r\n\t{\n\t\ttry\r\n\t\t{\r\n\t\t\tDBConnection ToDB = new DBConnection(); //Have a connection to the DB\r\n\t\t\tConnection DBConn = ToDB.openConn();\r\n\t\t\tStatement Stmt = DBConn.createStatement();\r\n\t\t\tString SQL_Command = \"SELECT Balance FROM SavingsAccount WHERE SavingsAccountNumber ='\"+SavingsAccountNumber+\"'\"; //SQL query command for Balance\r\n\t\t\tResultSet Rslt = Stmt.executeQuery(SQL_Command);\r\n\t\t\twhile (Rslt.next())\r\n\t\t\t{\r\n\t\t\t\tBalance = Rslt.getFloat(1);\r\n\t\t\t}\r\n\t\t\tStmt.close();\r\n\t\t\tToDB.closeConn();\r\n\t\t}\r\n\t\tcatch(SQLException e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"SQLException: \" + e);\r\n\t\t\twhile (e != null)\r\n\t\t\t{ System.out.println(\"SQLState: \" + e.getSQLState());\r\n\t\t\t\tSystem.out.println(\"Message: \" + e.getMessage());\r\n\t\t\t\tSystem.out.println(\"Vendor: \" + e.getErrorCode());\r\n\t\t\t\te = e.getNextException();\r\n\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (Exception e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Exception: \" + e);\r\n\t\t\te.printStackTrace ();\r\n\t\t}\r\n\t\treturn Balance;\r\n\t}",
"private void updateBalance(int balance) throws SQLException {\n\t\tupdateBalanceStatement.clearParameters();\n\t\tupdateBalanceStatement.setInt(1, balance);\n\t\tupdateBalanceStatement.setString(2, this.username);\n\t\tupdateBalanceStatement.executeUpdate();\n\t}",
"public long getBalance() {\n return this.balance;\n }",
"public String balance() {\n\t\treturn this.apiCall(\"balance\", \"\", \"\", true);\n\t}",
"@Override\n\tpublic double getAccountBalance(final int bankAccountId, final String vcDate, final Connection connection)\n\t{\n\t\tdouble opeAvailable = 0, totalAvailable = 0;\n\t\ttry {\n\n\t\t\tfinal StringBuilder str = new StringBuilder(\"SELECT case when sum(openingDebitBalance) = null then 0\")\n\t\t\t\t\t.append(\" ELSE sum(openingDebitBalance) end - case when sum(openingCreditBalance) = null then 0\")\n\t\t\t\t\t.append(\" else sum(openingCreditBalance) end AS \\\"openingBalance\\\" \")\n\t\t\t\t\t.append(\"FROM transactionSummary WHERE financialYearId=( SELECT id FROM financialYear WHERE startingDate <= ?\")\n\t\t\t\t\t.append(\"AND endingDate >= ?) AND glCodeId =(select glcodeid from bankaccount where id= ?)\");\n\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\tLOGGER.info(str);\n\t\t\tQuery pst = persistenceService.getSession().createSQLQuery(str.toString());\n\t\t\tpst.setString(0, vcDate);\n\t\t\tpst.setString(1, vcDate);\n\t\t\tpst.setInteger(2, bankAccountId);\n\t\t\tList<Object[]> rset = pst.list();\n\t\t\tfor (final Object[] element : rset)\n\t\t\t\topeAvailable = Double.parseDouble(element[0].toString());\n\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\tLOGGER.info(\"opening balance \" + opeAvailable);\n\n\t\t\tfinal StringBuilder str1 = new StringBuilder(\"SELECT (case when sum(gl.debitAmount) = null then 0\")\n\t\t\t\t\t.append(\" else sum(gl.debitAmount) end - case when sum(gl.creditAmount) = null then 0\")\n\t\t\t\t\t.append(\" else sum(gl.creditAmount) end) + \").append(opeAvailable).append(\"\")\n\t\t\t\t\t.append(\" as \\\"totalAmount\\\" FROM generalLedger gl, voucherHeader vh WHERE vh.id = gl.voucherHeaderId\")\n\t\t\t\t\t.append(\" AND gl.glCodeid = (select glcodeid from bankaccount where id= ?) AND \")\n\t\t\t\t\t.append(\" vh.voucherDate >=( SELECT TO_CHAR(startingDate, 'dd-Mon-yyyy')\")\n\t\t\t\t\t.append(\" FROM financialYear WHERE startingDate <= ? AND endingDate >= ?) AND vh.voucherDate <= ?\");\n\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\tLOGGER.info(str1);\n\t\t\tpst = persistenceService.getSession().createSQLQuery(str1.toString());\n\t\t\tpst.setInteger(0, bankAccountId);\n\t\t\tpst.setString(1, vcDate);\n\t\t\tpst.setString(2, vcDate);\n\t\t\tpst.setString(3, vcDate);\n\t\t\trset = pst.list();\n\t\t\tfor (final Object[] element : rset) {\n\t\t\t\ttotalAvailable = Double.parseDouble(element[0].toString());\n\t\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\t\tLOGGER.info(\"total balance \" + totalAvailable);\n\t\t\t}\n\n\t\t} catch (final HibernateException e) {\n\t\t\tLOGGER.error(\" could not get Bankbalance \" + e.toString(), e);\n\t\t\tthrow new HibernateException(e.toString());\n\t\t}\n\t\treturn totalAvailable;\n\t}",
"public void setBalance( long balance ) {\r\n this.balance = balance;\r\n }",
"public double getBalance(){\n return balance;\n }",
"public double getBalance(){\n return balance;\n }",
"public double getBalance()\n {\n return balance;\n }",
"public BankAccount(int balance) {\n\n this.balance = balance;\n\n }",
"public void setBalance(int balance) {\r\n\t\tif(0<=balance&&balance<=1000000) {\r\n\t\tthis.balance = balance;\r\n\t}else{\r\n\t\t System.out.println(\"잘못 입력하셨습니다. 현재 잔고는 \"+this.balance+\"입니다\");\r\n\t}\r\n \r\n}",
"public void setBalance(float balance) {\n this.balance = balance;\n }",
"@Override\r\n\tpublic Double getBalance( Integer id) {\n\t\tString sql = \"SELECT balance FROM buyers WHERE id = ?;\";\r\n\t\treturn jdbcTemplate.queryForObject( sql, Double.class, id);\r\n\t}",
"public float showBalance() {\n\t\treturn dao.showBalance();\r\n\t}",
"public double getBalance(){\n\t\treturn balance;\n\t}",
"public double getBalance() {\n return balance;\n }",
"public Double getBalance() {\r\n return balance;\r\n }",
"public String getBalance() {\n return balance;\n }",
"void setManageTransactionBalance(String balance);",
"public static void getAcountsBalance(int value) {\n\t\t\t\n\t\t\taccounts.clear();\n\n\t\t\tString query = \"select account.accID, accType, balance, dateCreated, fName, lName \" + \n\t\t \"from ser322.account,ser322.customer \" + \n\t\t \"WHERE customer.accID = account.accID AND balance =\" + value;\n\t\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\tStatement stmt = con.getConnection().createStatement();\n\t\t\t ResultSet rs = stmt.executeQuery(query);\n\t\t while (rs.next()) {\n\t\t \taccounts.addElement(new Account(rs.getInt(\"accID\"),rs.getString(\"accType\"),\n\t\t \t\t\t rs.getFloat(\"balance\"),rs.getDate(\"dateCreated\"), rs.getString(\"fName\"), rs.getString(\"lName\")));\n\t\t \n\t\t }\n\t\t \n\t\t } catch (SQLException e ) {\n\t\t \tSystem.out.println(\"QUERY WRONG - getAcountsBalance\");\n\t\t }\n\t\n\t\t}",
"public BaseJson<BigDecimal> wallet_balance() throws Exception {\n String s = main(\"wallet_balance\",\"[]\");\n return JsonHelper.jsonStr2Obj(s, BaseJson.class);\n }",
"public Double getBalance(){\n Double sum = 0.0;\n // Mencari balance dompet dari transaksi dengan cara menghitung total transaksi\n for (Transaction transaction : transactions) {\n sum += transaction.getAmount().doubleValue();\n }\n return sum;\n }",
"public Account(){\n this.id = 0;\n this.balance = 0;\n this.annualInterestRate = 0;\n this.dateCreated = new Date();\n }",
"public void setBalance(){\n balance.setBalance();\n }",
"@java.lang.Override\n public com.google.protobuf.ByteString\n getBalanceBytes() {\n java.lang.Object ref = balance_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n balance_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public StoneBalanceExample() {\n oredCriteria = new ArrayList<Criteria>();\n }",
"double getBalance(UUID name);",
"Databank getBank();",
"public double getBal() {\n\t\t return balance;\r\n\t }",
"@Override\r\npublic void checkBalance() {\n\t\r\n}",
"public int getBalance() {\n\t\treturn balance;\n\t}",
"public void setBalance(java.math.BigDecimal balance) {\n this.balance = balance;\n }",
"public int getBalance() {\n return total_bal;\n }",
"public int getPropertyBalance();",
"public BankAccount getAccountBalanceRepo(String accountNr){\n String sql = \"SELECT * FROM bankaccount WHERE accountnr = :accountnr\";\n Map paramMap = new HashMap();\n paramMap.put(\"accountnr\", accountNr);\n BankAccount result = jdbcTemplate.queryForObject(sql, paramMap, new AccountRowMapper());\n return result;\n }",
"private int getBalance() throws SQLException {\n\t\tgetBalanceStatement.clearParameters();\n\t\tgetBalanceStatement.setString(1, this.username);\n\t\tResultSet result = getBalanceStatement.executeQuery();\n\t\tresult.next();\n\t\tint out = result.getInt(1);\n\t\tresult.close();\n\t\treturn out;\n\t}",
"public BankAccount findAccountById(int currentBankID) throws SQLException;",
"public void deposit(double amount) {\n balance += amount;\n \n try {\n \n Class.forName(\"net.ucanaccess.jdbc.UcanaccessDriver\");\n \n // Load Driver\n String connURL=\"jdbc:ucanaccess://c:/Users/Ellen/Documents/CIST2373/ChattBankMDB.mdb\";\n \n // Get Connection\n Connection con = DriverManager.getConnection(connURL);\n \n // Create Statement\n Statement stmt = con.createStatement();\n \n // Create sql string \n String sql = \"Update Accounts set Balance = \"+getBalance()+ \n \" where AcctNo='\"+getAcctNo()+\"'\";\n \n // Check for properly formed sql\n System.out.println(sql);\n \n // Execute Statement\n int n = stmt.executeUpdate(sql);\n if (n == 1)\n System.out.println(\"Update was successful!\");\n else\n System.out.println(\"Update failed!\"); \n \n // Close Connection\n con.close(); \n } //end try\n \n catch (Exception err) {\n System.out.println(\"Error: \" + err);\n } //end catch\n }",
"public BankAccount() {\r\n\t\tbalance=0;\r\n\t\t\r\n\t}",
"public void initializeBalance() {\n try {\n Connection connection = connect();\n\n PreparedStatement createBalanceTable = connection.prepareStatement(\"CREATE TABLE IF NOT EXISTS balance (\"\n + \"id INTEGER PRIMARY KEY,\"\n + \"user_username varchar(100),\"\n + \"amount float, \"\n + \"time varchar,\"\n + \"FOREIGN KEY (user_username) REFERENCES User(username));\"\n );\n createBalanceTable.execute();\n createBalanceTable.close();\n connection.close();\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }",
"public void showAccountBalance(){\n balance();\n\n }",
"public void balance(){\n\t\tnamesTree.balance();\n\t\taccountNumbersTree.balance();\n\t}",
"public double getBalance() {\n return this.balance;\n }",
"public Balance() {\r\n value = BigDecimal.ZERO;\r\n }",
"public void setBalance(final int balance)\n {\n this.balance = balance;\n }",
"public double getBalance() {\n return balance;\n }",
"public double getBalance() {\n return balance;\n }",
"public double getBalance() {\n return balance;\n }",
"public double getBalance() {\n return balance;\n }",
"public float getBalance() {\n return balance;\n }",
"private double getBalance() { return balance; }",
"public Double getBalance() {\n return null;\n }",
"public double getBalance()\r\n\t{\r\n\t\treturn balance;\t\t\r\n\t}",
"public void setBalance(double balance){\n\t\tthis.balance = balance;\n\t}",
"BigDecimal getOpeningDebitBalance();",
"BigDecimal getOpeningDebitBalance();",
"public com.google.protobuf.ByteString\n getBalanceBytes() {\n java.lang.Object ref = balance_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n balance_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public void InitializeBalance(BigDecimal valor){\n \r\n ChekingAccount chekAc=pRepository.GetChekingAccount();\r\n chekAc.setSaldoInicial(valor);\r\n pRepository.SaveChekingAccount(chekAc);\r\n \r\n }",
"Account(int balance) {\n if(balance <0) this.balance=0;\n this.balance = balance;\n }",
"public void updateBalance(String mobileNo,int balance)\n\t{\n\t\tContext ctx;\n\t\ttry {\n\t\t\tctx = new InitialContext();\n\t\t\n\t\t\n\t\t DataSource ds=(DataSource)ctx.lookup(\"java:OracleDS\");\n\t\t\tConnection con=ds.getConnection();\n\t\t\tStatement stmt=con.createStatement();\n\t\t\t\n\t\t\tstmt.executeUpdate(\"update mobile set balance=\"+balance+\" where mobileno=\"+mobileNo);\n\t\t\tcon.close();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Error in connection with Database :\"+e.getMessage());\n\t\t\t\n\t\t}\n\t\t\n\t}",
"public int balance(String accountNumber, String userId) {\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\t\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\t\n\t\ttry{\n\t\t\t//connect to database\n\t\t\tconn=DriverManager.getConnection(url, username, password);\n\t\t\tString sql = \"select balance from \"+this.name+\" where accountNumber=?\";\n\t\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\t\tps.setString(1, accountNumber.toString());\n\t\t\tResultSet rs = ps.executeQuery();\n\t\t\tint nowBalance = 0;\n\t\t\twhile(rs.next()) { \n\t\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\t}\n\t\t\t\n\t\t\tString logs = \"Checked balance: \"+String.valueOf(nowBalance);\n\t\t\tString sql1 = \"insert into \"+userId+\" (log) values (?)\";\n\t\t\tpp = (PreparedStatement) conn.prepareStatement(sql1);\n\t\t\tpp.setString(1, logs);\n\t\t\tpp.executeUpdate();\n\t\t\t\n\t\t\treturn nowBalance;\n\t\t} catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t\t\n\t}",
"public double getBalance()\n {\n return startingBalance;\n }",
"public void deposit(String accountNumber, int amount) {\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp, ll;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\tint lastBalance;\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\ttry{\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql = \"select balance,userId from \"+this.name+\" where accountNumber=?\";\n\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\tps.setString(1, accountNumber.toString());\n\t\tResultSet rs = ps.executeQuery();\n\t\tint nowBalance = 0;\n\t\tString id = \"\";\n\t\twhile(rs.next()) { \n\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\tid = rs.getString(\"userId\");\n\t\t}\n\t\tlastBalance = nowBalance + amount;\n\t\t//System.out.println(lastBalance);\n\t\t\n\t\tString sql1 = \"UPDATE \"+this.name+\" SET balance=? where accountNumber=?\";\n\t\tpp = (PreparedStatement) conn.prepareStatement(sql1);\n\t\tpp.setInt(1, lastBalance);\n\t\tpp.setString(2, accountNumber.toString());\n\t\tpp.executeUpdate();\n\t\t\n\t\tString logs = \"deposit : \"+ amount+\" / balance: \"+String.valueOf(lastBalance);\n\t\tString sql11 = \"insert into \"+id+\" (log) values (?)\";\n\t\tll = (PreparedStatement) conn.prepareStatement(sql11);\n\t\tll.setString(1, logs);\n\t\tll.executeUpdate();\n\t\t\n\t\t}catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t}",
"public List<DietaBalanceada> consultar_dietaBalanceada();",
"public String myAfterBalanceAmount() {\r\n\t\tint count=0;\r\n\t\tList<SavingAccount> acc = null;\r\n\t\ttry {\r\n\t\t\tSystem.out.println(\"Before Repeat\");\r\n\t\t\tacc = getSavingAccountList();\r\n\r\n\t\t\tfor (SavingAccount savingAcc : acc) {\r\n\t\t\t\tif (!(\"0\".equals(savingAcc.getState()))) {\r\n\t\t\t\t\tif (savingAcc.getState().equals(\"active\")) {\r\n\t\t\t\t\t\tint maxRepeat = Integer.parseInt(savingAcc\r\n\t\t\t\t\t\t\t\t.getRepeatable());\r\n\r\n\t\t\t\t\t\tDate date = new Date();\r\n\t\t\t\t\t\tDate systemDate = savingAccSer\r\n\t\t\t\t\t\t\t\t.convertStringToDateDDmmYYYY(savingAccSer\r\n\t\t\t\t\t\t\t\t\t\t.convertDateToStringDDmmYYYY(date));\r\n\r\n\t\t\t\t\t\tDate dateEnd = savingAccSer\r\n\t\t\t\t\t\t\t\t.convertStringToDateDDmmYYYY(savingAcc\r\n\t\t\t\t\t\t\t\t\t\t.getDateEnd());\r\n\r\n\t\t\t\t\t\tif (systemDate.getTime() == dateEnd.getTime()) {\r\n\t\t\t\t\t\t\tDate newEndDate = DateUtils.addMonths(systemDate,\r\n\t\t\t\t\t\t\t\t\tsavingAcc.getInterestRateId().getMonth());\r\n\r\n\t\t\t\t\t\t\tfloat balance = savingAcc.getBalanceAmount();\r\n\t\t\t\t\t\t\tfloat interest = savingAcc.getInterestRateId()\r\n\t\t\t\t\t\t\t\t\t.getInterestRate();\r\n\r\n\t\t\t\t\t\t\tint month = savingAcc.getInterestRateId()\r\n\t\t\t\t\t\t\t\t\t.getMonth();\r\n\t\t\t\t\t\t\tint days = Days\r\n\t\t\t\t\t\t\t\t\t.daysBetween(\r\n\t\t\t\t\t\t\t\t\t\t\tnew DateTime(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsavingAccSer\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.convertStringToDate(savingAcc\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getDateStart())),\r\n\t\t\t\t\t\t\t\t\t\t\tnew DateTime(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsavingAccSer\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.convertStringToDate(savingAcc\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getDateEnd())))\r\n\t\t\t\t\t\t\t\t\t.getDays();\r\n\t\t\t\t\t\t\tfloat amountAll = balance\r\n\t\t\t\t\t\t\t\t\t+ (balance * ((interest / (100)) / 360) * days);\r\n\t\t\t\t\t\t\tsavingAcc.setDateStart(savingAccSer\r\n\t\t\t\t\t\t\t\t\t.convertDateToString(systemDate));\r\n\t\t\t\t\t\t\tsavingAcc.setDateEnd(savingAccSer\r\n\t\t\t\t\t\t\t\t\t.convertDateToString(newEndDate));\r\n\t\t\t\t\t\t\tsavingAcc.setBalanceAmount(amountAll);\r\n\t\t\t\t\t\t\tsavingAcc.setRepeatable(\"\" + (maxRepeat + 1));\r\n\t\t\t\t\t\t\tupdateSavingAccount(savingAcc);\r\n\t\t\t\t\t\t\tcount+=1;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\tSystem.out.println(\"Successfully!! \"+ count +\" Saving Account has been updated. Minh Map!!!\");\r\n\t\t\t\r\n\t\t\treturn \"success\";\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.out.println(\"Exception\");\r\n\r\n\t\t}\r\n\t\treturn \"Fail\";\r\n\t}",
"public void setBalance(Double balance) {\r\n this.balance = balance;\r\n }",
"@Override\n\tpublic int accountUpdate(String id, String balance) {\n\t\tSession session=sessionFactory.openSession();\n\t\tTransaction tr = session.beginTransaction();\n\t\tint executeUpdate = 0;\n\t\tString sqlString=\"update user set balance = '\"+balance+\"' where id ='\"+id+\"'\";\n\t\ttry {\n\t\t\tQuery query=session.createSQLQuery(sqlString);\n\t\t\texecuteUpdate = query.executeUpdate();\n\t\t\tSystem.out.println(\"executeUpdate:\"+executeUpdate);\n\t\t} catch (HibernateException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}finally{\n\t\t\ttr.commit();\n\t\t session.close();\n\t\t}\n\t\treturn executeUpdate;\t\n\t}",
"public void Deposit(Integer accountNo,float depositMoney){\n\tSessionFactory sessionFactory = new Configuration().configure(\"hibernate.cfg.xml\").buildSessionFactory();\n\tSession session = sessionFactory.openSession();\n\tTransaction trans = null;\n\ttry{\n\t\ttrans = session.beginTransaction();\n\t\tQuery query=session.createQuery(\"UPDATE Account set balance+=:balance where accountNo=:accountNo\"); \n\t\tquery.setParameter(\"balance\",depositMoney); \n\t\tquery.setParameter(\"accountNo\",accountNo); \n\t}catch(HibernateException hibernateException){\n\t\tif(trans != null){\n\t\t\ttrans.rollback();\n\t\t}\n\t\thibernateException.printStackTrace();\n\t}\n\t}",
"public java.math.BigDecimal getBalance() {\n return balance;\n }"
] | [
"0.6256659",
"0.6253897",
"0.6161887",
"0.6052792",
"0.6007962",
"0.5992738",
"0.598382",
"0.59808713",
"0.59671104",
"0.59655404",
"0.59493804",
"0.5944475",
"0.5944475",
"0.5929044",
"0.58891714",
"0.58717656",
"0.5871257",
"0.5839201",
"0.58093864",
"0.5794495",
"0.5794373",
"0.5794373",
"0.5792861",
"0.5790225",
"0.5790225",
"0.5777398",
"0.5777398",
"0.576912",
"0.576912",
"0.57617587",
"0.57617587",
"0.5743701",
"0.57244354",
"0.5722053",
"0.5708364",
"0.57033765",
"0.56972003",
"0.569613",
"0.567973",
"0.5677364",
"0.5669179",
"0.5660392",
"0.5658301",
"0.56578594",
"0.5655242",
"0.5647081",
"0.5645896",
"0.56420755",
"0.5628228",
"0.5627138",
"0.5626427",
"0.5623627",
"0.5606722",
"0.56027985",
"0.56014687",
"0.5595286",
"0.5582922",
"0.5579553",
"0.5579103",
"0.55756223",
"0.55752707",
"0.5569577",
"0.5568102",
"0.5566652",
"0.55662084",
"0.5561891",
"0.55556166",
"0.5543907",
"0.5536255",
"0.5535043",
"0.5523186",
"0.55217797",
"0.551842",
"0.55178934",
"0.5515522",
"0.5512042",
"0.55097926",
"0.5505763",
"0.5505763",
"0.5505763",
"0.5505763",
"0.55049235",
"0.55021036",
"0.5498412",
"0.54945385",
"0.5494492",
"0.5492579",
"0.5492579",
"0.5489636",
"0.54847556",
"0.54788065",
"0.5473692",
"0.5472998",
"0.5469174",
"0.54671735",
"0.5467048",
"0.54647994",
"0.5461322",
"0.5448236",
"0.54227674",
"0.54078424"
] | 0.0 | -1 |
This method was generated by MyBatis Generator. This method corresponds to the database table stone_balance | public void or(Criteria criteria) {
oredCriteria.add(criteria);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int baldown(double newbalance, Long accountno, Long broaccno, Double bramt) throws Exception{\n\tint j=DbConnect.getStatement().executeUpdate(\"update account set balance=\"+newbalance+\" where accno=\"+accountno+\"\");\r\n\tint i=DbConnect.getStatement().executeUpdate(\"update account set balance=balance+\"+bramt+\" where accno=\"+broaccno+\"\");\r\n\treturn i;\r\n}",
"public int balup(double newbalance, Long accountno, Long broaccno, Double bramt) throws Exception{\n\tint j=DbConnect.getStatement().executeUpdate(\"update account set balance=\"+newbalance+\" where accno=\"+accountno+\"\");\r\n\tint i=DbConnect.getStatement().executeUpdate(\"update account set balance=balance+\"+bramt+\" where accno=\"+broaccno+\"\");\r\n\treturn i;\r\n}",
"private void listBalances() {\n\t\t\r\n\t}",
"public Money getTotalBalance();",
"private void updateDatabaseAccountBalance() {\n\t\tString sql = \"UPDATE account SET balance = \" + this.balance + \" \";\n\t\tsql += \"WHERE accountID = '\" + this.accountID + \"';\";\n\n\t\tDbUtilities db = new MySqlUtilities();\n\t\tdb.executeQuery(sql);\n\t}",
"public ResultSet retBalance(Long userid) throws SQLException {\n\trs=DbConnect.getStatement().executeQuery(\"Select balance from account where accno=\"+userid+\"\");\r\n\treturn rs;\r\n}",
"@Override\r\n\tpublic double showbalanceDao() {\n\t\t\r\n\t\treturn temp.getCustBal();\r\n\t}",
"public String getBalance() {\n return this.balance;\n }",
"public int getBalance() {\n return this.balance;\n\n }",
"public void withdraw(String accountNumber, int amount) {\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp, ll;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\tint lastBalance;\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\ttry{\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql = \"select balance,userId from \"+this.name+\" where accountNumber=?\";\n\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\tps.setString(1, accountNumber.toString());\n\t\tResultSet rs = ps.executeQuery();\n\t\tint nowBalance = 0;\n\t\tString id = \"\";\n\t\twhile(rs.next()) { \n\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\tid = rs.getString(\"userId\");\n\t\t}\n\t\tif (nowBalance<amount) {\n\t\t\tSystem.out.println(\"No Balance\");\n\t\t\treturn;\n\t\t}\n\t\tlastBalance = nowBalance - amount;\n\t\t//System.out.println(lastBalance);\n\t\t\n\t\tString sql1 = \"UPDATE \"+this.name+\" SET balance=? where accountNumber=?\";\n\t\tpp = (PreparedStatement) conn.prepareStatement(sql1);\n\t\tpp.setInt(1, lastBalance);\n\t\tpp.setString(2, accountNumber.toString());\n\t\tpp.executeUpdate();\n\t\t\n\t\tString logs = \"withdraw : \"+ amount+\" / balance: \"+String.valueOf(lastBalance);\n\t\tString sql11 = \"insert into \"+id+\" (log) values (?)\";\n\t\tll = (PreparedStatement) conn.prepareStatement(sql11);\n\t\tll.setString(1, logs);\n\t\tll.executeUpdate();\n\t\tSystem.out.println(\"Ypu got $\"+String.valueOf(amount));\n\t\t\n\t\t}catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t\t\n\t}",
"Balance[] findAllByBankAccount_Id(Long id);",
"double getBalance();",
"double getBalance();",
"public int getBalance()\n {\n return balance;\n }",
"public double getBalance()\n \n {\n \n return balance;\n \n }",
"public double getBalance(){\n return this.balance;\r\n }",
"@Override\n\tpublic double queryBalance(int accNo) {\n\t\treturn 0;\n\t}",
"public void wire(String accountNumber,int bankNumber, String toAccountNumber, int amount) {\n\t\t\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp, ll, lp, ls, mm, nn;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\tint lastBalance;\n\t\tint tolastBalance;\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\ttry{\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql = \"select balance,userId from \"+this.name+\" where accountNumber=?\";\n\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\tps.setString(1, accountNumber.toString());\n\t\tResultSet rs = ps.executeQuery();\n\t\tint nowBalance = 0;\n\t\tString id = \"\";\n\t\twhile(rs.next()) { \n\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\tid = rs.getString(\"userId\");\n\t\t}\n\t\tif (nowBalance<amount) {\n\t\t\tSystem.out.println(\"No Balance\");\n\t\t\treturn;\n\t\t}\n\t\tlastBalance = nowBalance - amount;\n\t\t//System.out.println(lastBalance);\n\t\tString sql1 = \"UPDATE \"+this.name+\" SET balance=? where accountNumber=?\";\n\t\tls = (PreparedStatement) conn.prepareStatement(sql1);\n\t\tls.setInt(1, lastBalance);\n\t\tls.setString(2, accountNumber.toString());\n\t\tls.executeUpdate();\n\t\t\n\t\t\n\t\t\n\t\t//to account\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql3 = \"select bankName from bank where bankNumber=?\";\n\t\tll= (PreparedStatement) conn.prepareStatement(sql3);\n\t\tll.setString(1, String.valueOf(bankNumber).toString());\n\t\tResultSet rs3 = ll.executeQuery();\n\t\tString toname = \"\";\n\t\twhile(rs3.next()) { \n\t\t\ttoname=rs3.getString(\"bankName\");\n\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tString sql4 = \"select balance,userId from \"+toname+\" where accountNumber=?\";\n\t\tpp= (PreparedStatement) conn.prepareStatement(sql4);\n\t\tpp.setString(1, accountNumber.toString());\n\t\tResultSet rs4 = pp.executeQuery();\n\t\tint tonowBalance = 0;\n\t\tString toid = \"\";\n\t\twhile(rs4.next()) { \n\t\t\ttonowBalance=rs4.getInt(\"balance\");\n\t\t\ttoid = rs4.getString(\"userId\");\n\t\t}\n\t\t\n\t\ttolastBalance = tonowBalance + amount;\n\t\t//System.out.println(lastBalance);\n\t\tString sql5 = \"UPDATE \"+toname+\" SET balance=? where accountNumber=?\";\n\t\tlp = (PreparedStatement) conn.prepareStatement(sql5);\n\t\tlp.setInt(1, tolastBalance);\n\t\tlp.setString(2, toAccountNumber.toString());\n\t\tlp.executeUpdate();\n\t\t\n\t\t\n\t\t//log\n\t\tString logs = \"wired : \"+ amount+\" to \"+toAccountNumber+\"/ balance: \"+String.valueOf(lastBalance);\n\t\tString sql11 = \"insert into \"+id+\" (log) values (?)\";\n\t\tmm = (PreparedStatement) conn.prepareStatement(sql11);\n\t\tmm.setString(1, logs);\n\t\tmm.executeUpdate();\n\t\tSystem.out.println(\"You wired $\"+String.valueOf(amount));\n\t\t\n\t\tString logs1 = \"get : \"+ amount+\" from \" +accountNumber+ \"/ balance: \"+String.valueOf(tolastBalance);\n\t\tString sql12 = \"insert into \"+toid+\" (log) values (?)\";\n\t\tnn = (PreparedStatement) conn.prepareStatement(sql12);\n\t\tnn.setString(1, logs1);\n\t\tnn.executeUpdate();\n\t\tSystem.out.println(\"You got $\"+String.valueOf(amount));\n\t\t\n\t\t\n\t\t}catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t}",
"public double getBalance(){\n return balance;\n }",
"public double getBalance(){\n return balance;\r\n }",
"public Integer getBalance() {\n return balance;\n }",
"public Integer getBalance() {\n return balance;\n }",
"public long getBalance() {\n\t\n\treturn balance;\n}",
"public int getBalance() {\n return balance;\n }",
"public int getBalance() {\n return balance;\n }",
"public void setBalance(Integer balance) {\n this.balance = balance;\n }",
"public void setBalance(Integer balance) {\n this.balance = balance;\n }",
"public BigDecimal getBalance() {\n return balance;\n }",
"public BigDecimal getBalance() {\n return balance;\n }",
"public void setBalance(BigDecimal balance) {\n this.balance = balance;\n }",
"public void setBalance(BigDecimal balance) {\n this.balance = balance;\n }",
"public double getBalance(){\r\n\t\treturn balance;\r\n\t}",
"public float getBalance()\r\n\t{\n\t\ttry\r\n\t\t{\r\n\t\t\tDBConnection ToDB = new DBConnection(); //Have a connection to the DB\r\n\t\t\tConnection DBConn = ToDB.openConn();\r\n\t\t\tStatement Stmt = DBConn.createStatement();\r\n\t\t\tString SQL_Command = \"SELECT Balance FROM SavingsAccount WHERE SavingsAccountNumber ='\"+SavingsAccountNumber+\"'\"; //SQL query command for Balance\r\n\t\t\tResultSet Rslt = Stmt.executeQuery(SQL_Command);\r\n\t\t\twhile (Rslt.next())\r\n\t\t\t{\r\n\t\t\t\tBalance = Rslt.getFloat(1);\r\n\t\t\t}\r\n\t\t\tStmt.close();\r\n\t\t\tToDB.closeConn();\r\n\t\t}\r\n\t\tcatch(SQLException e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"SQLException: \" + e);\r\n\t\t\twhile (e != null)\r\n\t\t\t{ System.out.println(\"SQLState: \" + e.getSQLState());\r\n\t\t\t\tSystem.out.println(\"Message: \" + e.getMessage());\r\n\t\t\t\tSystem.out.println(\"Vendor: \" + e.getErrorCode());\r\n\t\t\t\te = e.getNextException();\r\n\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (Exception e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Exception: \" + e);\r\n\t\t\te.printStackTrace ();\r\n\t\t}\r\n\t\treturn Balance;\r\n\t}",
"private void updateBalance(int balance) throws SQLException {\n\t\tupdateBalanceStatement.clearParameters();\n\t\tupdateBalanceStatement.setInt(1, balance);\n\t\tupdateBalanceStatement.setString(2, this.username);\n\t\tupdateBalanceStatement.executeUpdate();\n\t}",
"public long getBalance() {\n return this.balance;\n }",
"public String balance() {\n\t\treturn this.apiCall(\"balance\", \"\", \"\", true);\n\t}",
"@Override\n\tpublic double getAccountBalance(final int bankAccountId, final String vcDate, final Connection connection)\n\t{\n\t\tdouble opeAvailable = 0, totalAvailable = 0;\n\t\ttry {\n\n\t\t\tfinal StringBuilder str = new StringBuilder(\"SELECT case when sum(openingDebitBalance) = null then 0\")\n\t\t\t\t\t.append(\" ELSE sum(openingDebitBalance) end - case when sum(openingCreditBalance) = null then 0\")\n\t\t\t\t\t.append(\" else sum(openingCreditBalance) end AS \\\"openingBalance\\\" \")\n\t\t\t\t\t.append(\"FROM transactionSummary WHERE financialYearId=( SELECT id FROM financialYear WHERE startingDate <= ?\")\n\t\t\t\t\t.append(\"AND endingDate >= ?) AND glCodeId =(select glcodeid from bankaccount where id= ?)\");\n\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\tLOGGER.info(str);\n\t\t\tQuery pst = persistenceService.getSession().createSQLQuery(str.toString());\n\t\t\tpst.setString(0, vcDate);\n\t\t\tpst.setString(1, vcDate);\n\t\t\tpst.setInteger(2, bankAccountId);\n\t\t\tList<Object[]> rset = pst.list();\n\t\t\tfor (final Object[] element : rset)\n\t\t\t\topeAvailable = Double.parseDouble(element[0].toString());\n\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\tLOGGER.info(\"opening balance \" + opeAvailable);\n\n\t\t\tfinal StringBuilder str1 = new StringBuilder(\"SELECT (case when sum(gl.debitAmount) = null then 0\")\n\t\t\t\t\t.append(\" else sum(gl.debitAmount) end - case when sum(gl.creditAmount) = null then 0\")\n\t\t\t\t\t.append(\" else sum(gl.creditAmount) end) + \").append(opeAvailable).append(\"\")\n\t\t\t\t\t.append(\" as \\\"totalAmount\\\" FROM generalLedger gl, voucherHeader vh WHERE vh.id = gl.voucherHeaderId\")\n\t\t\t\t\t.append(\" AND gl.glCodeid = (select glcodeid from bankaccount where id= ?) AND \")\n\t\t\t\t\t.append(\" vh.voucherDate >=( SELECT TO_CHAR(startingDate, 'dd-Mon-yyyy')\")\n\t\t\t\t\t.append(\" FROM financialYear WHERE startingDate <= ? AND endingDate >= ?) AND vh.voucherDate <= ?\");\n\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\tLOGGER.info(str1);\n\t\t\tpst = persistenceService.getSession().createSQLQuery(str1.toString());\n\t\t\tpst.setInteger(0, bankAccountId);\n\t\t\tpst.setString(1, vcDate);\n\t\t\tpst.setString(2, vcDate);\n\t\t\tpst.setString(3, vcDate);\n\t\t\trset = pst.list();\n\t\t\tfor (final Object[] element : rset) {\n\t\t\t\ttotalAvailable = Double.parseDouble(element[0].toString());\n\t\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\t\tLOGGER.info(\"total balance \" + totalAvailable);\n\t\t\t}\n\n\t\t} catch (final HibernateException e) {\n\t\t\tLOGGER.error(\" could not get Bankbalance \" + e.toString(), e);\n\t\t\tthrow new HibernateException(e.toString());\n\t\t}\n\t\treturn totalAvailable;\n\t}",
"public void setBalance( long balance ) {\r\n this.balance = balance;\r\n }",
"public double getBalance(){\n return balance;\n }",
"public double getBalance(){\n return balance;\n }",
"public double getBalance()\n {\n return balance;\n }",
"public BankAccount(int balance) {\n\n this.balance = balance;\n\n }",
"public void setBalance(int balance) {\r\n\t\tif(0<=balance&&balance<=1000000) {\r\n\t\tthis.balance = balance;\r\n\t}else{\r\n\t\t System.out.println(\"잘못 입력하셨습니다. 현재 잔고는 \"+this.balance+\"입니다\");\r\n\t}\r\n \r\n}",
"public void setBalance(float balance) {\n this.balance = balance;\n }",
"@Override\r\n\tpublic Double getBalance( Integer id) {\n\t\tString sql = \"SELECT balance FROM buyers WHERE id = ?;\";\r\n\t\treturn jdbcTemplate.queryForObject( sql, Double.class, id);\r\n\t}",
"public float showBalance() {\n\t\treturn dao.showBalance();\r\n\t}",
"public double getBalance(){\n\t\treturn balance;\n\t}",
"public double getBalance() {\n return balance;\n }",
"public Double getBalance() {\r\n return balance;\r\n }",
"public String getBalance() {\n return balance;\n }",
"void setManageTransactionBalance(String balance);",
"public static void getAcountsBalance(int value) {\n\t\t\t\n\t\t\taccounts.clear();\n\n\t\t\tString query = \"select account.accID, accType, balance, dateCreated, fName, lName \" + \n\t\t \"from ser322.account,ser322.customer \" + \n\t\t \"WHERE customer.accID = account.accID AND balance =\" + value;\n\t\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\tStatement stmt = con.getConnection().createStatement();\n\t\t\t ResultSet rs = stmt.executeQuery(query);\n\t\t while (rs.next()) {\n\t\t \taccounts.addElement(new Account(rs.getInt(\"accID\"),rs.getString(\"accType\"),\n\t\t \t\t\t rs.getFloat(\"balance\"),rs.getDate(\"dateCreated\"), rs.getString(\"fName\"), rs.getString(\"lName\")));\n\t\t \n\t\t }\n\t\t \n\t\t } catch (SQLException e ) {\n\t\t \tSystem.out.println(\"QUERY WRONG - getAcountsBalance\");\n\t\t }\n\t\n\t\t}",
"public BaseJson<BigDecimal> wallet_balance() throws Exception {\n String s = main(\"wallet_balance\",\"[]\");\n return JsonHelper.jsonStr2Obj(s, BaseJson.class);\n }",
"public Double getBalance(){\n Double sum = 0.0;\n // Mencari balance dompet dari transaksi dengan cara menghitung total transaksi\n for (Transaction transaction : transactions) {\n sum += transaction.getAmount().doubleValue();\n }\n return sum;\n }",
"public Account(){\n this.id = 0;\n this.balance = 0;\n this.annualInterestRate = 0;\n this.dateCreated = new Date();\n }",
"public void setBalance(){\n balance.setBalance();\n }",
"@java.lang.Override\n public com.google.protobuf.ByteString\n getBalanceBytes() {\n java.lang.Object ref = balance_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n balance_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public StoneBalanceExample() {\n oredCriteria = new ArrayList<Criteria>();\n }",
"double getBalance(UUID name);",
"Databank getBank();",
"public double getBal() {\n\t\t return balance;\r\n\t }",
"@Override\r\npublic void checkBalance() {\n\t\r\n}",
"public int getBalance() {\n\t\treturn balance;\n\t}",
"public void setBalance(java.math.BigDecimal balance) {\n this.balance = balance;\n }",
"public int getBalance() {\n return total_bal;\n }",
"public int getPropertyBalance();",
"public BankAccount getAccountBalanceRepo(String accountNr){\n String sql = \"SELECT * FROM bankaccount WHERE accountnr = :accountnr\";\n Map paramMap = new HashMap();\n paramMap.put(\"accountnr\", accountNr);\n BankAccount result = jdbcTemplate.queryForObject(sql, paramMap, new AccountRowMapper());\n return result;\n }",
"private int getBalance() throws SQLException {\n\t\tgetBalanceStatement.clearParameters();\n\t\tgetBalanceStatement.setString(1, this.username);\n\t\tResultSet result = getBalanceStatement.executeQuery();\n\t\tresult.next();\n\t\tint out = result.getInt(1);\n\t\tresult.close();\n\t\treturn out;\n\t}",
"public BankAccount findAccountById(int currentBankID) throws SQLException;",
"public void deposit(double amount) {\n balance += amount;\n \n try {\n \n Class.forName(\"net.ucanaccess.jdbc.UcanaccessDriver\");\n \n // Load Driver\n String connURL=\"jdbc:ucanaccess://c:/Users/Ellen/Documents/CIST2373/ChattBankMDB.mdb\";\n \n // Get Connection\n Connection con = DriverManager.getConnection(connURL);\n \n // Create Statement\n Statement stmt = con.createStatement();\n \n // Create sql string \n String sql = \"Update Accounts set Balance = \"+getBalance()+ \n \" where AcctNo='\"+getAcctNo()+\"'\";\n \n // Check for properly formed sql\n System.out.println(sql);\n \n // Execute Statement\n int n = stmt.executeUpdate(sql);\n if (n == 1)\n System.out.println(\"Update was successful!\");\n else\n System.out.println(\"Update failed!\"); \n \n // Close Connection\n con.close(); \n } //end try\n \n catch (Exception err) {\n System.out.println(\"Error: \" + err);\n } //end catch\n }",
"public BankAccount() {\r\n\t\tbalance=0;\r\n\t\t\r\n\t}",
"public void initializeBalance() {\n try {\n Connection connection = connect();\n\n PreparedStatement createBalanceTable = connection.prepareStatement(\"CREATE TABLE IF NOT EXISTS balance (\"\n + \"id INTEGER PRIMARY KEY,\"\n + \"user_username varchar(100),\"\n + \"amount float, \"\n + \"time varchar,\"\n + \"FOREIGN KEY (user_username) REFERENCES User(username));\"\n );\n createBalanceTable.execute();\n createBalanceTable.close();\n connection.close();\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }",
"public void showAccountBalance(){\n balance();\n\n }",
"public void balance(){\n\t\tnamesTree.balance();\n\t\taccountNumbersTree.balance();\n\t}",
"public double getBalance() {\n return this.balance;\n }",
"public Balance() {\r\n value = BigDecimal.ZERO;\r\n }",
"public void setBalance(final int balance)\n {\n this.balance = balance;\n }",
"public double getBalance() {\n return balance;\n }",
"public double getBalance() {\n return balance;\n }",
"public double getBalance() {\n return balance;\n }",
"public double getBalance() {\n return balance;\n }",
"public float getBalance() {\n return balance;\n }",
"private double getBalance() { return balance; }",
"public Double getBalance() {\n return null;\n }",
"public double getBalance()\r\n\t{\r\n\t\treturn balance;\t\t\r\n\t}",
"public void setBalance(double balance){\n\t\tthis.balance = balance;\n\t}",
"BigDecimal getOpeningDebitBalance();",
"BigDecimal getOpeningDebitBalance();",
"public com.google.protobuf.ByteString\n getBalanceBytes() {\n java.lang.Object ref = balance_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n balance_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public void InitializeBalance(BigDecimal valor){\n \r\n ChekingAccount chekAc=pRepository.GetChekingAccount();\r\n chekAc.setSaldoInicial(valor);\r\n pRepository.SaveChekingAccount(chekAc);\r\n \r\n }",
"Account(int balance) {\n if(balance <0) this.balance=0;\n this.balance = balance;\n }",
"public void updateBalance(String mobileNo,int balance)\n\t{\n\t\tContext ctx;\n\t\ttry {\n\t\t\tctx = new InitialContext();\n\t\t\n\t\t\n\t\t DataSource ds=(DataSource)ctx.lookup(\"java:OracleDS\");\n\t\t\tConnection con=ds.getConnection();\n\t\t\tStatement stmt=con.createStatement();\n\t\t\t\n\t\t\tstmt.executeUpdate(\"update mobile set balance=\"+balance+\" where mobileno=\"+mobileNo);\n\t\t\tcon.close();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Error in connection with Database :\"+e.getMessage());\n\t\t\t\n\t\t}\n\t\t\n\t}",
"public int balance(String accountNumber, String userId) {\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\t\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\t\n\t\ttry{\n\t\t\t//connect to database\n\t\t\tconn=DriverManager.getConnection(url, username, password);\n\t\t\tString sql = \"select balance from \"+this.name+\" where accountNumber=?\";\n\t\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\t\tps.setString(1, accountNumber.toString());\n\t\t\tResultSet rs = ps.executeQuery();\n\t\t\tint nowBalance = 0;\n\t\t\twhile(rs.next()) { \n\t\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\t}\n\t\t\t\n\t\t\tString logs = \"Checked balance: \"+String.valueOf(nowBalance);\n\t\t\tString sql1 = \"insert into \"+userId+\" (log) values (?)\";\n\t\t\tpp = (PreparedStatement) conn.prepareStatement(sql1);\n\t\t\tpp.setString(1, logs);\n\t\t\tpp.executeUpdate();\n\t\t\t\n\t\t\treturn nowBalance;\n\t\t} catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t\t\n\t}",
"public double getBalance()\n {\n return startingBalance;\n }",
"public void deposit(String accountNumber, int amount) {\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp, ll;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\tint lastBalance;\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\ttry{\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql = \"select balance,userId from \"+this.name+\" where accountNumber=?\";\n\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\tps.setString(1, accountNumber.toString());\n\t\tResultSet rs = ps.executeQuery();\n\t\tint nowBalance = 0;\n\t\tString id = \"\";\n\t\twhile(rs.next()) { \n\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\tid = rs.getString(\"userId\");\n\t\t}\n\t\tlastBalance = nowBalance + amount;\n\t\t//System.out.println(lastBalance);\n\t\t\n\t\tString sql1 = \"UPDATE \"+this.name+\" SET balance=? where accountNumber=?\";\n\t\tpp = (PreparedStatement) conn.prepareStatement(sql1);\n\t\tpp.setInt(1, lastBalance);\n\t\tpp.setString(2, accountNumber.toString());\n\t\tpp.executeUpdate();\n\t\t\n\t\tString logs = \"deposit : \"+ amount+\" / balance: \"+String.valueOf(lastBalance);\n\t\tString sql11 = \"insert into \"+id+\" (log) values (?)\";\n\t\tll = (PreparedStatement) conn.prepareStatement(sql11);\n\t\tll.setString(1, logs);\n\t\tll.executeUpdate();\n\t\t\n\t\t}catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t}",
"public List<DietaBalanceada> consultar_dietaBalanceada();",
"public String myAfterBalanceAmount() {\r\n\t\tint count=0;\r\n\t\tList<SavingAccount> acc = null;\r\n\t\ttry {\r\n\t\t\tSystem.out.println(\"Before Repeat\");\r\n\t\t\tacc = getSavingAccountList();\r\n\r\n\t\t\tfor (SavingAccount savingAcc : acc) {\r\n\t\t\t\tif (!(\"0\".equals(savingAcc.getState()))) {\r\n\t\t\t\t\tif (savingAcc.getState().equals(\"active\")) {\r\n\t\t\t\t\t\tint maxRepeat = Integer.parseInt(savingAcc\r\n\t\t\t\t\t\t\t\t.getRepeatable());\r\n\r\n\t\t\t\t\t\tDate date = new Date();\r\n\t\t\t\t\t\tDate systemDate = savingAccSer\r\n\t\t\t\t\t\t\t\t.convertStringToDateDDmmYYYY(savingAccSer\r\n\t\t\t\t\t\t\t\t\t\t.convertDateToStringDDmmYYYY(date));\r\n\r\n\t\t\t\t\t\tDate dateEnd = savingAccSer\r\n\t\t\t\t\t\t\t\t.convertStringToDateDDmmYYYY(savingAcc\r\n\t\t\t\t\t\t\t\t\t\t.getDateEnd());\r\n\r\n\t\t\t\t\t\tif (systemDate.getTime() == dateEnd.getTime()) {\r\n\t\t\t\t\t\t\tDate newEndDate = DateUtils.addMonths(systemDate,\r\n\t\t\t\t\t\t\t\t\tsavingAcc.getInterestRateId().getMonth());\r\n\r\n\t\t\t\t\t\t\tfloat balance = savingAcc.getBalanceAmount();\r\n\t\t\t\t\t\t\tfloat interest = savingAcc.getInterestRateId()\r\n\t\t\t\t\t\t\t\t\t.getInterestRate();\r\n\r\n\t\t\t\t\t\t\tint month = savingAcc.getInterestRateId()\r\n\t\t\t\t\t\t\t\t\t.getMonth();\r\n\t\t\t\t\t\t\tint days = Days\r\n\t\t\t\t\t\t\t\t\t.daysBetween(\r\n\t\t\t\t\t\t\t\t\t\t\tnew DateTime(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsavingAccSer\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.convertStringToDate(savingAcc\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getDateStart())),\r\n\t\t\t\t\t\t\t\t\t\t\tnew DateTime(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsavingAccSer\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.convertStringToDate(savingAcc\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getDateEnd())))\r\n\t\t\t\t\t\t\t\t\t.getDays();\r\n\t\t\t\t\t\t\tfloat amountAll = balance\r\n\t\t\t\t\t\t\t\t\t+ (balance * ((interest / (100)) / 360) * days);\r\n\t\t\t\t\t\t\tsavingAcc.setDateStart(savingAccSer\r\n\t\t\t\t\t\t\t\t\t.convertDateToString(systemDate));\r\n\t\t\t\t\t\t\tsavingAcc.setDateEnd(savingAccSer\r\n\t\t\t\t\t\t\t\t\t.convertDateToString(newEndDate));\r\n\t\t\t\t\t\t\tsavingAcc.setBalanceAmount(amountAll);\r\n\t\t\t\t\t\t\tsavingAcc.setRepeatable(\"\" + (maxRepeat + 1));\r\n\t\t\t\t\t\t\tupdateSavingAccount(savingAcc);\r\n\t\t\t\t\t\t\tcount+=1;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\tSystem.out.println(\"Successfully!! \"+ count +\" Saving Account has been updated. Minh Map!!!\");\r\n\t\t\t\r\n\t\t\treturn \"success\";\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.out.println(\"Exception\");\r\n\r\n\t\t}\r\n\t\treturn \"Fail\";\r\n\t}",
"public void setBalance(Double balance) {\r\n this.balance = balance;\r\n }",
"@Override\n\tpublic int accountUpdate(String id, String balance) {\n\t\tSession session=sessionFactory.openSession();\n\t\tTransaction tr = session.beginTransaction();\n\t\tint executeUpdate = 0;\n\t\tString sqlString=\"update user set balance = '\"+balance+\"' where id ='\"+id+\"'\";\n\t\ttry {\n\t\t\tQuery query=session.createSQLQuery(sqlString);\n\t\t\texecuteUpdate = query.executeUpdate();\n\t\t\tSystem.out.println(\"executeUpdate:\"+executeUpdate);\n\t\t} catch (HibernateException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}finally{\n\t\t\ttr.commit();\n\t\t session.close();\n\t\t}\n\t\treturn executeUpdate;\t\n\t}",
"public void Deposit(Integer accountNo,float depositMoney){\n\tSessionFactory sessionFactory = new Configuration().configure(\"hibernate.cfg.xml\").buildSessionFactory();\n\tSession session = sessionFactory.openSession();\n\tTransaction trans = null;\n\ttry{\n\t\ttrans = session.beginTransaction();\n\t\tQuery query=session.createQuery(\"UPDATE Account set balance+=:balance where accountNo=:accountNo\"); \n\t\tquery.setParameter(\"balance\",depositMoney); \n\t\tquery.setParameter(\"accountNo\",accountNo); \n\t}catch(HibernateException hibernateException){\n\t\tif(trans != null){\n\t\t\ttrans.rollback();\n\t\t}\n\t\thibernateException.printStackTrace();\n\t}\n\t}",
"public java.math.BigDecimal getBalance() {\n return balance;\n }"
] | [
"0.6256659",
"0.6253897",
"0.6161887",
"0.6052792",
"0.6007962",
"0.5992738",
"0.598382",
"0.59808713",
"0.59671104",
"0.59655404",
"0.59493804",
"0.5944475",
"0.5944475",
"0.5929044",
"0.58891714",
"0.58717656",
"0.5871257",
"0.5839201",
"0.58093864",
"0.5794495",
"0.5794373",
"0.5794373",
"0.5792861",
"0.5790225",
"0.5790225",
"0.5777398",
"0.5777398",
"0.576912",
"0.576912",
"0.57617587",
"0.57617587",
"0.5743701",
"0.57244354",
"0.5722053",
"0.5708364",
"0.57033765",
"0.56972003",
"0.569613",
"0.567973",
"0.5677364",
"0.5669179",
"0.5660392",
"0.5658301",
"0.56578594",
"0.5655242",
"0.5647081",
"0.5645896",
"0.56420755",
"0.5628228",
"0.5627138",
"0.5626427",
"0.5623627",
"0.5606722",
"0.56027985",
"0.56014687",
"0.5595286",
"0.5582922",
"0.5579553",
"0.5579103",
"0.55756223",
"0.55752707",
"0.5569577",
"0.5568102",
"0.5566652",
"0.55662084",
"0.5561891",
"0.55556166",
"0.5543907",
"0.5536255",
"0.5535043",
"0.5523186",
"0.55217797",
"0.551842",
"0.55178934",
"0.5515522",
"0.5512042",
"0.55097926",
"0.5505763",
"0.5505763",
"0.5505763",
"0.5505763",
"0.55049235",
"0.55021036",
"0.5498412",
"0.54945385",
"0.5494492",
"0.5492579",
"0.5492579",
"0.5489636",
"0.54847556",
"0.54788065",
"0.5473692",
"0.5472998",
"0.5469174",
"0.54671735",
"0.5467048",
"0.54647994",
"0.5461322",
"0.5448236",
"0.54227674",
"0.54078424"
] | 0.0 | -1 |
This method was generated by MyBatis Generator. This method corresponds to the database table stone_balance | public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int baldown(double newbalance, Long accountno, Long broaccno, Double bramt) throws Exception{\n\tint j=DbConnect.getStatement().executeUpdate(\"update account set balance=\"+newbalance+\" where accno=\"+accountno+\"\");\r\n\tint i=DbConnect.getStatement().executeUpdate(\"update account set balance=balance+\"+bramt+\" where accno=\"+broaccno+\"\");\r\n\treturn i;\r\n}",
"public int balup(double newbalance, Long accountno, Long broaccno, Double bramt) throws Exception{\n\tint j=DbConnect.getStatement().executeUpdate(\"update account set balance=\"+newbalance+\" where accno=\"+accountno+\"\");\r\n\tint i=DbConnect.getStatement().executeUpdate(\"update account set balance=balance+\"+bramt+\" where accno=\"+broaccno+\"\");\r\n\treturn i;\r\n}",
"private void listBalances() {\n\t\t\r\n\t}",
"public Money getTotalBalance();",
"private void updateDatabaseAccountBalance() {\n\t\tString sql = \"UPDATE account SET balance = \" + this.balance + \" \";\n\t\tsql += \"WHERE accountID = '\" + this.accountID + \"';\";\n\n\t\tDbUtilities db = new MySqlUtilities();\n\t\tdb.executeQuery(sql);\n\t}",
"public ResultSet retBalance(Long userid) throws SQLException {\n\trs=DbConnect.getStatement().executeQuery(\"Select balance from account where accno=\"+userid+\"\");\r\n\treturn rs;\r\n}",
"@Override\r\n\tpublic double showbalanceDao() {\n\t\t\r\n\t\treturn temp.getCustBal();\r\n\t}",
"public String getBalance() {\n return this.balance;\n }",
"public void withdraw(String accountNumber, int amount) {\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp, ll;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\tint lastBalance;\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\ttry{\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql = \"select balance,userId from \"+this.name+\" where accountNumber=?\";\n\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\tps.setString(1, accountNumber.toString());\n\t\tResultSet rs = ps.executeQuery();\n\t\tint nowBalance = 0;\n\t\tString id = \"\";\n\t\twhile(rs.next()) { \n\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\tid = rs.getString(\"userId\");\n\t\t}\n\t\tif (nowBalance<amount) {\n\t\t\tSystem.out.println(\"No Balance\");\n\t\t\treturn;\n\t\t}\n\t\tlastBalance = nowBalance - amount;\n\t\t//System.out.println(lastBalance);\n\t\t\n\t\tString sql1 = \"UPDATE \"+this.name+\" SET balance=? where accountNumber=?\";\n\t\tpp = (PreparedStatement) conn.prepareStatement(sql1);\n\t\tpp.setInt(1, lastBalance);\n\t\tpp.setString(2, accountNumber.toString());\n\t\tpp.executeUpdate();\n\t\t\n\t\tString logs = \"withdraw : \"+ amount+\" / balance: \"+String.valueOf(lastBalance);\n\t\tString sql11 = \"insert into \"+id+\" (log) values (?)\";\n\t\tll = (PreparedStatement) conn.prepareStatement(sql11);\n\t\tll.setString(1, logs);\n\t\tll.executeUpdate();\n\t\tSystem.out.println(\"Ypu got $\"+String.valueOf(amount));\n\t\t\n\t\t}catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t\t\n\t}",
"public int getBalance() {\n return this.balance;\n\n }",
"Balance[] findAllByBankAccount_Id(Long id);",
"double getBalance();",
"double getBalance();",
"public int getBalance()\n {\n return balance;\n }",
"public double getBalance()\n \n {\n \n return balance;\n \n }",
"@Override\n\tpublic double queryBalance(int accNo) {\n\t\treturn 0;\n\t}",
"public double getBalance(){\n return this.balance;\r\n }",
"public void wire(String accountNumber,int bankNumber, String toAccountNumber, int amount) {\n\t\t\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp, ll, lp, ls, mm, nn;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\tint lastBalance;\n\t\tint tolastBalance;\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\ttry{\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql = \"select balance,userId from \"+this.name+\" where accountNumber=?\";\n\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\tps.setString(1, accountNumber.toString());\n\t\tResultSet rs = ps.executeQuery();\n\t\tint nowBalance = 0;\n\t\tString id = \"\";\n\t\twhile(rs.next()) { \n\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\tid = rs.getString(\"userId\");\n\t\t}\n\t\tif (nowBalance<amount) {\n\t\t\tSystem.out.println(\"No Balance\");\n\t\t\treturn;\n\t\t}\n\t\tlastBalance = nowBalance - amount;\n\t\t//System.out.println(lastBalance);\n\t\tString sql1 = \"UPDATE \"+this.name+\" SET balance=? where accountNumber=?\";\n\t\tls = (PreparedStatement) conn.prepareStatement(sql1);\n\t\tls.setInt(1, lastBalance);\n\t\tls.setString(2, accountNumber.toString());\n\t\tls.executeUpdate();\n\t\t\n\t\t\n\t\t\n\t\t//to account\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql3 = \"select bankName from bank where bankNumber=?\";\n\t\tll= (PreparedStatement) conn.prepareStatement(sql3);\n\t\tll.setString(1, String.valueOf(bankNumber).toString());\n\t\tResultSet rs3 = ll.executeQuery();\n\t\tString toname = \"\";\n\t\twhile(rs3.next()) { \n\t\t\ttoname=rs3.getString(\"bankName\");\n\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tString sql4 = \"select balance,userId from \"+toname+\" where accountNumber=?\";\n\t\tpp= (PreparedStatement) conn.prepareStatement(sql4);\n\t\tpp.setString(1, accountNumber.toString());\n\t\tResultSet rs4 = pp.executeQuery();\n\t\tint tonowBalance = 0;\n\t\tString toid = \"\";\n\t\twhile(rs4.next()) { \n\t\t\ttonowBalance=rs4.getInt(\"balance\");\n\t\t\ttoid = rs4.getString(\"userId\");\n\t\t}\n\t\t\n\t\ttolastBalance = tonowBalance + amount;\n\t\t//System.out.println(lastBalance);\n\t\tString sql5 = \"UPDATE \"+toname+\" SET balance=? where accountNumber=?\";\n\t\tlp = (PreparedStatement) conn.prepareStatement(sql5);\n\t\tlp.setInt(1, tolastBalance);\n\t\tlp.setString(2, toAccountNumber.toString());\n\t\tlp.executeUpdate();\n\t\t\n\t\t\n\t\t//log\n\t\tString logs = \"wired : \"+ amount+\" to \"+toAccountNumber+\"/ balance: \"+String.valueOf(lastBalance);\n\t\tString sql11 = \"insert into \"+id+\" (log) values (?)\";\n\t\tmm = (PreparedStatement) conn.prepareStatement(sql11);\n\t\tmm.setString(1, logs);\n\t\tmm.executeUpdate();\n\t\tSystem.out.println(\"You wired $\"+String.valueOf(amount));\n\t\t\n\t\tString logs1 = \"get : \"+ amount+\" from \" +accountNumber+ \"/ balance: \"+String.valueOf(tolastBalance);\n\t\tString sql12 = \"insert into \"+toid+\" (log) values (?)\";\n\t\tnn = (PreparedStatement) conn.prepareStatement(sql12);\n\t\tnn.setString(1, logs1);\n\t\tnn.executeUpdate();\n\t\tSystem.out.println(\"You got $\"+String.valueOf(amount));\n\t\t\n\t\t\n\t\t}catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t}",
"public double getBalance(){\n return balance;\n }",
"public double getBalance(){\n return balance;\r\n }",
"public Integer getBalance() {\n return balance;\n }",
"public Integer getBalance() {\n return balance;\n }",
"public long getBalance() {\n\t\n\treturn balance;\n}",
"public int getBalance() {\n return balance;\n }",
"public int getBalance() {\n return balance;\n }",
"public void setBalance(Integer balance) {\n this.balance = balance;\n }",
"public void setBalance(Integer balance) {\n this.balance = balance;\n }",
"public BigDecimal getBalance() {\n return balance;\n }",
"public BigDecimal getBalance() {\n return balance;\n }",
"public void setBalance(BigDecimal balance) {\n this.balance = balance;\n }",
"public void setBalance(BigDecimal balance) {\n this.balance = balance;\n }",
"public double getBalance(){\r\n\t\treturn balance;\r\n\t}",
"public float getBalance()\r\n\t{\n\t\ttry\r\n\t\t{\r\n\t\t\tDBConnection ToDB = new DBConnection(); //Have a connection to the DB\r\n\t\t\tConnection DBConn = ToDB.openConn();\r\n\t\t\tStatement Stmt = DBConn.createStatement();\r\n\t\t\tString SQL_Command = \"SELECT Balance FROM SavingsAccount WHERE SavingsAccountNumber ='\"+SavingsAccountNumber+\"'\"; //SQL query command for Balance\r\n\t\t\tResultSet Rslt = Stmt.executeQuery(SQL_Command);\r\n\t\t\twhile (Rslt.next())\r\n\t\t\t{\r\n\t\t\t\tBalance = Rslt.getFloat(1);\r\n\t\t\t}\r\n\t\t\tStmt.close();\r\n\t\t\tToDB.closeConn();\r\n\t\t}\r\n\t\tcatch(SQLException e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"SQLException: \" + e);\r\n\t\t\twhile (e != null)\r\n\t\t\t{ System.out.println(\"SQLState: \" + e.getSQLState());\r\n\t\t\t\tSystem.out.println(\"Message: \" + e.getMessage());\r\n\t\t\t\tSystem.out.println(\"Vendor: \" + e.getErrorCode());\r\n\t\t\t\te = e.getNextException();\r\n\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (Exception e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Exception: \" + e);\r\n\t\t\te.printStackTrace ();\r\n\t\t}\r\n\t\treturn Balance;\r\n\t}",
"private void updateBalance(int balance) throws SQLException {\n\t\tupdateBalanceStatement.clearParameters();\n\t\tupdateBalanceStatement.setInt(1, balance);\n\t\tupdateBalanceStatement.setString(2, this.username);\n\t\tupdateBalanceStatement.executeUpdate();\n\t}",
"public long getBalance() {\n return this.balance;\n }",
"public String balance() {\n\t\treturn this.apiCall(\"balance\", \"\", \"\", true);\n\t}",
"@Override\n\tpublic double getAccountBalance(final int bankAccountId, final String vcDate, final Connection connection)\n\t{\n\t\tdouble opeAvailable = 0, totalAvailable = 0;\n\t\ttry {\n\n\t\t\tfinal StringBuilder str = new StringBuilder(\"SELECT case when sum(openingDebitBalance) = null then 0\")\n\t\t\t\t\t.append(\" ELSE sum(openingDebitBalance) end - case when sum(openingCreditBalance) = null then 0\")\n\t\t\t\t\t.append(\" else sum(openingCreditBalance) end AS \\\"openingBalance\\\" \")\n\t\t\t\t\t.append(\"FROM transactionSummary WHERE financialYearId=( SELECT id FROM financialYear WHERE startingDate <= ?\")\n\t\t\t\t\t.append(\"AND endingDate >= ?) AND glCodeId =(select glcodeid from bankaccount where id= ?)\");\n\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\tLOGGER.info(str);\n\t\t\tQuery pst = persistenceService.getSession().createSQLQuery(str.toString());\n\t\t\tpst.setString(0, vcDate);\n\t\t\tpst.setString(1, vcDate);\n\t\t\tpst.setInteger(2, bankAccountId);\n\t\t\tList<Object[]> rset = pst.list();\n\t\t\tfor (final Object[] element : rset)\n\t\t\t\topeAvailable = Double.parseDouble(element[0].toString());\n\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\tLOGGER.info(\"opening balance \" + opeAvailable);\n\n\t\t\tfinal StringBuilder str1 = new StringBuilder(\"SELECT (case when sum(gl.debitAmount) = null then 0\")\n\t\t\t\t\t.append(\" else sum(gl.debitAmount) end - case when sum(gl.creditAmount) = null then 0\")\n\t\t\t\t\t.append(\" else sum(gl.creditAmount) end) + \").append(opeAvailable).append(\"\")\n\t\t\t\t\t.append(\" as \\\"totalAmount\\\" FROM generalLedger gl, voucherHeader vh WHERE vh.id = gl.voucherHeaderId\")\n\t\t\t\t\t.append(\" AND gl.glCodeid = (select glcodeid from bankaccount where id= ?) AND \")\n\t\t\t\t\t.append(\" vh.voucherDate >=( SELECT TO_CHAR(startingDate, 'dd-Mon-yyyy')\")\n\t\t\t\t\t.append(\" FROM financialYear WHERE startingDate <= ? AND endingDate >= ?) AND vh.voucherDate <= ?\");\n\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\tLOGGER.info(str1);\n\t\t\tpst = persistenceService.getSession().createSQLQuery(str1.toString());\n\t\t\tpst.setInteger(0, bankAccountId);\n\t\t\tpst.setString(1, vcDate);\n\t\t\tpst.setString(2, vcDate);\n\t\t\tpst.setString(3, vcDate);\n\t\t\trset = pst.list();\n\t\t\tfor (final Object[] element : rset) {\n\t\t\t\ttotalAvailable = Double.parseDouble(element[0].toString());\n\t\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\t\tLOGGER.info(\"total balance \" + totalAvailable);\n\t\t\t}\n\n\t\t} catch (final HibernateException e) {\n\t\t\tLOGGER.error(\" could not get Bankbalance \" + e.toString(), e);\n\t\t\tthrow new HibernateException(e.toString());\n\t\t}\n\t\treturn totalAvailable;\n\t}",
"public void setBalance( long balance ) {\r\n this.balance = balance;\r\n }",
"public double getBalance(){\n return balance;\n }",
"public double getBalance(){\n return balance;\n }",
"public double getBalance()\n {\n return balance;\n }",
"public BankAccount(int balance) {\n\n this.balance = balance;\n\n }",
"public void setBalance(int balance) {\r\n\t\tif(0<=balance&&balance<=1000000) {\r\n\t\tthis.balance = balance;\r\n\t}else{\r\n\t\t System.out.println(\"잘못 입력하셨습니다. 현재 잔고는 \"+this.balance+\"입니다\");\r\n\t}\r\n \r\n}",
"public void setBalance(float balance) {\n this.balance = balance;\n }",
"@Override\r\n\tpublic Double getBalance( Integer id) {\n\t\tString sql = \"SELECT balance FROM buyers WHERE id = ?;\";\r\n\t\treturn jdbcTemplate.queryForObject( sql, Double.class, id);\r\n\t}",
"public float showBalance() {\n\t\treturn dao.showBalance();\r\n\t}",
"public double getBalance(){\n\t\treturn balance;\n\t}",
"public double getBalance() {\n return balance;\n }",
"public Double getBalance() {\r\n return balance;\r\n }",
"void setManageTransactionBalance(String balance);",
"public String getBalance() {\n return balance;\n }",
"public static void getAcountsBalance(int value) {\n\t\t\t\n\t\t\taccounts.clear();\n\n\t\t\tString query = \"select account.accID, accType, balance, dateCreated, fName, lName \" + \n\t\t \"from ser322.account,ser322.customer \" + \n\t\t \"WHERE customer.accID = account.accID AND balance =\" + value;\n\t\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\tStatement stmt = con.getConnection().createStatement();\n\t\t\t ResultSet rs = stmt.executeQuery(query);\n\t\t while (rs.next()) {\n\t\t \taccounts.addElement(new Account(rs.getInt(\"accID\"),rs.getString(\"accType\"),\n\t\t \t\t\t rs.getFloat(\"balance\"),rs.getDate(\"dateCreated\"), rs.getString(\"fName\"), rs.getString(\"lName\")));\n\t\t \n\t\t }\n\t\t \n\t\t } catch (SQLException e ) {\n\t\t \tSystem.out.println(\"QUERY WRONG - getAcountsBalance\");\n\t\t }\n\t\n\t\t}",
"public BaseJson<BigDecimal> wallet_balance() throws Exception {\n String s = main(\"wallet_balance\",\"[]\");\n return JsonHelper.jsonStr2Obj(s, BaseJson.class);\n }",
"public Double getBalance(){\n Double sum = 0.0;\n // Mencari balance dompet dari transaksi dengan cara menghitung total transaksi\n for (Transaction transaction : transactions) {\n sum += transaction.getAmount().doubleValue();\n }\n return sum;\n }",
"public Account(){\n this.id = 0;\n this.balance = 0;\n this.annualInterestRate = 0;\n this.dateCreated = new Date();\n }",
"public void setBalance(){\n balance.setBalance();\n }",
"@java.lang.Override\n public com.google.protobuf.ByteString\n getBalanceBytes() {\n java.lang.Object ref = balance_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n balance_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public StoneBalanceExample() {\n oredCriteria = new ArrayList<Criteria>();\n }",
"double getBalance(UUID name);",
"Databank getBank();",
"public double getBal() {\n\t\t return balance;\r\n\t }",
"@Override\r\npublic void checkBalance() {\n\t\r\n}",
"public int getBalance() {\n\t\treturn balance;\n\t}",
"public void setBalance(java.math.BigDecimal balance) {\n this.balance = balance;\n }",
"public int getBalance() {\n return total_bal;\n }",
"public int getPropertyBalance();",
"public BankAccount getAccountBalanceRepo(String accountNr){\n String sql = \"SELECT * FROM bankaccount WHERE accountnr = :accountnr\";\n Map paramMap = new HashMap();\n paramMap.put(\"accountnr\", accountNr);\n BankAccount result = jdbcTemplate.queryForObject(sql, paramMap, new AccountRowMapper());\n return result;\n }",
"private int getBalance() throws SQLException {\n\t\tgetBalanceStatement.clearParameters();\n\t\tgetBalanceStatement.setString(1, this.username);\n\t\tResultSet result = getBalanceStatement.executeQuery();\n\t\tresult.next();\n\t\tint out = result.getInt(1);\n\t\tresult.close();\n\t\treturn out;\n\t}",
"public BankAccount findAccountById(int currentBankID) throws SQLException;",
"public void deposit(double amount) {\n balance += amount;\n \n try {\n \n Class.forName(\"net.ucanaccess.jdbc.UcanaccessDriver\");\n \n // Load Driver\n String connURL=\"jdbc:ucanaccess://c:/Users/Ellen/Documents/CIST2373/ChattBankMDB.mdb\";\n \n // Get Connection\n Connection con = DriverManager.getConnection(connURL);\n \n // Create Statement\n Statement stmt = con.createStatement();\n \n // Create sql string \n String sql = \"Update Accounts set Balance = \"+getBalance()+ \n \" where AcctNo='\"+getAcctNo()+\"'\";\n \n // Check for properly formed sql\n System.out.println(sql);\n \n // Execute Statement\n int n = stmt.executeUpdate(sql);\n if (n == 1)\n System.out.println(\"Update was successful!\");\n else\n System.out.println(\"Update failed!\"); \n \n // Close Connection\n con.close(); \n } //end try\n \n catch (Exception err) {\n System.out.println(\"Error: \" + err);\n } //end catch\n }",
"public void initializeBalance() {\n try {\n Connection connection = connect();\n\n PreparedStatement createBalanceTable = connection.prepareStatement(\"CREATE TABLE IF NOT EXISTS balance (\"\n + \"id INTEGER PRIMARY KEY,\"\n + \"user_username varchar(100),\"\n + \"amount float, \"\n + \"time varchar,\"\n + \"FOREIGN KEY (user_username) REFERENCES User(username));\"\n );\n createBalanceTable.execute();\n createBalanceTable.close();\n connection.close();\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }",
"public BankAccount() {\r\n\t\tbalance=0;\r\n\t\t\r\n\t}",
"public void showAccountBalance(){\n balance();\n\n }",
"public void balance(){\n\t\tnamesTree.balance();\n\t\taccountNumbersTree.balance();\n\t}",
"public double getBalance() {\n return this.balance;\n }",
"public Balance() {\r\n value = BigDecimal.ZERO;\r\n }",
"public void setBalance(final int balance)\n {\n this.balance = balance;\n }",
"public double getBalance() {\n return balance;\n }",
"public double getBalance() {\n return balance;\n }",
"public double getBalance() {\n return balance;\n }",
"public double getBalance() {\n return balance;\n }",
"public float getBalance() {\n return balance;\n }",
"private double getBalance() { return balance; }",
"public Double getBalance() {\n return null;\n }",
"public void setBalance(double balance){\n\t\tthis.balance = balance;\n\t}",
"public double getBalance()\r\n\t{\r\n\t\treturn balance;\t\t\r\n\t}",
"BigDecimal getOpeningDebitBalance();",
"BigDecimal getOpeningDebitBalance();",
"public com.google.protobuf.ByteString\n getBalanceBytes() {\n java.lang.Object ref = balance_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n balance_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public void InitializeBalance(BigDecimal valor){\n \r\n ChekingAccount chekAc=pRepository.GetChekingAccount();\r\n chekAc.setSaldoInicial(valor);\r\n pRepository.SaveChekingAccount(chekAc);\r\n \r\n }",
"Account(int balance) {\n if(balance <0) this.balance=0;\n this.balance = balance;\n }",
"public void updateBalance(String mobileNo,int balance)\n\t{\n\t\tContext ctx;\n\t\ttry {\n\t\t\tctx = new InitialContext();\n\t\t\n\t\t\n\t\t DataSource ds=(DataSource)ctx.lookup(\"java:OracleDS\");\n\t\t\tConnection con=ds.getConnection();\n\t\t\tStatement stmt=con.createStatement();\n\t\t\t\n\t\t\tstmt.executeUpdate(\"update mobile set balance=\"+balance+\" where mobileno=\"+mobileNo);\n\t\t\tcon.close();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Error in connection with Database :\"+e.getMessage());\n\t\t\t\n\t\t}\n\t\t\n\t}",
"public int balance(String accountNumber, String userId) {\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\t\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\t\n\t\ttry{\n\t\t\t//connect to database\n\t\t\tconn=DriverManager.getConnection(url, username, password);\n\t\t\tString sql = \"select balance from \"+this.name+\" where accountNumber=?\";\n\t\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\t\tps.setString(1, accountNumber.toString());\n\t\t\tResultSet rs = ps.executeQuery();\n\t\t\tint nowBalance = 0;\n\t\t\twhile(rs.next()) { \n\t\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\t}\n\t\t\t\n\t\t\tString logs = \"Checked balance: \"+String.valueOf(nowBalance);\n\t\t\tString sql1 = \"insert into \"+userId+\" (log) values (?)\";\n\t\t\tpp = (PreparedStatement) conn.prepareStatement(sql1);\n\t\t\tpp.setString(1, logs);\n\t\t\tpp.executeUpdate();\n\t\t\t\n\t\t\treturn nowBalance;\n\t\t} catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t\t\n\t}",
"public List<DietaBalanceada> consultar_dietaBalanceada();",
"public void deposit(String accountNumber, int amount) {\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp, ll;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\tint lastBalance;\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\ttry{\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql = \"select balance,userId from \"+this.name+\" where accountNumber=?\";\n\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\tps.setString(1, accountNumber.toString());\n\t\tResultSet rs = ps.executeQuery();\n\t\tint nowBalance = 0;\n\t\tString id = \"\";\n\t\twhile(rs.next()) { \n\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\tid = rs.getString(\"userId\");\n\t\t}\n\t\tlastBalance = nowBalance + amount;\n\t\t//System.out.println(lastBalance);\n\t\t\n\t\tString sql1 = \"UPDATE \"+this.name+\" SET balance=? where accountNumber=?\";\n\t\tpp = (PreparedStatement) conn.prepareStatement(sql1);\n\t\tpp.setInt(1, lastBalance);\n\t\tpp.setString(2, accountNumber.toString());\n\t\tpp.executeUpdate();\n\t\t\n\t\tString logs = \"deposit : \"+ amount+\" / balance: \"+String.valueOf(lastBalance);\n\t\tString sql11 = \"insert into \"+id+\" (log) values (?)\";\n\t\tll = (PreparedStatement) conn.prepareStatement(sql11);\n\t\tll.setString(1, logs);\n\t\tll.executeUpdate();\n\t\t\n\t\t}catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t}",
"public double getBalance()\n {\n return startingBalance;\n }",
"public String myAfterBalanceAmount() {\r\n\t\tint count=0;\r\n\t\tList<SavingAccount> acc = null;\r\n\t\ttry {\r\n\t\t\tSystem.out.println(\"Before Repeat\");\r\n\t\t\tacc = getSavingAccountList();\r\n\r\n\t\t\tfor (SavingAccount savingAcc : acc) {\r\n\t\t\t\tif (!(\"0\".equals(savingAcc.getState()))) {\r\n\t\t\t\t\tif (savingAcc.getState().equals(\"active\")) {\r\n\t\t\t\t\t\tint maxRepeat = Integer.parseInt(savingAcc\r\n\t\t\t\t\t\t\t\t.getRepeatable());\r\n\r\n\t\t\t\t\t\tDate date = new Date();\r\n\t\t\t\t\t\tDate systemDate = savingAccSer\r\n\t\t\t\t\t\t\t\t.convertStringToDateDDmmYYYY(savingAccSer\r\n\t\t\t\t\t\t\t\t\t\t.convertDateToStringDDmmYYYY(date));\r\n\r\n\t\t\t\t\t\tDate dateEnd = savingAccSer\r\n\t\t\t\t\t\t\t\t.convertStringToDateDDmmYYYY(savingAcc\r\n\t\t\t\t\t\t\t\t\t\t.getDateEnd());\r\n\r\n\t\t\t\t\t\tif (systemDate.getTime() == dateEnd.getTime()) {\r\n\t\t\t\t\t\t\tDate newEndDate = DateUtils.addMonths(systemDate,\r\n\t\t\t\t\t\t\t\t\tsavingAcc.getInterestRateId().getMonth());\r\n\r\n\t\t\t\t\t\t\tfloat balance = savingAcc.getBalanceAmount();\r\n\t\t\t\t\t\t\tfloat interest = savingAcc.getInterestRateId()\r\n\t\t\t\t\t\t\t\t\t.getInterestRate();\r\n\r\n\t\t\t\t\t\t\tint month = savingAcc.getInterestRateId()\r\n\t\t\t\t\t\t\t\t\t.getMonth();\r\n\t\t\t\t\t\t\tint days = Days\r\n\t\t\t\t\t\t\t\t\t.daysBetween(\r\n\t\t\t\t\t\t\t\t\t\t\tnew DateTime(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsavingAccSer\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.convertStringToDate(savingAcc\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getDateStart())),\r\n\t\t\t\t\t\t\t\t\t\t\tnew DateTime(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsavingAccSer\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.convertStringToDate(savingAcc\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getDateEnd())))\r\n\t\t\t\t\t\t\t\t\t.getDays();\r\n\t\t\t\t\t\t\tfloat amountAll = balance\r\n\t\t\t\t\t\t\t\t\t+ (balance * ((interest / (100)) / 360) * days);\r\n\t\t\t\t\t\t\tsavingAcc.setDateStart(savingAccSer\r\n\t\t\t\t\t\t\t\t\t.convertDateToString(systemDate));\r\n\t\t\t\t\t\t\tsavingAcc.setDateEnd(savingAccSer\r\n\t\t\t\t\t\t\t\t\t.convertDateToString(newEndDate));\r\n\t\t\t\t\t\t\tsavingAcc.setBalanceAmount(amountAll);\r\n\t\t\t\t\t\t\tsavingAcc.setRepeatable(\"\" + (maxRepeat + 1));\r\n\t\t\t\t\t\t\tupdateSavingAccount(savingAcc);\r\n\t\t\t\t\t\t\tcount+=1;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\tSystem.out.println(\"Successfully!! \"+ count +\" Saving Account has been updated. Minh Map!!!\");\r\n\t\t\t\r\n\t\t\treturn \"success\";\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.out.println(\"Exception\");\r\n\r\n\t\t}\r\n\t\treturn \"Fail\";\r\n\t}",
"public void setBalance(Double balance) {\r\n this.balance = balance;\r\n }",
"@Override\n\tpublic int accountUpdate(String id, String balance) {\n\t\tSession session=sessionFactory.openSession();\n\t\tTransaction tr = session.beginTransaction();\n\t\tint executeUpdate = 0;\n\t\tString sqlString=\"update user set balance = '\"+balance+\"' where id ='\"+id+\"'\";\n\t\ttry {\n\t\t\tQuery query=session.createSQLQuery(sqlString);\n\t\t\texecuteUpdate = query.executeUpdate();\n\t\t\tSystem.out.println(\"executeUpdate:\"+executeUpdate);\n\t\t} catch (HibernateException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}finally{\n\t\t\ttr.commit();\n\t\t session.close();\n\t\t}\n\t\treturn executeUpdate;\t\n\t}",
"public void Deposit(Integer accountNo,float depositMoney){\n\tSessionFactory sessionFactory = new Configuration().configure(\"hibernate.cfg.xml\").buildSessionFactory();\n\tSession session = sessionFactory.openSession();\n\tTransaction trans = null;\n\ttry{\n\t\ttrans = session.beginTransaction();\n\t\tQuery query=session.createQuery(\"UPDATE Account set balance+=:balance where accountNo=:accountNo\"); \n\t\tquery.setParameter(\"balance\",depositMoney); \n\t\tquery.setParameter(\"accountNo\",accountNo); \n\t}catch(HibernateException hibernateException){\n\t\tif(trans != null){\n\t\t\ttrans.rollback();\n\t\t}\n\t\thibernateException.printStackTrace();\n\t}\n\t}",
"public java.math.BigDecimal getBalance() {\n return balance;\n }"
] | [
"0.6254246",
"0.6251309",
"0.61570585",
"0.60492665",
"0.60057724",
"0.5992073",
"0.5980547",
"0.5977196",
"0.59642655",
"0.5963503",
"0.59486586",
"0.5940858",
"0.5940858",
"0.59254086",
"0.58854914",
"0.5869225",
"0.58683485",
"0.5837839",
"0.5806156",
"0.5791228",
"0.57907706",
"0.57907706",
"0.5789064",
"0.5786519",
"0.5786519",
"0.5774691",
"0.5774691",
"0.5765082",
"0.5765082",
"0.5758692",
"0.5758692",
"0.5740032",
"0.57227457",
"0.57202905",
"0.570451",
"0.56995517",
"0.5696218",
"0.5693933",
"0.5676445",
"0.5674041",
"0.566554",
"0.5657456",
"0.5655087",
"0.565498",
"0.5653004",
"0.5643857",
"0.56422824",
"0.5638485",
"0.5624594",
"0.56236255",
"0.5623417",
"0.5622009",
"0.5602906",
"0.56001335",
"0.55997765",
"0.55917853",
"0.55788296",
"0.55772203",
"0.5576971",
"0.557337",
"0.557114",
"0.5564688",
"0.55644137",
"0.5563821",
"0.5562173",
"0.5559716",
"0.55548126",
"0.55420464",
"0.5535851",
"0.5533963",
"0.55212945",
"0.5519972",
"0.5514862",
"0.5514407",
"0.5511833",
"0.5508671",
"0.5507144",
"0.55020714",
"0.55020714",
"0.55020714",
"0.55020714",
"0.5500946",
"0.5498619",
"0.5494768",
"0.5491949",
"0.5490798",
"0.5488625",
"0.5488625",
"0.54857177",
"0.54815656",
"0.54763603",
"0.54732734",
"0.5471391",
"0.5466189",
"0.54660946",
"0.5464866",
"0.5460848",
"0.5458931",
"0.5447544",
"0.542226",
"0.5403921"
] | 0.0 | -1 |
This method was generated by MyBatis Generator. This method corresponds to the database table stone_balance | public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int baldown(double newbalance, Long accountno, Long broaccno, Double bramt) throws Exception{\n\tint j=DbConnect.getStatement().executeUpdate(\"update account set balance=\"+newbalance+\" where accno=\"+accountno+\"\");\r\n\tint i=DbConnect.getStatement().executeUpdate(\"update account set balance=balance+\"+bramt+\" where accno=\"+broaccno+\"\");\r\n\treturn i;\r\n}",
"public int balup(double newbalance, Long accountno, Long broaccno, Double bramt) throws Exception{\n\tint j=DbConnect.getStatement().executeUpdate(\"update account set balance=\"+newbalance+\" where accno=\"+accountno+\"\");\r\n\tint i=DbConnect.getStatement().executeUpdate(\"update account set balance=balance+\"+bramt+\" where accno=\"+broaccno+\"\");\r\n\treturn i;\r\n}",
"private void listBalances() {\n\t\t\r\n\t}",
"public Money getTotalBalance();",
"private void updateDatabaseAccountBalance() {\n\t\tString sql = \"UPDATE account SET balance = \" + this.balance + \" \";\n\t\tsql += \"WHERE accountID = '\" + this.accountID + \"';\";\n\n\t\tDbUtilities db = new MySqlUtilities();\n\t\tdb.executeQuery(sql);\n\t}",
"public ResultSet retBalance(Long userid) throws SQLException {\n\trs=DbConnect.getStatement().executeQuery(\"Select balance from account where accno=\"+userid+\"\");\r\n\treturn rs;\r\n}",
"@Override\r\n\tpublic double showbalanceDao() {\n\t\t\r\n\t\treturn temp.getCustBal();\r\n\t}",
"public String getBalance() {\n return this.balance;\n }",
"public int getBalance() {\n return this.balance;\n\n }",
"public void withdraw(String accountNumber, int amount) {\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp, ll;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\tint lastBalance;\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\ttry{\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql = \"select balance,userId from \"+this.name+\" where accountNumber=?\";\n\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\tps.setString(1, accountNumber.toString());\n\t\tResultSet rs = ps.executeQuery();\n\t\tint nowBalance = 0;\n\t\tString id = \"\";\n\t\twhile(rs.next()) { \n\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\tid = rs.getString(\"userId\");\n\t\t}\n\t\tif (nowBalance<amount) {\n\t\t\tSystem.out.println(\"No Balance\");\n\t\t\treturn;\n\t\t}\n\t\tlastBalance = nowBalance - amount;\n\t\t//System.out.println(lastBalance);\n\t\t\n\t\tString sql1 = \"UPDATE \"+this.name+\" SET balance=? where accountNumber=?\";\n\t\tpp = (PreparedStatement) conn.prepareStatement(sql1);\n\t\tpp.setInt(1, lastBalance);\n\t\tpp.setString(2, accountNumber.toString());\n\t\tpp.executeUpdate();\n\t\t\n\t\tString logs = \"withdraw : \"+ amount+\" / balance: \"+String.valueOf(lastBalance);\n\t\tString sql11 = \"insert into \"+id+\" (log) values (?)\";\n\t\tll = (PreparedStatement) conn.prepareStatement(sql11);\n\t\tll.setString(1, logs);\n\t\tll.executeUpdate();\n\t\tSystem.out.println(\"Ypu got $\"+String.valueOf(amount));\n\t\t\n\t\t}catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t\t\n\t}",
"Balance[] findAllByBankAccount_Id(Long id);",
"double getBalance();",
"double getBalance();",
"public int getBalance()\n {\n return balance;\n }",
"public double getBalance()\n \n {\n \n return balance;\n \n }",
"public double getBalance(){\n return this.balance;\r\n }",
"@Override\n\tpublic double queryBalance(int accNo) {\n\t\treturn 0;\n\t}",
"public void wire(String accountNumber,int bankNumber, String toAccountNumber, int amount) {\n\t\t\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp, ll, lp, ls, mm, nn;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\tint lastBalance;\n\t\tint tolastBalance;\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\ttry{\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql = \"select balance,userId from \"+this.name+\" where accountNumber=?\";\n\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\tps.setString(1, accountNumber.toString());\n\t\tResultSet rs = ps.executeQuery();\n\t\tint nowBalance = 0;\n\t\tString id = \"\";\n\t\twhile(rs.next()) { \n\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\tid = rs.getString(\"userId\");\n\t\t}\n\t\tif (nowBalance<amount) {\n\t\t\tSystem.out.println(\"No Balance\");\n\t\t\treturn;\n\t\t}\n\t\tlastBalance = nowBalance - amount;\n\t\t//System.out.println(lastBalance);\n\t\tString sql1 = \"UPDATE \"+this.name+\" SET balance=? where accountNumber=?\";\n\t\tls = (PreparedStatement) conn.prepareStatement(sql1);\n\t\tls.setInt(1, lastBalance);\n\t\tls.setString(2, accountNumber.toString());\n\t\tls.executeUpdate();\n\t\t\n\t\t\n\t\t\n\t\t//to account\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql3 = \"select bankName from bank where bankNumber=?\";\n\t\tll= (PreparedStatement) conn.prepareStatement(sql3);\n\t\tll.setString(1, String.valueOf(bankNumber).toString());\n\t\tResultSet rs3 = ll.executeQuery();\n\t\tString toname = \"\";\n\t\twhile(rs3.next()) { \n\t\t\ttoname=rs3.getString(\"bankName\");\n\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tString sql4 = \"select balance,userId from \"+toname+\" where accountNumber=?\";\n\t\tpp= (PreparedStatement) conn.prepareStatement(sql4);\n\t\tpp.setString(1, accountNumber.toString());\n\t\tResultSet rs4 = pp.executeQuery();\n\t\tint tonowBalance = 0;\n\t\tString toid = \"\";\n\t\twhile(rs4.next()) { \n\t\t\ttonowBalance=rs4.getInt(\"balance\");\n\t\t\ttoid = rs4.getString(\"userId\");\n\t\t}\n\t\t\n\t\ttolastBalance = tonowBalance + amount;\n\t\t//System.out.println(lastBalance);\n\t\tString sql5 = \"UPDATE \"+toname+\" SET balance=? where accountNumber=?\";\n\t\tlp = (PreparedStatement) conn.prepareStatement(sql5);\n\t\tlp.setInt(1, tolastBalance);\n\t\tlp.setString(2, toAccountNumber.toString());\n\t\tlp.executeUpdate();\n\t\t\n\t\t\n\t\t//log\n\t\tString logs = \"wired : \"+ amount+\" to \"+toAccountNumber+\"/ balance: \"+String.valueOf(lastBalance);\n\t\tString sql11 = \"insert into \"+id+\" (log) values (?)\";\n\t\tmm = (PreparedStatement) conn.prepareStatement(sql11);\n\t\tmm.setString(1, logs);\n\t\tmm.executeUpdate();\n\t\tSystem.out.println(\"You wired $\"+String.valueOf(amount));\n\t\t\n\t\tString logs1 = \"get : \"+ amount+\" from \" +accountNumber+ \"/ balance: \"+String.valueOf(tolastBalance);\n\t\tString sql12 = \"insert into \"+toid+\" (log) values (?)\";\n\t\tnn = (PreparedStatement) conn.prepareStatement(sql12);\n\t\tnn.setString(1, logs1);\n\t\tnn.executeUpdate();\n\t\tSystem.out.println(\"You got $\"+String.valueOf(amount));\n\t\t\n\t\t\n\t\t}catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t}",
"public double getBalance(){\n return balance;\n }",
"public double getBalance(){\n return balance;\r\n }",
"public Integer getBalance() {\n return balance;\n }",
"public Integer getBalance() {\n return balance;\n }",
"public long getBalance() {\n\t\n\treturn balance;\n}",
"public int getBalance() {\n return balance;\n }",
"public int getBalance() {\n return balance;\n }",
"public void setBalance(Integer balance) {\n this.balance = balance;\n }",
"public void setBalance(Integer balance) {\n this.balance = balance;\n }",
"public BigDecimal getBalance() {\n return balance;\n }",
"public BigDecimal getBalance() {\n return balance;\n }",
"public void setBalance(BigDecimal balance) {\n this.balance = balance;\n }",
"public void setBalance(BigDecimal balance) {\n this.balance = balance;\n }",
"public double getBalance(){\r\n\t\treturn balance;\r\n\t}",
"public float getBalance()\r\n\t{\n\t\ttry\r\n\t\t{\r\n\t\t\tDBConnection ToDB = new DBConnection(); //Have a connection to the DB\r\n\t\t\tConnection DBConn = ToDB.openConn();\r\n\t\t\tStatement Stmt = DBConn.createStatement();\r\n\t\t\tString SQL_Command = \"SELECT Balance FROM SavingsAccount WHERE SavingsAccountNumber ='\"+SavingsAccountNumber+\"'\"; //SQL query command for Balance\r\n\t\t\tResultSet Rslt = Stmt.executeQuery(SQL_Command);\r\n\t\t\twhile (Rslt.next())\r\n\t\t\t{\r\n\t\t\t\tBalance = Rslt.getFloat(1);\r\n\t\t\t}\r\n\t\t\tStmt.close();\r\n\t\t\tToDB.closeConn();\r\n\t\t}\r\n\t\tcatch(SQLException e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"SQLException: \" + e);\r\n\t\t\twhile (e != null)\r\n\t\t\t{ System.out.println(\"SQLState: \" + e.getSQLState());\r\n\t\t\t\tSystem.out.println(\"Message: \" + e.getMessage());\r\n\t\t\t\tSystem.out.println(\"Vendor: \" + e.getErrorCode());\r\n\t\t\t\te = e.getNextException();\r\n\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (Exception e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Exception: \" + e);\r\n\t\t\te.printStackTrace ();\r\n\t\t}\r\n\t\treturn Balance;\r\n\t}",
"private void updateBalance(int balance) throws SQLException {\n\t\tupdateBalanceStatement.clearParameters();\n\t\tupdateBalanceStatement.setInt(1, balance);\n\t\tupdateBalanceStatement.setString(2, this.username);\n\t\tupdateBalanceStatement.executeUpdate();\n\t}",
"public long getBalance() {\n return this.balance;\n }",
"public String balance() {\n\t\treturn this.apiCall(\"balance\", \"\", \"\", true);\n\t}",
"@Override\n\tpublic double getAccountBalance(final int bankAccountId, final String vcDate, final Connection connection)\n\t{\n\t\tdouble opeAvailable = 0, totalAvailable = 0;\n\t\ttry {\n\n\t\t\tfinal StringBuilder str = new StringBuilder(\"SELECT case when sum(openingDebitBalance) = null then 0\")\n\t\t\t\t\t.append(\" ELSE sum(openingDebitBalance) end - case when sum(openingCreditBalance) = null then 0\")\n\t\t\t\t\t.append(\" else sum(openingCreditBalance) end AS \\\"openingBalance\\\" \")\n\t\t\t\t\t.append(\"FROM transactionSummary WHERE financialYearId=( SELECT id FROM financialYear WHERE startingDate <= ?\")\n\t\t\t\t\t.append(\"AND endingDate >= ?) AND glCodeId =(select glcodeid from bankaccount where id= ?)\");\n\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\tLOGGER.info(str);\n\t\t\tQuery pst = persistenceService.getSession().createSQLQuery(str.toString());\n\t\t\tpst.setString(0, vcDate);\n\t\t\tpst.setString(1, vcDate);\n\t\t\tpst.setInteger(2, bankAccountId);\n\t\t\tList<Object[]> rset = pst.list();\n\t\t\tfor (final Object[] element : rset)\n\t\t\t\topeAvailable = Double.parseDouble(element[0].toString());\n\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\tLOGGER.info(\"opening balance \" + opeAvailable);\n\n\t\t\tfinal StringBuilder str1 = new StringBuilder(\"SELECT (case when sum(gl.debitAmount) = null then 0\")\n\t\t\t\t\t.append(\" else sum(gl.debitAmount) end - case when sum(gl.creditAmount) = null then 0\")\n\t\t\t\t\t.append(\" else sum(gl.creditAmount) end) + \").append(opeAvailable).append(\"\")\n\t\t\t\t\t.append(\" as \\\"totalAmount\\\" FROM generalLedger gl, voucherHeader vh WHERE vh.id = gl.voucherHeaderId\")\n\t\t\t\t\t.append(\" AND gl.glCodeid = (select glcodeid from bankaccount where id= ?) AND \")\n\t\t\t\t\t.append(\" vh.voucherDate >=( SELECT TO_CHAR(startingDate, 'dd-Mon-yyyy')\")\n\t\t\t\t\t.append(\" FROM financialYear WHERE startingDate <= ? AND endingDate >= ?) AND vh.voucherDate <= ?\");\n\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\tLOGGER.info(str1);\n\t\t\tpst = persistenceService.getSession().createSQLQuery(str1.toString());\n\t\t\tpst.setInteger(0, bankAccountId);\n\t\t\tpst.setString(1, vcDate);\n\t\t\tpst.setString(2, vcDate);\n\t\t\tpst.setString(3, vcDate);\n\t\t\trset = pst.list();\n\t\t\tfor (final Object[] element : rset) {\n\t\t\t\ttotalAvailable = Double.parseDouble(element[0].toString());\n\t\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\t\tLOGGER.info(\"total balance \" + totalAvailable);\n\t\t\t}\n\n\t\t} catch (final HibernateException e) {\n\t\t\tLOGGER.error(\" could not get Bankbalance \" + e.toString(), e);\n\t\t\tthrow new HibernateException(e.toString());\n\t\t}\n\t\treturn totalAvailable;\n\t}",
"public void setBalance( long balance ) {\r\n this.balance = balance;\r\n }",
"public double getBalance(){\n return balance;\n }",
"public double getBalance(){\n return balance;\n }",
"public double getBalance()\n {\n return balance;\n }",
"public BankAccount(int balance) {\n\n this.balance = balance;\n\n }",
"public void setBalance(int balance) {\r\n\t\tif(0<=balance&&balance<=1000000) {\r\n\t\tthis.balance = balance;\r\n\t}else{\r\n\t\t System.out.println(\"잘못 입력하셨습니다. 현재 잔고는 \"+this.balance+\"입니다\");\r\n\t}\r\n \r\n}",
"public void setBalance(float balance) {\n this.balance = balance;\n }",
"@Override\r\n\tpublic Double getBalance( Integer id) {\n\t\tString sql = \"SELECT balance FROM buyers WHERE id = ?;\";\r\n\t\treturn jdbcTemplate.queryForObject( sql, Double.class, id);\r\n\t}",
"public float showBalance() {\n\t\treturn dao.showBalance();\r\n\t}",
"public double getBalance(){\n\t\treturn balance;\n\t}",
"public double getBalance() {\n return balance;\n }",
"public Double getBalance() {\r\n return balance;\r\n }",
"void setManageTransactionBalance(String balance);",
"public String getBalance() {\n return balance;\n }",
"public static void getAcountsBalance(int value) {\n\t\t\t\n\t\t\taccounts.clear();\n\n\t\t\tString query = \"select account.accID, accType, balance, dateCreated, fName, lName \" + \n\t\t \"from ser322.account,ser322.customer \" + \n\t\t \"WHERE customer.accID = account.accID AND balance =\" + value;\n\t\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\tStatement stmt = con.getConnection().createStatement();\n\t\t\t ResultSet rs = stmt.executeQuery(query);\n\t\t while (rs.next()) {\n\t\t \taccounts.addElement(new Account(rs.getInt(\"accID\"),rs.getString(\"accType\"),\n\t\t \t\t\t rs.getFloat(\"balance\"),rs.getDate(\"dateCreated\"), rs.getString(\"fName\"), rs.getString(\"lName\")));\n\t\t \n\t\t }\n\t\t \n\t\t } catch (SQLException e ) {\n\t\t \tSystem.out.println(\"QUERY WRONG - getAcountsBalance\");\n\t\t }\n\t\n\t\t}",
"public BaseJson<BigDecimal> wallet_balance() throws Exception {\n String s = main(\"wallet_balance\",\"[]\");\n return JsonHelper.jsonStr2Obj(s, BaseJson.class);\n }",
"public Double getBalance(){\n Double sum = 0.0;\n // Mencari balance dompet dari transaksi dengan cara menghitung total transaksi\n for (Transaction transaction : transactions) {\n sum += transaction.getAmount().doubleValue();\n }\n return sum;\n }",
"public Account(){\n this.id = 0;\n this.balance = 0;\n this.annualInterestRate = 0;\n this.dateCreated = new Date();\n }",
"public void setBalance(){\n balance.setBalance();\n }",
"@java.lang.Override\n public com.google.protobuf.ByteString\n getBalanceBytes() {\n java.lang.Object ref = balance_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n balance_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public StoneBalanceExample() {\n oredCriteria = new ArrayList<Criteria>();\n }",
"double getBalance(UUID name);",
"Databank getBank();",
"public double getBal() {\n\t\t return balance;\r\n\t }",
"@Override\r\npublic void checkBalance() {\n\t\r\n}",
"public void setBalance(java.math.BigDecimal balance) {\n this.balance = balance;\n }",
"public int getBalance() {\n\t\treturn balance;\n\t}",
"public int getBalance() {\n return total_bal;\n }",
"public int getPropertyBalance();",
"public BankAccount getAccountBalanceRepo(String accountNr){\n String sql = \"SELECT * FROM bankaccount WHERE accountnr = :accountnr\";\n Map paramMap = new HashMap();\n paramMap.put(\"accountnr\", accountNr);\n BankAccount result = jdbcTemplate.queryForObject(sql, paramMap, new AccountRowMapper());\n return result;\n }",
"private int getBalance() throws SQLException {\n\t\tgetBalanceStatement.clearParameters();\n\t\tgetBalanceStatement.setString(1, this.username);\n\t\tResultSet result = getBalanceStatement.executeQuery();\n\t\tresult.next();\n\t\tint out = result.getInt(1);\n\t\tresult.close();\n\t\treturn out;\n\t}",
"public BankAccount findAccountById(int currentBankID) throws SQLException;",
"public void deposit(double amount) {\n balance += amount;\n \n try {\n \n Class.forName(\"net.ucanaccess.jdbc.UcanaccessDriver\");\n \n // Load Driver\n String connURL=\"jdbc:ucanaccess://c:/Users/Ellen/Documents/CIST2373/ChattBankMDB.mdb\";\n \n // Get Connection\n Connection con = DriverManager.getConnection(connURL);\n \n // Create Statement\n Statement stmt = con.createStatement();\n \n // Create sql string \n String sql = \"Update Accounts set Balance = \"+getBalance()+ \n \" where AcctNo='\"+getAcctNo()+\"'\";\n \n // Check for properly formed sql\n System.out.println(sql);\n \n // Execute Statement\n int n = stmt.executeUpdate(sql);\n if (n == 1)\n System.out.println(\"Update was successful!\");\n else\n System.out.println(\"Update failed!\"); \n \n // Close Connection\n con.close(); \n } //end try\n \n catch (Exception err) {\n System.out.println(\"Error: \" + err);\n } //end catch\n }",
"public BankAccount() {\r\n\t\tbalance=0;\r\n\t\t\r\n\t}",
"public void initializeBalance() {\n try {\n Connection connection = connect();\n\n PreparedStatement createBalanceTable = connection.prepareStatement(\"CREATE TABLE IF NOT EXISTS balance (\"\n + \"id INTEGER PRIMARY KEY,\"\n + \"user_username varchar(100),\"\n + \"amount float, \"\n + \"time varchar,\"\n + \"FOREIGN KEY (user_username) REFERENCES User(username));\"\n );\n createBalanceTable.execute();\n createBalanceTable.close();\n connection.close();\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }",
"public void showAccountBalance(){\n balance();\n\n }",
"public void balance(){\n\t\tnamesTree.balance();\n\t\taccountNumbersTree.balance();\n\t}",
"public double getBalance() {\n return this.balance;\n }",
"public Balance() {\r\n value = BigDecimal.ZERO;\r\n }",
"public void setBalance(final int balance)\n {\n this.balance = balance;\n }",
"public double getBalance() {\n return balance;\n }",
"public double getBalance() {\n return balance;\n }",
"public double getBalance() {\n return balance;\n }",
"public double getBalance() {\n return balance;\n }",
"public float getBalance() {\n return balance;\n }",
"private double getBalance() { return balance; }",
"public Double getBalance() {\n return null;\n }",
"public void setBalance(double balance){\n\t\tthis.balance = balance;\n\t}",
"public double getBalance()\r\n\t{\r\n\t\treturn balance;\t\t\r\n\t}",
"BigDecimal getOpeningDebitBalance();",
"BigDecimal getOpeningDebitBalance();",
"public com.google.protobuf.ByteString\n getBalanceBytes() {\n java.lang.Object ref = balance_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n balance_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public void InitializeBalance(BigDecimal valor){\n \r\n ChekingAccount chekAc=pRepository.GetChekingAccount();\r\n chekAc.setSaldoInicial(valor);\r\n pRepository.SaveChekingAccount(chekAc);\r\n \r\n }",
"Account(int balance) {\n if(balance <0) this.balance=0;\n this.balance = balance;\n }",
"public void updateBalance(String mobileNo,int balance)\n\t{\n\t\tContext ctx;\n\t\ttry {\n\t\t\tctx = new InitialContext();\n\t\t\n\t\t\n\t\t DataSource ds=(DataSource)ctx.lookup(\"java:OracleDS\");\n\t\t\tConnection con=ds.getConnection();\n\t\t\tStatement stmt=con.createStatement();\n\t\t\t\n\t\t\tstmt.executeUpdate(\"update mobile set balance=\"+balance+\" where mobileno=\"+mobileNo);\n\t\t\tcon.close();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Error in connection with Database :\"+e.getMessage());\n\t\t\t\n\t\t}\n\t\t\n\t}",
"public int balance(String accountNumber, String userId) {\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\t\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\t\n\t\ttry{\n\t\t\t//connect to database\n\t\t\tconn=DriverManager.getConnection(url, username, password);\n\t\t\tString sql = \"select balance from \"+this.name+\" where accountNumber=?\";\n\t\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\t\tps.setString(1, accountNumber.toString());\n\t\t\tResultSet rs = ps.executeQuery();\n\t\t\tint nowBalance = 0;\n\t\t\twhile(rs.next()) { \n\t\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\t}\n\t\t\t\n\t\t\tString logs = \"Checked balance: \"+String.valueOf(nowBalance);\n\t\t\tString sql1 = \"insert into \"+userId+\" (log) values (?)\";\n\t\t\tpp = (PreparedStatement) conn.prepareStatement(sql1);\n\t\t\tpp.setString(1, logs);\n\t\t\tpp.executeUpdate();\n\t\t\t\n\t\t\treturn nowBalance;\n\t\t} catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t\t\n\t}",
"public double getBalance()\n {\n return startingBalance;\n }",
"public void deposit(String accountNumber, int amount) {\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp, ll;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\tint lastBalance;\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\ttry{\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql = \"select balance,userId from \"+this.name+\" where accountNumber=?\";\n\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\tps.setString(1, accountNumber.toString());\n\t\tResultSet rs = ps.executeQuery();\n\t\tint nowBalance = 0;\n\t\tString id = \"\";\n\t\twhile(rs.next()) { \n\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\tid = rs.getString(\"userId\");\n\t\t}\n\t\tlastBalance = nowBalance + amount;\n\t\t//System.out.println(lastBalance);\n\t\t\n\t\tString sql1 = \"UPDATE \"+this.name+\" SET balance=? where accountNumber=?\";\n\t\tpp = (PreparedStatement) conn.prepareStatement(sql1);\n\t\tpp.setInt(1, lastBalance);\n\t\tpp.setString(2, accountNumber.toString());\n\t\tpp.executeUpdate();\n\t\t\n\t\tString logs = \"deposit : \"+ amount+\" / balance: \"+String.valueOf(lastBalance);\n\t\tString sql11 = \"insert into \"+id+\" (log) values (?)\";\n\t\tll = (PreparedStatement) conn.prepareStatement(sql11);\n\t\tll.setString(1, logs);\n\t\tll.executeUpdate();\n\t\t\n\t\t}catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t}",
"public List<DietaBalanceada> consultar_dietaBalanceada();",
"public String myAfterBalanceAmount() {\r\n\t\tint count=0;\r\n\t\tList<SavingAccount> acc = null;\r\n\t\ttry {\r\n\t\t\tSystem.out.println(\"Before Repeat\");\r\n\t\t\tacc = getSavingAccountList();\r\n\r\n\t\t\tfor (SavingAccount savingAcc : acc) {\r\n\t\t\t\tif (!(\"0\".equals(savingAcc.getState()))) {\r\n\t\t\t\t\tif (savingAcc.getState().equals(\"active\")) {\r\n\t\t\t\t\t\tint maxRepeat = Integer.parseInt(savingAcc\r\n\t\t\t\t\t\t\t\t.getRepeatable());\r\n\r\n\t\t\t\t\t\tDate date = new Date();\r\n\t\t\t\t\t\tDate systemDate = savingAccSer\r\n\t\t\t\t\t\t\t\t.convertStringToDateDDmmYYYY(savingAccSer\r\n\t\t\t\t\t\t\t\t\t\t.convertDateToStringDDmmYYYY(date));\r\n\r\n\t\t\t\t\t\tDate dateEnd = savingAccSer\r\n\t\t\t\t\t\t\t\t.convertStringToDateDDmmYYYY(savingAcc\r\n\t\t\t\t\t\t\t\t\t\t.getDateEnd());\r\n\r\n\t\t\t\t\t\tif (systemDate.getTime() == dateEnd.getTime()) {\r\n\t\t\t\t\t\t\tDate newEndDate = DateUtils.addMonths(systemDate,\r\n\t\t\t\t\t\t\t\t\tsavingAcc.getInterestRateId().getMonth());\r\n\r\n\t\t\t\t\t\t\tfloat balance = savingAcc.getBalanceAmount();\r\n\t\t\t\t\t\t\tfloat interest = savingAcc.getInterestRateId()\r\n\t\t\t\t\t\t\t\t\t.getInterestRate();\r\n\r\n\t\t\t\t\t\t\tint month = savingAcc.getInterestRateId()\r\n\t\t\t\t\t\t\t\t\t.getMonth();\r\n\t\t\t\t\t\t\tint days = Days\r\n\t\t\t\t\t\t\t\t\t.daysBetween(\r\n\t\t\t\t\t\t\t\t\t\t\tnew DateTime(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsavingAccSer\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.convertStringToDate(savingAcc\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getDateStart())),\r\n\t\t\t\t\t\t\t\t\t\t\tnew DateTime(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsavingAccSer\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.convertStringToDate(savingAcc\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getDateEnd())))\r\n\t\t\t\t\t\t\t\t\t.getDays();\r\n\t\t\t\t\t\t\tfloat amountAll = balance\r\n\t\t\t\t\t\t\t\t\t+ (balance * ((interest / (100)) / 360) * days);\r\n\t\t\t\t\t\t\tsavingAcc.setDateStart(savingAccSer\r\n\t\t\t\t\t\t\t\t\t.convertDateToString(systemDate));\r\n\t\t\t\t\t\t\tsavingAcc.setDateEnd(savingAccSer\r\n\t\t\t\t\t\t\t\t\t.convertDateToString(newEndDate));\r\n\t\t\t\t\t\t\tsavingAcc.setBalanceAmount(amountAll);\r\n\t\t\t\t\t\t\tsavingAcc.setRepeatable(\"\" + (maxRepeat + 1));\r\n\t\t\t\t\t\t\tupdateSavingAccount(savingAcc);\r\n\t\t\t\t\t\t\tcount+=1;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\tSystem.out.println(\"Successfully!! \"+ count +\" Saving Account has been updated. Minh Map!!!\");\r\n\t\t\t\r\n\t\t\treturn \"success\";\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.out.println(\"Exception\");\r\n\r\n\t\t}\r\n\t\treturn \"Fail\";\r\n\t}",
"public void setBalance(Double balance) {\r\n this.balance = balance;\r\n }",
"@Override\n\tpublic int accountUpdate(String id, String balance) {\n\t\tSession session=sessionFactory.openSession();\n\t\tTransaction tr = session.beginTransaction();\n\t\tint executeUpdate = 0;\n\t\tString sqlString=\"update user set balance = '\"+balance+\"' where id ='\"+id+\"'\";\n\t\ttry {\n\t\t\tQuery query=session.createSQLQuery(sqlString);\n\t\t\texecuteUpdate = query.executeUpdate();\n\t\t\tSystem.out.println(\"executeUpdate:\"+executeUpdate);\n\t\t} catch (HibernateException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}finally{\n\t\t\ttr.commit();\n\t\t session.close();\n\t\t}\n\t\treturn executeUpdate;\t\n\t}",
"public void Deposit(Integer accountNo,float depositMoney){\n\tSessionFactory sessionFactory = new Configuration().configure(\"hibernate.cfg.xml\").buildSessionFactory();\n\tSession session = sessionFactory.openSession();\n\tTransaction trans = null;\n\ttry{\n\t\ttrans = session.beginTransaction();\n\t\tQuery query=session.createQuery(\"UPDATE Account set balance+=:balance where accountNo=:accountNo\"); \n\t\tquery.setParameter(\"balance\",depositMoney); \n\t\tquery.setParameter(\"accountNo\",accountNo); \n\t}catch(HibernateException hibernateException){\n\t\tif(trans != null){\n\t\t\ttrans.rollback();\n\t\t}\n\t\thibernateException.printStackTrace();\n\t}\n\t}",
"public java.math.BigDecimal getBalance() {\n return balance;\n }"
] | [
"0.6257401",
"0.6254438",
"0.6161535",
"0.6054013",
"0.60082215",
"0.5993809",
"0.5983186",
"0.5981287",
"0.5967813",
"0.5967191",
"0.5949743",
"0.59459656",
"0.59459656",
"0.59297687",
"0.5890412",
"0.587308",
"0.5872259",
"0.584036",
"0.5810854",
"0.57962006",
"0.579471",
"0.579471",
"0.5792875",
"0.5790713",
"0.5790713",
"0.5778891",
"0.5778891",
"0.5769552",
"0.5769552",
"0.5763822",
"0.5763822",
"0.5744492",
"0.57258487",
"0.57236683",
"0.5708359",
"0.5703243",
"0.5699339",
"0.5697645",
"0.5681245",
"0.56788135",
"0.56700957",
"0.5661688",
"0.5659845",
"0.5659348",
"0.5655676",
"0.5647027",
"0.56466496",
"0.56428343",
"0.5629093",
"0.5627635",
"0.56273925",
"0.56242955",
"0.56076217",
"0.5603623",
"0.56021035",
"0.5597103",
"0.5582562",
"0.55804604",
"0.5580238",
"0.557578",
"0.5575343",
"0.55698454",
"0.5568917",
"0.5568167",
"0.55664366",
"0.5562932",
"0.5556589",
"0.5544964",
"0.55375737",
"0.55369264",
"0.5523909",
"0.5521524",
"0.55192953",
"0.5518451",
"0.55162275",
"0.551352",
"0.5511489",
"0.5506484",
"0.5506484",
"0.5506484",
"0.5506484",
"0.5505282",
"0.55038494",
"0.54992586",
"0.54967123",
"0.54953766",
"0.54940236",
"0.54940236",
"0.5489175",
"0.5486224",
"0.54800606",
"0.54754776",
"0.54734373",
"0.5469201",
"0.5468912",
"0.5467371",
"0.5465251",
"0.54636157",
"0.54497653",
"0.542471",
"0.5408221"
] | 0.0 | -1 |
This method was generated by MyBatis Generator. This method corresponds to the database table stone_balance | protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int baldown(double newbalance, Long accountno, Long broaccno, Double bramt) throws Exception{\n\tint j=DbConnect.getStatement().executeUpdate(\"update account set balance=\"+newbalance+\" where accno=\"+accountno+\"\");\r\n\tint i=DbConnect.getStatement().executeUpdate(\"update account set balance=balance+\"+bramt+\" where accno=\"+broaccno+\"\");\r\n\treturn i;\r\n}",
"public int balup(double newbalance, Long accountno, Long broaccno, Double bramt) throws Exception{\n\tint j=DbConnect.getStatement().executeUpdate(\"update account set balance=\"+newbalance+\" where accno=\"+accountno+\"\");\r\n\tint i=DbConnect.getStatement().executeUpdate(\"update account set balance=balance+\"+bramt+\" where accno=\"+broaccno+\"\");\r\n\treturn i;\r\n}",
"private void listBalances() {\n\t\t\r\n\t}",
"public Money getTotalBalance();",
"private void updateDatabaseAccountBalance() {\n\t\tString sql = \"UPDATE account SET balance = \" + this.balance + \" \";\n\t\tsql += \"WHERE accountID = '\" + this.accountID + \"';\";\n\n\t\tDbUtilities db = new MySqlUtilities();\n\t\tdb.executeQuery(sql);\n\t}",
"public ResultSet retBalance(Long userid) throws SQLException {\n\trs=DbConnect.getStatement().executeQuery(\"Select balance from account where accno=\"+userid+\"\");\r\n\treturn rs;\r\n}",
"@Override\r\n\tpublic double showbalanceDao() {\n\t\t\r\n\t\treturn temp.getCustBal();\r\n\t}",
"public String getBalance() {\n return this.balance;\n }",
"public int getBalance() {\n return this.balance;\n\n }",
"public void withdraw(String accountNumber, int amount) {\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp, ll;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\tint lastBalance;\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\ttry{\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql = \"select balance,userId from \"+this.name+\" where accountNumber=?\";\n\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\tps.setString(1, accountNumber.toString());\n\t\tResultSet rs = ps.executeQuery();\n\t\tint nowBalance = 0;\n\t\tString id = \"\";\n\t\twhile(rs.next()) { \n\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\tid = rs.getString(\"userId\");\n\t\t}\n\t\tif (nowBalance<amount) {\n\t\t\tSystem.out.println(\"No Balance\");\n\t\t\treturn;\n\t\t}\n\t\tlastBalance = nowBalance - amount;\n\t\t//System.out.println(lastBalance);\n\t\t\n\t\tString sql1 = \"UPDATE \"+this.name+\" SET balance=? where accountNumber=?\";\n\t\tpp = (PreparedStatement) conn.prepareStatement(sql1);\n\t\tpp.setInt(1, lastBalance);\n\t\tpp.setString(2, accountNumber.toString());\n\t\tpp.executeUpdate();\n\t\t\n\t\tString logs = \"withdraw : \"+ amount+\" / balance: \"+String.valueOf(lastBalance);\n\t\tString sql11 = \"insert into \"+id+\" (log) values (?)\";\n\t\tll = (PreparedStatement) conn.prepareStatement(sql11);\n\t\tll.setString(1, logs);\n\t\tll.executeUpdate();\n\t\tSystem.out.println(\"Ypu got $\"+String.valueOf(amount));\n\t\t\n\t\t}catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t\t\n\t}",
"Balance[] findAllByBankAccount_Id(Long id);",
"double getBalance();",
"double getBalance();",
"public int getBalance()\n {\n return balance;\n }",
"public double getBalance()\n \n {\n \n return balance;\n \n }",
"public double getBalance(){\n return this.balance;\r\n }",
"@Override\n\tpublic double queryBalance(int accNo) {\n\t\treturn 0;\n\t}",
"public void wire(String accountNumber,int bankNumber, String toAccountNumber, int amount) {\n\t\t\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp, ll, lp, ls, mm, nn;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\tint lastBalance;\n\t\tint tolastBalance;\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\ttry{\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql = \"select balance,userId from \"+this.name+\" where accountNumber=?\";\n\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\tps.setString(1, accountNumber.toString());\n\t\tResultSet rs = ps.executeQuery();\n\t\tint nowBalance = 0;\n\t\tString id = \"\";\n\t\twhile(rs.next()) { \n\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\tid = rs.getString(\"userId\");\n\t\t}\n\t\tif (nowBalance<amount) {\n\t\t\tSystem.out.println(\"No Balance\");\n\t\t\treturn;\n\t\t}\n\t\tlastBalance = nowBalance - amount;\n\t\t//System.out.println(lastBalance);\n\t\tString sql1 = \"UPDATE \"+this.name+\" SET balance=? where accountNumber=?\";\n\t\tls = (PreparedStatement) conn.prepareStatement(sql1);\n\t\tls.setInt(1, lastBalance);\n\t\tls.setString(2, accountNumber.toString());\n\t\tls.executeUpdate();\n\t\t\n\t\t\n\t\t\n\t\t//to account\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql3 = \"select bankName from bank where bankNumber=?\";\n\t\tll= (PreparedStatement) conn.prepareStatement(sql3);\n\t\tll.setString(1, String.valueOf(bankNumber).toString());\n\t\tResultSet rs3 = ll.executeQuery();\n\t\tString toname = \"\";\n\t\twhile(rs3.next()) { \n\t\t\ttoname=rs3.getString(\"bankName\");\n\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tString sql4 = \"select balance,userId from \"+toname+\" where accountNumber=?\";\n\t\tpp= (PreparedStatement) conn.prepareStatement(sql4);\n\t\tpp.setString(1, accountNumber.toString());\n\t\tResultSet rs4 = pp.executeQuery();\n\t\tint tonowBalance = 0;\n\t\tString toid = \"\";\n\t\twhile(rs4.next()) { \n\t\t\ttonowBalance=rs4.getInt(\"balance\");\n\t\t\ttoid = rs4.getString(\"userId\");\n\t\t}\n\t\t\n\t\ttolastBalance = tonowBalance + amount;\n\t\t//System.out.println(lastBalance);\n\t\tString sql5 = \"UPDATE \"+toname+\" SET balance=? where accountNumber=?\";\n\t\tlp = (PreparedStatement) conn.prepareStatement(sql5);\n\t\tlp.setInt(1, tolastBalance);\n\t\tlp.setString(2, toAccountNumber.toString());\n\t\tlp.executeUpdate();\n\t\t\n\t\t\n\t\t//log\n\t\tString logs = \"wired : \"+ amount+\" to \"+toAccountNumber+\"/ balance: \"+String.valueOf(lastBalance);\n\t\tString sql11 = \"insert into \"+id+\" (log) values (?)\";\n\t\tmm = (PreparedStatement) conn.prepareStatement(sql11);\n\t\tmm.setString(1, logs);\n\t\tmm.executeUpdate();\n\t\tSystem.out.println(\"You wired $\"+String.valueOf(amount));\n\t\t\n\t\tString logs1 = \"get : \"+ amount+\" from \" +accountNumber+ \"/ balance: \"+String.valueOf(tolastBalance);\n\t\tString sql12 = \"insert into \"+toid+\" (log) values (?)\";\n\t\tnn = (PreparedStatement) conn.prepareStatement(sql12);\n\t\tnn.setString(1, logs1);\n\t\tnn.executeUpdate();\n\t\tSystem.out.println(\"You got $\"+String.valueOf(amount));\n\t\t\n\t\t\n\t\t}catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t}",
"public double getBalance(){\n return balance;\n }",
"public double getBalance(){\n return balance;\r\n }",
"public Integer getBalance() {\n return balance;\n }",
"public Integer getBalance() {\n return balance;\n }",
"public long getBalance() {\n\t\n\treturn balance;\n}",
"public int getBalance() {\n return balance;\n }",
"public int getBalance() {\n return balance;\n }",
"public void setBalance(Integer balance) {\n this.balance = balance;\n }",
"public void setBalance(Integer balance) {\n this.balance = balance;\n }",
"public BigDecimal getBalance() {\n return balance;\n }",
"public BigDecimal getBalance() {\n return balance;\n }",
"public void setBalance(BigDecimal balance) {\n this.balance = balance;\n }",
"public void setBalance(BigDecimal balance) {\n this.balance = balance;\n }",
"public double getBalance(){\r\n\t\treturn balance;\r\n\t}",
"public float getBalance()\r\n\t{\n\t\ttry\r\n\t\t{\r\n\t\t\tDBConnection ToDB = new DBConnection(); //Have a connection to the DB\r\n\t\t\tConnection DBConn = ToDB.openConn();\r\n\t\t\tStatement Stmt = DBConn.createStatement();\r\n\t\t\tString SQL_Command = \"SELECT Balance FROM SavingsAccount WHERE SavingsAccountNumber ='\"+SavingsAccountNumber+\"'\"; //SQL query command for Balance\r\n\t\t\tResultSet Rslt = Stmt.executeQuery(SQL_Command);\r\n\t\t\twhile (Rslt.next())\r\n\t\t\t{\r\n\t\t\t\tBalance = Rslt.getFloat(1);\r\n\t\t\t}\r\n\t\t\tStmt.close();\r\n\t\t\tToDB.closeConn();\r\n\t\t}\r\n\t\tcatch(SQLException e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"SQLException: \" + e);\r\n\t\t\twhile (e != null)\r\n\t\t\t{ System.out.println(\"SQLState: \" + e.getSQLState());\r\n\t\t\t\tSystem.out.println(\"Message: \" + e.getMessage());\r\n\t\t\t\tSystem.out.println(\"Vendor: \" + e.getErrorCode());\r\n\t\t\t\te = e.getNextException();\r\n\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (Exception e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Exception: \" + e);\r\n\t\t\te.printStackTrace ();\r\n\t\t}\r\n\t\treturn Balance;\r\n\t}",
"private void updateBalance(int balance) throws SQLException {\n\t\tupdateBalanceStatement.clearParameters();\n\t\tupdateBalanceStatement.setInt(1, balance);\n\t\tupdateBalanceStatement.setString(2, this.username);\n\t\tupdateBalanceStatement.executeUpdate();\n\t}",
"public long getBalance() {\n return this.balance;\n }",
"public String balance() {\n\t\treturn this.apiCall(\"balance\", \"\", \"\", true);\n\t}",
"@Override\n\tpublic double getAccountBalance(final int bankAccountId, final String vcDate, final Connection connection)\n\t{\n\t\tdouble opeAvailable = 0, totalAvailable = 0;\n\t\ttry {\n\n\t\t\tfinal StringBuilder str = new StringBuilder(\"SELECT case when sum(openingDebitBalance) = null then 0\")\n\t\t\t\t\t.append(\" ELSE sum(openingDebitBalance) end - case when sum(openingCreditBalance) = null then 0\")\n\t\t\t\t\t.append(\" else sum(openingCreditBalance) end AS \\\"openingBalance\\\" \")\n\t\t\t\t\t.append(\"FROM transactionSummary WHERE financialYearId=( SELECT id FROM financialYear WHERE startingDate <= ?\")\n\t\t\t\t\t.append(\"AND endingDate >= ?) AND glCodeId =(select glcodeid from bankaccount where id= ?)\");\n\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\tLOGGER.info(str);\n\t\t\tQuery pst = persistenceService.getSession().createSQLQuery(str.toString());\n\t\t\tpst.setString(0, vcDate);\n\t\t\tpst.setString(1, vcDate);\n\t\t\tpst.setInteger(2, bankAccountId);\n\t\t\tList<Object[]> rset = pst.list();\n\t\t\tfor (final Object[] element : rset)\n\t\t\t\topeAvailable = Double.parseDouble(element[0].toString());\n\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\tLOGGER.info(\"opening balance \" + opeAvailable);\n\n\t\t\tfinal StringBuilder str1 = new StringBuilder(\"SELECT (case when sum(gl.debitAmount) = null then 0\")\n\t\t\t\t\t.append(\" else sum(gl.debitAmount) end - case when sum(gl.creditAmount) = null then 0\")\n\t\t\t\t\t.append(\" else sum(gl.creditAmount) end) + \").append(opeAvailable).append(\"\")\n\t\t\t\t\t.append(\" as \\\"totalAmount\\\" FROM generalLedger gl, voucherHeader vh WHERE vh.id = gl.voucherHeaderId\")\n\t\t\t\t\t.append(\" AND gl.glCodeid = (select glcodeid from bankaccount where id= ?) AND \")\n\t\t\t\t\t.append(\" vh.voucherDate >=( SELECT TO_CHAR(startingDate, 'dd-Mon-yyyy')\")\n\t\t\t\t\t.append(\" FROM financialYear WHERE startingDate <= ? AND endingDate >= ?) AND vh.voucherDate <= ?\");\n\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\tLOGGER.info(str1);\n\t\t\tpst = persistenceService.getSession().createSQLQuery(str1.toString());\n\t\t\tpst.setInteger(0, bankAccountId);\n\t\t\tpst.setString(1, vcDate);\n\t\t\tpst.setString(2, vcDate);\n\t\t\tpst.setString(3, vcDate);\n\t\t\trset = pst.list();\n\t\t\tfor (final Object[] element : rset) {\n\t\t\t\ttotalAvailable = Double.parseDouble(element[0].toString());\n\t\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\t\tLOGGER.info(\"total balance \" + totalAvailable);\n\t\t\t}\n\n\t\t} catch (final HibernateException e) {\n\t\t\tLOGGER.error(\" could not get Bankbalance \" + e.toString(), e);\n\t\t\tthrow new HibernateException(e.toString());\n\t\t}\n\t\treturn totalAvailable;\n\t}",
"public void setBalance( long balance ) {\r\n this.balance = balance;\r\n }",
"public double getBalance(){\n return balance;\n }",
"public double getBalance(){\n return balance;\n }",
"public double getBalance()\n {\n return balance;\n }",
"public BankAccount(int balance) {\n\n this.balance = balance;\n\n }",
"public void setBalance(int balance) {\r\n\t\tif(0<=balance&&balance<=1000000) {\r\n\t\tthis.balance = balance;\r\n\t}else{\r\n\t\t System.out.println(\"잘못 입력하셨습니다. 현재 잔고는 \"+this.balance+\"입니다\");\r\n\t}\r\n \r\n}",
"public void setBalance(float balance) {\n this.balance = balance;\n }",
"@Override\r\n\tpublic Double getBalance( Integer id) {\n\t\tString sql = \"SELECT balance FROM buyers WHERE id = ?;\";\r\n\t\treturn jdbcTemplate.queryForObject( sql, Double.class, id);\r\n\t}",
"public float showBalance() {\n\t\treturn dao.showBalance();\r\n\t}",
"public double getBalance(){\n\t\treturn balance;\n\t}",
"public double getBalance() {\n return balance;\n }",
"public Double getBalance() {\r\n return balance;\r\n }",
"public String getBalance() {\n return balance;\n }",
"void setManageTransactionBalance(String balance);",
"public static void getAcountsBalance(int value) {\n\t\t\t\n\t\t\taccounts.clear();\n\n\t\t\tString query = \"select account.accID, accType, balance, dateCreated, fName, lName \" + \n\t\t \"from ser322.account,ser322.customer \" + \n\t\t \"WHERE customer.accID = account.accID AND balance =\" + value;\n\t\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\tStatement stmt = con.getConnection().createStatement();\n\t\t\t ResultSet rs = stmt.executeQuery(query);\n\t\t while (rs.next()) {\n\t\t \taccounts.addElement(new Account(rs.getInt(\"accID\"),rs.getString(\"accType\"),\n\t\t \t\t\t rs.getFloat(\"balance\"),rs.getDate(\"dateCreated\"), rs.getString(\"fName\"), rs.getString(\"lName\")));\n\t\t \n\t\t }\n\t\t \n\t\t } catch (SQLException e ) {\n\t\t \tSystem.out.println(\"QUERY WRONG - getAcountsBalance\");\n\t\t }\n\t\n\t\t}",
"public BaseJson<BigDecimal> wallet_balance() throws Exception {\n String s = main(\"wallet_balance\",\"[]\");\n return JsonHelper.jsonStr2Obj(s, BaseJson.class);\n }",
"public Double getBalance(){\n Double sum = 0.0;\n // Mencari balance dompet dari transaksi dengan cara menghitung total transaksi\n for (Transaction transaction : transactions) {\n sum += transaction.getAmount().doubleValue();\n }\n return sum;\n }",
"public Account(){\n this.id = 0;\n this.balance = 0;\n this.annualInterestRate = 0;\n this.dateCreated = new Date();\n }",
"public void setBalance(){\n balance.setBalance();\n }",
"@java.lang.Override\n public com.google.protobuf.ByteString\n getBalanceBytes() {\n java.lang.Object ref = balance_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n balance_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public StoneBalanceExample() {\n oredCriteria = new ArrayList<Criteria>();\n }",
"double getBalance(UUID name);",
"Databank getBank();",
"public double getBal() {\n\t\t return balance;\r\n\t }",
"@Override\r\npublic void checkBalance() {\n\t\r\n}",
"public int getBalance() {\n\t\treturn balance;\n\t}",
"public void setBalance(java.math.BigDecimal balance) {\n this.balance = balance;\n }",
"public int getBalance() {\n return total_bal;\n }",
"public int getPropertyBalance();",
"public BankAccount getAccountBalanceRepo(String accountNr){\n String sql = \"SELECT * FROM bankaccount WHERE accountnr = :accountnr\";\n Map paramMap = new HashMap();\n paramMap.put(\"accountnr\", accountNr);\n BankAccount result = jdbcTemplate.queryForObject(sql, paramMap, new AccountRowMapper());\n return result;\n }",
"private int getBalance() throws SQLException {\n\t\tgetBalanceStatement.clearParameters();\n\t\tgetBalanceStatement.setString(1, this.username);\n\t\tResultSet result = getBalanceStatement.executeQuery();\n\t\tresult.next();\n\t\tint out = result.getInt(1);\n\t\tresult.close();\n\t\treturn out;\n\t}",
"public BankAccount findAccountById(int currentBankID) throws SQLException;",
"public void deposit(double amount) {\n balance += amount;\n \n try {\n \n Class.forName(\"net.ucanaccess.jdbc.UcanaccessDriver\");\n \n // Load Driver\n String connURL=\"jdbc:ucanaccess://c:/Users/Ellen/Documents/CIST2373/ChattBankMDB.mdb\";\n \n // Get Connection\n Connection con = DriverManager.getConnection(connURL);\n \n // Create Statement\n Statement stmt = con.createStatement();\n \n // Create sql string \n String sql = \"Update Accounts set Balance = \"+getBalance()+ \n \" where AcctNo='\"+getAcctNo()+\"'\";\n \n // Check for properly formed sql\n System.out.println(sql);\n \n // Execute Statement\n int n = stmt.executeUpdate(sql);\n if (n == 1)\n System.out.println(\"Update was successful!\");\n else\n System.out.println(\"Update failed!\"); \n \n // Close Connection\n con.close(); \n } //end try\n \n catch (Exception err) {\n System.out.println(\"Error: \" + err);\n } //end catch\n }",
"public BankAccount() {\r\n\t\tbalance=0;\r\n\t\t\r\n\t}",
"public void initializeBalance() {\n try {\n Connection connection = connect();\n\n PreparedStatement createBalanceTable = connection.prepareStatement(\"CREATE TABLE IF NOT EXISTS balance (\"\n + \"id INTEGER PRIMARY KEY,\"\n + \"user_username varchar(100),\"\n + \"amount float, \"\n + \"time varchar,\"\n + \"FOREIGN KEY (user_username) REFERENCES User(username));\"\n );\n createBalanceTable.execute();\n createBalanceTable.close();\n connection.close();\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }",
"public void showAccountBalance(){\n balance();\n\n }",
"public void balance(){\n\t\tnamesTree.balance();\n\t\taccountNumbersTree.balance();\n\t}",
"public double getBalance() {\n return this.balance;\n }",
"public Balance() {\r\n value = BigDecimal.ZERO;\r\n }",
"public void setBalance(final int balance)\n {\n this.balance = balance;\n }",
"public double getBalance() {\n return balance;\n }",
"public double getBalance() {\n return balance;\n }",
"public double getBalance() {\n return balance;\n }",
"public double getBalance() {\n return balance;\n }",
"public float getBalance() {\n return balance;\n }",
"private double getBalance() { return balance; }",
"public Double getBalance() {\n return null;\n }",
"public double getBalance()\r\n\t{\r\n\t\treturn balance;\t\t\r\n\t}",
"public void setBalance(double balance){\n\t\tthis.balance = balance;\n\t}",
"BigDecimal getOpeningDebitBalance();",
"BigDecimal getOpeningDebitBalance();",
"public com.google.protobuf.ByteString\n getBalanceBytes() {\n java.lang.Object ref = balance_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n balance_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public void InitializeBalance(BigDecimal valor){\n \r\n ChekingAccount chekAc=pRepository.GetChekingAccount();\r\n chekAc.setSaldoInicial(valor);\r\n pRepository.SaveChekingAccount(chekAc);\r\n \r\n }",
"Account(int balance) {\n if(balance <0) this.balance=0;\n this.balance = balance;\n }",
"public void updateBalance(String mobileNo,int balance)\n\t{\n\t\tContext ctx;\n\t\ttry {\n\t\t\tctx = new InitialContext();\n\t\t\n\t\t\n\t\t DataSource ds=(DataSource)ctx.lookup(\"java:OracleDS\");\n\t\t\tConnection con=ds.getConnection();\n\t\t\tStatement stmt=con.createStatement();\n\t\t\t\n\t\t\tstmt.executeUpdate(\"update mobile set balance=\"+balance+\" where mobileno=\"+mobileNo);\n\t\t\tcon.close();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Error in connection with Database :\"+e.getMessage());\n\t\t\t\n\t\t}\n\t\t\n\t}",
"public int balance(String accountNumber, String userId) {\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\t\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\t\n\t\ttry{\n\t\t\t//connect to database\n\t\t\tconn=DriverManager.getConnection(url, username, password);\n\t\t\tString sql = \"select balance from \"+this.name+\" where accountNumber=?\";\n\t\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\t\tps.setString(1, accountNumber.toString());\n\t\t\tResultSet rs = ps.executeQuery();\n\t\t\tint nowBalance = 0;\n\t\t\twhile(rs.next()) { \n\t\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\t}\n\t\t\t\n\t\t\tString logs = \"Checked balance: \"+String.valueOf(nowBalance);\n\t\t\tString sql1 = \"insert into \"+userId+\" (log) values (?)\";\n\t\t\tpp = (PreparedStatement) conn.prepareStatement(sql1);\n\t\t\tpp.setString(1, logs);\n\t\t\tpp.executeUpdate();\n\t\t\t\n\t\t\treturn nowBalance;\n\t\t} catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t\t\n\t}",
"public double getBalance()\n {\n return startingBalance;\n }",
"public void deposit(String accountNumber, int amount) {\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp, ll;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\tint lastBalance;\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\ttry{\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql = \"select balance,userId from \"+this.name+\" where accountNumber=?\";\n\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\tps.setString(1, accountNumber.toString());\n\t\tResultSet rs = ps.executeQuery();\n\t\tint nowBalance = 0;\n\t\tString id = \"\";\n\t\twhile(rs.next()) { \n\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\tid = rs.getString(\"userId\");\n\t\t}\n\t\tlastBalance = nowBalance + amount;\n\t\t//System.out.println(lastBalance);\n\t\t\n\t\tString sql1 = \"UPDATE \"+this.name+\" SET balance=? where accountNumber=?\";\n\t\tpp = (PreparedStatement) conn.prepareStatement(sql1);\n\t\tpp.setInt(1, lastBalance);\n\t\tpp.setString(2, accountNumber.toString());\n\t\tpp.executeUpdate();\n\t\t\n\t\tString logs = \"deposit : \"+ amount+\" / balance: \"+String.valueOf(lastBalance);\n\t\tString sql11 = \"insert into \"+id+\" (log) values (?)\";\n\t\tll = (PreparedStatement) conn.prepareStatement(sql11);\n\t\tll.setString(1, logs);\n\t\tll.executeUpdate();\n\t\t\n\t\t}catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t}",
"public List<DietaBalanceada> consultar_dietaBalanceada();",
"public String myAfterBalanceAmount() {\r\n\t\tint count=0;\r\n\t\tList<SavingAccount> acc = null;\r\n\t\ttry {\r\n\t\t\tSystem.out.println(\"Before Repeat\");\r\n\t\t\tacc = getSavingAccountList();\r\n\r\n\t\t\tfor (SavingAccount savingAcc : acc) {\r\n\t\t\t\tif (!(\"0\".equals(savingAcc.getState()))) {\r\n\t\t\t\t\tif (savingAcc.getState().equals(\"active\")) {\r\n\t\t\t\t\t\tint maxRepeat = Integer.parseInt(savingAcc\r\n\t\t\t\t\t\t\t\t.getRepeatable());\r\n\r\n\t\t\t\t\t\tDate date = new Date();\r\n\t\t\t\t\t\tDate systemDate = savingAccSer\r\n\t\t\t\t\t\t\t\t.convertStringToDateDDmmYYYY(savingAccSer\r\n\t\t\t\t\t\t\t\t\t\t.convertDateToStringDDmmYYYY(date));\r\n\r\n\t\t\t\t\t\tDate dateEnd = savingAccSer\r\n\t\t\t\t\t\t\t\t.convertStringToDateDDmmYYYY(savingAcc\r\n\t\t\t\t\t\t\t\t\t\t.getDateEnd());\r\n\r\n\t\t\t\t\t\tif (systemDate.getTime() == dateEnd.getTime()) {\r\n\t\t\t\t\t\t\tDate newEndDate = DateUtils.addMonths(systemDate,\r\n\t\t\t\t\t\t\t\t\tsavingAcc.getInterestRateId().getMonth());\r\n\r\n\t\t\t\t\t\t\tfloat balance = savingAcc.getBalanceAmount();\r\n\t\t\t\t\t\t\tfloat interest = savingAcc.getInterestRateId()\r\n\t\t\t\t\t\t\t\t\t.getInterestRate();\r\n\r\n\t\t\t\t\t\t\tint month = savingAcc.getInterestRateId()\r\n\t\t\t\t\t\t\t\t\t.getMonth();\r\n\t\t\t\t\t\t\tint days = Days\r\n\t\t\t\t\t\t\t\t\t.daysBetween(\r\n\t\t\t\t\t\t\t\t\t\t\tnew DateTime(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsavingAccSer\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.convertStringToDate(savingAcc\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getDateStart())),\r\n\t\t\t\t\t\t\t\t\t\t\tnew DateTime(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsavingAccSer\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.convertStringToDate(savingAcc\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getDateEnd())))\r\n\t\t\t\t\t\t\t\t\t.getDays();\r\n\t\t\t\t\t\t\tfloat amountAll = balance\r\n\t\t\t\t\t\t\t\t\t+ (balance * ((interest / (100)) / 360) * days);\r\n\t\t\t\t\t\t\tsavingAcc.setDateStart(savingAccSer\r\n\t\t\t\t\t\t\t\t\t.convertDateToString(systemDate));\r\n\t\t\t\t\t\t\tsavingAcc.setDateEnd(savingAccSer\r\n\t\t\t\t\t\t\t\t\t.convertDateToString(newEndDate));\r\n\t\t\t\t\t\t\tsavingAcc.setBalanceAmount(amountAll);\r\n\t\t\t\t\t\t\tsavingAcc.setRepeatable(\"\" + (maxRepeat + 1));\r\n\t\t\t\t\t\t\tupdateSavingAccount(savingAcc);\r\n\t\t\t\t\t\t\tcount+=1;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\tSystem.out.println(\"Successfully!! \"+ count +\" Saving Account has been updated. Minh Map!!!\");\r\n\t\t\t\r\n\t\t\treturn \"success\";\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.out.println(\"Exception\");\r\n\r\n\t\t}\r\n\t\treturn \"Fail\";\r\n\t}",
"public void setBalance(Double balance) {\r\n this.balance = balance;\r\n }",
"@Override\n\tpublic int accountUpdate(String id, String balance) {\n\t\tSession session=sessionFactory.openSession();\n\t\tTransaction tr = session.beginTransaction();\n\t\tint executeUpdate = 0;\n\t\tString sqlString=\"update user set balance = '\"+balance+\"' where id ='\"+id+\"'\";\n\t\ttry {\n\t\t\tQuery query=session.createSQLQuery(sqlString);\n\t\t\texecuteUpdate = query.executeUpdate();\n\t\t\tSystem.out.println(\"executeUpdate:\"+executeUpdate);\n\t\t} catch (HibernateException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}finally{\n\t\t\ttr.commit();\n\t\t session.close();\n\t\t}\n\t\treturn executeUpdate;\t\n\t}",
"public void Deposit(Integer accountNo,float depositMoney){\n\tSessionFactory sessionFactory = new Configuration().configure(\"hibernate.cfg.xml\").buildSessionFactory();\n\tSession session = sessionFactory.openSession();\n\tTransaction trans = null;\n\ttry{\n\t\ttrans = session.beginTransaction();\n\t\tQuery query=session.createQuery(\"UPDATE Account set balance+=:balance where accountNo=:accountNo\"); \n\t\tquery.setParameter(\"balance\",depositMoney); \n\t\tquery.setParameter(\"accountNo\",accountNo); \n\t}catch(HibernateException hibernateException){\n\t\tif(trans != null){\n\t\t\ttrans.rollback();\n\t\t}\n\t\thibernateException.printStackTrace();\n\t}\n\t}",
"public java.math.BigDecimal getBalance() {\n return balance;\n }"
] | [
"0.6256659",
"0.6253897",
"0.6161887",
"0.6052792",
"0.6007962",
"0.5992738",
"0.598382",
"0.59808713",
"0.59671104",
"0.59655404",
"0.59493804",
"0.5944475",
"0.5944475",
"0.5929044",
"0.58891714",
"0.58717656",
"0.5871257",
"0.5839201",
"0.58093864",
"0.5794495",
"0.5794373",
"0.5794373",
"0.5792861",
"0.5790225",
"0.5790225",
"0.5777398",
"0.5777398",
"0.576912",
"0.576912",
"0.57617587",
"0.57617587",
"0.5743701",
"0.57244354",
"0.5722053",
"0.5708364",
"0.57033765",
"0.56972003",
"0.569613",
"0.567973",
"0.5677364",
"0.5669179",
"0.5660392",
"0.5658301",
"0.56578594",
"0.5655242",
"0.5647081",
"0.5645896",
"0.56420755",
"0.5628228",
"0.5627138",
"0.5626427",
"0.5623627",
"0.5606722",
"0.56027985",
"0.56014687",
"0.5595286",
"0.5582922",
"0.5579553",
"0.5579103",
"0.55756223",
"0.55752707",
"0.5569577",
"0.5568102",
"0.5566652",
"0.55662084",
"0.5561891",
"0.55556166",
"0.5543907",
"0.5536255",
"0.5535043",
"0.5523186",
"0.55217797",
"0.551842",
"0.55178934",
"0.5515522",
"0.5512042",
"0.55097926",
"0.5505763",
"0.5505763",
"0.5505763",
"0.5505763",
"0.55049235",
"0.55021036",
"0.5498412",
"0.54945385",
"0.5494492",
"0.5492579",
"0.5492579",
"0.5489636",
"0.54847556",
"0.54788065",
"0.5473692",
"0.5472998",
"0.5469174",
"0.54671735",
"0.5467048",
"0.54647994",
"0.5461322",
"0.5448236",
"0.54227674",
"0.54078424"
] | 0.0 | -1 |
This method was generated by MyBatis Generator. This method corresponds to the database table stone_balance | public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int baldown(double newbalance, Long accountno, Long broaccno, Double bramt) throws Exception{\n\tint j=DbConnect.getStatement().executeUpdate(\"update account set balance=\"+newbalance+\" where accno=\"+accountno+\"\");\r\n\tint i=DbConnect.getStatement().executeUpdate(\"update account set balance=balance+\"+bramt+\" where accno=\"+broaccno+\"\");\r\n\treturn i;\r\n}",
"public int balup(double newbalance, Long accountno, Long broaccno, Double bramt) throws Exception{\n\tint j=DbConnect.getStatement().executeUpdate(\"update account set balance=\"+newbalance+\" where accno=\"+accountno+\"\");\r\n\tint i=DbConnect.getStatement().executeUpdate(\"update account set balance=balance+\"+bramt+\" where accno=\"+broaccno+\"\");\r\n\treturn i;\r\n}",
"private void listBalances() {\n\t\t\r\n\t}",
"public Money getTotalBalance();",
"private void updateDatabaseAccountBalance() {\n\t\tString sql = \"UPDATE account SET balance = \" + this.balance + \" \";\n\t\tsql += \"WHERE accountID = '\" + this.accountID + \"';\";\n\n\t\tDbUtilities db = new MySqlUtilities();\n\t\tdb.executeQuery(sql);\n\t}",
"public ResultSet retBalance(Long userid) throws SQLException {\n\trs=DbConnect.getStatement().executeQuery(\"Select balance from account where accno=\"+userid+\"\");\r\n\treturn rs;\r\n}",
"@Override\r\n\tpublic double showbalanceDao() {\n\t\t\r\n\t\treturn temp.getCustBal();\r\n\t}",
"public String getBalance() {\n return this.balance;\n }",
"public int getBalance() {\n return this.balance;\n\n }",
"public void withdraw(String accountNumber, int amount) {\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp, ll;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\tint lastBalance;\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\ttry{\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql = \"select balance,userId from \"+this.name+\" where accountNumber=?\";\n\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\tps.setString(1, accountNumber.toString());\n\t\tResultSet rs = ps.executeQuery();\n\t\tint nowBalance = 0;\n\t\tString id = \"\";\n\t\twhile(rs.next()) { \n\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\tid = rs.getString(\"userId\");\n\t\t}\n\t\tif (nowBalance<amount) {\n\t\t\tSystem.out.println(\"No Balance\");\n\t\t\treturn;\n\t\t}\n\t\tlastBalance = nowBalance - amount;\n\t\t//System.out.println(lastBalance);\n\t\t\n\t\tString sql1 = \"UPDATE \"+this.name+\" SET balance=? where accountNumber=?\";\n\t\tpp = (PreparedStatement) conn.prepareStatement(sql1);\n\t\tpp.setInt(1, lastBalance);\n\t\tpp.setString(2, accountNumber.toString());\n\t\tpp.executeUpdate();\n\t\t\n\t\tString logs = \"withdraw : \"+ amount+\" / balance: \"+String.valueOf(lastBalance);\n\t\tString sql11 = \"insert into \"+id+\" (log) values (?)\";\n\t\tll = (PreparedStatement) conn.prepareStatement(sql11);\n\t\tll.setString(1, logs);\n\t\tll.executeUpdate();\n\t\tSystem.out.println(\"Ypu got $\"+String.valueOf(amount));\n\t\t\n\t\t}catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t\t\n\t}",
"Balance[] findAllByBankAccount_Id(Long id);",
"double getBalance();",
"double getBalance();",
"public int getBalance()\n {\n return balance;\n }",
"public double getBalance()\n \n {\n \n return balance;\n \n }",
"public double getBalance(){\n return this.balance;\r\n }",
"@Override\n\tpublic double queryBalance(int accNo) {\n\t\treturn 0;\n\t}",
"public void wire(String accountNumber,int bankNumber, String toAccountNumber, int amount) {\n\t\t\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp, ll, lp, ls, mm, nn;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\tint lastBalance;\n\t\tint tolastBalance;\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\ttry{\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql = \"select balance,userId from \"+this.name+\" where accountNumber=?\";\n\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\tps.setString(1, accountNumber.toString());\n\t\tResultSet rs = ps.executeQuery();\n\t\tint nowBalance = 0;\n\t\tString id = \"\";\n\t\twhile(rs.next()) { \n\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\tid = rs.getString(\"userId\");\n\t\t}\n\t\tif (nowBalance<amount) {\n\t\t\tSystem.out.println(\"No Balance\");\n\t\t\treturn;\n\t\t}\n\t\tlastBalance = nowBalance - amount;\n\t\t//System.out.println(lastBalance);\n\t\tString sql1 = \"UPDATE \"+this.name+\" SET balance=? where accountNumber=?\";\n\t\tls = (PreparedStatement) conn.prepareStatement(sql1);\n\t\tls.setInt(1, lastBalance);\n\t\tls.setString(2, accountNumber.toString());\n\t\tls.executeUpdate();\n\t\t\n\t\t\n\t\t\n\t\t//to account\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql3 = \"select bankName from bank where bankNumber=?\";\n\t\tll= (PreparedStatement) conn.prepareStatement(sql3);\n\t\tll.setString(1, String.valueOf(bankNumber).toString());\n\t\tResultSet rs3 = ll.executeQuery();\n\t\tString toname = \"\";\n\t\twhile(rs3.next()) { \n\t\t\ttoname=rs3.getString(\"bankName\");\n\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tString sql4 = \"select balance,userId from \"+toname+\" where accountNumber=?\";\n\t\tpp= (PreparedStatement) conn.prepareStatement(sql4);\n\t\tpp.setString(1, accountNumber.toString());\n\t\tResultSet rs4 = pp.executeQuery();\n\t\tint tonowBalance = 0;\n\t\tString toid = \"\";\n\t\twhile(rs4.next()) { \n\t\t\ttonowBalance=rs4.getInt(\"balance\");\n\t\t\ttoid = rs4.getString(\"userId\");\n\t\t}\n\t\t\n\t\ttolastBalance = tonowBalance + amount;\n\t\t//System.out.println(lastBalance);\n\t\tString sql5 = \"UPDATE \"+toname+\" SET balance=? where accountNumber=?\";\n\t\tlp = (PreparedStatement) conn.prepareStatement(sql5);\n\t\tlp.setInt(1, tolastBalance);\n\t\tlp.setString(2, toAccountNumber.toString());\n\t\tlp.executeUpdate();\n\t\t\n\t\t\n\t\t//log\n\t\tString logs = \"wired : \"+ amount+\" to \"+toAccountNumber+\"/ balance: \"+String.valueOf(lastBalance);\n\t\tString sql11 = \"insert into \"+id+\" (log) values (?)\";\n\t\tmm = (PreparedStatement) conn.prepareStatement(sql11);\n\t\tmm.setString(1, logs);\n\t\tmm.executeUpdate();\n\t\tSystem.out.println(\"You wired $\"+String.valueOf(amount));\n\t\t\n\t\tString logs1 = \"get : \"+ amount+\" from \" +accountNumber+ \"/ balance: \"+String.valueOf(tolastBalance);\n\t\tString sql12 = \"insert into \"+toid+\" (log) values (?)\";\n\t\tnn = (PreparedStatement) conn.prepareStatement(sql12);\n\t\tnn.setString(1, logs1);\n\t\tnn.executeUpdate();\n\t\tSystem.out.println(\"You got $\"+String.valueOf(amount));\n\t\t\n\t\t\n\t\t}catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t}",
"public double getBalance(){\n return balance;\n }",
"public double getBalance(){\n return balance;\r\n }",
"public Integer getBalance() {\n return balance;\n }",
"public Integer getBalance() {\n return balance;\n }",
"public long getBalance() {\n\t\n\treturn balance;\n}",
"public int getBalance() {\n return balance;\n }",
"public int getBalance() {\n return balance;\n }",
"public void setBalance(Integer balance) {\n this.balance = balance;\n }",
"public void setBalance(Integer balance) {\n this.balance = balance;\n }",
"public BigDecimal getBalance() {\n return balance;\n }",
"public BigDecimal getBalance() {\n return balance;\n }",
"public void setBalance(BigDecimal balance) {\n this.balance = balance;\n }",
"public void setBalance(BigDecimal balance) {\n this.balance = balance;\n }",
"public double getBalance(){\r\n\t\treturn balance;\r\n\t}",
"public float getBalance()\r\n\t{\n\t\ttry\r\n\t\t{\r\n\t\t\tDBConnection ToDB = new DBConnection(); //Have a connection to the DB\r\n\t\t\tConnection DBConn = ToDB.openConn();\r\n\t\t\tStatement Stmt = DBConn.createStatement();\r\n\t\t\tString SQL_Command = \"SELECT Balance FROM SavingsAccount WHERE SavingsAccountNumber ='\"+SavingsAccountNumber+\"'\"; //SQL query command for Balance\r\n\t\t\tResultSet Rslt = Stmt.executeQuery(SQL_Command);\r\n\t\t\twhile (Rslt.next())\r\n\t\t\t{\r\n\t\t\t\tBalance = Rslt.getFloat(1);\r\n\t\t\t}\r\n\t\t\tStmt.close();\r\n\t\t\tToDB.closeConn();\r\n\t\t}\r\n\t\tcatch(SQLException e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"SQLException: \" + e);\r\n\t\t\twhile (e != null)\r\n\t\t\t{ System.out.println(\"SQLState: \" + e.getSQLState());\r\n\t\t\t\tSystem.out.println(\"Message: \" + e.getMessage());\r\n\t\t\t\tSystem.out.println(\"Vendor: \" + e.getErrorCode());\r\n\t\t\t\te = e.getNextException();\r\n\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (Exception e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Exception: \" + e);\r\n\t\t\te.printStackTrace ();\r\n\t\t}\r\n\t\treturn Balance;\r\n\t}",
"private void updateBalance(int balance) throws SQLException {\n\t\tupdateBalanceStatement.clearParameters();\n\t\tupdateBalanceStatement.setInt(1, balance);\n\t\tupdateBalanceStatement.setString(2, this.username);\n\t\tupdateBalanceStatement.executeUpdate();\n\t}",
"public long getBalance() {\n return this.balance;\n }",
"public String balance() {\n\t\treturn this.apiCall(\"balance\", \"\", \"\", true);\n\t}",
"@Override\n\tpublic double getAccountBalance(final int bankAccountId, final String vcDate, final Connection connection)\n\t{\n\t\tdouble opeAvailable = 0, totalAvailable = 0;\n\t\ttry {\n\n\t\t\tfinal StringBuilder str = new StringBuilder(\"SELECT case when sum(openingDebitBalance) = null then 0\")\n\t\t\t\t\t.append(\" ELSE sum(openingDebitBalance) end - case when sum(openingCreditBalance) = null then 0\")\n\t\t\t\t\t.append(\" else sum(openingCreditBalance) end AS \\\"openingBalance\\\" \")\n\t\t\t\t\t.append(\"FROM transactionSummary WHERE financialYearId=( SELECT id FROM financialYear WHERE startingDate <= ?\")\n\t\t\t\t\t.append(\"AND endingDate >= ?) AND glCodeId =(select glcodeid from bankaccount where id= ?)\");\n\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\tLOGGER.info(str);\n\t\t\tQuery pst = persistenceService.getSession().createSQLQuery(str.toString());\n\t\t\tpst.setString(0, vcDate);\n\t\t\tpst.setString(1, vcDate);\n\t\t\tpst.setInteger(2, bankAccountId);\n\t\t\tList<Object[]> rset = pst.list();\n\t\t\tfor (final Object[] element : rset)\n\t\t\t\topeAvailable = Double.parseDouble(element[0].toString());\n\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\tLOGGER.info(\"opening balance \" + opeAvailable);\n\n\t\t\tfinal StringBuilder str1 = new StringBuilder(\"SELECT (case when sum(gl.debitAmount) = null then 0\")\n\t\t\t\t\t.append(\" else sum(gl.debitAmount) end - case when sum(gl.creditAmount) = null then 0\")\n\t\t\t\t\t.append(\" else sum(gl.creditAmount) end) + \").append(opeAvailable).append(\"\")\n\t\t\t\t\t.append(\" as \\\"totalAmount\\\" FROM generalLedger gl, voucherHeader vh WHERE vh.id = gl.voucherHeaderId\")\n\t\t\t\t\t.append(\" AND gl.glCodeid = (select glcodeid from bankaccount where id= ?) AND \")\n\t\t\t\t\t.append(\" vh.voucherDate >=( SELECT TO_CHAR(startingDate, 'dd-Mon-yyyy')\")\n\t\t\t\t\t.append(\" FROM financialYear WHERE startingDate <= ? AND endingDate >= ?) AND vh.voucherDate <= ?\");\n\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\tLOGGER.info(str1);\n\t\t\tpst = persistenceService.getSession().createSQLQuery(str1.toString());\n\t\t\tpst.setInteger(0, bankAccountId);\n\t\t\tpst.setString(1, vcDate);\n\t\t\tpst.setString(2, vcDate);\n\t\t\tpst.setString(3, vcDate);\n\t\t\trset = pst.list();\n\t\t\tfor (final Object[] element : rset) {\n\t\t\t\ttotalAvailable = Double.parseDouble(element[0].toString());\n\t\t\t\tif (LOGGER.isInfoEnabled())\n\t\t\t\t\tLOGGER.info(\"total balance \" + totalAvailable);\n\t\t\t}\n\n\t\t} catch (final HibernateException e) {\n\t\t\tLOGGER.error(\" could not get Bankbalance \" + e.toString(), e);\n\t\t\tthrow new HibernateException(e.toString());\n\t\t}\n\t\treturn totalAvailable;\n\t}",
"public void setBalance( long balance ) {\r\n this.balance = balance;\r\n }",
"public double getBalance(){\n return balance;\n }",
"public double getBalance(){\n return balance;\n }",
"public double getBalance()\n {\n return balance;\n }",
"public BankAccount(int balance) {\n\n this.balance = balance;\n\n }",
"public void setBalance(int balance) {\r\n\t\tif(0<=balance&&balance<=1000000) {\r\n\t\tthis.balance = balance;\r\n\t}else{\r\n\t\t System.out.println(\"잘못 입력하셨습니다. 현재 잔고는 \"+this.balance+\"입니다\");\r\n\t}\r\n \r\n}",
"public void setBalance(float balance) {\n this.balance = balance;\n }",
"@Override\r\n\tpublic Double getBalance( Integer id) {\n\t\tString sql = \"SELECT balance FROM buyers WHERE id = ?;\";\r\n\t\treturn jdbcTemplate.queryForObject( sql, Double.class, id);\r\n\t}",
"public float showBalance() {\n\t\treturn dao.showBalance();\r\n\t}",
"public double getBalance(){\n\t\treturn balance;\n\t}",
"public double getBalance() {\n return balance;\n }",
"public Double getBalance() {\r\n return balance;\r\n }",
"public String getBalance() {\n return balance;\n }",
"void setManageTransactionBalance(String balance);",
"public static void getAcountsBalance(int value) {\n\t\t\t\n\t\t\taccounts.clear();\n\n\t\t\tString query = \"select account.accID, accType, balance, dateCreated, fName, lName \" + \n\t\t \"from ser322.account,ser322.customer \" + \n\t\t \"WHERE customer.accID = account.accID AND balance =\" + value;\n\t\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\tStatement stmt = con.getConnection().createStatement();\n\t\t\t ResultSet rs = stmt.executeQuery(query);\n\t\t while (rs.next()) {\n\t\t \taccounts.addElement(new Account(rs.getInt(\"accID\"),rs.getString(\"accType\"),\n\t\t \t\t\t rs.getFloat(\"balance\"),rs.getDate(\"dateCreated\"), rs.getString(\"fName\"), rs.getString(\"lName\")));\n\t\t \n\t\t }\n\t\t \n\t\t } catch (SQLException e ) {\n\t\t \tSystem.out.println(\"QUERY WRONG - getAcountsBalance\");\n\t\t }\n\t\n\t\t}",
"public BaseJson<BigDecimal> wallet_balance() throws Exception {\n String s = main(\"wallet_balance\",\"[]\");\n return JsonHelper.jsonStr2Obj(s, BaseJson.class);\n }",
"public Double getBalance(){\n Double sum = 0.0;\n // Mencari balance dompet dari transaksi dengan cara menghitung total transaksi\n for (Transaction transaction : transactions) {\n sum += transaction.getAmount().doubleValue();\n }\n return sum;\n }",
"public Account(){\n this.id = 0;\n this.balance = 0;\n this.annualInterestRate = 0;\n this.dateCreated = new Date();\n }",
"public void setBalance(){\n balance.setBalance();\n }",
"@java.lang.Override\n public com.google.protobuf.ByteString\n getBalanceBytes() {\n java.lang.Object ref = balance_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n balance_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public StoneBalanceExample() {\n oredCriteria = new ArrayList<Criteria>();\n }",
"double getBalance(UUID name);",
"Databank getBank();",
"public double getBal() {\n\t\t return balance;\r\n\t }",
"@Override\r\npublic void checkBalance() {\n\t\r\n}",
"public int getBalance() {\n\t\treturn balance;\n\t}",
"public void setBalance(java.math.BigDecimal balance) {\n this.balance = balance;\n }",
"public int getBalance() {\n return total_bal;\n }",
"public int getPropertyBalance();",
"public BankAccount getAccountBalanceRepo(String accountNr){\n String sql = \"SELECT * FROM bankaccount WHERE accountnr = :accountnr\";\n Map paramMap = new HashMap();\n paramMap.put(\"accountnr\", accountNr);\n BankAccount result = jdbcTemplate.queryForObject(sql, paramMap, new AccountRowMapper());\n return result;\n }",
"private int getBalance() throws SQLException {\n\t\tgetBalanceStatement.clearParameters();\n\t\tgetBalanceStatement.setString(1, this.username);\n\t\tResultSet result = getBalanceStatement.executeQuery();\n\t\tresult.next();\n\t\tint out = result.getInt(1);\n\t\tresult.close();\n\t\treturn out;\n\t}",
"public BankAccount findAccountById(int currentBankID) throws SQLException;",
"public void deposit(double amount) {\n balance += amount;\n \n try {\n \n Class.forName(\"net.ucanaccess.jdbc.UcanaccessDriver\");\n \n // Load Driver\n String connURL=\"jdbc:ucanaccess://c:/Users/Ellen/Documents/CIST2373/ChattBankMDB.mdb\";\n \n // Get Connection\n Connection con = DriverManager.getConnection(connURL);\n \n // Create Statement\n Statement stmt = con.createStatement();\n \n // Create sql string \n String sql = \"Update Accounts set Balance = \"+getBalance()+ \n \" where AcctNo='\"+getAcctNo()+\"'\";\n \n // Check for properly formed sql\n System.out.println(sql);\n \n // Execute Statement\n int n = stmt.executeUpdate(sql);\n if (n == 1)\n System.out.println(\"Update was successful!\");\n else\n System.out.println(\"Update failed!\"); \n \n // Close Connection\n con.close(); \n } //end try\n \n catch (Exception err) {\n System.out.println(\"Error: \" + err);\n } //end catch\n }",
"public BankAccount() {\r\n\t\tbalance=0;\r\n\t\t\r\n\t}",
"public void initializeBalance() {\n try {\n Connection connection = connect();\n\n PreparedStatement createBalanceTable = connection.prepareStatement(\"CREATE TABLE IF NOT EXISTS balance (\"\n + \"id INTEGER PRIMARY KEY,\"\n + \"user_username varchar(100),\"\n + \"amount float, \"\n + \"time varchar,\"\n + \"FOREIGN KEY (user_username) REFERENCES User(username));\"\n );\n createBalanceTable.execute();\n createBalanceTable.close();\n connection.close();\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }",
"public void showAccountBalance(){\n balance();\n\n }",
"public void balance(){\n\t\tnamesTree.balance();\n\t\taccountNumbersTree.balance();\n\t}",
"public double getBalance() {\n return this.balance;\n }",
"public Balance() {\r\n value = BigDecimal.ZERO;\r\n }",
"public void setBalance(final int balance)\n {\n this.balance = balance;\n }",
"public double getBalance() {\n return balance;\n }",
"public double getBalance() {\n return balance;\n }",
"public double getBalance() {\n return balance;\n }",
"public double getBalance() {\n return balance;\n }",
"public float getBalance() {\n return balance;\n }",
"private double getBalance() { return balance; }",
"public Double getBalance() {\n return null;\n }",
"public double getBalance()\r\n\t{\r\n\t\treturn balance;\t\t\r\n\t}",
"public void setBalance(double balance){\n\t\tthis.balance = balance;\n\t}",
"BigDecimal getOpeningDebitBalance();",
"BigDecimal getOpeningDebitBalance();",
"public com.google.protobuf.ByteString\n getBalanceBytes() {\n java.lang.Object ref = balance_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n balance_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public void InitializeBalance(BigDecimal valor){\n \r\n ChekingAccount chekAc=pRepository.GetChekingAccount();\r\n chekAc.setSaldoInicial(valor);\r\n pRepository.SaveChekingAccount(chekAc);\r\n \r\n }",
"Account(int balance) {\n if(balance <0) this.balance=0;\n this.balance = balance;\n }",
"public void updateBalance(String mobileNo,int balance)\n\t{\n\t\tContext ctx;\n\t\ttry {\n\t\t\tctx = new InitialContext();\n\t\t\n\t\t\n\t\t DataSource ds=(DataSource)ctx.lookup(\"java:OracleDS\");\n\t\t\tConnection con=ds.getConnection();\n\t\t\tStatement stmt=con.createStatement();\n\t\t\t\n\t\t\tstmt.executeUpdate(\"update mobile set balance=\"+balance+\" where mobileno=\"+mobileNo);\n\t\t\tcon.close();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Error in connection with Database :\"+e.getMessage());\n\t\t\t\n\t\t}\n\t\t\n\t}",
"public int balance(String accountNumber, String userId) {\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\t\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\t\n\t\ttry{\n\t\t\t//connect to database\n\t\t\tconn=DriverManager.getConnection(url, username, password);\n\t\t\tString sql = \"select balance from \"+this.name+\" where accountNumber=?\";\n\t\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\t\tps.setString(1, accountNumber.toString());\n\t\t\tResultSet rs = ps.executeQuery();\n\t\t\tint nowBalance = 0;\n\t\t\twhile(rs.next()) { \n\t\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\t}\n\t\t\t\n\t\t\tString logs = \"Checked balance: \"+String.valueOf(nowBalance);\n\t\t\tString sql1 = \"insert into \"+userId+\" (log) values (?)\";\n\t\t\tpp = (PreparedStatement) conn.prepareStatement(sql1);\n\t\t\tpp.setString(1, logs);\n\t\t\tpp.executeUpdate();\n\t\t\t\n\t\t\treturn nowBalance;\n\t\t} catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t\t\n\t}",
"public double getBalance()\n {\n return startingBalance;\n }",
"public void deposit(String accountNumber, int amount) {\n\t\tConnection conn;\n\t\tPreparedStatement ps, pp, ll;\n\t\tString url = \"jdbc:mysql://localhost:3306/mars\";\n\t\tString username = \"root\";\n\t\tString password = \"1113\";\n\t\tint lastBalance;\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\ttry{\n\t\tconn=DriverManager.getConnection(url, username, password);\n\t\tString sql = \"select balance,userId from \"+this.name+\" where accountNumber=?\";\n\t\tps= (PreparedStatement) conn.prepareStatement(sql);\n\t\tps.setString(1, accountNumber.toString());\n\t\tResultSet rs = ps.executeQuery();\n\t\tint nowBalance = 0;\n\t\tString id = \"\";\n\t\twhile(rs.next()) { \n\t\t\tnowBalance=rs.getInt(\"balance\");\n\t\t\tid = rs.getString(\"userId\");\n\t\t}\n\t\tlastBalance = nowBalance + amount;\n\t\t//System.out.println(lastBalance);\n\t\t\n\t\tString sql1 = \"UPDATE \"+this.name+\" SET balance=? where accountNumber=?\";\n\t\tpp = (PreparedStatement) conn.prepareStatement(sql1);\n\t\tpp.setInt(1, lastBalance);\n\t\tpp.setString(2, accountNumber.toString());\n\t\tpp.executeUpdate();\n\t\t\n\t\tString logs = \"deposit : \"+ amount+\" / balance: \"+String.valueOf(lastBalance);\n\t\tString sql11 = \"insert into \"+id+\" (log) values (?)\";\n\t\tll = (PreparedStatement) conn.prepareStatement(sql11);\n\t\tll.setString(1, logs);\n\t\tll.executeUpdate();\n\t\t\n\t\t}catch (SQLException e) {\n\t\t throw new IllegalStateException(\"Cannot connect the database!\", e);\n\t\t}\n\t}",
"public List<DietaBalanceada> consultar_dietaBalanceada();",
"public String myAfterBalanceAmount() {\r\n\t\tint count=0;\r\n\t\tList<SavingAccount> acc = null;\r\n\t\ttry {\r\n\t\t\tSystem.out.println(\"Before Repeat\");\r\n\t\t\tacc = getSavingAccountList();\r\n\r\n\t\t\tfor (SavingAccount savingAcc : acc) {\r\n\t\t\t\tif (!(\"0\".equals(savingAcc.getState()))) {\r\n\t\t\t\t\tif (savingAcc.getState().equals(\"active\")) {\r\n\t\t\t\t\t\tint maxRepeat = Integer.parseInt(savingAcc\r\n\t\t\t\t\t\t\t\t.getRepeatable());\r\n\r\n\t\t\t\t\t\tDate date = new Date();\r\n\t\t\t\t\t\tDate systemDate = savingAccSer\r\n\t\t\t\t\t\t\t\t.convertStringToDateDDmmYYYY(savingAccSer\r\n\t\t\t\t\t\t\t\t\t\t.convertDateToStringDDmmYYYY(date));\r\n\r\n\t\t\t\t\t\tDate dateEnd = savingAccSer\r\n\t\t\t\t\t\t\t\t.convertStringToDateDDmmYYYY(savingAcc\r\n\t\t\t\t\t\t\t\t\t\t.getDateEnd());\r\n\r\n\t\t\t\t\t\tif (systemDate.getTime() == dateEnd.getTime()) {\r\n\t\t\t\t\t\t\tDate newEndDate = DateUtils.addMonths(systemDate,\r\n\t\t\t\t\t\t\t\t\tsavingAcc.getInterestRateId().getMonth());\r\n\r\n\t\t\t\t\t\t\tfloat balance = savingAcc.getBalanceAmount();\r\n\t\t\t\t\t\t\tfloat interest = savingAcc.getInterestRateId()\r\n\t\t\t\t\t\t\t\t\t.getInterestRate();\r\n\r\n\t\t\t\t\t\t\tint month = savingAcc.getInterestRateId()\r\n\t\t\t\t\t\t\t\t\t.getMonth();\r\n\t\t\t\t\t\t\tint days = Days\r\n\t\t\t\t\t\t\t\t\t.daysBetween(\r\n\t\t\t\t\t\t\t\t\t\t\tnew DateTime(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsavingAccSer\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.convertStringToDate(savingAcc\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getDateStart())),\r\n\t\t\t\t\t\t\t\t\t\t\tnew DateTime(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsavingAccSer\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.convertStringToDate(savingAcc\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getDateEnd())))\r\n\t\t\t\t\t\t\t\t\t.getDays();\r\n\t\t\t\t\t\t\tfloat amountAll = balance\r\n\t\t\t\t\t\t\t\t\t+ (balance * ((interest / (100)) / 360) * days);\r\n\t\t\t\t\t\t\tsavingAcc.setDateStart(savingAccSer\r\n\t\t\t\t\t\t\t\t\t.convertDateToString(systemDate));\r\n\t\t\t\t\t\t\tsavingAcc.setDateEnd(savingAccSer\r\n\t\t\t\t\t\t\t\t\t.convertDateToString(newEndDate));\r\n\t\t\t\t\t\t\tsavingAcc.setBalanceAmount(amountAll);\r\n\t\t\t\t\t\t\tsavingAcc.setRepeatable(\"\" + (maxRepeat + 1));\r\n\t\t\t\t\t\t\tupdateSavingAccount(savingAcc);\r\n\t\t\t\t\t\t\tcount+=1;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\tSystem.out.println(\"Successfully!! \"+ count +\" Saving Account has been updated. Minh Map!!!\");\r\n\t\t\t\r\n\t\t\treturn \"success\";\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.out.println(\"Exception\");\r\n\r\n\t\t}\r\n\t\treturn \"Fail\";\r\n\t}",
"public void setBalance(Double balance) {\r\n this.balance = balance;\r\n }",
"@Override\n\tpublic int accountUpdate(String id, String balance) {\n\t\tSession session=sessionFactory.openSession();\n\t\tTransaction tr = session.beginTransaction();\n\t\tint executeUpdate = 0;\n\t\tString sqlString=\"update user set balance = '\"+balance+\"' where id ='\"+id+\"'\";\n\t\ttry {\n\t\t\tQuery query=session.createSQLQuery(sqlString);\n\t\t\texecuteUpdate = query.executeUpdate();\n\t\t\tSystem.out.println(\"executeUpdate:\"+executeUpdate);\n\t\t} catch (HibernateException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}finally{\n\t\t\ttr.commit();\n\t\t session.close();\n\t\t}\n\t\treturn executeUpdate;\t\n\t}",
"public void Deposit(Integer accountNo,float depositMoney){\n\tSessionFactory sessionFactory = new Configuration().configure(\"hibernate.cfg.xml\").buildSessionFactory();\n\tSession session = sessionFactory.openSession();\n\tTransaction trans = null;\n\ttry{\n\t\ttrans = session.beginTransaction();\n\t\tQuery query=session.createQuery(\"UPDATE Account set balance+=:balance where accountNo=:accountNo\"); \n\t\tquery.setParameter(\"balance\",depositMoney); \n\t\tquery.setParameter(\"accountNo\",accountNo); \n\t}catch(HibernateException hibernateException){\n\t\tif(trans != null){\n\t\t\ttrans.rollback();\n\t\t}\n\t\thibernateException.printStackTrace();\n\t}\n\t}",
"public java.math.BigDecimal getBalance() {\n return balance;\n }"
] | [
"0.6256659",
"0.6253897",
"0.6161887",
"0.6052792",
"0.6007962",
"0.5992738",
"0.598382",
"0.59808713",
"0.59671104",
"0.59655404",
"0.59493804",
"0.5944475",
"0.5944475",
"0.5929044",
"0.58891714",
"0.58717656",
"0.5871257",
"0.5839201",
"0.58093864",
"0.5794495",
"0.5794373",
"0.5794373",
"0.5792861",
"0.5790225",
"0.5790225",
"0.5777398",
"0.5777398",
"0.576912",
"0.576912",
"0.57617587",
"0.57617587",
"0.5743701",
"0.57244354",
"0.5722053",
"0.5708364",
"0.57033765",
"0.56972003",
"0.569613",
"0.567973",
"0.5677364",
"0.5669179",
"0.5660392",
"0.5658301",
"0.56578594",
"0.5655242",
"0.5647081",
"0.5645896",
"0.56420755",
"0.5628228",
"0.5627138",
"0.5626427",
"0.5623627",
"0.5606722",
"0.56027985",
"0.56014687",
"0.5595286",
"0.5582922",
"0.5579553",
"0.5579103",
"0.55756223",
"0.55752707",
"0.5569577",
"0.5568102",
"0.5566652",
"0.55662084",
"0.5561891",
"0.55556166",
"0.5543907",
"0.5536255",
"0.5535043",
"0.5523186",
"0.55217797",
"0.551842",
"0.55178934",
"0.5515522",
"0.5512042",
"0.55097926",
"0.5505763",
"0.5505763",
"0.5505763",
"0.5505763",
"0.55049235",
"0.55021036",
"0.5498412",
"0.54945385",
"0.5494492",
"0.5492579",
"0.5492579",
"0.5489636",
"0.54847556",
"0.54788065",
"0.5473692",
"0.5472998",
"0.5469174",
"0.54671735",
"0.5467048",
"0.54647994",
"0.5461322",
"0.5448236",
"0.54227674",
"0.54078424"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public int apply(int[][] region) {
return 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"private stendhal() {\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.66708666",
"0.65675074",
"0.65229905",
"0.6481001",
"0.64770633",
"0.64584893",
"0.6413091",
"0.63764185",
"0.6275735",
"0.62541914",
"0.6236919",
"0.6223816",
"0.62017626",
"0.61944294",
"0.61944294",
"0.61920846",
"0.61867654",
"0.6173323",
"0.61328775",
"0.61276996",
"0.6080555",
"0.6076938",
"0.6041293",
"0.6024541",
"0.6019185",
"0.5998426",
"0.5967487",
"0.5967487",
"0.5964935",
"0.59489644",
"0.59404725",
"0.5922823",
"0.5908894",
"0.5903041",
"0.5893847",
"0.5885641",
"0.5883141",
"0.586924",
"0.5856793",
"0.58503157",
"0.58464456",
"0.5823378",
"0.5809384",
"0.58089525",
"0.58065355",
"0.58065355",
"0.5800514",
"0.57912874",
"0.57912874",
"0.57912874",
"0.57912874",
"0.57912874",
"0.57912874",
"0.57896614",
"0.5789486",
"0.5786597",
"0.5783299",
"0.5783299",
"0.5773351",
"0.5773351",
"0.5773351",
"0.5773351",
"0.5773351",
"0.5760369",
"0.5758614",
"0.5758614",
"0.574912",
"0.574912",
"0.574912",
"0.57482654",
"0.5732775",
"0.5732775",
"0.5732775",
"0.57207066",
"0.57149917",
"0.5714821",
"0.57132614",
"0.57132614",
"0.57132614",
"0.57132614",
"0.57132614",
"0.57132614",
"0.57132614",
"0.57115865",
"0.57045746",
"0.5699",
"0.5696016",
"0.5687285",
"0.5677473",
"0.5673346",
"0.56716853",
"0.56688815",
"0.5661065",
"0.5657898",
"0.5654782",
"0.5654782",
"0.5654782",
"0.5654563",
"0.56536144",
"0.5652585",
"0.5649566"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public int getSize() {
return 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
Initializes user ID, number of attempts, tries, deaths, and jams for a player of Bang. | public BangPlayer(long userId, int numTries, int numDeaths, int numJams) {
super(userId);
attempts = numTries;
deaths = numDeaths;
jams = numJams;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static void initializeGame()\n {\n minSecret = 1;\n maxSecret = 100;\n secretNumber = newSecretNumber(minSecret,maxSecret);\n guessesLeft = 10;\n guessRange = 10;\n bestGuess = maxSecret + 1;\n extraGuesses = 5;\n isPlaying = true;\n safeLineUsed = false;\n showDebugInfo = false;\n\n }",
"public static void initPlayer() {\n\t\tuser = game.getUsers().get(game.getUserTurn());\n\t\tlblBudgetText.setText(user.getBudget()+\"\");\n\t\tdisplayUserTeam();\n\t}",
"public KunyarukGame() {\n \t\tthis(321);\n \t\tlong seed = System.nanoTime();\n \t\tRandom ran = new Random(seed);\n \t\tthis.secret = ran.nextInt(this.upperBound)+1;\n \t\tsuper.setMessage(\"Can you guess a number between 1 and \"+this.upperBound+\" that I'm thinking of?\");\n }",
"private static void init() {\n\t\tguess = 0;\n\t\ttries = 10;\n\t\tlen = Random.getRand(4, 8);\n\t\tcorrectGuesses = 0;\n\t\twordGen = new RandomWordGenerator(len);\n\t\twordGen.generate();\n\t\tword = wordGen.getWord();\n\t\tguessesResult = new boolean[word.length()];\n\n\t}",
"private void initUser() {\n\t}",
"public Hangman() {\n\t\tinit();\n\t\trunGame();\n\t}",
"public HangmanController() {\n\t\tthis.guessedLetters = new ArrayList<Character>();\n\t\tthis.wrongLetters = new ArrayList<Character>();\n\t\tthis.numOfWrongGuess = 0;\n\t\tthis.dr = new DictReader();\n\t}",
"private void setUpGame() {\n \tresetGame();\n \tprintln(\"Welcome to Hangman!\");\n \tprintln(\"The word now looks like this: \" + currentWord);\n \tprintln(\"You have \" + guessesLeft + \" guesses left.\");\n }",
"private void initializeBadGuys() {\n\t\tplayer = new Player();\t\t\n\t\tfor (int i = 0; i < councilmen.length; i++) {\n\t\t\tcouncilmen[i] = new Councilman();\n\t\t}\n\t}",
"@Override\n\tpublic void initialize(IsValidHobby arg0) {\n\t\t\n\t}",
"public GameUser() {\n\t}",
"public UserPlayer(){\n this.playerNum = 0;\n this.isLead = false;\n this.playerHand = new Hand();\n this.suitUserChose = null;\n }",
"@Override\n public void initialize() {\n numPlayers = game().numPlayers();\n haveSeen = new ArrayList<>();\n goldProb = new double[3];\n Probability = new double[numPlayers];\n oldBoard = game().board().copy();\n //sets all of the players to miners at first\n //the lower the value the higher the player is predicted as Saboteur\n for (int i = 0; i < numPlayers; i++) {\n Probability[i] = 0.5;\n haveSeen.add(new int[3]);\n }\n for(int i=0; i<3; i++) {\n //top is 0, middle is 1, bottom is 2\n goldProb[i]=0.1;\n }\n if(role() == Role.SABOTEUR) Probability[index()]=0;\n else if(role() == Role.GOLD_MINER) Probability[index()]=1;\n }",
"public void initGame() {\n // Create a new deck, with the right numbers of cards and shuffle it.\n this.deck.clear();\n this.deck.init();\n\n // Init all the players.\n for (Player player : this.players.values()) {\n player.init();\n }\n\n // Give START_NUM_CARD to each players.\n for (int i = 0; i < START_NUM_CARD; i++) {\n for (Player player : this.players.values()) {\n player.addCard(this.deck.pop());\n }\n }\n\n // Reset vars\n this.table.clear();\n this.onTableAmount = 0;\n this.numTurns = 0;\n this.newTurn = false;\n this.numPlayerInTurn = 0;\n this.currentPlayer = this.startingGamePlayer;\n\n // Subtract the blind to each players.\n this.players.get(this.currentPlayer).addToTable(this.currentSmallBlind);\n this.addOnTableAmount(this.currentSmallBlind);\n for (int i = 0; i < this.playerAmount; i++) {\n if (!(i == this.currentPlayer)) {\n this.players.get(i).addToTable(this.currentSmallBlind * 2);\n this.addOnTableAmount(this.currentSmallBlind * 2);\n }\n }\n this.currentHighestPlayerBet = currentSmallBlind * 2;\n\n // Add the first 3 cards.\n for (int i = 0; i < 3; i++) {\n this.table.push(this.deck.pop());\n }\n\n // Increment numTurns\n this.numTurns++;\n this.numGame++;\n }",
"public LoginJudge() {\n\t\tsuper();\n\t}",
"private void initShootHash(GameState pState) {\n for (int i = 0; i < pState.getNumBirds(); i++) {\n hasTriedToShoot.put(pState.getBird(i), false);\n }\n }",
"public Game(int balls) {\r\n currentLevel = new NullLevel();\r\n totalScore = 0;\r\n this.balls = balls;\r\n }",
"public EvilHangman(int numGuess){\n\t\tthis.guesses = numGuess;\n\t\tthis.dict = new EvilDictionary(\"dictionary.txt\");\n\t\tthis.usedLetters = new ArrayList<Character>();\n\t\tthis.showWords = false;\n\t}",
"public void setAttempts(int value) {\n this.attempts = value;\n }",
"public User() {\n this.prefs = Gdx.app.getPreferences(\"prefs\");\n\n this.noWalls = prefs.getBoolean(\"noWalls\");\n this.noGrid = prefs.getBoolean(\"noGrid\");\n }",
"private AssistantJack()\n\t{\n\t\tthis.timesAsked = 0;\n\t\tthis.correctTheory = null;\n\t}",
"public void start() {\n // Bid initialized (higher the number, lower the bid rank)\n bid = 100;\n // Check if the players have token, if no token remove player from the game\n // The player remaining wins the pot\n for (int i = 0; i < numberOfPlayers; i++) {\n if (tokens.get(i) == 0) {\n players.remove(i);\n tokens.remove(i);\n cups.remove(i);\n // Add pot to the remaining player's balance\n }\n }\n numberOfPlayers = players.size();\n // Roll all five dice inside the cup for each player\n for (int i = 0; i < numberOfPlayers; i++) {\n cups.get(i).shake();\n }\n // Get the player with the highest poker dice hand\n firstPlayer = players.get(0);\n for (int i = 1; i < numberOfPlayers; i++) {\n PokerDiceHand first = cups.get(players.indexOf(firstPlayer)).getHand();\n PokerDiceHand current = cups.get(i).getHand();\n if (current.getRank() < first.getRank()) {\n firstPlayer = players.get(i);\n }\n }\n // First player's turn\n turn = firstPlayer;\n gameCup = new Cup();\n gameCup.shake();\n }",
"static void init() {\n\t\tuserDatabase = new HashMap<String, User>();\n\t}",
"private void gameStart() {\n\tready.clear();\r\n\r\n\tplayers = new TreeBidiMap<>();\r\n\tmafia = new ArrayList<>();\r\n\tinnocentIDs = new ArrayList<>();\r\n\r\n\tfor (int i = 0; i < votedStart.size(); i++) {\r\n\t int id = votedStart.get(i);\r\n\t // playerIDs.add(id);\r\n\t players.put(id, server.getUsername(id));\r\n\r\n\t}\r\n\r\n\tint numMafia = (int) Math.round((double) votedStart.size() / 3);\r\n\tmafiaAtStart = new String[numMafia];\r\n\r\n\tfor (int j = 0; j < numMafia; j++) {\r\n\t // int index = mafiaPicker.nextInt(votedStart.size());\r\n\t int index = ThreadLocalRandom.current().nextInt(votedStart.size());\r\n\t int id = votedStart.get(index);\r\n\r\n\t mafia.add(id);\r\n\t mafiaAtStart[j] = server.getUsername(id);\r\n\t votedStart.remove(index);\r\n\t}\r\n\r\n\tfor (int k = 0; k < votedStart.size(); k++) {\r\n\r\n\t int id = votedStart.get(k);\r\n\r\n\t innocentIDs.add(id);\r\n\t}\r\n\r\n\tvotedStart.clear();\r\n\r\n\tint[] innocentIDArray = innocentIDs.stream().mapToInt(i -> i).toArray();\r\n\tserver.privateMessage(\"you are an innocent\", innocentIDArray);\r\n\r\n\tint[] mafiaIDArray = innocentIDs.stream().mapToInt(i -> i).toArray();\r\n\tString[] mafiaNameArray = new String[mafiaIDArray.length];\r\n\r\n\tfor (int l = 0; l < mafiaIDArray.length; l++) {\r\n\t mafiaNameArray[l] = server.getUsername(mafiaIDArray[l]);\r\n\t}\r\n\r\n\t// currently uses the default toSting method for array. Also i think it\r\n\t// will display the id numbers rather than the players names - need to\r\n\t// convert if so would be good to only show only the other mafia members\r\n\t// rather than including the players own name in the list\r\n\tserver.privateMessage(\"you are one of the mafia, the mafia members (including \" + \"you) are \" + mafiaIDArray,\r\n\t\tmafiaIDArray);\r\n\r\n\tday = true;\r\n\tgameInProgress = true;\r\n }",
"public static Map<String, Object> initUser() {\n\n Map<String, Object> user = new HashMap<String, Object>();\n Map<String, Object> tone = new HashMap<String, Object>();\n\n Map<String, Object> emotionTone = new HashMap<String, Object>();\n emotionTone.put(\"current\", null);\n\n Map<String, Object> socialTone = new HashMap<String, Object>();\n socialTone.put(\"current\", null);\n\n Map<String, Object> languageTone = new HashMap<String, Object>();\n languageTone.put(\"current\", null);\n\n tone.put(\"emotion\", emotionTone);\n tone.put(\"social\", socialTone);\n tone.put(\"language\", languageTone);\n\n user.put(\"tone\", tone);\n\n return user;\n }",
"private void initObjects() {\n inputValidation = new InputValidation(activity);\n databaseHelper = new DatabaseHelper(activity);\n user = new User();\n }",
"public BlackJackGame()\r\n\t{\r\n\t\tplayer1 = new Player();\r\n\t\tdealer = new Player();\r\n\t\tcardDeck = new Deck();\r\n\t\tendGame = false;\r\n\t}",
"private void initObjects() {\n databaseHelper = new DatabaseHelper(activity);\n dbHelper = new DBHelper(activity);\n inputValidation = new InputValidation(activity);\n progress = new ProgressDialog(activity);\n user=new User();\n }",
"public Game() {\t\t\t\t\t\n\t\t\n\t\tmDeck = new Deck();\t\t\t\t\t\t\t\t\t\t\t\n\t\tmDealer = new Dealer(mDeck.getCard(), mDeck.getCard());\t//dealer gets a random value card twice to initialise the dealers hand with 2 cards\n\t\tmUser = new User();\t\t\t\t\t\t\t\t\t\t\t\n\t\tgiveCard();\t\t\t\t\t\n\t}",
"private void setUpUser() {\n Bundle extras = getIntent().getExtras();\n mActiveUser = extras.getString(Helper.USER_NAME);\n mUser = mDbHelper.getUser(mActiveUser, true);\n Log.d(TAG, mUser.toString());\n\n if (mUser == null) {\n Toast.makeText(getBaseContext(), \"Error loading user data\", Toast.LENGTH_SHORT);\n return;\n }\n\n mIsNumPassword = Helper.isNumeric(mUser.getPassword());\n\n mKeyController = new KeyController(getApplicationContext(), mUser);\n }",
"public void initialize() {\n\n list.add(user1);\n list.add(user2);\n list.add(user3);\n }",
"public void initialize() {\n\t\tBmoUser bmoUser = new BmoUser();\n\n\t\t// Responsable\n\t\tBmFilter filterLeaderUserActive = new BmFilter();\n\t\tfilterLeaderUserActive.setValueFilter(bmoUser.getKind(), bmoUser.getStatus(), \"\" + BmoUser.STATUS_ACTIVE);\n\t\tleaderUserIdSuggestBox.addFilter(filterLeaderUserActive);\n\t\t\n\t\t// Consultor\n\t\tBmFilter filterAssignedUserActive = new BmFilter();\n\t\tfilterAssignedUserActive.setValueFilter(bmoUser.getKind(), bmoUser.getStatus(), \"\" + BmoUser.STATUS_ACTIVE);\n\t\tassignedUserIdSuggestBox.addFilter(filterAssignedUserActive);\n\t}",
"public Player() {\r\n\t\tthis.gemPile = new int[4];\r\n\t\tthis.hand = new ArrayList<Card>();\r\n\t\tthis.bag = new ArrayList<Card>();\r\n\t\tthis.discard = new ArrayList<Card>();\r\n\t\tthis.lockedCards = new ArrayList<Card>();\r\n\t\tthis.toUse = new ArrayList<Integer>();\r\n\t\tnewTurn();\r\n\t}",
"public BlackjackGameImpl(){\n\t\tsuper();\n\t\tplayers = new HashMap<>();\n\t\tplayersAvailableOptions = new HashMap<>();\n\t\thandAvailableOptions = new HashMap<>();\n\t\thistoricalActions = new HashMap<>();\n\t\tinsurances = new ArrayList<>();\n\t}",
"public User(String name) {\n\t\tthis.name = name;\n\t\tpassword = 1234;\n\t\thealth = 100;\n\t\tmana = 100;\n\t\tlevel = 1.0;\n\t\twepInvo = new ArrayList<Weapon>();\n\t\tscore = 0;\n\t\tend = false;\n\t\trightHand = null;\n\t\tleftHand = null;\n\t\tfeet = new Armor(\"Boots\", \"feet\", 0, 1);\n\t\tlegs = new Armor(\"Rags\", \"legs\", 0, 1);\n\t\ttorso = null;\n\t\thead = null;\n\t\tback = null;\n\t}",
"public void gameInit() {\n lobbyRoom.sendPortToAll();\n lobbyRoom.sendPlayers(game.getCars());\n lobbyRoom.sendTrack(game.getTrack());\n lobbyRoom.sendPowerupManager(game.getManager());\n this.running = true;\n }",
"private void initVars(){\n this.dice = new Dice();\n this.playing = true;\n this.currentPlayer = 0;\n this.turn = 0;\n this.xPlayers=new ArrayList<>(); \n this.players = new Player[4];\n this.diceRoller=true;\n this.xTokens=new ArrayList<>();\n this.winners=new ArrayList<>();\n this.computerPlayer= new Autoplay();\n this.gameResults = \"\";\n this.debug = false;\n }",
"public void init()\n\t// throws GameException\n\t{\n\t\tnextPlayer = Game.FIRST_PLAYER;\n\t\tsomeoneQuit = false;\n\t\tonePlayerLeft = null;\n\t\tisGameNew = true;\n\t\twinningPlayer = Game.GAME_NOT_OVER;\n\t\tinitializeCMNGame();\n\t\t// if (WINS.size() <= 0)\n\t\t// throw new GameException (\"Unacceptable input C = \" + CC +\n\t\t// \", M = \" + MM + \", N = \" + NN +\n\t\t// \".\\nExiting...\");\n\t}",
"public void setAttempts(int A)\t\n\t{\t//start of setAttempts method\n\t\tattempts = A;\n\t}",
"public Hangup() {}",
"private void attemptLogin() {\n final UserManager um = new UserManager();\n final String userName = userText.getText().toString();\n final String userPass = passwordText.getText().toString();\n final User attemptUser = um.login(userName, userPass);\n if (attemptUser != null) {\n SessionState.getInstance().startSession(attemptUser,\n getApplicationContext());\n resetFields();\n switch (attemptUser.getUserStatus()) {\n case USER:\n startBMS();\n break;\n case ADMIN:\n startAdmin();\n break;\n case BANNED:\n Toast.makeText(LoginActivity.this, \"Sorry, this user is \" +\n \"currently banned\", Toast\n .LENGTH_SHORT).show();\n break;\n case LOCKED:\n Toast.makeText(LoginActivity.this, \"Sorry, this user is \" +\n \"currently locked\", Toast\n .LENGTH_SHORT).show();\n break;\n\n }\n } else {\n if (!um.userExists(userName)) {\n userText.setError(\"Invalid Username\");\n } else {\n passwordText.setError(\"Invalid Password\");\n loginAttempts++;\n if (loginAttempts >= LOCK_ATTEMPTS) {\n final User attemptedUser = um.findUserById(userName);\n attemptedUser.setUserStatus(User.UserStatus.LOCKED);\n um.updateUser(attemptedUser);\n Toast.makeText(LoginActivity.this, \"Account locked: \" +\n \"too many attempts\", Toast\n .LENGTH_SHORT).show();\n }\n }\n }\n }",
"public KunyarukGame(int upperbound) {\n\t\tthis.upperBound = upperbound;\n\t\tlong seed = System.nanoTime();\n\t\tRandom ran = new Random(seed);\n\t\tthis.secret = ran.nextInt(this.upperBound) + 1;\n\t\tsuper.setMessage(\"Can you guess a number between 1 and \"+this.upperBound+\" that I'm thinking of?\");\n\t}",
"public void jamChoice(Jam choice){\r\n userJam = choice;\r\n }",
"public void initGame() {\n\r\n\t\tscore = 0;\r\n\t\tshipsLeft = MAX_SHIPS;\r\n\t\tasteroidsSpeed = MIN_ROCK_SPEED;\r\n\t\tnewShipScore = NEW_SHIP_POINTS;\r\n\t\tnewUfoScore = NEW_UFO_POINTS;\r\n\t\tShip.initShip();\r\n\t\tinitPhotons();\r\n\t\tstopUfo();\r\n\t\tstopMissle();\r\n\t\tinitAsteroids();\r\n\t\tinitExplosions();\r\n\t\tplaying = true;\r\n\t\tpaused = false;\r\n\t\tphotonTime = System.currentTimeMillis();\r\n\t}",
"public User(String username , String password , int rating , int wins , int losses)\n {\n if (wins < 0 || losses < 0 || rating < 0)\n {\n throw new IllegalArgumentException(\"You can't have a negative win,loss or rating.\");\n }\n this.userID++;\n this.username = username;\n this.password = password;\n this.rating = rating;\n this.wins = wins;\n this.losses = losses;\n this.currentLobby = null;\n }",
"public ServerBasicPlayer(int id) {\r\n\t\tthis.ID = id;\r\n\t\t// Set default values.\r\n\t\tthis.allocatedLobby = -1;\r\n\t\tthis.username = \"USER\" + id;\r\n\t}",
"public User(int id) {\n\t\tthis.id = id;\n\t\tratings = new HashMap<Movie, Rating>();\n\t\tavgR = new Genre[19];\n\t\tfor(int i = 0; i < avgR.length; i++) {\n\t\t\tavgR[i] = new Genre(Genre.AVAILGENRES[i]);\n\t\t}\n\t}",
"public void initializeScoringVariables(){\n\t\tgame.setMovement(moveDistance);\n\t\tgame.setRight(correctGuess);\n\t\tgame.setWrong(incorrectGuesses);\n\t\tgame.setTime(duration(startTime,endTime));\n\t}",
"public void initUsers() {\n User user1 = new User(\"Alicja\", \"Grzyb\", \"111111\", \"grzyb\");\n User user2 = new User(\"Krzysztof\", \"Kowalski\", \"222222\", \"kowalski\");\n User user3 = new User(\"Karolina\", \"Nowak\", \"333333\", \"nowak\");\n User user4 = new User(\"Zbigniew\", \"Stonoga \", \"444444\", \"stonoga\");\n User user5 = new User(\"Olek\", \"Michnik\", \"555555\", \"michnik\");\n users.add(user1);\n users.add(user2);\n users.add(user3);\n users.add(user4);\n users.add(user5);\n }",
"public void initialize() {\n\t\tthis.avatar = new Avatar();\n\t\tthis.pellet = new Pellet(HEIGHT, WIDTH);\n\t\tthis.wall = new Wall(HEIGHT, WIDTH);\n\n\t\t// notifies the user about the controls\n\t\tSystem.out.println(\"\\nGame controls:\");\n\t\tSystem.out.println(\"w --> move up, s --> move down, a --> move left, d --> move right\");\n\t\tSystem.out.println(\"e --> exit the game\");\n\t\t\n\t\t// display the initial score and location\n\t\tSystem.out.println(\"\\nAvatar location: \" + avatar.getLocation().getX() + \",\" + avatar.getLocation().getY());\n System.out.println(\"Points: \" + avatar.getScore());\n\t}",
"public Battle() {\r\n\t\tnbVals = 0;\r\n\t\tplayer1 = new Deck();\r\n\t\tplayer2 = new Deck();\r\n\t\ttrick = new Deck();\r\n\t}",
"public BlackJack(int playerName) {\n this.playerName = playerName;\n this.playerHand = new Hand(String.valueOf(this.playerName));\n this.dealerHand = new Hand(\"Dealer\");\n this.gameOver = false;\n this.playerBet = MIN_BET;\n this.roundCount = 0;\n this.isRunning = true;\n this.startGame();\n }",
"public Player() {\n\n\t\tnumberOfPlayers++;\n\t\tthis.playerNumber = \"Player \" + numberOfPlayers; \n\t\tthis.balance = 500.00; \n\t\tthis.numberOfLoans = 0;\n\t\tthis.score = 0;\n\t\tthis.inRound = true; \n\t}",
"public static void hangMan(Scanner input, Questions thisSession){\n hangMan1();\n Random rand=new Random();\n int randomNumber=rand.nextInt(thisSession.getLength());\n String userInput;\n byte lives=6,givenLetterscontrol=0;\n boolean letterIsInAnswer=false,playerWon=false;\n System.out.println(\"Welcome. Please type just one letter and press enter. You have 5 lives to guess the sentence. The questions is:\\n\"+\n thisSession.getQuestion(randomNumber));\n String answerSentence=(thisSession.getAnswer(randomNumber));\n String[] sentence=new String[answerSentence.length()];\n String [] lowDiagonal=new String[answerSentence.length()], givenLetter=new String[lives];\n sentence=answerSentence.split(\"\");\n for (int i=0;i<sentence.length;i++){\n if (sentence[i].equals(\" \")){\n lowDiagonal[i]=\" \";\n }else{ \n lowDiagonal[i]=\"_\";\n }\n System.out.print(lowDiagonal[i]+ \" \");\n }\n do{\n System.out.println(\"\\nWrite a letter and press enter to send the letter\");\n userInput=input.nextLine();\n userInput=userInput.toLowerCase();\n letterIsInAnswer=false;\n if (givenLetterscontrol>0){ //checks if user input has already been given.\n for (int i=0;i<6;i++){\n if (givenLetter[i].equals(userInput)){\n do{\n System.out.println(\"That letter has already been given. Please write another one.\");\n userInput=input.nextLine();\n }while (givenLetter[i].equals(userInput));\n }\n }\n }\n givenLetter[givenLetterscontrol]=userInput;\n for (int i=0;i<sentence.length;i++){ //checks if the letter is in the answer.\n if (sentence[i].equals(userInput)){\n letterIsInAnswer=true;\n lowDiagonal[i]=userInput;\n }\n }\n if (letterIsInAnswer==false){ //If letter was not in the answer, a life is lost.\n lives--;\n switch(lives){\n case 5:\n hangMan2();\n break;\n case 4:\n hangMan3();\n break;\n case 3:\n hangMan4();\n break; \n case 2:\n hangMan5();\n break;\n case 1:\n hangMan6();\n break;\n case 0:\n hangMan7();\n youLost();\n lives=-1;\n break;\n }\n System.out.println(\"That letter is not in the answer.\");\n }\n if (letterIsInAnswer){\n if (Arrays.equals(lowDiagonal,sentence)){\n playerWon=true;\n for (int i=0;i<sentence.length;i++){ \n System.out.print(lowDiagonal[i]+ \" \");\n } \n youWon();\n }else{\n for (int i=0;i<sentence.length;i++){ \n System.out.print(lowDiagonal[i]+ \" \");\n } \n }\n }\n\n }while (lives>=0 && playerWon==false);\n System.out.println(\"Thanks for playing! Returning to main menu...\");\n }",
"public Jeans(Avatar avatar) {\n super();\n this.avatar = avatar;\n }",
"public GuessingGame(int upperBound) {\n\t\tthis.upperBound = upperBound;\n\t\tthis.secret = getRandomNumber(upperBound);\n\t\tthis.hint = \"I'm thinking of a number between 1 and \" + upperBound;\n\t}",
"private void initPlayers() {\n this.playerOne = new Player(1, 5, 6);\n this.playerTwo = new Player(2, 0, 1);\n this.currentPlayer = playerOne;\n\n }",
"@Override\r\n\tpublic void init() { \r\n\t\t\r\n\t\tsession = -1;\r\n\t\t\r\n\t\tProgressDif = 0;\r\n\t\tnoisFact = 0;\r\n\t\tcompromiseFact = 0;\r\n\t\t\r\n\t\tcompromiseLearn = 20;\r\n\t\tprogressLearn = 10;\r\n\t\tnoisLearn = 0.2;\r\n\t\t\r\n\t\treservationPanic = 0.2;\r\n\t\tmyBids = new ArrayList<Pair<Bid,Double>>();\r\n\t\topponentBidsA = new Vector<ArrayList<Pair<Bid,Double>>>();\r\n\t\topponentBidsB = new Vector<ArrayList<Pair<Bid,Double>>>();\r\n\r\n\t\tdf = utilitySpace.getDiscountFactor();\r\n\t\tif (df==0) df = 1; \r\n\r\n\t\ttry {\r\n\t\t\tinitStates();\r\n\t\t} catch (Exception e) {\r\n \t\t\te.printStackTrace();\r\n\t\t}\t\t\r\n\t}",
"private void init() {\n\t\tsendPacket(new Packet01Login(\"[you have connected to \"+UPnPGateway.getMappedAddress()+\"]\", null));\n\t}",
"private void default_init(){\n id = 0;\n xPos = 0;\n yPos = 0;\n hp = 100;\n name=\"\";\n character_id = 1;\n weapons = new ArrayList<>();\n weaponEntryTracker = new LinkedList<>();\n isJumping = false;\n isFalling = false;\n initial_y= -1;\n stateOfMovement = 0;\n for(int i = 0; i < 3; i++){\n this.weapons.add(new Pair<>(NO_WEAPON_ID, (short) 0));\n }\n this.weapons.set(0,new Pair<>(PISTOL_ID,DEFAULT_PISTOL_AMMO));\n currentWeapon = this.weapons.get(0);\n bulletsFired = new ArrayList<>();\n shootingDirection = 1;\n energy = 0;\n sprint = false;\n score = 0;\n roundsWon = 0;\n ready = false;\n audioHandler = new AudioHandler();\n }",
"public static void main( String[] args) \r\n {\n Scanner scan; \r\n HangMan game; \r\n String userInput; \r\n String letter; \r\n int errorValue;\r\n boolean temp;\r\n \r\n //Initialize the variables (other variables will be given values as program proceeds) \r\n scan = new Scanner( System.in); \r\n temp = true; \r\n \r\n //Create the user-interface and play the game \r\n while( temp ) \r\n { \r\n game = new HangMan(); \r\n System.out.println( \"Welcome to Hang-man game\"); \r\n System.out.println( \"You have \" + 6 + \" tries\"); \r\n System.out.println( \"Enter any button except q to proceed, q to quit\"); \r\n userInput = scan.next(); \r\n \r\n //Outer loop for re-playing of the game\r\n if( !userInput.equals( \"q\")) \r\n { \r\n //Inner loop for the simulation of the game \r\n while( !game.isGameOver() && !game.hasLost()) \r\n { \r\n System.out.println( \"The word that you're looking for: \" + game.knownSoFar); \r\n System.out.println( \"Number of tries left : \" + (6 - game.numberOfIncorrectTries)); \r\n System.out.println( \"Letters in the english alphabet: \" + game.allLetters); \r\n System.out.println( \"Used letters: \" + game.usedLetters); \r\n System.out.println( \"Please enter a letter\");\r\n letter = scan.next(); \r\n errorValue = game.tryThis( letter.charAt(0) /* or just letter itself (depending on the implementation of the method)*/); \r\n \r\n if( errorValue == -1) // Invalid input \r\n {\r\n System.out.println( \"Please enter a valid letter\"); \r\n }\r\n else if( errorValue == -2) // Repeated letter \r\n {\r\n System.out.println( \"You entered this letter before, please enter a different letter\"); \r\n }\r\n else if( errorValue == 1) // Correct answer 1 repetition \r\n {\r\n System.out.println( \"The letter you entered is repeated 1 time\"); \r\n }\r\n else if( errorValue > 1) // Correct answer multiple representation\r\n {\r\n System.out.println( \"The letter you entered is repeated \" + errorValue + \" times\"); \r\n }\r\n else if( errorValue == 0) // Wrong answer \r\n {\r\n System.out.println( \"Unfortunately the letter you entered is not in the word\"); \r\n }\r\n else if( errorValue == -3) // Game Over \r\n {\r\n System.out.println( \"Game Over\"); \r\n }\r\n if( game.hasLost()) \r\n {\r\n System.out.println( \"Unfortunately, you lost\"); // Implementing a method showing the secret word would be nice \r\n }\r\n else if( game.isGameOver()) \r\n {\r\n System.out.println( \"You won, congratulations\"); \r\n }\r\n } \r\n } \r\n \r\n else \r\n { \r\n temp = false; \r\n System.out.println( \"Bye - bye, thanks for playing\"); \r\n } \r\n } \r\n }",
"public BSState() {\n this.playerTurn=1;\n this.p1TotalHits=0;\n this.p2TotalHits=0;\n this.shipsAlive=10;\n this.shipsSunk=0;\n this.isHit=false;\n this.phaseOfGame=\"SetUp\";\n this.shotLocations=null;\n this.shipLocations=null;\n this.shipType=1;\n this.board=new String[10][20];\n //this.player1=new HumanPlayer;\n //this.player2=new ComputerPlayer;\n\n }",
"public void setUpGame() {\n\t\tGameID = sql.getTheCurrentGameID() + 1;\r\n\t\tSystem.err.println(GameID);\r\n\t\ttheModel.shuffleDeck();\r\n\t\ttheModel.createPlayers();\r\n\t\ttheModel.displayTopCard();\r\n\t\t// theModel.chooseFirstActivePlayer();\r\n\t}",
"public Game() {\n\t\tusers = new ArrayList<>();\n\t\ttmpTeam = new UserTeam();\n\t\tcore = new Core();\n\t\tmarket = new Market(core);\n\t}",
"private void addDefaultUsersAndPlayers(Game game) {\n\t\tString[] userNames = { \"User1\", \"User2\", \"User3\", \"User4\" };\n\t\tfor (int i = 0; i < userNames.length; i++) {\n\t\t\tUser user = game.getKingdomino().addUser(userNames[i]);\n\t\t\tPlayer player = new Player(game);\n\t\t\tplayer.setUser(user);\n\t\t\tplayer.setColor(PlayerColor.values()[i]);\n\t\t\tKingdom kingdom = new Kingdom(player);\n\t\t\tnew Castle(0, 0, kingdom, player);\n\t\t}\n\t}",
"Players(GameStrategy playStrategy, String pseudo) {\n this.gameStrategy = playStrategy;\n this.score = 2;\n this.pseudo = pseudo;\n totalPawnsTaked = 0;\n }",
"public UserSession initUserSession() {\n return new UserSession(RAND_MAX, RAND_MIN, rand(RAND_MIN, RAND_MAX));\n }",
"public CheckingAccount()\n {\n withdrawals = 0;\n deposits = 0;\n }",
"public void setBallInitial(){\n\tvalidBall = new Ball(Player.getxPlayerLoc(),Player.getyPlayerLoc(), angle,true,ballImage,game.getDifficulty());\n}",
"public Game()\n {\n // initialise instance variables\n playerName = \"\";\n gameTotal = 0;\n }",
"public void prepareGame() {\n setInitialPosition();\n\n //Check NickName\n boolean nickNameEstablished = checkNickName();\n if (!nickNameEstablished) {\n Intent intent = new Intent(this, NickNameActivity.class);\n startActivityForResult(intent, NICKNAME_ACTIVITY_REQUEST_CODE);\n } else {\n setDynamicBackground();\n }\n }",
"public static void main(String[] args) {\n\t\tSystem.out.println(\"Hello! Welcome to the game!\");\n\t int attempts = 0; //1a\n\t int green = 0;\n\t int red = 0;\n\t\tScanner myObj = new Scanner(System.in);\n\t Answer answer = new Answer();\n\t Guess userGuess = new Guess();\n //answer.printAnswer(); (this was included for your convenience if you want to see what the answer is when you run the program)\n\t while ((attempts < 10) && (green != 3)){\n\t userGuess.printGuessList();\n\t String stringGuess = getUserInput(myObj); //1d\n\t userGuess.set(stringGuess);\n\t int[] guess = userGuess.getGuess();\n\t green = answer.numGreenBall(guess);\n\t System.out.print(\"Green Balls: \" + green);\n\t red = answer.numRedBall(guess);\n\t System.out.println(\" Red Balls: \" + red);\n\t System.out.println();\n\t userGuess.sortAllGuesses();\n\t attempts = userGuess.getNumOfGuess();\n\t }\n\t //10\n if (green == 3){\n\t System.out.println(\"You won!\");\n\t }\n\t if (attempts == 10){\n\t System.out.println(\"You lose! You couldn't guess the number in ten tries.\");\n\t }\n\t\tmyObj.close();\n\t }",
"public BSGameState(BSGameState bs) {\n this.humanPlayerBoard = new int[10][10];\n this.computerPlayerBoard = new int[10][10];\n for (int i = 0; i < 10; i++) {\n for (int j = 0; j < 10; j++) {\n this.humanPlayerBoard[i][j] = bs.humanPlayerBoard[i][j];\n this.computerPlayerBoard[i][j] = bs.computerPlayerBoard[i][j];\n }\n }\n // initalize rest of data\n turnCode = bs.turnCode;\n humanPlayerHits = bs.humanPlayerHits;\n computerPlayerHits = bs.computerPlayerHits;\n inGame = true;\n\n playerShips = new Ship[5];\n computerShips = new Ship[5];\n\n for (int i = 0; i < 5; i++) {\n playerShips[i] = bs.playerShips[i];\n computerShips[0] = bs.computerShips[i];\n }\n computerPlayerMiss = bs.computerPlayerMiss;\n humanPlayerMiss = bs.humanPlayerMiss;\n }",
"public void initializeGameRoom() {\n DatabaseReference game = database.getReference(gameCodeRef);\n game.child(\"NumberOfPlayers\").setValue(0);\n game.child(\"PlayersDoneBrainstorming\").setValue(0);\n game.child(\"PlayersDoneEliminating\").setValue(0);\n game.child(\"AllDoneBrainstorming\").setValue(false);\n game.child(\"AllDoneEliminating\").setValue(false);\n game.child(\"StartGame\").setValue(false);\n\n }",
"public BowlingGame(List<BowlingPlayer> bowlingPlayers){\n _bowlingPlayers = bowlingPlayers;\n }",
"public void init(String userID);",
"public XuatHang() {\n initComponents();\n }",
"public static void set_checks2(){\n\t\t\n\t\t//Check if difficulty\n\t\n\t\t\t//Check if user is batting\n\t\t\tif(TossBrain.compselect.equals(\"bat\")){\n\t\t\t\tif(PlayArena2.usershot2==PlayArena2.compshot2){\n\t\t\t\t\t\n\t\t\t\t\tcheck_if_factor2=true;}\n\t\t\t\telse if(PlayArena2.usershot2==6 && (PlayArena2.compshot2==2 || PlayArena2.compshot2==3))\n\t\t\t\t\tcheck_if_factor2=true;\n\t\t\t\telse if(PlayArena2.usershot2==4 && (PlayArena2.compshot2==2 ))\n\t\t\t\t\tcheck_if_factor2=true;\n\t\t\t\telse\n\t\t\t\t\tcheck_if_factor2=false;\n\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(PlayArena2.usershot2==PlayArena2.compshot2){\n\t\t\t\t\t\n\t\t\t\t\tcheck_if_factor2=true;}\n\t\t\t\telse\n\t\t\t\tcheck_if_factor2=false;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t//Wicket?\nif(check_if_factor2){\n\t\t\t\t\n\t\t\t\tcheck_if_wicket2=true;\n\t\t\t\tint temp_wickets=0;\n\t\t\t\t\n\t\t\t\tif(wicket_2==2){\n\t\t\t\t\t\t temp_wickets=3;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Check Striker while wicket fell\n\t\t\tif(temp_wickets!=3)\n\t\t\t{\n\t\t\t\tif(Striker.equals(bat1))\n\t\t\t\t\t{\n\t\t\t\t\t\tif(TossBrain.compselect.equals(\"bat\")){\n\t\t\t\t\t\t\tStriker=PlayBrain1.myteam[++list_pointer];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\tStriker=PlayBrain1.oppteam[++list_pointer];\n\t\t\t\t\t\t\t}\n\t\t\t\t\tbat1=Striker;\n\t\t\t\t\t\n\t\t\t\t//\tSystem.out.println(Striker);\n\t\t\t\t\t//System.out.println(NonStriker);\n\t\t\t\t\t//System.out.println(wicket_1);\n\t\t\t\t}\n\t\t\t\t//Else of Striker\n\t\t\t\telse{\n\t\t\t\t\tif(TossBrain.compselect.equals(\"bat\")){\n\t\t\t\t\t\tStriker=PlayBrain1.myteam[++list_pointer];\n\t\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\tStriker=PlayBrain1.oppteam[++list_pointer];\n\t\t\t\t\t\t}\n\t\t\t\tbat2=Striker;\n\t\t\t\t//System.out.println(Striker);\n\t\t\t\t//System.out.println(NonStriker);\n\t\t\t\t}\n\t\t\t\tif(over_ball_2!=5)\t\n\t\t\t\tcheck_if_strike_change2=false;\n\t\t\t\telse{\n\t\t\t\t\t//System.out.println(\"over strike change\");\n\t\t\t\t\tcheck_if_strike_change2=true;}\n\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\telse{\n\t\t\t\t//System.out.println(\"no wicket zone\");\n\t\t\t\tcheck_if_wicket2=false;\n\t\t\t\t\n\t\t\t\t//Strike Change?\n\t\t\t\tif(TossBrain.compselect.equals(\"bat\")){\n\t\t\t\t\tif(PlayArena2.usershot2%2!=0 && over_ball_2!=5){\n\t\t\t\t\t\tcheck_if_strike_change2=true;\n\t\t\t\t\t\t}\n\t\t\t\t\telse if(PlayArena2.usershot2%2==0 && over_ball_2==5){\n\t\t\t\t\t\tcheck_if_strike_change2=true;\n\t\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tcheck_if_strike_change2=false;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(PlayArena2.compshot2%2!=0 && over_ball_2!=5){\n\t\t\t\t\t\tcheck_if_strike_change2=true;\n\t\t\t\t\t}\n\t\t\t\t\telse if(PlayArena2.compshot2%2==0 && over_ball_2==5){\n\t\t\t\t\t\tcheck_if_strike_change2=true;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tcheck_if_strike_change2=false;\n\t\t\t\t}\n\t\t\t}\n\n\t}",
"private static void initUsers() {\n\t\tusers = new ArrayList<User>();\n\n\t\tusers.add(new User(\"Majo\", \"abc\", true));\n\t\tusers.add(new User(\"Alvaro\", \"def\", false));\n\t\tusers.add(new User(\"Luis\", \"ghi\", true));\n\t\tusers.add(new User(\"David\", \"jkl\", false));\n\t\tusers.add(new User(\"Juan\", \"mno\", true));\n\t\tusers.add(new User(\"Javi\", \"pqr\", false));\n\t}",
"private void addDefaultUsersAndPlayers(Game game) {\n String[] users = { \"User1\", \"User2\", \"User3\", \"User4\" };\n for (int i = 0; i < users.length; i++) {\n game.getKingdomino().addUser(users[i]);\n Player player = new Player(game);\n player.setColor(Player.PlayerColor.values()[i]);\n Kingdom kingdom = new Kingdom(player);\n new Castle(0, 0, kingdom, player);\n }\n }",
"public User() {\n username = null;\n password = null;\n email = null;\n firstName = null;\n lastName = null;\n gender = null;\n personID = null;\n }",
"public Game() {\n generatePort();\n status = Status.ATTENTE;\n generateGameID();\n name = \"GameG4B\";\n players = new ArrayList<>();\n maxRealPlayer = 0;\n maxVirtualPlayer = 0;\n realPlayerNb = 0;\n virtualPlayerNb = 0;\n rounds = new ArrayList<>();\n currentRound = 0;\n }",
"private void initialParameters()\n\t{\n\t\tasteroidList = new ArrayList<Asteroid>();\n\t\tfor(int i = 0 ; i < INITIAL_ASTEROIDS ; i++)\n\t\t\tasteroidList.add(new Asteroid(getRandomLocationX(), getRandomLocationY(), SCREEN_WIDTH, SCREEN_HEIGHT));\n\t\t\n\t\t//========== Game Status ===========\n\t\trunning \t= true;\n\t\tisWin \t\t= false;\n\t\tisGameOver \t= false;\n\t\t\n\t\t//========== Game Craft ===========\t\t\n\t\tcraft = new Craft(SCREEN_WIDTH/2, SCREEN_HEIGHT/2, SCREEN_WIDTH, SCREEN_HEIGHT);\n\t}",
"public void initializeGame() {\n speed = 75;\n ticks = 0;\n ticksTubes = 0;\n best = null;\n score = 0;\n\n //Make a new pool of birds based on the parameters set in the species'\n //genomes\n birds.clear();\n for (final Species species : Pool.species)\n for (final Genome genome : species.genomes) {\n genome.generateNetwork();\n birds.add(new Bird(species, genome));\n }\n tubes.clear();\n }",
"public Player(boolean isMyTurn) {\r\n this.pits = new int[6];\r\n Arrays.fill(pits, 6);\r\n this.bigPit = 0;\r\n this.pitIndex = -1;\r\n setMyTurn(isMyTurn);\r\n }",
"public void resetAttackAttempts() {\r\n\t\tattackAttempts = 0;\r\n\t}",
"public void initUser(ActiveSession user) {\n this.user = user;\n }",
"public Robber() {\n\t\t// robberPlayers = (ArrayList<Player>) GSC.players.clone();\n\t}",
"void testBigBang(Tester t) {\r\n initData();\r\n FloodItWorld g = this.runGame;\r\n int worldWidth = 1000;\r\n int worldHeight = 1000;\r\n double tickRate = .012;\r\n g.bigBang(worldWidth, worldHeight, tickRate);\r\n }",
"public InitializeGame() {\r\n\t //Non Player Characters\r\n\t\t\t//Hakunin, the shaman, will lead the player in his quest for freedom\r\n\t\t\tNpcDialog shaman = new NpcDialog(\"Hakunin\",\"Some kind of Shaman is standing in front of you. He appraises you with his crazy eyes from somewhere in the world only he inhabits.\", job.shaman);\r\n\t\t\t//The prisoner Npc\r\n\t\t\tNpcDialog prisoner = new NpcDialog(\"Gilgamesh\",\"A weird kind of humanoid is in front of you, wearing rags, he looks tired and is dying\",job.prisoner);\r\n\t\t\t// A bunch of generic citizen npc's\r\n\t\t\tNpcDialog citizen1 = new NpcDialog(\"Waldo\",\"a local life form\",job.citizen);\r\n\t\t\tNpcDialog citizen2 = new NpcDialog(\"Opipou\",\"Typical girl next door, except you doesn't live here,it's not a girl an it's right in front of you\",job.citizen);\r\n\t\t\tNpcDialog citizen3 = new NpcDialog(\"Fifou\",\"he seems to be crazyly normal for an alien ... wait ... you are the alien here\",job.citizen);\r\n\t\t\tNpcDialog citizen4 = new NpcDialog(\"Genericname\",\"just another citizen\",job.citizen);\r\n\t\t\t\r\n\t\t\t//Fighter Non player characters\r\n\t\t\t//the boss\r\n\t\t\tNpcFightBoss boss= new NpcFightBoss(150, 5, \"Transplantor\",\" the boss\", 30);\r\n\t\t\t//the monsters\r\n\t\t\tNpcFightMonster snake1=new NpcFightMonster(10,2,\"Snake\",\"small snake\");\r\n\t\t\tNpcFightMonster snake1bis=new NpcFightMonster(10,2,\"Snake\",\"small snake\");\r\n\t\t\tNpcFightMonster snake2=new NpcFightMonster(20,5,\"Snake\",\"big snake\");\r\n\t\t\tNpcFightMonster wolf=new NpcFightMonster(50,10,\"Wolf\",\"black wolf\");\r\n\t\t\tNpcFightMonster shark=new NpcFightMonster(25,5,\"Shark\",\"shark\");\r\n\t\t\t//the guard\r\n\t\t\tNpcFightGuard guard = new NpcFightGuard(100,1,\"Guard\",\"This is a city guard\",jail); \r\n\r\n\t\t\t\r\n\t\t //images\r\n\t\t //zone pictures\r\n\t\t crashZonePic = new ImageIcon(getClass().getResource(\"/images/crash.png\"));\r\n\t\t gladePic = new ImageIcon(getClass().getResource(\"/images/glade.jpg\"));\r\n\t\t forestWPic = new ImageIcon(getClass().getResource(\"/images/forestW.jpg\"));\r\n\t\t forestSPic = new ImageIcon(getClass().getResource(\"/images/forestS.jpg\"));\r\n\t\t forestNPic = new ImageIcon(getClass().getResource(\"/images/forestN.jpg\"));\r\n\t\t housePic = new ImageIcon(getClass().getResource(\"/images/house.jpg\"));\r\n\t\t lairofthebeastPic = new ImageIcon(getClass().getResource(\"/images/lairodthebeastPic.jpg\"));\r\n\t\t cavePic = new ImageIcon(getClass().getResource(\"/images/cave.jpg\"));\r\n\t\t frozenlakePic = new ImageIcon(getClass().getResource(\"/images/frozenlake.gif\"));\r\n\t\t pickPic = new ImageIcon(getClass().getResource(\"/images/peak.jpg\"));\r\n\t\t mountainbasePic = new ImageIcon(getClass().getResource(\"/images/mountainbase.jpg\"));\r\n\t\t bridgePic = new ImageIcon(getClass().getResource(\"/images/bridge.jpg\"));\r\n\t\t jailPic = new ImageIcon(getClass().getResource(\"/images/jail.jpg\"));\r\n\t\t jailentrancePic = new ImageIcon(getClass().getResource(\"/images/jailentrance.jpg\"));\r\n\t\t churchPic = new ImageIcon(getClass().getResource(\"/images/church.jpg\"));\r\n\t\t cityentrancePic = new ImageIcon(getClass().getResource(\"/images/cityentrance.jpg\"));\r\n\t\t marketplacePic = new ImageIcon(getClass().getResource(\"/images/marketplace.jpg\"));\r\n\t\t caveentrancePic = new ImageIcon(getClass().getResource(\"/images/caveentrance.png\"));\r\n\t\t //weapon pictures\r\n\t\t swordPic = new ImageIcon(getClass().getResource(\"/images/sword.png\"));\r\n\t\t knifePic = new ImageIcon(getClass().getResource(\"/images/knife.png\"));\r\n\t\t gunPic = new ImageIcon(getClass().getResource(\"/images/gun.png\"));\r\n\t\t key1Pic = new ImageIcon(getClass().getResource(\"/images/key.jpg\"));\r\n\t\t key2Pic = new ImageIcon(getClass().getResource(\"/images/key2.png\"));\r\n\t\t key3Pic = new ImageIcon(getClass().getResource(\"/images/key3.jpg\"));\r\n\t\t machetePic = new ImageIcon(getClass().getResource(\"/images/machete.png\"));\r\n\t\t bunchkeyPic = new ImageIcon(getClass().getResource(\"/images/bunch_key.png\"));\r\n\t\t grapplePic = new ImageIcon(getClass().getResource(\"/images/grapple.png\"));\r\n\t\t medlakePic = new ImageIcon(getClass().getResource(\"/images/magic_water.png\"));\r\n\t\t medikitPic = new ImageIcon(getClass().getResource(\"/images/Medkit_1.png\"));\r\n\t\t chestPic = new ImageIcon(getClass().getResource(\"/images/chest.jpg\"));\t\t \r\n\t\t plankPic = new ImageIcon(getClass().getResource(\"/images/plank.jpg\"));\t\t \r\n\r\n\t\t \r\n\t\t\t//creation of the items\r\n\t\t\t//creation of the weapons\r\n\t\t\tknife = new Weapon(5, 2, \"knife\", \"This knife can be useful to fight small targets.\", knifePic);\r\n\t\t\tsword = new Weapon(15, 6, \"sword\", \"This sword was found in the Market place. It is surely more powerful than your knife!\", swordPic);\r\n\t\t\tgun = new Weapon(30, 12, \"gun\", \"This gun was taken from a guard. You will need it sooner than you think.\", gunPic);\r\n\t\t\t\r\n\t\t\t//creation of the medikits\r\n\t\t\tmedChurch = new Medikit(30, 30, \"Small Medikit\", \"This is a medikit. Use it carefully!\",medikitPic);\r\n\t\t\tmedLake = new Medikit(60,40,\"Magic Lake Water\", \"This lake is refreshing. Oh, it can heal you! Come back as much as you need.\",medlakePic);\r\n\t\r\n\t\t\t// creation of the keys\r\n\t\t\t//keys to unlock the paths\r\n\t\t\tkeyForestS = new Key(\"Machete\", \" Perfect to pull some wood out of the way.\",machetePic);\r\n\t\t\tkeyForestW = new Key(\"Planks\", \" Great to build a path across gaps.\",plankPic);\r\n\t\t\tkeyHouse = new Key(\"Old Key\", \" No idea of what it can open...\",key2Pic);\r\n\t\t\tkeyJail = new Key(\"Bunch of keys\", \" Given by a helpful prisoner in jail.\",bunchkeyPic);\r\n\t\t\tkeyPick = new Key(\"Climbing kit\", \" Perfect to cross difficulties on the way.\",grapplePic);\r\n\t\t\t//keys to open the chests\r\n\t\t\tkeyChestMarketplace = new Key(\"A very old Key\", \" Found in the house.\",key1Pic);\r\n\t\t\tkeyChestHouse = new Key(\"A big old Key\", \" Wandering on the ground.\",key1Pic);\r\n\t\t\tkeyChestChurch = new Key(\"Small old Key\", \" Picked up on the Market place.\",key3Pic);\r\n\t\t\t//keys to repair the spaceship (SS)\r\n\t\t\tkeySSGenerator = new Key(\"Generator Cell\", \" Generator cell of your spaceship.\",null);\r\n\t\t\tkeySSWheel = new Key(\"Wheels\", \" Wheels of your spaceship.\",null);\r\n\t\t\tkeySSEnergyCell = new Key(\"Energy Cell\", \" Energy cell of your spaceship.\",null);\r\n\t\t\tkeySSFTL = new Key(\"FTL\", \" 'Faster Than Light' technology, necessary for your spaceship.\",null);\r\n\t\t\t\r\n\t\t\t//creation of the chests\r\n\t\t\tchestMarketplace = new Chest(sword, \"Old Chest\", \" A very old wooden chest, a bit hidden in the street.\", keyChestMarketplace,chestPic);\r\n\t\t\tchestHouse = new Chest(keySSWheel, \"A Tidying Chest\", \" A big tidying chest. Something is shining inside...\", keyChestHouse,chestPic);\r\n\t\t\tchestChurch = new Chest(medChurch, \"Chest\", \" There is a wooden chest in the church. Do you think you're allowed to open it?\", keyChestChurch,chestPic);\r\n \r\n\t\t\t//create zones\r\n\t\t crashzone = new Zone(\"crashZone\", \"the crash zone, where your spaceship is\", crashZonePic);\r\n glade = new Zone(\"glade\", \"the glade, a calm zone\", gladePic);\r\n forestS = new Zone(\"forestS\",\"the south part of the forest\", forestSPic);\r\n forestW = new Zone(\"forestW\",\"the west part of the forest\", forestWPic);\r\n forestN = new Zone(\"forestN\", \"the north part of the forest\", forestNPic);\r\n bridge = new Zone(\"bridge\", \"front of a long wooden bridge\", bridgePic);\r\n cityentrance = new Zone(\"cityentrance\",\"the entrance of a little city\", cityentrancePic);\r\n marketplace = new Zone(\"marketplace\", \"the animated market place\", marketplacePic);\r\n house= new Zone(\"house\", \"the house of someone\", housePic);\r\n church = new Zone(\"church\", \"the church, the god house\", churchPic);\r\n jailentrance = new Zone(\"jailentrance\", \"the entrance of the jail\", jailentrancePic);\r\n jail = new Zone(\"jail\", \"the jail, what are you doing here\", jailPic);\r\n caveentrance = new Zone(\"caveentrance\", \"the entrance of a dark cave\", caveentrancePic);\r\n frozenlake = new Zone(\"frozenlake\", \"front of a beautiful lake\", frozenlakePic);\r\n mountainbase= new Zone(\"mountainbase\", \"the snow of the mountain base\", mountainbasePic);\r\n pick = new Zone(\"pick\", \"the pick of the mountain\", pickPic);\r\n cave = new Zone(\"cave\", \"the dark cave\", cavePic);\r\n lairofthebeast = new Zone(\"lairofthebeast\", \"the lair of the beast, be careful !\", lairofthebeastPic);\r\n currentZone = crashzone;\r\n \r\n //list of items per zone \r\n forestS.setItems(keyForestS);\r\n forestS.setItems(keySSGenerator);\r\n \r\n forestW.setItems(keyForestW);\r\n \r\n marketplace.setItems(chestMarketplace);\r\n marketplace.setItems(keyChestChurch);\r\n marketplace.setItems(keyHouse);\r\n \r\n house.setItems(chestHouse);\r\n house.setItems(keyChestMarketplace);\r\n \r\n church.setItems(chestChurch);\r\n \r\n caveentrance.setItems(keyChestHouse);\r\n \r\n jailentrance.setItems(gun);\r\n \r\n jail.setItems(keyJail);\r\n \r\n frozenlake.setItems(medLake);\r\n \r\n pick.setItems(keySSFTL);\r\n \r\n cave.setItems(keyPick);\r\n \r\n lairofthebeast.setItems(keySSEnergyCell);\r\n \r\n //create path\r\n glade_crashzone = new Path(crashzone,false, null);\r\n crashzone_glade = new Path(glade,false, null);\r\n glade_forestS = new Path(forestS,false, null);\r\n forestS_glade = new Path(glade,false, null);\r\n glade_forestW = new Path(forestW,true, keyForestS);//path initially blocked\r\n forestW_glade = new Path(glade,false, null);\r\n glade_forestN = new Path(forestN,true, keyForestS);//path initially blocked\r\n forestN_glade = new Path(glade,false, null);\r\n bridge_forestW = new Path(forestW,false, null);\r\n forestW_bridge = new Path(bridge,false, null);\r\n bridge_forestN = new Path(forestN,false, null);\r\n forestN_bridge = new Path(bridge,false, null);\r\n bridge_cityentrance = new Path(cityentrance,true, keyForestW);//path initially blocked\r\n cityentrance_bridge = new Path(bridge,false, null);\r\n forestN_caveentrance = new Path(caveentrance,false, null);\r\n caveentrance_forestN = new Path(forestN,false, null);\r\n pick_mountainbase = new Path(mountainbase, false, null);\r\n mountainbase_pick = new Path(pick, true, keyPick);// path initially blocked\r\n mountainbase_caveentrance = new Path(caveentrance, false, null);\r\n caveentrance_mountainbase = new Path(mountainbase, false, null);\r\n caveentrance_cave = new Path(cave, false, null);\r\n cave_caveentrance = new Path(caveentrance, false, null);\r\n caveentrance_frozenlake = new Path(frozenlake, false, null);\r\n frozenlake_caveentrance = new Path(caveentrance, false, null);\r\n cave_lairofthebeast = new Path(lairofthebeast, false, null);\r\n lairofthebeast_cave = new Path(cave, false, null);\r\n jailentrance_jail = new Path(jail, true, keyJail);//path always blocked, the way can be crossed only if the guards put the player in jail\r\n jail_jailentrance = new Path(jailentrance, true, keyJail);//path initially blocked\r\n jailentrance_marketplace = new Path(marketplace, false, null);\r\n marketplace_jailentrance = new Path(jailentrance, false, null);\r\n marketplace_church = new Path(church, false, null);\r\n church_marketplace = new Path(marketplace, false, null);\r\n marketplace_cityentrance = new Path(cityentrance, false, null);\r\n cityentrance_marketplace = new Path(marketplace, false, null);\r\n marketplace_house = new Path(house, true, keyHouse);//path initially blocked\r\n house_marketplace = new Path(marketplace, false, null);\r\n \r\n //initialization of exits\r\n glade.setExits(\"north\",glade_forestN);\r\n glade.setExits(\"east\",glade_crashzone);\r\n glade.setExits(\"west\",glade_forestW);\r\n glade.setExits(\"south\",glade_forestS);\r\n \r\n crashzone.setExits(\"west\",crashzone_glade);\r\n \r\n forestS.setExits(\"north\",forestS_glade); \r\n \r\n forestW.setExits(\"east\",forestW_glade);\r\n forestW.setExits(\"north\",forestW_bridge);\r\n \r\n forestN.setExits(\"west\",forestN_bridge);\r\n forestN.setExits(\"north\",forestN_caveentrance);\r\n forestN.setExits(\"south\", forestN_glade);\r\n \r\n caveentrance.setExits(\"north\",caveentrance_cave);\r\n caveentrance.setExits(\"east\",caveentrance_frozenlake);\r\n caveentrance.setExits(\"west\",caveentrance_mountainbase);\r\n caveentrance.setExits(\"south\",caveentrance_forestN);\r\n \r\n frozenlake.setExits(\"west\",frozenlake_caveentrance);\r\n \r\n cave.setExits(\"east\",cave_lairofthebeast);\r\n cave.setExits(\"south\",cave_caveentrance);\r\n \r\n lairofthebeast.setExits(\"west\",lairofthebeast_cave);\r\n \r\n mountainbase.setExits(\"north\",mountainbase_pick);\r\n mountainbase.setExits(\"east\",mountainbase_caveentrance);\r\n \r\n bridge.setExits(\"west\",bridge_cityentrance);\r\n bridge.setExits(\"south\",bridge_forestW);\r\n bridge.setExits(\"east\",bridge_forestN);\r\n \r\n cityentrance.setExits(\"west\",cityentrance_marketplace);\r\n cityentrance.setExits(\"east\",cityentrance_bridge);\r\n \r\n marketplace.setExits(\"west\",marketplace_church);\r\n marketplace.setExits(\"north\",marketplace_jailentrance);\r\n marketplace.setExits(\"east\",marketplace_cityentrance);\r\n marketplace.setExits(\"south\",marketplace_house);\r\n \r\n house.setExits(\"north\",house_marketplace);\r\n \r\n church.setExits(\"east\",church_marketplace);\r\n \r\n jailentrance.setExits(\"north\",jailentrance_jail);\r\n jailentrance.setExits(\"south\",jailentrance_marketplace);\r\n \r\n jail.setExits(\"south\",jail_jailentrance);\r\n \r\n pick.setExits(\"south\", pick_mountainbase);\r\n \n //Placement of Npcs\r\n \t\thouse.setCurrentNpcFightGuard(guard);\n\r\n\t\t\tlairofthebeast.setCurrentNpcFightBoss(boss);\r\n\t\t\tSystem.out.println(lairofthebeast.getCurrentNpcFightBoss().getName());\r\n\t\t\t//TODO\r\n\t\t\t\r\n\t\t\tglade.setCurrentNpcDialog(shaman);\r\n\t\t\tcityentrance.setCurrentNpcDialog(citizen1);\r\n\t\t\tjail.setCurrentNpcDialog(prisoner);\r\n\t\t\tmarketplace.setCurrentNpcDialog(citizen2);\r\n\t\t\tchurch.setCurrentNpcDialog(citizen3);\r\n\t\t\thouse.setCurrentNpcDialog(citizen4);\r\n\r\n\t\t\tforestN.setCurrentNpcFightMonster(snake1);\r\n\t\t\tforestW.setCurrentNpcFightMonster(snake1bis);\r\n\t\t\tcaveentrance.setCurrentNpcFightMonster(snake2);\r\n\t\t\tcave.setCurrentNpcFightMonster(wolf);\r\n\t\t\tbridge.setCurrentNpcFightMonster(shark);\r\n\r\n\t}",
"protected void initUserAccount(String userServer, long userId, String userName, String balanceId) {\r\n\t\tDataCollection.remove(userServer, \"finance\", \"bill_\" + userId, new BasicDBObject());\r\n\t\tBasicDBObject oField = null;\r\n\t\tif (StringUtil.isEmpty(balanceId)) {\r\n\t\t\toField = new BasicDBObject().append(\"balance\", 0).append(\"income\", 0).append(\"withdraw\", 0).append(\"timestamp\", System.currentTimeMillis())\r\n\t\t\t\t\t.append(\"userId\", userId).append(\"userName\", userName);\r\n\t\t} else {\r\n\t\t\toField = new BasicDBObject().append(\"_id\", new ObjectId(balanceId)).append(\"balance\", 0).append(\"income\", 0).append(\"withdraw\", 0)\r\n\t\t\t\t\t.append(\"timestamp\", System.currentTimeMillis()).append(\"userId\", userId).append(\"userName\", userName);\r\n\t\t}\r\n\t\tbalanceId = DataCollection.insert(userServer, \"finance\", \"bill_\" + userId, oField).toString();\r\n\t\tDataCollection.createIndex(userServer, \"finance\", \"bill_\" + userId, \"keyIdx\", new BasicDBObject().append(\"shortId\", 1), false);\r\n\t\tString sql = \"update user set balance=0,income=0,withdraw=0,income_total=0,withdraw_total=0,sms_count=0,balance_id=? where user_id=?\";\r\n\t\tDataSet.update(Const.defaultMysqlServer, Const.defaultMysqlDB, sql, new String[] { balanceId, String.valueOf(userId) });\r\n\t}",
"public Jumble() {\n jumble = new HashMap<>();\n total = 0;\n }",
"public Bonus (){\n\t\tsuper (); \n\t\t//TODO [CORRECCION] Tiene una clase Config, utilizarla para estos valores fijos.\n\t\tthis.tiempoDeVida = Config.BONUS_VIDA; // cantidad de turnos\n\t\tPosicion posicion = new Posicion(randX.nextInt(), randY.nextInt());\n\t\tTamanio tamanio = new Tamanio(Config.BONUS_ANCHO, Config.BONUS_ALTO);\n\t\tthis.setPosicion(posicion);\n\t\tthis.setTamanio(tamanio);\n\t}",
"public UserObject() {\n command = \"\";\n lastCommand = \"\";\n response = \"\";\n }",
"public User(int userId, String email, String password, String nickName,\r\n\t\t\tint money, String avatar, int userChar) {\r\n\t\tthis.userId = userId;\r\n\t\tthis.email = email;\r\n\t\tthis.password = password;\r\n\t\tthis.nickName = nickName;\r\n\t\tthis.money = money; \r\n\t\tthis.avatar = avatar;\r\n\t\tthis.characterId = userChar;\r\n\t}",
"private void hardCodeNikesh() {\n User nikesh = new User(\"Nikesh\", new Timeline(), new Subscriptions());\n nikesh.post(\"sunfish sunfish sunfish\");\n jitter.addUser(\"Nikesh\", nikesh);\n }",
"@Test\n\tpublic void gutterball() {\n\t\tString attemptScore = mockBowlingGameController.getAttemptScore();\n\t\tMockito.when(attemptScore).thenReturn(\"0\");\n\t\ttry {\n\t\t\tMockito.doCallRealMethod().when(mockBowlingGameController).convertInputToInteger();\n\t\t\tint convertedAttemptScore = mockBowlingGameController.convertInputToInteger();\n\t\t\tMockito.doCallRealMethod().when(mockBowlingGameController).checkGutterball(convertedAttemptScore);\n\n\t\t\tMockito.doThrow(GutterballException.class).when(mockBowlingGameController)\n\t\t\t\t\t.checkGutterball(convertedAttemptScore);\n\t\t} catch (Exception ex) {\n\t\t\tthrow new BowlingTestException(ex);\n\t\t}\n\t}",
"public DiceGame() // Constructor with variables to pass values\n {\n // Show random values.\n \t// Assign default values to the die1Rand and die2Rand fields.\n \tdie1Rand = 0;\n \tdie2Rand = 0;\n \tthrowCount = 0;\n }",
"private void initializeStatus()\n\t{\n\t\tif (playerList == null || playerList.isEmpty())\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Cast die to determine starting player until one player has a better result (no tie)\n\t\tList<Player> startingPlayers = playerList;\n\t\twhile (startingPlayers.size() > 1)\n\t\t{\n\t\t\tList<Player> maxResultPlayers = new ArrayList<Player>();\n\t\t\tint maxResult = 0;\n\t\t\t\n\t\t\t// All players with best result must roll die\n\t\t\t// In the first round that consists of all players\n\t\t\tfor(Player player : startingPlayers)\n\t\t\t{\n\t\t\t\tint result = board.rollDice();\n\t\t\t\t\n\t\t\t\t// The player having the better result is remembered\n\t\t\t\tif (result > maxResult)\n\t\t\t\t{\n\t\t\t\t\tmaxResultPlayers.clear();\n\t\t\t\t\tmaxResultPlayers.add(player);\n\t\t\t\t\tmaxResult = result;\n\t\t\t\t}\n\t\t\t\t// If tied, the player is added for another round of die rolling\n\t\t\t\telse if (result == maxResult)\n\t\t\t\t{\n\t\t\t\t\tmaxResultPlayers.add(player);\n\t\t\t\t}\n\t\t\t}\n\t\t\tstartingPlayers = maxResultPlayers;\n\t\t}\n\t\t\n\t\t// Set current game status\n\t\tPlayer starting = startingPlayers.get(0);\n\t\tincreaseTurnCount();\n\t\tthis.currentPlayerID = starting.getId();\n\t}",
"Game() {\n _randomSource = new Random();\n\n _players = new Player[2];\n _input = new BufferedReader(new InputStreamReader(System.in));\n _players[0] = new HumanPlayer(BP, this);\n _players[1] = new MachinePlayer(WP, this);\n _playing = false;\n }"
] | [
"0.61264557",
"0.5917874",
"0.57214576",
"0.55069983",
"0.5491222",
"0.54345846",
"0.54280686",
"0.5387615",
"0.53151053",
"0.5285839",
"0.52634084",
"0.5224621",
"0.5190973",
"0.5164292",
"0.51462114",
"0.5143121",
"0.5135888",
"0.51355636",
"0.5121788",
"0.5117831",
"0.5087622",
"0.50843847",
"0.5051475",
"0.50258285",
"0.5010831",
"0.49925667",
"0.49805912",
"0.49715215",
"0.49537656",
"0.49471247",
"0.4938355",
"0.49313813",
"0.49127552",
"0.4910234",
"0.48858407",
"0.48833993",
"0.4875575",
"0.4871314",
"0.4869701",
"0.48633218",
"0.4851128",
"0.4849485",
"0.48488757",
"0.48475346",
"0.484541",
"0.48379064",
"0.48222882",
"0.48201135",
"0.4816798",
"0.48091146",
"0.480721",
"0.48071685",
"0.47962376",
"0.47918952",
"0.4779915",
"0.47797257",
"0.47704786",
"0.47674856",
"0.47632548",
"0.47602352",
"0.47586775",
"0.47504577",
"0.47439888",
"0.47371733",
"0.47340575",
"0.47321787",
"0.47247788",
"0.47230998",
"0.47230026",
"0.4722888",
"0.47212684",
"0.4716876",
"0.47147897",
"0.47126865",
"0.47079438",
"0.47064131",
"0.47063178",
"0.47034866",
"0.470137",
"0.47000888",
"0.46978468",
"0.46798348",
"0.46722078",
"0.4669268",
"0.46683222",
"0.46673217",
"0.46622828",
"0.46495792",
"0.46417364",
"0.46415806",
"0.46338883",
"0.46332946",
"0.46301016",
"0.46266368",
"0.46237797",
"0.46235698",
"0.4615363",
"0.46136025",
"0.46116492",
"0.46114635"
] | 0.80800366 | 0 |
Returns the number of times the user played Bang. | public int getAttempts() {
return attempts;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic long countchitietdonhang() {\n\t\treturn chiTietDonHangRepository.countchitietdonhang();\n\t}",
"public int getNumGuesses() {\n\t\treturn this.guessList.length;\n\t}",
"int getTotalBotCount() {\n int t = 0;\n\n for (Integer i : m_botTypes.values())\n t += i;\n\n return t;\n }",
"public int getGuesses() {\n\t\treturn this.guesses;\n\t}",
"public int getBottles() {\n return totalBottles;\n }",
"public int numberOfBoats(){\n return this.boats.size();\n }",
"public int countUsers()\n {\n int nbUser = 0;\n pw.println(12);\n try\n {\n nbUser = Integer.parseInt(bis.readLine()) ;\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n return nbUser ;\n }",
"int getUserCount();",
"int getUserCount();",
"public BangPlayer(long userId, int numTries, int numDeaths, int numJams) {\n super(userId);\n attempts = numTries;\n deaths = numDeaths;\n jams = numJams;\n }",
"int getTimesPlayed (String song_id);",
"public int getGuessesLeft() {\r\n return (guessesAllowed - numWrongGuesses);\r\n }",
"void testBigBang(Tester t) {\r\n initData();\r\n FloodItWorld g = this.runGame;\r\n int worldWidth = 1000;\r\n int worldHeight = 1000;\r\n double tickRate = .012;\r\n g.bigBang(worldWidth, worldHeight, tickRate);\r\n }",
"public int getNumberGunsUsedInShooting(Shooting shooting) throws SQLException {\n int numberOfGuns = 0;\n String selectGuns =\n \"SELECT COUNT(*) as count FROM Guns WHERE ShootingId=?\";\n Connection connection = null;\n PreparedStatement selectStmt = null;\n ResultSet results = null;\n try {\n connection = connectionManager.getConnection();\n selectStmt = connection.prepareStatement(selectGuns);\n selectStmt.setInt(1, shooting.getShootingId());\n results = selectStmt.executeQuery();\n\n while (results.next()) {\n numberOfGuns = results.getInt(\"count\");\n }\n } catch (SQLException e) {\n e.printStackTrace();\n throw e;\n } finally {\n if (connection != null) {\n connection.close();\n }\n if (selectStmt != null) {\n selectStmt.close();\n }\n if (results != null) {\n results.close();\n }\n }\n return numberOfGuns;\n }",
"@Override\n\tpublic int kangwoncount() throws Exception {\n\t\treturn dao.kangwoncount();\n\t}",
"public int getGuessesLeft() {\r\n return 0;\r\n }",
"public int getTimesPlayed() {\r\n\t\treturn timesPlayed;\r\n\t}",
"public int getNumPlayed()\n\t{\n\t\treturn numPlayed;\n\t}",
"public int getBlackMarblesCount()\r\n\t{\r\n\t\treturn this.blackMarblesCount;\r\n\t}",
"public int countBoats() {\r\n\t\treturn boats.size();\r\n\t}",
"int getBattlesWon();",
"@java.lang.Override\n public int getBattlesLost() {\n return battlesLost_;\n }",
"@java.lang.Override\n public int getBattlesLost() {\n return battlesLost_;\n }",
"public int checkNoOfRapelPlayerHolds () { return noOfRapels; }",
"int getTimesPlayedByUser (String user_id, String song_id);",
"public int getMissedCallsCount();",
"public int getPlayerCount() {\n return 0;\n }",
"@Override\n public int getBalloonUserTrackingsCount()\n throws com.liferay.portal.kernel.exception.SystemException {\n return _balloonUserTrackingLocalService.getBalloonUserTrackingsCount();\n }",
"public int get_numLostBags(){\r\n return num_lost_bags;\r\n }",
"public int getNumBoats() {\n return NUM_BOATS;\n }",
"int getBattlesLost();",
"public int getNumCaught() {\r\n\t\tint count = 0;\r\n\t\tfor (int poke : caughtPokemon.values()) {\r\n\t\t\tcount += poke;\r\n\t\t}\r\n\t\treturn count;\r\n\t}",
"int getFaintedPokemonCount();",
"public int getGuessesLeft() {\r\n return this.numGuesses;\r\n }",
"public int getNumOfBoats() {\n\t\treturn numOfBoats;\n\t}",
"public int getBadCount() {\n return badCount;\n }",
"public long countB() {\n return this.countB;\n }",
"public Byte getNumChargedFail() {\n return numChargedFail;\n }",
"public int getHats() {\n return totalHats;\n }",
"public int getCount () {\n return numsBaby;\n }",
"public int getPauseBetweenHillClimbPlays()\n {\n return 0;\n }",
"@Override\n\tpublic int getTotalCount(Chatting chatting) {\n\t\treturn 0;\n\t}",
"public int getGoalTally(Player player){\r\n return player.getGoal();\r\n }",
"public abstract int numOfBaby();",
"public int getPlayedTimes() {\n return playedTimes;\n }",
"int getTries();",
"public static Integer getBotWins() {\n return humanVsBot.OWins + botVsHuman.XWins;\n }",
"public int getMissedCallCount(){\r\n\t\t//if(_debug) Log.v(_context, \"NotificationViewFlipper.getMissedCallCount() MissedCallCount: \" + _missedCallCount);\r\n\t\treturn _missedCallCount;\r\n\t}",
"int getLettersCount();",
"public int getNumTimes();",
"@java.lang.Override\n public int getBattlesWon() {\n return battlesWon_;\n }",
"public static int getBassTrack(){\n\t\treturn bassTrack;\n\t}",
"public int getUserCount() {\n\t\t\treturn 7;\n\t\t}",
"@java.lang.Override\n public int getBattlesWon() {\n return battlesWon_;\n }",
"int getFriendCount();",
"int getFriendCount();",
"public int hamming() {\n return ham;\n }",
"@Override\n public int getTotalHumanPlayers() {\n return totalHumanPlayers;\n }",
"public ArrayList<Integer> getBballStatCountsForGame(Game game) {\n\t\tString gameId = game.getId().toString();\n\t\tArrayList<Integer> counts = new ArrayList<Integer>();\n\t\tList<Player> players = getPlayers();\n\t\tArrayList<String> typeIds = StatType.getBballStatTypeIds();\n\t\tArrayList<String> boolStats = StatType.getBballBoolStats();\n\t\tfor (String typeId : typeIds) {\n\t\t\tint sumTypeCount = 0;\n\t\t\tfor (Player player : players) {\n\t\t\t\tsumTypeCount += player.getStatCountForTypeForGame(gameId, typeId);\n\t\t\t}\n\t\t\tcounts.add(sumTypeCount);\n\t\t\tStatType s = StatType.findById(StatType.class, Long.parseLong(typeId));\n\t\t\tif (boolStats.contains(s.name)) {\n\t\t\t\tint madeCount = 0;\n\t\t\t\tfor (Player player : players) {\n\t\t\t\t\tmadeCount += player.getStatCountForTypeTrueForGame(gameId, typeId);\n\t\t\t\t};\n\t\t\t\tcounts.add(madeCount);\n\t\t\t}\n\t\t}\n\t\treturn counts;\n\t}",
"public int GetPot_Count() {\n\t\treturn POT_COUNT;\n\t}",
"public String getResetBadCount() {\n\t\treturn resetBadCount;\n\t}",
"public int totalGames() {\n return wins + losses + draws;\n }",
"public int countPlayers(){\n return players.size();\n }",
"@javax.annotation.Nullable\n @ApiModelProperty(value = \"Number of times the text is said. Specifying '0' causes the `Say` action to loop until the Call is hung up.\")\n\n public Integer getLoop() {\n return loop;\n }",
"public int getWrongLettersCount() {\n return wrongLettersCount;\n }",
"public int hamming() {\n return hamming;\n }",
"public int getUserWonNumber() {\n\t\tint result = -1;\n\t\ttry {\n\t\t\tthis.rs = smt.executeQuery(\"SELECT count(id) FROM tp.gamerecord WHERE winner = (SELECT id FROM tp.player WHERE isAI = false)\");\n\t\t\tif(this.rs.next()) {\n\t\t\t\tresult = rs.getInt(1);\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\tSystem.err.println(\"Query is Failed!\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn result;\n\t}",
"public int hamming() {\n return hamming_score;\n }",
"public int hamming() {\n\t\treturn hamming;\n\t}",
"public int getUserCount() {\n return instance.getUserCount();\n }",
"private int getAttemptsPerTurn() {\n return attemptsPerTurn;\n }",
"public int getGamesPlayed() {\n return gamesPlayed;\n }",
"public int getWhiteMarblesCount()\r\n\t{\r\n\t\treturn whiteMarblesCount;\r\n\t}",
"public static int haveGun() {\n\t\treturn 108;\n\t}",
"public int getBadgeCount()\n\t{\n\t\tint result = 0;\n\t\tfor(int i = 0; i < m_badges.length; i++)\n\t\t\tif(m_badges[i] == 1)\n\t\t\t\tresult++;\n\t\treturn result;\n\t}",
"public int bobCount ();",
"public int bikeNum(){\n return bike;\n }",
"private int getBlockedCount(){\n int count = 0;\n\n String whereClause = DbHelper.IS_BLOCKED + \" = ?\";\n String[] whereArgs = new String[]{String.valueOf(true)};\n\n Cursor cursor = mDbHelper.getReadableDatabase().query(DbHelper.TABLE_NAME, null, whereClause, whereArgs, null, null, null);\n\n while(cursor.moveToNext()){\n count++;\n }\n\n return count;\n }",
"public int getNumCharacters()\n\t{\n\t\treturn gameCharCount;\n\t}",
"public Integer getSpeechDrop() {\n return speechDrop;\n }",
"public int getFaintedPokemonCount() {\n if (faintedPokemonBuilder_ == null) {\n return faintedPokemon_.size();\n } else {\n return faintedPokemonBuilder_.getCount();\n }\n }",
"@Override\n\tpublic int selectCount() {\n\n\t\tint res = session.selectOne(\"play.play_count\");\n\n\t\treturn res;\n\t}",
"public String play() \r\n { \r\n \r\n theDiceTotal = dice.roll();\r\n \r\n while ( theDiceTotal != 12 )\r\n { \r\n theDiceTotal = dice.roll();\r\n System.out.println( dice.getDie1FaceValue() + \" \" + dice.getDie2FaceValue() );\r\n count++;\r\n }\r\n \r\n return ( count - 1 ) + \" dice rolled.\"; \r\n }",
"int getTimesCombatActionsCalled();",
"public String getGuessesMade() {\r\n return \"DEFAULT\";\r\n }",
"@Override\n\tpublic Integer count(Integer id) {\n\t\treturn chiTietDonHangRepository.count(id);\n\t}",
"public int getBallCount() {\r\n\t\treturn ballCount;\r\n\t}",
"public int getBirths()\n\t{\n \treturn currentBirths;\n\t}",
"public static void main( String[] args) \r\n {\n Scanner scan; \r\n HangMan game; \r\n String userInput; \r\n String letter; \r\n int errorValue;\r\n boolean temp;\r\n \r\n //Initialize the variables (other variables will be given values as program proceeds) \r\n scan = new Scanner( System.in); \r\n temp = true; \r\n \r\n //Create the user-interface and play the game \r\n while( temp ) \r\n { \r\n game = new HangMan(); \r\n System.out.println( \"Welcome to Hang-man game\"); \r\n System.out.println( \"You have \" + 6 + \" tries\"); \r\n System.out.println( \"Enter any button except q to proceed, q to quit\"); \r\n userInput = scan.next(); \r\n \r\n //Outer loop for re-playing of the game\r\n if( !userInput.equals( \"q\")) \r\n { \r\n //Inner loop for the simulation of the game \r\n while( !game.isGameOver() && !game.hasLost()) \r\n { \r\n System.out.println( \"The word that you're looking for: \" + game.knownSoFar); \r\n System.out.println( \"Number of tries left : \" + (6 - game.numberOfIncorrectTries)); \r\n System.out.println( \"Letters in the english alphabet: \" + game.allLetters); \r\n System.out.println( \"Used letters: \" + game.usedLetters); \r\n System.out.println( \"Please enter a letter\");\r\n letter = scan.next(); \r\n errorValue = game.tryThis( letter.charAt(0) /* or just letter itself (depending on the implementation of the method)*/); \r\n \r\n if( errorValue == -1) // Invalid input \r\n {\r\n System.out.println( \"Please enter a valid letter\"); \r\n }\r\n else if( errorValue == -2) // Repeated letter \r\n {\r\n System.out.println( \"You entered this letter before, please enter a different letter\"); \r\n }\r\n else if( errorValue == 1) // Correct answer 1 repetition \r\n {\r\n System.out.println( \"The letter you entered is repeated 1 time\"); \r\n }\r\n else if( errorValue > 1) // Correct answer multiple representation\r\n {\r\n System.out.println( \"The letter you entered is repeated \" + errorValue + \" times\"); \r\n }\r\n else if( errorValue == 0) // Wrong answer \r\n {\r\n System.out.println( \"Unfortunately the letter you entered is not in the word\"); \r\n }\r\n else if( errorValue == -3) // Game Over \r\n {\r\n System.out.println( \"Game Over\"); \r\n }\r\n if( game.hasLost()) \r\n {\r\n System.out.println( \"Unfortunately, you lost\"); // Implementing a method showing the secret word would be nice \r\n }\r\n else if( game.isGameOver()) \r\n {\r\n System.out.println( \"You won, congratulations\"); \r\n }\r\n } \r\n } \r\n \r\n else \r\n { \r\n temp = false; \r\n System.out.println( \"Bye - bye, thanks for playing\"); \r\n } \r\n } \r\n }",
"public int getCollected() {\n return macguffinsCollected;\n }",
"@Override\n protected Integer count() {\n Matcher matcher = UPPER.matcher(this.password);\n Integer score = 0;\n\n while (matcher.find()) {\n score++;\n }\n\n return score;\n }",
"public static int getNumberOfGuppiesBorn() {\n return numberOfGuppiesBorn;\n }",
"public int getUserCount()\n\t{\n\t\tint ret = -1;\n\t\ttry {\n\t\t\tret = Integer.parseInt(userCount.getTextContent());\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tlogger.warn(\"Could not parse user-count field\");\n\t\t}\n\t\treturn ret;\n\t}",
"public static int getIntegerbpm() {\n return integerbpm;\n }",
"long getMisses();",
"@Test public void bunnyCountTest() throws NegativeValueException { \n PetBunny pb1 = new PetBunny(\"Floppy\", \"Holland Lop\", 3.5);\n \n pb1.resetBunnyCount();\n \n Assert.assertEquals(0, pb1.getBunnyCount(), 0.00001);\n }",
"public int countHandShakes(){\n\t\tif (this.getNCouples() < 1) {\n\t\t\treturn 0;\n\t\t}else if (this.getNCouples() == 1) {\n\t\t\treturn 1;\n\t\t}else{\n\t\t\tthis.setNCouples(this.getNCouples() - 1);\n\t\t\treturn (this.getNCouples() + 1) * 3 - 2 + countHandShakes();\n\t\t}\n\t}",
"public int getAttempts() {\n return attempts;\n }"
] | [
"0.59671193",
"0.5752294",
"0.57061654",
"0.56681204",
"0.5655155",
"0.5632641",
"0.56010664",
"0.55700296",
"0.55700296",
"0.5555746",
"0.55477613",
"0.5538558",
"0.55307",
"0.5515645",
"0.55110365",
"0.550374",
"0.5492669",
"0.54862875",
"0.5448714",
"0.5428054",
"0.5378629",
"0.537604",
"0.5366146",
"0.5347102",
"0.5326713",
"0.5322855",
"0.53140557",
"0.5304577",
"0.53019124",
"0.52875066",
"0.52852285",
"0.527995",
"0.52751917",
"0.5265565",
"0.5265052",
"0.52577406",
"0.5237124",
"0.5233521",
"0.52298075",
"0.5223758",
"0.52221113",
"0.5216148",
"0.52143466",
"0.5212716",
"0.5209609",
"0.5197069",
"0.51938987",
"0.5191241",
"0.51649785",
"0.5156773",
"0.51563674",
"0.51547146",
"0.5151984",
"0.51470476",
"0.51422584",
"0.51422584",
"0.51406574",
"0.5136788",
"0.5134426",
"0.51329535",
"0.51277465",
"0.51238525",
"0.5122262",
"0.51199347",
"0.5110393",
"0.51085967",
"0.51006186",
"0.50907606",
"0.50830275",
"0.5082494",
"0.5073163",
"0.50725585",
"0.5069971",
"0.50590926",
"0.50578296",
"0.50576097",
"0.50530833",
"0.50516164",
"0.50449353",
"0.50418293",
"0.5037484",
"0.50356835",
"0.50354993",
"0.50336605",
"0.50334615",
"0.5031256",
"0.5030815",
"0.5027999",
"0.5022592",
"0.5011046",
"0.50096005",
"0.50081164",
"0.50055444",
"0.50049376",
"0.4997711",
"0.49928477",
"0.49890587",
"0.49818859"
] | 0.5016725 | 91 |
Returns the number of times the user died in Bang. | public int getDeaths() {
return deaths;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getNumDeaths() {\n\t\treturn this.numDeaths;\n\t}",
"public int getDaysSinceDeath() {\n return daysSinceDeath;\n }",
"public String getDeadCount() {\n return deadCount;\n }",
"public int getDeaths()\n\t{\n \treturn currentDeath;\n\t}",
"public int getBadCount() {\n return badCount;\n }",
"public int getMissCountExpired() {\n return missCountExpired;\n }",
"@Override\n\tpublic long countchitietdonhang() {\n\t\treturn chiTietDonHangRepository.countchitietdonhang();\n\t}",
"public Byte getNumChargedFail() {\n return numChargedFail;\n }",
"public int getHappiness() {\n \t\treturn happiness;\n \t}",
"public int getThrow()\n{\n // Return the total number of times the dice was thrown.\n return throwCount;\n}",
"public void countDeaths() {\n\t\tfor (LogLineData d : dataList) {\n\n\t\t\tif (!d.getDeadName().equals(\"<WORLD>\")) {\n\t\t\t\tint deadIndex = getKillerIndex(d.getDeadName());\n\n\t\t\t\tif (deadIndex == -1) {\n\t\t\t\t\tNinja n = new Ninja(d.getDeadName());\n\t\t\t\t\tn.setDeathsNumber(1);\n\t\t\t\t\tkillers.add(n);\n\t\t\t\t} else {\n\t\t\t\t\tint death = killers.get(deadIndex).getDeathsNumber();\n\t\t\t\t\tkillers.get(deadIndex).setDeathsNumber(death + 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public String getResetBadCount() {\n\t\treturn resetBadCount;\n\t}",
"@Override\n public int getBalloonUserTrackingsCount()\n throws com.liferay.portal.kernel.exception.SystemException {\n return _balloonUserTrackingLocalService.getBalloonUserTrackingsCount();\n }",
"public int getNumDead() {\n int count = 0;\n for (Map.Entry<Integer, Enemy> entry :enemies.entrySet()) {\n if (entry.getValue().isDead()) {\n count++;\n }\n }\n return count;\n }",
"int getUnreachableCount();",
"public int getMissedCallsCount();",
"public int getDeathPoints() {\n return deathPoints;\n }",
"long getMisses();",
"int getInvalidLoginCount();",
"int getHappiness();",
"@Override\n\tpublic int kangwoncount() throws Exception {\n\t\treturn dao.kangwoncount();\n\t}",
"public int howManyHeroDead() {\r\n int count;\r\n count = 0;\r\n for (Hero h: team) {\r\n if (h.isDead()) {\r\n count = count + 1;\r\n }\r\n }\r\n return count;\r\n }",
"public int countUsers()\n {\n int nbUser = 0;\n pw.println(12);\n try\n {\n nbUser = Integer.parseInt(bis.readLine()) ;\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n return nbUser ;\n }",
"public int addDeath() {\n\t\treturn ++this.numDeaths;\n\t}",
"int getUserCount();",
"int getUserCount();",
"@java.lang.Override\n public int getBattlesLost() {\n return battlesLost_;\n }",
"public int getNumberGunsUsedInShooting(Shooting shooting) throws SQLException {\n int numberOfGuns = 0;\n String selectGuns =\n \"SELECT COUNT(*) as count FROM Guns WHERE ShootingId=?\";\n Connection connection = null;\n PreparedStatement selectStmt = null;\n ResultSet results = null;\n try {\n connection = connectionManager.getConnection();\n selectStmt = connection.prepareStatement(selectGuns);\n selectStmt.setInt(1, shooting.getShootingId());\n results = selectStmt.executeQuery();\n\n while (results.next()) {\n numberOfGuns = results.getInt(\"count\");\n }\n } catch (SQLException e) {\n e.printStackTrace();\n throw e;\n } finally {\n if (connection != null) {\n connection.close();\n }\n if (selectStmt != null) {\n selectStmt.close();\n }\n if (results != null) {\n results.close();\n }\n }\n return numberOfGuns;\n }",
"@java.lang.Override\n public int getBattlesLost() {\n return battlesLost_;\n }",
"private int getFailCount() {\n\t\t\t\t\treturn record.getIntProperty(DatabasePasswordComposite.PASSWORD_FAILS, 0);\n\t\t\t\t}",
"public double getLikelinessToGetKilled() {\n return likelinessToGetKilled;\n }",
"public int getInactiveCount() {\n return inactiveCount;\n }",
"public long numMisses() {\n return numMisses.longValue();\n }",
"public int getKillCount(){\n return killCount;\n }",
"public BangPlayer(long userId, int numTries, int numDeaths, int numJams) {\n super(userId);\n attempts = numTries;\n deaths = numDeaths;\n jams = numJams;\n }",
"public String getOnDeath () {\n return this.onDeath;\n }",
"public int getDamageTaken() {\n return this.damageTaken;\n }",
"@Override\n\tpublic Integer count(Integer id) {\n\t\treturn chiTietDonHangRepository.count(id);\n\t}",
"public int countBadLegs() {\n int badLegs = 0;\n\n for (int i = 0; i < locations(); i++) {\n badLegs += (locationIsLeg(i) && isLocationBad(i)) ? 1 : 0;\n }\n\n return badLegs;\n }",
"public int getDamageTaken () {\r\n\t\treturn this.damageTaken;\r\n\t}",
"int getBattlesLost();",
"public int getFailedCheckCount() {\n return iFailedCheckCount;\n }",
"protected int countUsers() \n\t{\n\t\tint result = -1;\n\t\ttry {\n\t\t\tStatement stat = conn.createStatement();\n\t\t\tResultSet rs = stat.executeQuery(\"SELECT COUNT(lfm_username) FROM Persons;\");\n\t\t\tSystem.out.println(rs.toString());\n\t\t\tresult = rs.getInt(1);\n\t\t} \n\t\tcatch (SQLException e) \n\t\t{\n\t\t\tSystem.out.println(\"Something went wrong counting users from Persons\");\n\t\t}\n\t\treturn result;\n\t}",
"public static int getUnseenCountAlerts() {\r\n\t\tint count = 0;\r\n\t\ttry {\r\n\t\t\tConnection con = connection.Connect.getConnection();\r\n\t\t\tString query = \"SELECT COUNT(is_seen) from alerts where is_seen = 0\";\r\n\t\t\tPreparedStatement ps = con.prepareStatement(query);\r\n\t\t\tResultSet rs = ps.executeQuery();\r\n\t\t\twhile (rs.next()) {\r\n\t\t\t\tcount = rs.getInt(1);\r\n\t\t\t}\r\n\t\t} catch (SQLException ex) {\r\n\t\t\tlogger.error(\"\", ex);\r\n\t\t\tex.printStackTrace();\r\n\t\t}\r\n\t\treturn count;\r\n\t}",
"public long getFailedLoginAttempts() {\n return FxContext.getUserTicket().getFailedLoginAttempts();\n }",
"public void lifeLost() {\n\n\t\tif (invincipleTimer <= currentTickCount) {\n\t\t\tSystem.out.println(\"Life Lost!\");\n\n\t\t\thealth--;\n\t\t\tinvincipleTimer = currentTickCount + invicibleLength;\n\t\t}\n\t}",
"public int getHealthRecovery() {\r\n\t\treturn healthRecovery;\r\n\t}",
"public static int getFailCount()\r\n\t{\r\n\t\treturn failCount;\r\n\t}",
"public Hangup() {}",
"public void setDied();",
"@Override\r\n\tpublic Integer getBind_ex_account_cnt() {\n\t\treturn super.getBind_ex_account_cnt();\r\n\t}",
"boolean getHealthy();",
"public int useBomb(){\n //do harm while the animation start\n //cause harm to the boss\n println(\"BEFORE Main.boss.health: \"+Main.boss.health);\n int count = 0;\n if ((Main.boss.alive) && (Main.boss.posY != -1)){\n Main.boss.decreaseHealth(10);\n if(Main.boss.health <= 0){\n Main.boss.alive = false;\n Main.boss.deadTime = millis();\n Main.score += 100;\n bossKilled = true;\n }\n }\n println(\"AFTER Main.boss.health: \"+Main.boss.health);\n //remove all bullets\n Main.boss.emptyBullets();\n //kill all the enemies\n for(int j = 0; j < Main.enemies.size(); j++){\n Enemy tempEnemy = Main.enemies.get(j);\n tempEnemy.alive = false;\n tempEnemy.deadTime = millis();\n count ++;\n }\n // fill(0,0,0);\n // rect(0,0,width,height);\n return count;\n }",
"public Integer getHealthCheckGracePeriodSeconds() {\n return this.healthCheckGracePeriodSeconds;\n }",
"public static int getBedsCount()\n throws com.liferay.portal.kernel.exception.SystemException {\n return getService().getBedsCount();\n }",
"public long getUserCount() throws UserManagementException;",
"public boolean hasDied() {\n return !isAlive();\n }",
"public void death() {\n\t\t\tif (died==false) {\n\t\t\t\tlives-=1;\n\t\t\t\tdeathSound.play();//play the death sound\n\t\t\t\t\n\t\t\t}\n\t\t\tpauseGame(deathSound.getLength());//pause the game until the death sound is over\n\t\t\tif (lives==0) {//if you have no lives left, you died forever and the flag changes.\n\t\t\t\tdeath=true;\n\t\t\t}\n\t\t\tdied=true;\n\t\t}",
"long getUnjoinedEventsCount();",
"void testBigBang(Tester t) {\r\n initData();\r\n FloodItWorld g = this.runGame;\r\n int worldWidth = 1000;\r\n int worldHeight = 1000;\r\n double tickRate = .012;\r\n g.bigBang(worldWidth, worldHeight, tickRate);\r\n }",
"public static int getDeadPlayersAmount(List<Player> players) {\n long count = players.stream()\n .filter(player -> !player.isAlive())\n .count();\n\n int result = (int) count;\n\n return result;\n\n }",
"@Basic\n\tpublic double getDeathTime(){\n\t\treturn this.death_time;\n\t}",
"long count() throws Exception;",
"public int getUserCount() {\n return instance.getUserCount();\n }",
"public int getUpDays() {\n return (int)(_uptime / 86400000);\n }",
"@Override\n public void die() {\n _brain.mouth.say(\"aaarrrrrgggh...\");\n }",
"@Override\n public long dynamicQueryCount(\n com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)\n throws com.liferay.portal.kernel.exception.SystemException {\n return _balloonUserTrackingLocalService.dynamicQueryCount(dynamicQuery);\n }",
"public int getUserCount() {\n\t\t\treturn 7;\n\t\t}",
"@Override\n\tpublic int getVanBanPhapQuiesCount()\n\t\tthrows com.liferay.portal.kernel.exception.SystemException {\n\t\treturn _vanBanPhapQuyLocalService.getVanBanPhapQuiesCount();\n\t}",
"private void Dead() {\n\t\thunger -= 5;\n\t\tthirst -= 5;\n\t\tif ((thirst < 25) && (hunger < 25)){\t\t\t// Player is very weak\n\t\t\thealth -= 15;\n\t\t}else if ((thirst < 25) || (hunger < 25)){\t\t// Player is kinda weak\n\t\t\thealth -= 5;\n\t\t}\n\t\tif (health <= 0){\t\t\t\t\t\t\t\t// Player is dead\n\t\t\taddMessage(\"Overcome by your weakness you succumb.\", \"AI\");\n\t \t\taddMessage(\"You have died\", \"AI\");\n\t \t\tmenu = MENU.GAME_OVER;\n\t\t}\n\t}",
"public int getGuessesLeft() {\r\n return (guessesAllowed - numWrongGuesses);\r\n }",
"@Transactional\r\n\tpublic Integer countBudgetAccounts() {\r\n\t\treturn ((Long) budgetAccountDAO.createQuerySingleResult(\"select count(o) from BudgetAccount o\").getSingleResult()).intValue();\r\n\t}",
"private double enemyKills()\n {\n return (double)enemyResult.shipsLost();\n }",
"@Override\n\tpublic int chungchungcount() throws Exception {\n\t\treturn dao.chungchungcount();\n\t}",
"public static int getPreviousHealth(EntityLiving entity) {\n return entity.getEntityData().getInteger(\"phb\");\n }",
"public int getMissedCallCount(){\r\n\t\t//if(_debug) Log.v(_context, \"NotificationViewFlipper.getMissedCallCount() MissedCallCount: \" + _missedCallCount);\r\n\t\treturn _missedCallCount;\r\n\t}",
"public int our_packetsLost(){ //For a group call, should take an input ID, should be UPDATED\n return this.our_packs_lost;\n }",
"public int incrementAges() {\n int deadGuppyCount = 0;\n Iterator<Guppy> it = guppiesInPool.iterator();\n\n while (it.hasNext()) {\n Guppy currentGuppy = it.next();\n currentGuppy.incrementAge();\n if (!currentGuppy.getIsAlive()) {\n deadGuppyCount++;\n }\n }\n return deadGuppyCount;\n }",
"@Override\n\tpublic int kyungsangcount() throws Exception {\n\t\treturn dao.kyungsangcount();\n\t}",
"public int getNumCaught() {\r\n\t\tint count = 0;\r\n\t\tfor (int poke : caughtPokemon.values()) {\r\n\t\t\tcount += poke;\r\n\t\t}\r\n\t\treturn count;\r\n\t}",
"public int getDeathsOfPlayer(Player player) {\n\t\treturn getStatsProperty(StatsProperty.DEATHS, player);\n\t}",
"public int getMissCountNotFound() {\n return missCountNotFound;\n }",
"public abstract double getPercentDead();",
"public int getBirths()\n\t{\n \treturn currentBirths;\n\t}",
"@Override\n\tpublic int hyundaecount() throws Exception {\n\t\treturn dao.hyundaecount();\n\t}",
"public int getDamageDealt () {\r\n\t\treturn this.damageDealt;\r\n\t}",
"int getDame();",
"int getDeleteUserMonsterUuidsCount();",
"public int rollDie() {\n\t\treturn (int) (Math.random()*6)+1;\n\t}",
"int getBattlesWon();",
"public int getNumAttacked() {\n return this.numAttacked;\n }",
"@Override\n\tpublic int kyunggicount() throws Exception {\n\t\treturn dao.kyunggicount();\n\t}",
"public int getNumCacheMiss() {\n return cacheHandler.getCountCacheMiss();\n }",
"public int damageDropped(int p_149692_1_)\n {\n return func_149887_c(p_149692_1_) ? 0 : p_149692_1_ & 7;\n }",
"private static int safeCount(Character[] characters) {\r\n int safe = 0;\r\n for (Character c : characters) {\r\n // Check if c is not dead\r\n if (!c.isDead()) {\r\n safe += 1;\r\n\t\t\t}\r\n }\r\n\r\n // Return number of characters that are alive\r\n return safe;\r\n }",
"double getDeathFactor();",
"public void checkDeath()\n {\n if (player.getY() >= 549)\n {\n gameOver();\n }\n }",
"public long getExceptionCount();",
"public int getWrongLettersCount() {\n return wrongLettersCount;\n }",
"@Override\n\tpublic int getDeadzone()\n\t{\n\t\treturn (int)(this.zone*100);\n\t}"
] | [
"0.61171377",
"0.6037423",
"0.58753014",
"0.5829067",
"0.58245325",
"0.57667625",
"0.5753741",
"0.5741983",
"0.56065714",
"0.5553235",
"0.55499",
"0.55182314",
"0.55079705",
"0.5492263",
"0.5397378",
"0.5397282",
"0.53961074",
"0.5370308",
"0.53554446",
"0.5353457",
"0.5345912",
"0.5342134",
"0.53288215",
"0.53172135",
"0.530918",
"0.530918",
"0.5249016",
"0.5240146",
"0.52373415",
"0.52349174",
"0.5227759",
"0.5207995",
"0.51992935",
"0.519317",
"0.5128594",
"0.5125187",
"0.51193184",
"0.51151633",
"0.51151055",
"0.51013935",
"0.5099785",
"0.50729567",
"0.5065557",
"0.5060086",
"0.5059954",
"0.50556743",
"0.50548303",
"0.5053697",
"0.50476474",
"0.5045592",
"0.5040499",
"0.5038614",
"0.5026248",
"0.50211734",
"0.5018665",
"0.5008731",
"0.49971962",
"0.49934697",
"0.49902505",
"0.4988179",
"0.49855626",
"0.4982508",
"0.49801958",
"0.4979821",
"0.49769485",
"0.4975906",
"0.4962155",
"0.49611515",
"0.4952399",
"0.4947098",
"0.49436116",
"0.49408603",
"0.493715",
"0.4935262",
"0.49269563",
"0.49255517",
"0.4924336",
"0.491516",
"0.4909922",
"0.49094778",
"0.4906027",
"0.49035817",
"0.48980686",
"0.48969573",
"0.4895729",
"0.48901284",
"0.4889035",
"0.48886934",
"0.48858866",
"0.4885361",
"0.4880797",
"0.48720616",
"0.4866522",
"0.48660716",
"0.48627836",
"0.48586643",
"0.4844994",
"0.48437786",
"0.48411316",
"0.48381352"
] | 0.59248686 | 2 |
Returns the number of times the user jammed the gun in Bang. | public int getJams() {
return jams;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static int haveGun() {\n\t\treturn 108;\n\t}",
"public int hamming() {\n\t\treturn hamming;\n\t}",
"public int hamming() {\n return ham;\n }",
"public int hamming() {\n return hamming;\n }",
"public int getNumberGunsUsedInShooting(Shooting shooting) throws SQLException {\n int numberOfGuns = 0;\n String selectGuns =\n \"SELECT COUNT(*) as count FROM Guns WHERE ShootingId=?\";\n Connection connection = null;\n PreparedStatement selectStmt = null;\n ResultSet results = null;\n try {\n connection = connectionManager.getConnection();\n selectStmt = connection.prepareStatement(selectGuns);\n selectStmt.setInt(1, shooting.getShootingId());\n results = selectStmt.executeQuery();\n\n while (results.next()) {\n numberOfGuns = results.getInt(\"count\");\n }\n } catch (SQLException e) {\n e.printStackTrace();\n throw e;\n } finally {\n if (connection != null) {\n connection.close();\n }\n if (selectStmt != null) {\n selectStmt.close();\n }\n if (results != null) {\n results.close();\n }\n }\n return numberOfGuns;\n }",
"public int useBomb(){\n //do harm while the animation start\n //cause harm to the boss\n println(\"BEFORE Main.boss.health: \"+Main.boss.health);\n int count = 0;\n if ((Main.boss.alive) && (Main.boss.posY != -1)){\n Main.boss.decreaseHealth(10);\n if(Main.boss.health <= 0){\n Main.boss.alive = false;\n Main.boss.deadTime = millis();\n Main.score += 100;\n bossKilled = true;\n }\n }\n println(\"AFTER Main.boss.health: \"+Main.boss.health);\n //remove all bullets\n Main.boss.emptyBullets();\n //kill all the enemies\n for(int j = 0; j < Main.enemies.size(); j++){\n Enemy tempEnemy = Main.enemies.get(j);\n tempEnemy.alive = false;\n tempEnemy.deadTime = millis();\n count ++;\n }\n // fill(0,0,0);\n // rect(0,0,width,height);\n return count;\n }",
"void testBigBang(Tester t) {\r\n initData();\r\n FloodItWorld g = this.runGame;\r\n int worldWidth = 1000;\r\n int worldHeight = 1000;\r\n double tickRate = .012;\r\n g.bigBang(worldWidth, worldHeight, tickRate);\r\n }",
"public int hamming() {\n return hamming_score;\n }",
"public int hamming() {\n\t\tint hammingScore = 0;\n\t\t\n\t\tfor (int row = 0; row < this.dimension(); row++) {\n\t\t\tfor (int column = 0; column < this.dimension(); column++) {\n\t\t\t\tif (blocks[row][column] != 0 && blocks[row][column] != getGoalValueForBlock(row, column)) {\n\t\t\t\t\thammingScore++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn hammingScore;\n\t}",
"public int hamming() {\n int ham = 0;\n for (int i = 0; i < this.tiles.length; i++) {\n int n = this.tiles[i];\n if (n != i+1 && n > 0) {\n ham++;\n }\n }\n return ham;\n }",
"public double rebuild_bricks_and_determine_percent_killed() throws Exception{\n blocker.rebuildBricks(true);\n List list=blocker.getKillList();\n double n=0;\n double d=0;\n for(int i=0;i<list.size();i++){\n //System.out.println(list.get(i));\n if((boolean)list.get(i))\n n+=1;\n d+=1;\n }\n //System.out.println();\n Brick[] brick=blocker.getBricks();\n return n/d;\n }",
"public int hamming() {\n int distance = 0;\n for (int i = 0; i < _N; i++) {\n for (int j = 0; j < _N; j++) {\n if (_tiles[i][j] != _goal[i][j]) {\n distance++;\n }\n }\n }\n return distance;\n }",
"public int getNbTomb(String player) {\r\n\t\tif (hasTomb(player))\r\n\t\t\treturn tombs.get(player).getNbSign();\r\n\t\telse\r\n\t\t\treturn 0;\r\n\t}",
"public int get_numLostBags(){\r\n return num_lost_bags;\r\n }",
"public int getDamageTaken() {\n return this.damageTaken;\n }",
"int getBattlesLost();",
"public int hamming() {\n int numIncorrect = -1;\n int index = 1;\n\n for (int[] row : tiles) {\n for (int tile : row) {\n if (tile != index)\n numIncorrect++;\n index++;\n }\n }\n return numIncorrect;\n }",
"public int getDamageTaken () {\r\n\t\treturn this.damageTaken;\r\n\t}",
"public int hamming() { \n int total = 0;\n for (int n = 0; n < state.length; n++) \n if (state[n] != 0 && state[n] != n) total++;\n return total;\n }",
"public int hamming() {\n int hamming = 0;\n for (int i = 0; i < dimension; i++)\n for (int j = 0; j < dimension; j++)\n if (isWrongPosition(i, j)) hamming++;\n\n return hamming;\n }",
"public int hamming() {\n int count = 1;\n int hamming = 0;\n for (int row = 0; row < dimension(); row++) {\n for (int column = 0; column < dimension(); column++) {\n if (row == dimension() - 1 && column == dimension()-1) break; // Skip last value of the board\n if (blocks[row][column] != count) hamming++;\n count++;\n }\n } \n return hamming;\n }",
"public int incrementAges() {\n int deadGuppyCount = 0;\n Iterator<Guppy> it = guppiesInPool.iterator();\n\n while (it.hasNext()) {\n Guppy currentGuppy = it.next();\n currentGuppy.incrementAge();\n if (!currentGuppy.getIsAlive()) {\n deadGuppyCount++;\n }\n }\n return deadGuppyCount;\n }",
"int getBombsPlaced () {\n return bombsPlaced;\n }",
"public int hamming() {\n int wrong = 0;\n for (int row = 0; row < N; ++row) {\n for (int col = 0; col < N; ++col) {\n int goalValue = N * row + col + 1;\n if (tiles[row][col] != 0 && tiles[row][col] != goalValue) {\n wrong++;\n }\n }\n }\n\n return wrong;\n }",
"public int countBadLegs() {\n int badLegs = 0;\n\n for (int i = 0; i < locations(); i++) {\n badLegs += (locationIsLeg(i) && isLocationBad(i)) ? 1 : 0;\n }\n\n return badLegs;\n }",
"public int getInitBombPower() {\n \t\treturn 1;\n \t}",
"int getLegs();",
"int getFaintedPokemonCount();",
"public int getTotalminions() {\n\t\treturn totalminions;\n\t}",
"public int adjustForCrowding() {\n int deadGuppyCount = 0;\n\n Collections.sort(this.guppiesInPool, new Comparator<Guppy>() {\n @Override\n public int compare(Guppy g1, Guppy g2) {\n return Double.compare(g1.getHealthCoefficient(), g2.getHealthCoefficient());\n }\n });\n\n Guppy weakestGuppy;\n Iterator<Guppy> it = guppiesInPool.iterator();\n double volumeNeeded = this.getGuppyVolumeRequirementInLitres();\n\n while (it.hasNext() && volumeNeeded > this.getVolumeLitres()) {\n weakestGuppy = it.next();\n volumeNeeded -= (weakestGuppy.getVolumeNeeded() / ML_TO_L_CONVERSION);\n\n weakestGuppy.setIsAlive(false);\n\n\n deadGuppyCount++;\n\n }\n return deadGuppyCount;\n }",
"int getUserQuestJobsCount();",
"int getBattlesWon();",
"public void lastChanceGas()\n {\n System.out.print( \"Tank capacity: \" );\n int capacity = scan.nextInt();\n System.out.print( \"Gage reading: \" );\n int gage = scan.nextInt();\n System.out.print( \"Miles per gallon: \" );\n int mpg = scan.nextInt();\n double gasLeft = capacity * ( gage * 0.01 );\n double milesDriveable = gasLeft * mpg;\n if ( milesDriveable >= 200 )\n {\n System.out.println( \"Safe to Proceed!\" );\n }\n else\n {\n System.out.println( \"Get Gas!\" );\n }\n\n }",
"@Override\n\tpublic long countchitietdonhang() {\n\t\treturn chiTietDonHangRepository.countchitietdonhang();\n\t}",
"public int getBadgeCount()\n\t{\n\t\tint result = 0;\n\t\tfor(int i = 0; i < m_badges.length; i++)\n\t\t\tif(m_badges[i] == 1)\n\t\t\t\tresult++;\n\t\treturn result;\n\t}",
"public int getGunType() {\n return gunType_;\n }",
"public int GetPot_Count() {\n\t\treturn POT_COUNT;\n\t}",
"public int knightWithJugIn() {\n \n return knightsBefore.car();\n }",
"@java.lang.Override\n public int getBattlesLost() {\n return battlesLost_;\n }",
"public int getBottles() {\n return totalBottles;\n }",
"public int getGunType() {\n return gunType_;\n }",
"public int getKillCount(){\n return killCount;\n }",
"public int getMountainCount() {\n\t\tcounter = 0;\n\t\tfor (int row = 0; row < battlefield.length; row++) {\n\t\t\tfor (int column = 0; column < battlefield[row].length; column++) {\n\t\t\t\tif (battlefield[row][column].getTerrain().getIcon() == \"M\") {\n\t\t\t\t\tcounter++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn counter;\n\t}",
"public int incNummerOfMissing() {\n\t\t\treturn numberOfMissings++;\n\t\t}",
"public int getGuessesLeft() {\r\n return (guessesAllowed - numWrongGuesses);\r\n }",
"public static int GetMills() {\r\n return (int) System.currentTimeMillis() - StartUpTimeMS;\r\n }",
"private int neighborBombCount(Tile t) {\r\n int tileRow = t.getRow();\r\n int tileCol = t.getCol();\r\n int bombCount = 0;\r\n for (int r = tileRow - 1; r <= tileRow + 1; r++) {\r\n for (int c = tileCol - 1; c <= tileCol + 1; c++) {\r\n if (r >= 0 && r < gridSize && c >= 0 && c < gridSize) { \r\n if (grid[r][c].isBomb()) {\r\n bombCount++;\r\n } \r\n }\r\n }\r\n }\r\n return bombCount; \r\n }",
"public int getTotalGifts() {\r\n return totalGifts;\r\n }",
"public int applyNutrientCoefficient() {\n int deadGuppyCount = 0;\n\n Iterator<Guppy> it = guppiesInPool.iterator();\n while (it.hasNext()) {\n Guppy currentGuppy = it.next();\n\n randomNumberGenerator = new Random();\n double generatedDouble = randomNumberGenerator.nextDouble();\n\n if (generatedDouble > this.getNutrientCoefficient()) {\n currentGuppy.setIsAlive(false);\n deadGuppyCount++;\n }\n }\n return deadGuppyCount;\n }",
"public int verificarCantidadGanadores() {\n\t\t if(ganador.size() == 1 && !ganador.contains(\"dealer\")) {\n\t\t\t return 20;\n\t\t }else if(ganador.size() == 2 && !ganador.contains(\"dealer\")) {\n\t\t\t return 10;\n\t\t }else if(ganador.size() == 3 && !ganador.contains(\"dealer\")){\n\t\t\t return 0;\n\t\t }else if(ganador.size() == 1 && ganador.contains(\"dealer\")) {\n\t\t\t return 30;\n\t\t }\n\t\t return 0;\n\t }",
"@java.lang.Override\n public int getBattlesLost() {\n return battlesLost_;\n }",
"public int getNumCaught() {\r\n\t\tint count = 0;\r\n\t\tfor (int poke : caughtPokemon.values()) {\r\n\t\t\tcount += poke;\r\n\t\t}\r\n\t\treturn count;\r\n\t}",
"@Override\n public int getJumpMP(boolean gravity) {\n int jump = 0;\n\n if (hasShield() && (getNumberOfShields(MiscType.S_SHIELD_LARGE) > 0)) {\n return 0;\n }\n\n if (hasModularArmor()) {\n jump--;\n }\n\n for (Mounted mounted : getMisc()) {\n if (mounted.getType().hasFlag(MiscType.F_JUMP_JET) && !mounted.isDestroyed() && !mounted.isBreached()) {\n jump++;\n } else if (mounted.getType().hasFlag(MiscType.F_JUMP_BOOSTER) && !mounted.isDestroyed() && !mounted.isBreached()) {\n jump = getOriginalJumpMP();\n break;\n }\n }\n\n // apply Partial Wing bonus if we have the ability to jump\n if (jump > 0) {\n for (Mounted mount : getMisc()) {\n if (mount.getType().hasFlag(MiscType.F_PARTIAL_WING)) {\n jump += getPartialWingJumpBonus(mount);\n break;\n }\n }\n }\n\n if (gravity) {\n return applyGravityEffectsOnMP(jump);\n }\n return jump;\n }",
"public int getBaggage() {\n\t\treturn baggage;\n\t}",
"public int getBadCount() {\n return badCount;\n }",
"public int getLegs() {\n return legs;\n }",
"public void setJam(int jam){\n\t\tjamBelajar = jam;\n\t}",
"public int totalGemValue() {\r\n\t\ttotal = 0;\r\n\t\ttotal += gemPile[0];\r\n\t\ttotal += gemPile[1] * 2;\r\n\t\ttotal += gemPile[2] * 3;\r\n\t\ttotal += gemPile[3] * 4;\r\n\t\treturn total;\r\n\t}",
"public int hamming() \n {\n int hamming = 0; \n for (int i = 0; i < SIZE; i++)\n {\n if (i + 1 != (int) (blocks[i]) && (int) blocks[i] != 0) \n { \n hamming++;\n }\n }\n return hamming;\n }",
"public int getNumMissiles(){\n return this.nunMissiles;\n }",
"public int getTotalCollisions(){\r\n return totalCollisions;\r\n }",
"int getReservePokemonCount();",
"public static int getNumberOfGuppiesBorn() {\n return numberOfGuppiesBorn;\n }",
"public int mortgage() {\n\t\treturn 0;\n\t}",
"public int getNumOfLegs() {\n return numOfLegs;\n }",
"public int numberOfBoomerangs(int[][] points) {\n int re=0;\n \tfor(int i=0; i<points.length; i++){\n \t\tMap<Integer, Integer> map=new HashMap<Integer, Integer>();\n \t\tfor(int j=0; j<points.length; j++){\n \t\t\tint x=points[i][0]-points[j][0];\n \t\t\tint y=points[i][1]-points[j][1];\n \t\t\tint dis=x*x+y*y; \t\t\t\n \t\t\tmap.put(dis, map.getOrDefault(dis, 0)+1);\n \t\t}\n \t\t\n \t\tfor(Integer cnt: map.values()){\n \t\t\tif(cnt>=2){\n \t\t\t\tre+=cnt*(cnt-1);\n \t\t\t}\n \t\t}\n \t}\n \treturn re;\n }",
"public int getDamage () {\n\t\treturn (this.puissance + stuff.getDegat());\n\t}",
"private int countGrasses()//issues...see comment below in countTrees()\n {\n int grasses = 0;\n Field field = getField();\n Iterator<Location> it;\n List<Object> plantList = new List<>();\n while(it.hasNext()) {\n plantList.add(field.getObjectAt(currant));\n if(plant instanceof Grass) {\n grasses++;\n }\n }\n return grasses;\n }",
"public int bombRange() {\r\n return bombRange;\r\n }",
"public int getGoal() {\n\t\treturn this.map.getGoal();\n\t}",
"public int dropPotion() {\r\n\t\t// If the random number generated is larger than the \r\n\t\t// drop chance, at least one health potion is dropped\r\n\t\tif (rnd.nextInt(100) < HEALTH_POTION_DROP_CHANCE) {\r\n\t\t\treturn rnd.nextInt(MAX_NO_HEALTH_POTION_DROP) + 1;\r\n\t\t}\r\n\t\t// no health potions dropped\r\n\t\treturn 0;\r\n\t}",
"public int getAnthill() {\r\n\t\treturn this.anthill;\r\n\t}",
"protected long miss() {\n return numMisses.incrementAndGet();\n }",
"public int numberOfBoomerangs(int[][] points) {\n\n Map<Integer, Integer> map = new HashMap<>();\n int result = 0;\n for (int i = 0; i < points.length; i++){\n for(int j = 0; j < points.length; j++){\n if(j != i){\n int distance = calcSquareDistance(points[i],points[j]);\n map.put(distance, map.getOrDefault(distance,0) + 1);\n }\n }\n for(Integer val : map.values()){\n result += (val * (val-1));\n }\n map.clear();\n }\n return result;\n }",
"@Override\n public int getRemainingMines() {\n int numPlacedFlags = cells.stream()\n .mapToInt(b -> (int) b.stream().filter(c -> c.getFlagState() == 1).count()).sum();\n return numMines - numPlacedFlags;\n }",
"int getMinigameDefenseChancesLeft();",
"public double getLikelinessToGetKilled() {\n return likelinessToGetKilled;\n }",
"public int getDamage() {\n //TODO\n return 1;\n }",
"public int getWhiteMarblesCount()\r\n\t{\r\n\t\treturn whiteMarblesCount;\r\n\t}",
"int getMarbles(int remainingMarbles) ;",
"public int getBlackMarblesCount()\r\n\t{\r\n\t\treturn this.blackMarblesCount;\r\n\t}",
"int waterGun();",
"public int shoot()\n {\n if(availableAmmo > 0)\n {\n System.out.println(\"Pew Pew\");\n availableAmmo--; \n damageCaused = randomDamageGenerator.nextInt(450);\n return damageCaused;\n }\n else return -1;\n }",
"public boolean isJam() {\n boolean jam = false;\n if (sensor_door.getDistance(DistanceUnit.CM) < 100) {\n jam = true;\n RobotLog.vv(\"jam?\", \"TRUE\");\n }\n return jam;\n }",
"public int dropBalls(){\r\n if(balls>0){\r\n balls--;\r\n }\r\n return getBalls();\r\n }",
"long getMisses();",
"public short getBowDamage();",
"public int getHardHits(){\n\t\treturn hardhit;\n\t}",
"public int getGuesses() {\n\t\treturn this.guesses;\n\t}",
"public int getCollected() {\n return macguffinsCollected;\n }",
"public int getGoalTally(Player player){\r\n return player.getGoal();\r\n }",
"private int heavyAttack() {\n return attack(6, 2);\n }",
"public BangPlayer(long userId, int numTries, int numDeaths, int numJams) {\n super(userId);\n attempts = numTries;\n deaths = numDeaths;\n jams = numJams;\n }",
"public int getGamenumber() {\n\t\treturn this.gamenumber;\n\t}",
"BigInteger getTotalDifficulty();",
"public int hamming() {\n int c = 0;\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < n; j++) {\n int x = tiles[i][j];\n if (x == 0) continue;\n if (x != i*n + j + 1) c++;\n }\n }\n return c;\n }",
"public double getOriginalGravity() {\n\t\tdouble gravity = 0;\n\t\tfor (RecipeIngredient ri : m_ingredientList) {\n\t\t\tif (ri.getIngredient().getType() == Ingredient.Type.MALT) {\n\t\t\t\tMalt m = (Malt) ri.getIngredient();\n\t\t\t\tgravity += 1000 * (m.getGravity() - 1) * ri.getAmount();\n\t\t\t}\n\t\t}\n\t\treturn 1 + (gravity / m_batchSize) / 1000;\n\t}",
"@Override\n\tpublic int kyunggicount() throws Exception {\n\t\treturn dao.kyunggicount();\n\t}",
"public long numMisses() {\n return numMisses.longValue();\n }",
"public int[] get_nrBagsPerFlight() {\r\n return (bagsPerFlight_mess);\r\n }",
"public int getUpkeep() {\n return upkeep;\n }"
] | [
"0.63877285",
"0.6034218",
"0.6027851",
"0.6003246",
"0.59571207",
"0.5938666",
"0.58499736",
"0.5789362",
"0.5653386",
"0.5609455",
"0.55264807",
"0.5524934",
"0.55236083",
"0.55125934",
"0.5480633",
"0.54677314",
"0.5452324",
"0.5431374",
"0.54266834",
"0.5414355",
"0.5405255",
"0.54036087",
"0.5393048",
"0.53797",
"0.53051084",
"0.5303633",
"0.52981913",
"0.52906215",
"0.528278",
"0.5280385",
"0.5277761",
"0.52775717",
"0.52617896",
"0.525871",
"0.52356726",
"0.5230893",
"0.5217645",
"0.5213717",
"0.52050555",
"0.51967156",
"0.51881266",
"0.51864886",
"0.51824737",
"0.517713",
"0.51735294",
"0.5169151",
"0.51681733",
"0.51671785",
"0.5166868",
"0.5165998",
"0.5165171",
"0.51614726",
"0.51603115",
"0.5158891",
"0.51577425",
"0.5155369",
"0.51442254",
"0.5139281",
"0.51367223",
"0.5135812",
"0.5122485",
"0.51183534",
"0.5112083",
"0.51097995",
"0.51095855",
"0.5109395",
"0.5107432",
"0.5089801",
"0.5082905",
"0.5079823",
"0.5068947",
"0.50658506",
"0.5065112",
"0.5061617",
"0.50614434",
"0.505608",
"0.5044693",
"0.50438356",
"0.50384134",
"0.5035212",
"0.5032195",
"0.5023706",
"0.50205994",
"0.50186765",
"0.5018046",
"0.5013679",
"0.5011218",
"0.5006486",
"0.50051135",
"0.50036424",
"0.49994895",
"0.49980536",
"0.49956158",
"0.4991741",
"0.49816704",
"0.4974903",
"0.4973956",
"0.49713942",
"0.4971196",
"0.4964347",
"0.496304"
] | 0.0 | -1 |
Returns the Bang survival rate of the user. | public double getSurvivalRate() {
return 100 - (Math.round((double) deaths / (double) attempts * 100d));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private int getEnemyGunFireRate()\n\t{\n\t\tfloat rate = 115 - (GameState._playerScore * .2f);\n\t\tif (rate < 20)\n\t\t{\n\t\t\trate = 20;\n\t\t}\n\t\treturn (int)rate;\n\t}",
"public double getStaySuccessRate() {\n if (total_stayed == 0)\n return 0;\n return (double) won_stayed / total_stayed * 100;\n }",
"float getBounceRate() throws SQLException;",
"public Double getBounceRate() {\r\n return bounceRate;\r\n }",
"public static double getBasalMetabolicRate(User user) {\n double BMR;\n\n double age = (double) user.getAge();\n double height = user.getHeight();\n double weight = user.getWeight();\n\n if (user.isMale()) {\n BMR = (13.397 * weight) + (4.799 * height) + (5.677 * age) + 88.362;\n } else {\n BMR = (9.247 * weight) + (3.098 * height) + (4.33 * age) + 447.593;\n }\n return BMR;\n }",
"int getMortgageRate();",
"float getVacationAccrualRate();",
"double getRate();",
"double getDeathFactor();",
"public double averageChirpsPerUser() {\n\t\tcheckAuthority();\n\t\ttry {\n\t\t\treturn this.administratorRepository.averageChirpsPerUser();\n\t\t} catch (Exception e) {\n\t\t\treturn 0.;\n\t\t}\n\t}",
"@Override\n\tpublic int getGrowingAge() {\n\t\t// adapter for vanilla code to enable breeding interaction\n\t\treturn isAdult() ? 0 : -1;\n\t}",
"public static double valueOfRush(int attack) {\n return valueOfMinionDamage(attack) * 0.5;\n }",
"public int maximum_heart_rate() {\r\n return (220 - age());\r\n }",
"public float getHungerDamage();",
"public float getBatt() {\n return batt_;\n }",
"public float getBatt() {\n return batt_;\n }",
"@Override\n\tpublic double calRate() {\n\t\treturn 0.9f;\n\t}",
"float getBlackoutPeriod();",
"public Byte getUserAge() {\r\n return userAge;\r\n }",
"protected int get_breeding_age()\n {\n return breeding_age;\n }",
"float getBonusPercentHP();",
"public abstract double getPercentDead();",
"@Override\n\tpublic float calculateRunRate() {\n\t\tint remaingrun=Math.abs((super.getTarget()-super.getCurrentscore()));\n\t\tfloat remaingOver=50-super.getCurrentover();\n\t\treturn remaingrun/remaingOver;\n\t}",
"@Override\n\tpublic float calculateRunRate() {\n\t\tint remaingrun=Math.abs((super.getTarget()-super.getCurrentscore()));\n\t\tfloat remaingOver=20-super.getCurrentover();\n\t\treturn remaingrun/remaingOver;\n\t}",
"public int getRespawnRate() {\r\n return respawnRate;\r\n }",
"@Override\n\tpublic float calculateRunRate() {\n\t\tint remaingrun=Math.abs((super.getTarget()-super.getCurrentscore()));\n\t\tfloat remaingOver=30-super.getCurrentover();\n\t\treturn remaingrun/remaingOver;\n\t}",
"abstract public double getBegBal(int yr);",
"public Money getLuggage() {\n\t\treturn luggage;\n\t}",
"int getHeartRate();",
"float getBonusExp();",
"@Override\n\tpublic double attack() {\n\t\treturn 12.5;\n\t}",
"private static int chargeRate(Thing b, Thing s) {\n \t\tint rate=b.getStat(\"WP\");\r\n \t\t\r\n \t\t// bonus for appropraite recharge skill\r\n \t\trate=rate*(1+b.getStat(rechargeSkill(s)));\r\n \t\t\r\n \t\t// spell specific charge rate\r\n \t\t// default is 100\r\n \t\trate=(rate*s.getStat(\"ChargeRate\"));\r\n \t\t\r\n \t\t// more costly spells take longer to recharge\r\n \t\trate=rate/s.getStat(\"SpellCost\");\r\n \t\t\r\n \t\tif (rate<=0) {\r\n \t\t\tGame.warn(\"Spell.chargeRate(...)==0 for \"+s.name());\r\n \t\t}\r\n \t\t\r\n \t\treturn rate;\r\n \t}",
"@Override\n\tpublic double getRate() {\n\t\treturn 7;\n\t}",
"public int getBaggage() {\n\t\treturn baggage;\n\t}",
"public int getHeartRate() {\n if (extraCase_ == 5) {\n return (Integer) extra_;\n }\n return 0;\n }",
"@Override\n public int viability() {\n int[] newStats = getNewStats();\n return newStats[0] * newStats[1];\n }",
"public static void bullyAttack(){\n int punch = player.getHealth() - bullyHitPoints ;\n player.setHealth(punch);\n //Step 2: Conditional dialogue\n if(bullyHitPoints > 50) {\n System.out.println(textparser.getMassiveDamage() + bullyHitPoints + textparser.getToYou());\n }else if(bullyHitPoints > 25){\n System.out.println(textparser.getPunch() + bullyHitPoints + textparser.getToYou());\n }else{\n System.out.println(textparser.getDidntHurtMuch() + bullyHitPoints + textparser.getToYou());\n }\n }",
"public static double calculateGross(double hours, double rate)\t// static \"double\"(return type) ~\n\t{\n\t\tdouble gross;\n\t\tgross = hours * rate;\n\t\tSystem.out.println(hours + \" hours at $\" + rate + \" per hour is $\" + gross);\n\t\treturn gross;\t// The value that is returned.\n\t}",
"public double getBust() {\n return bust;\n }",
"int getHPPerSecond();",
"public Float getBonusRepurchase() {\n return bonusRepurchase;\n }",
"@Override\r\n\tpublic final int getSaludBonus() {\r\n\t\treturn BONUSSALUD;\r\n\t}",
"public int getHeartRate() {\n if (extraCase_ == 5) {\n return (Integer) extra_;\n }\n return 0;\n }",
"public double getRating(){\n\t\treturn this.user_rating;\n\t}",
"public int getGrowthTime(){\n return this.growthTime;\n }",
"public Float rumusBMI(float t, float b){\n return b/((t/100)*(t/100));\n }",
"protected abstract float _getGrowthChance();",
"Map<Date, Float> getFullBounceRate(Step step) throws SQLException;",
"private long calculateAvaregeRating(long curentUserRating) {\n long totalStars = 0;\n for (int x = 1; x < 6; x++) {\n totalStars = totalStars + ((long) documentSnapshot.get(x + \"_star\")) * x;\n }\n totalStars = totalStars + curentUserRating;\n return totalStars / ((long) documentSnapshot.get(\"total_rating\") + 1);\n }",
"@Override\n public UserFraudScore getAggregatedFraudScore(NewUserRequest newUserRequest) {\n return fraudChecks.stream()\n .map(fraudCheck -> fraudCheck.getFraudScore(newUserRequest))\n .reduce((a, b) -> { return UserFraudScore.getHighest(a, b); })\n .get();\n }",
"public double getBonusAwarded() {\n return bonusAwarded;\n }",
"protected double get_breeding_probability()\n {\n return breeding_probability;\n }",
"public double getCredits(User user) throws Exception;",
"public double getRise(\n )\n {return rise;}",
"public Integer getRate() {\r\n return rate;\r\n }",
"@Override\n public boolean gainBerryEffect(Battle b, ActivePokemon user, CastSource source) {\n List<Stat> stats = user.getStages().getNonMaxStats();\n\n // You probably don't need the berry at this point anyhow...\n if (stats.isEmpty()) {\n return false;\n }\n\n // Sharply raise random battle stat\n Stat stat = RandomUtils.getRandomValue(stats);\n return new StageModifier(2*ripen(user), stat).modify(b, user, user, source);\n }",
"public float getRate(){\r\n return rate;\r\n }",
"public int getRate() {\n return rate_;\n }",
"public BigDecimal getBackPaidRate() {\n return backPaidRate;\n }",
"public int getSessionExpireRate();",
"public double getGrossWage(){\r\n\t return (salary + addings);\r\n }",
"public double getReputation() {\n return reputation;\n }",
"public void lastChanceGas()\n {\n System.out.print( \"Tank capacity: \" );\n int capacity = scan.nextInt();\n System.out.print( \"Gage reading: \" );\n int gage = scan.nextInt();\n System.out.print( \"Miles per gallon: \" );\n int mpg = scan.nextInt();\n double gasLeft = capacity * ( gage * 0.01 );\n double milesDriveable = gasLeft * mpg;\n if ( milesDriveable >= 200 )\n {\n System.out.println( \"Safe to Proceed!\" );\n }\n else\n {\n System.out.println( \"Get Gas!\" );\n }\n\n }",
"@Query(\"select (select count(u) from User u where u.chirps.size *1.0 > (select avg(u.chirps.size)*1.75 from User u))*1.0/count(u) from User u\")\n\tDouble usersAboveAvgChirps();",
"public int attack()\n {\n int percent = Randomizer.nextInt(100) + 1;\n int baseDamage = super.attack();\n if(percent <= 5)\n {\n baseDamage *= 2;\n baseDamage += 50;\n }\n return baseDamage;\n }",
"float getSteamSupplyRating2();",
"public int getChargeRate();",
"public void updateDuration(User user);",
"public float getCountRate() {\n return countMonitor.getRate();\n }",
"static double SigmoidDistributionChance(Rocket rocket, double riskAtFullCapacity, double beta) {\n double proba = 1 / (1 + Math.pow(riskAtFullCapacity / (1-riskAtFullCapacity), -beta));\n return riskAtFullCapacity / 100.0 * proba;\n }",
"public float getFrecencyBoost(long now) {\r\n float result = adjustFrecencyBoost(storedFrecencyBoost, lastVisitTime, now);\r\n result = (float)Math.min(result, MAX_FRECENCY_BOOST);\r\n return result;\r\n }",
"public int getRate() {\n return rate_;\n }",
"public int getRegularHourlyWage() {\n return regularHourlyWage;\n }",
"public static double valueOfRush(Card c) {\n return valueOfRush(c.finalStats.get(Stat.ATTACK));\n }",
"public double getRate() {\n return rate;\n }",
"public double getRate() {\n return rate;\n }",
"public double getRate() {\r\n\t\treturn (getRate(0)+getRate(1))/2.0;\r\n\t}",
"public double pay(){\n\t\treturn payRate;\n\t}",
"Float attack();",
"public int getSessionCreateRate();",
"float getVacationAccrued();",
"@Override\n\tpublic double getBalanta() {\n\t\treturn this.balanta;\n\t}",
"boolean refillUserAccount(User user, double delta);",
"public boolean checkiFRated(int newRate){\r\n\r\n\t\t//! ask the server if the user already voted this\r\n\t\treturn(FLAG_RATED);\r\n\t}",
"public BigDecimal getFagentgathrate() {\n return fagentgathrate;\n }",
"@ApiModelProperty(value = \"The amount of surcharge money refunded. This amount is always negative.\")\n public V1Money getRefundedSurchargeMoney() {\n return refundedSurchargeMoney;\n }",
"public BigDecimal getTotalGprs() {\r\n return totalGprs;\r\n }",
"public Double throttleRate() {\n return this.throttleRate;\n }",
"public double get50PlusFieldGoals()\r\n {\r\n return fg_50_plus;\r\n }",
"public double getRate() {\n\t\treturn rate;\n\t}",
"public float getUserRatingScore() {\n float scorePercent = Float.valueOf(userRating) * 10;\n\n return ((5 * scorePercent) / 100);\n }",
"private static float getBonus(LivingEntity living, int level) {\n // 25% boost per level at max\n int effectLevel = TinkerModifiers.momentumEffect.get().getLevel(living) + 1;\n return level * effectLevel / 128f;\n }",
"int getBonusExp();",
"int getBonusExp();",
"public double getDropChance() {\n return _dropChance;\n }",
"public int getDamageTaken() {\n return this.damageTaken;\n }",
"public double getGrt() {\n\t\treturn _tempNoTiceShipMessage.getGrt();\n\t}",
"public int uploadingProgressBarGetRate() {\n return uploadingProgressBar.getProgress();\n }",
"public double getSwitchSuccessRate() {\n if (total_switched == 0)\n return 0;\n return (double) won_switched / total_switched * 100;\n }",
"public double ratioUsersMorePosted75ChirpsOfAveragePerUser() {\n\t\tcheckAuthority();\n\t\ttry {\n\t\t\treturn this.administratorRepository\n\t\t\t\t\t.ratioUsersMorePosted75ChirpsOfAveragePerUser();\n\t\t} catch (Exception e) {\n\t\t\treturn 0.;\n\t\t}\n\t}"
] | [
"0.62743145",
"0.5989727",
"0.59682417",
"0.59251046",
"0.5810568",
"0.56113666",
"0.551745",
"0.5461067",
"0.5416179",
"0.5377624",
"0.53062284",
"0.53024787",
"0.5293829",
"0.52660614",
"0.5258487",
"0.5255664",
"0.525033",
"0.5247273",
"0.5245078",
"0.5243867",
"0.5223618",
"0.52186716",
"0.52070326",
"0.51866144",
"0.51829714",
"0.5180839",
"0.51784205",
"0.5176612",
"0.5158508",
"0.5146241",
"0.51427025",
"0.51163447",
"0.5112561",
"0.51022065",
"0.5075462",
"0.50617266",
"0.5052859",
"0.5052634",
"0.5049522",
"0.5044693",
"0.5034036",
"0.5025628",
"0.5023213",
"0.50131017",
"0.5010382",
"0.5006003",
"0.5004136",
"0.4994558",
"0.49929404",
"0.49839157",
"0.49807504",
"0.4978292",
"0.49752873",
"0.49601108",
"0.49578205",
"0.4956043",
"0.49535498",
"0.49532232",
"0.49527118",
"0.49526107",
"0.49505478",
"0.49473938",
"0.4947351",
"0.49436784",
"0.4941064",
"0.49409172",
"0.49375704",
"0.49368006",
"0.49324042",
"0.49312067",
"0.49278128",
"0.49237645",
"0.49232534",
"0.49220258",
"0.4918642",
"0.4918642",
"0.49117956",
"0.49067286",
"0.4905608",
"0.4905212",
"0.49030408",
"0.49016616",
"0.49016446",
"0.4899714",
"0.48938325",
"0.48934528",
"0.48899627",
"0.48861092",
"0.48756078",
"0.48712978",
"0.48693115",
"0.48657906",
"0.48553452",
"0.48553452",
"0.48495767",
"0.48463607",
"0.48454955",
"0.4844001",
"0.48426437",
"0.4842441"
] | 0.7351278 | 0 |
Test of shortestPathEstacoes method, of class GraphAlgorithms. | @Test
public void testShortestPathEstacoes() {
completeMap = new Graph(false);
incompleteMap = new Graph(false);
completeMap.insertVertex(porto);
Company.getParkRegistry().getParkMap().put(porto, portoL);
completeMap.insertVertex(braga);
Company.getParkRegistry().getParkMap().put(braga, bragaL);
completeMap.insertVertex(vila);
Company.getParkRegistry().getParkMap().put(vila, vilaL);
completeMap.insertVertex(aveiro);
Company.getParkRegistry().getParkMap().put(aveiro, aveiroL);
completeMap.insertVertex(coimbra);
Company.getParkRegistry().getParkMap().put(coimbra, coimbraL);
completeMap.insertVertex(leiria);
Company.getParkRegistry().getParkMap().put(leiria, leiriaL);
completeMap.insertVertex(viseu);
Company.getParkRegistry().getParkMap().put(viseu, viseuL);
completeMap.insertVertex(guarda);
Company.getParkRegistry().getParkMap().put(guarda, guardaL);
completeMap.insertVertex(castelo);
Company.getParkRegistry().getParkMap().put(castelo, casteloL);
completeMap.insertVertex(lisboa);
Company.getParkRegistry().getParkMap().put(lisboa, lisboaL);
completeMap.insertVertex(faro);
Company.getParkRegistry().getParkMap().put(faro, faroL);
completeMap.insertEdge(porto, aveiro, c, 75);
completeMap.insertEdge(porto, braga, c2, 60);
completeMap.insertEdge(porto, vila, c3, 100);
completeMap.insertEdge(viseu, guarda, c4, 75);
completeMap.insertEdge(guarda, castelo, c5, 100);
completeMap.insertEdge(aveiro, coimbra, c6, 60);
completeMap.insertEdge(coimbra, lisboa, c7, 200);
completeMap.insertEdge(coimbra, leiria, c8, 80);
completeMap.insertEdge(aveiro, leiria, c9, 120);
completeMap.insertEdge(leiria, lisboa, c10, 150);
completeMap.insertEdge(aveiro, viseu, c11, 85);
completeMap.insertEdge(leiria, castelo, c12, 170);
completeMap.insertEdge(lisboa, faro, c13, 280);
incompleteMap = completeMap.clone();
incompleteMap.removeEdge(aveiro, viseu);
incompleteMap.removeEdge(leiria, castelo);
incompleteMap.removeEdge(lisboa, faro);
System.out.println("Test of shortest path");
LinkedList<String> shortPath = new LinkedList<>();
double lenpath = 0;
Company.getParkRegistry().setGraph(completeMap);
lenpath = GraphAlgorithms.shortestPathEnergySpent(completeMap, porto, l, shortPath);
assertTrue("Length path should be 0 if vertex does not exist", lenpath == 0);
Company.getParkRegistry().setGraph(incompleteMap);
lenpath = GraphAlgorithms.shortestPathEnergySpent(incompleteMap, porto, faro, shortPath);
assertTrue("Length path should be 0 if there is no path", lenpath == 0);
Company.getParkRegistry().setGraph(completeMap);
lenpath = GraphAlgorithms.shortestPath(completeMap, porto, porto, shortPath);
assertTrue("Number of nodes should be 1 if source and vertex are the same", lenpath == 0);
Company.getParkRegistry().setGraph(incompleteMap);
lenpath = GraphAlgorithms.shortestPath(incompleteMap, porto, lisboa, shortPath);
assertTrue("Path between Porto and Lisboa should be 335 Km", lenpath == 335);
Iterator<String> it = shortPath.iterator();
assertTrue("First in path should be Porto", it.next().equals(porto));
assertTrue("then Aveiro", it.next().equals(aveiro));
assertTrue("then Coimbra", it.next().equals(coimbra));
assertTrue("then Lisboa", it.next().equals(lisboa));
completeMap.insertEdge(porto, lisboa, c, 10);
Company.getParkRegistry().setGraph(incompleteMap);
lenpath = GraphAlgorithms.shortestPathEnergySpent(incompleteMap, braga, leiria, shortPath);
assertEquals("Path between Braga and Leiria should be close to 152.89", lenpath, 152, 1);
it = shortPath.iterator();
assertTrue("First in path should be Braga", it.next().equals(braga));
assertTrue("then Porto", it.next().equals(porto));
assertTrue("then Aveiro", it.next().equals(aveiro));
assertTrue("then Coimbra", it.next().equals(coimbra));
assertTrue("then Leiria", it.next().equals(leiria));
shortPath.clear();
Company.getParkRegistry().setGraph(completeMap);
lenpath = GraphAlgorithms.shortestPathEnergySpent(completeMap, porto, castelo, shortPath);
assertEquals("Path between Porto and Castelo Branco should be close to 202.86", lenpath, 202, 1);
assertTrue("N. cities between Porto and Castelo Branco should be 5 ", shortPath.size() == 5);
it = shortPath.iterator();
assertTrue("First in path should be Porto", it.next().equals(porto));
assertTrue("then Aveiro", it.next().equals(aveiro));
assertTrue("then Viseu", it.next().equals(viseu));
assertTrue("then Viseu", it.next().equals(guarda));
assertTrue("then Castelo Branco", it.next().equals(castelo));
//Changing Edge: aveiro-viseu with Edge: leiria-C.Branco
//should change shortest path between porto and castelo Branco
completeMap.removeEdge(aveiro, viseu);
completeMap.insertEdge(leiria, castelo, c12, 170);
shortPath.clear();
Company.getParkRegistry().setGraph(completeMap);
lenpath = GraphAlgorithms.shortestPath(completeMap, porto, castelo, shortPath);
assertTrue("Path between Porto and Castelo Branco should now be 330 Km", lenpath == 330);
assertTrue("Path between Porto and Castelo Branco should be 4 cities", shortPath.size() == 4);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test public void testPublic14() {\n Graph<String> graph= TestGraphs.testGraph2();\n List<String> shortestPath= new ArrayList<String>();\n\n assertEquals(1, graph.Dijkstra(\"apple\", \"banana\", shortestPath));\n assertEquals(\"apple banana\", TestGraphs.listToString(shortestPath));\n\n assertEquals(2, graph.Dijkstra(\"apple\", \"cherry\", shortestPath));\n assertEquals(\"apple banana cherry\",\n TestGraphs.listToString(shortestPath));\n\n assertEquals(3, graph.Dijkstra(\"apple\", \"date\", shortestPath));\n assertEquals(\"apple banana cherry date\",\n TestGraphs.listToString(shortestPath));\n\n assertEquals(4, graph.Dijkstra(\"apple\", \"elderberry\", shortestPath));\n assertEquals(\"apple banana cherry date elderberry\",\n TestGraphs.listToString(shortestPath));\n\n assertEquals(5, graph.Dijkstra(\"apple\", \"fig\", shortestPath));\n assertEquals(\"apple banana cherry date elderberry fig\",\n TestGraphs.listToString(shortestPath));\n\n assertEquals(6, graph.Dijkstra(\"apple\", \"guava\", shortestPath));\n assertEquals(\"apple banana cherry date elderberry fig guava\",\n TestGraphs.listToString(shortestPath));\n }",
"@Test\n void testShortestPath(){\n weighted_graph g = new WGraph_DS();\n for(int i = 1; i <= 7; i++){\n g.addNode(i);\n }\n g.connect(1,2,20);\n g.connect(1,5,15);\n g.connect(2,3,20);\n g.connect(5,6,15);\n g.connect(3,4,20);\n g.connect(6,4,15);\n g.connect(1,7,2);\n g.connect(7,4,1);\n weighted_graph_algorithms ga = new WGraph_Algo();\n ga.init(g);\n LinkedList<node_info> expectedPath = new LinkedList<>(Arrays.asList(g.getNode(1),g.getNode(7),g.getNode(4)));\n assertNull(ga.shortestPath(1,10));\n assertEquals(expectedPath,ga.shortestPath(1,4));\n assertEquals(1,ga.shortestPath(1,1).size());\n }",
"@Test\n void shortestPath() {\n directed_weighted_graph g0 = new DW_GraphDS();\n dw_graph_algorithms ag0 = new DWGraph_Algo();\n node_data n0 = new NodeData(0);\n node_data n1 = new NodeData(1);\n node_data n2 = new NodeData(2);\n node_data n3 = new NodeData(3);\n g0.addNode(n1);\n g0.addNode(n2);\n g0.addNode(n3);\n g0.connect(1, 2, 5);\n g0.connect(2, 3, 3);\n g0.connect(1, 3, 15);\n g0.connect(3, 2, 1);\n ag0.init(g0);\n\n List<node_data> list0 = ag0.shortestPath(1, 1); //should go from 1 -> 1\n int[] list0Test = {1, 1};\n int i = 0;\n for (node_data n : list0) {\n\n assertEquals(n.getKey(), list0Test[i]);\n i++;\n }\n\n List<node_data> list1 = ag0.shortestPath(1, 2); //should go 1 -> 2\n int[] list1Test = {1, 2};\n i = 0;\n for (node_data n : list1) {\n\n assertEquals(n.getKey(), list1Test[i]);\n i++;\n }\n g0.connect(1, 3, 2);\n List<node_data> list2 = ag0.shortestPath(1, 2); //should go 1 -> 3 -> 2\n int[] list2Test = {1, 3, 2};\n i = 0;\n for (node_data n : list2) {\n\n assertEquals(n.getKey(), list2Test[i]);\n i++;\n }\n\n g0.connect(1, 3, 10);\n List<node_data> list3 = ag0.shortestPath(1,3);\n int[] list3Test = {1, 2, 3};\n i = 0;\n for(node_data n: list3) {\n\n assertEquals(n.getKey(), list3Test[i]);\n i++;\n }\n/*\n\n List<node_data> list4 = ag0.shortestPath(1,4);\n int[] list4Test = {1, 4};\n i = 0;\n for(node_data n: list4) {\n\n assertEquals(n.getKey(), list4Test[i]);\n i++;\n }\n\n List<node_data> list5 = ag0.shortestPath(4,1);\n int[] list5Test = {4, 1};\n i = 0;\n for(node_data n: list5) {\n\n assertEquals(n.getKey(), list5Test[i]);\n i++;\n }\n*/\n }",
"@Test\n void testShortestPathDist(){\n weighted_graph g = new WGraph_DS();\n for(int i = 1; i <= 7; i++){\n g.addNode(i);\n }\n g.connect(1,2,20);\n g.connect(1,5,15);\n g.connect(2,3,20);\n g.connect(5,6,15);\n g.connect(3,4,20);\n g.connect(6,4,15);\n g.connect(1,7,2);\n g.connect(7,4,50);\n weighted_graph_algorithms ga = new WGraph_Algo();\n ga.init(g);\n assertTrue(Double.compare(45,ga.shortestPathDist(1,4)) == 0);\n assertEquals(0,ga.shortestPathDist(1,1));\n assertEquals(-1,ga.shortestPathDist(1,200));\n }",
"@Test\n public void testDijkstra() throws Exception {\n String graphFileName = \"algorithm/graph/shortestpath/weighted/weightedGraph.txt\";\n Graph graph = Graph.createGraphFromFile(WeightedShortestPath.class.getResource(\"/\").getPath() + File.separator +\n graphFileName);\n\n System.out.println(\"==============Graph before weighted shortest path found==============\");\n graph.printGraph();\n\n WeightedShortestPath.dijkstra(graph, graph.getVertex(\"v1\"));\n System.out.println(\"======Graph after weighted shortest path found by Dijkstra's algorithm=====\");\n graph.printGraph();\n\n System.out.println(\"===================Print the path to each vertex====================\");\n for (Vertex v: graph.getVertexMap().values()) {\n graph.printPath(v);\n System.out.println();\n }\n System.out.println();\n }",
"@Test\n public void testGetShortestPath02() {\n System.out.println(\"getShortestPath\");\n User userA = null;\n for (User user1 : sn10.getUsersList()) {\n if (user1.getNickname().equals(\"nick0\")) {\n userA = user1;\n }\n }\n User userB = null;\n for (User user1 : sn10.getUsersList()) {\n if (user1.getNickname().equals(\"nick7\")) {\n userB = user1;\n }\n }\n LinkedList<City> shortestPathCities = new LinkedList();\n Double expResult = 76.0;\n Double result = sn10.getShortestPath(userA, userB, shortestPathCities);\n assertFalse(expResult.intValue() == result.intValue());\n }",
"@Test\n public void testGetShortestPath01() {\n System.out.println(\"getShortestPath\");\n User userA = null;\n for (User user1 : sn10.getUsersList()) {\n if (user1.getNickname().equals(\"nick0\")) {\n userA = user1;\n }\n }\n User userB = null;\n for (User user1 : sn10.getUsersList()) {\n if (user1.getNickname().equals(\"nick7\")) {\n userB = user1;\n }\n }\n LinkedList<City> shortestPathCities = new LinkedList();\n Double expResult = 66.0;\n Double result = sn10.getShortestPath(userA, userB, shortestPathCities);\n assertEquals(expResult, result, 0.1);\n }",
"@Test public void testPublic15() {\n Graph<Character> graph= TestGraphs.testGraph3();\n List<Character> shortestPath= new ArrayList<Character>();\n\n assertEquals(1, graph.Dijkstra('A', 'O', shortestPath));\n assertEquals(\"A O\", TestGraphs.listToString(shortestPath));\n\n assertEquals(4, graph.Dijkstra('M', 'F', shortestPath));\n assertEquals(\"M N P D F\", TestGraphs.listToString(shortestPath));\n }",
"@Test\n public void testShortestDistance() {\n Vertex v1 = new Vertex(1, \"A\");\n Vertex v2 = new Vertex(2, \"B\");\n Vertex v3 = new Vertex(3, \"C\");\n\n Edge<Vertex> e1 = new Edge<>(v1, v2, 1);\n Edge<Vertex> e2 = new Edge<>(v2, v3, 3);\n Edge<Vertex> e3 = new Edge<>(v1, v3, 2);\n\n Graph<Vertex, Edge<Vertex>> g = new Graph<>();\n g.addVertex(v1);\n g.addVertex(v2);\n g.addVertex(v3);\n g.addEdge(e1);\n g.addEdge(e2);\n g.addEdge(e3);\n\n List<Vertex> expectedPath = new ArrayList<>();\n expectedPath.add(v1);\n expectedPath.add(v3);\n assertEquals(expectedPath, g.shortestPath(v1, v3));\n\n assertEquals(6, g.edgeLengthSum());\n }",
"public void testaGraph() {\n\t\tEstacaoDAO a = new EstacaoDAO();\n\t\ta.carregarEstacoes();\n\t\tLinha b = new Linha(\"a\");\n\t\tb.loadAllStations(a);\n\t\tb.shortestPath(a,\"Curado\",\"Recife\");\n\t}",
"@Test public void testPublic17() {\n Graph<Integer> graph= TestGraphs.testGraph5();\n List<Integer> shortestPath= new ArrayList<Integer>();\n\n assertEquals(8, graph.Dijkstra(131, 141, shortestPath));\n assertEquals(\"131 330 132 141\", TestGraphs.listToString(shortestPath));\n }",
"public int doDijkstras(String startVertex, String endVertex, ArrayList<String> shortestPath)\r\n\t{\r\n\t\tif(!this.dataMap.containsKey(startVertex) || !this.dataMap.containsKey(endVertex))\r\n\t\t{\r\n\t\t\tthrow new IllegalArgumentException(\"Vertex does not exist in the graph!\");\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tSet<String> visited = new HashSet<String>();\r\n\t\t\r\n\t\tPriorityQueue<Vertex> minDist = new PriorityQueue<Vertex>();\r\n\t\t\r\n\t\tVertex firstV = new Vertex(startVertex,startVertex,0);\r\n\t\tminDist.add(firstV);\r\n\t\t\r\n\t\tfor(String V : this.adjacencyMap.get(startVertex).keySet())\r\n\t\t{\r\n\t\t\tminDist.add(new Vertex(V,startVertex,this.getCost(startVertex, V)));\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t//map of vertexName --> VertexObject\r\n\t\tHashMap<String, Vertex> mapV = new HashMap<String,Vertex>();\r\n\t\tmapV.put(startVertex, firstV);\t\r\n\t\t\r\n\t\t/*\r\n\t\t * Init keys-->costs\r\n\t\t */\r\n\t\tfor(String key : this.getVertices())\r\n\t\t{\r\n\t\t\tif(key.equals(startVertex))\r\n\t\t\t{\r\n\t\t\t\tmapV.put(key, new Vertex(key,null,0));\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tmapV.put(key, new Vertex(key,null,Integer.MAX_VALUE));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\r\n\t\t/*\r\n\t\t * Init List for shortest path\r\n\t\t */\r\n\t\tLinkedList<String> list = new LinkedList<String>();\r\n\t\tlist.add(startVertex);\r\n\r\n\t\tHashMap<String,List<String>> path = new HashMap<String,List<String>>();\r\n\t\tpath.put(startVertex, list);\r\n\t\t\r\n\t\twhile(!minDist.isEmpty())\r\n\t\t{\r\n\t\t\tVertex node = minDist.poll();\r\n\t\t\tString V = node.current;\r\n\t\t\tint minimum = node.cost;\r\n\t\t\tSystem.out.println(minDist.toString());\r\n\t\t\t\r\n\t\t\t\tvisited.add(V);\r\n\t\t\t\t\r\n\t\t\t\tTreeSet<String> adj = new TreeSet<String>(this.adjacencyMap.get(V).keySet());\r\n\t\t\t\t\r\n\t\t\t\tfor(String successor : adj)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(!visited.contains(successor) && !V.equals(successor))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\tint newCost = this.getCost(V, successor)+minimum;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(newCost < mapV.get(successor).cost)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tminDist.remove(mapV.get(successor));\r\n\t\t\t\t\t\t\t\tminDist.add(new Vertex(successor,V,newCost));\r\n\t\t\t\t\t\t\t\tmapV.put(successor, new Vertex(successor,V,newCost));\r\n\r\n\t\t\t\t\t\t\t\tLinkedList<String> newList = new LinkedList<String>(path.get(V));\r\n\t\t\t\t\t\t\t\tnewList.add(successor);\r\n\t\t\t\t\t\t\t\tpath.put(successor, newList);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tint smallestPath = mapV.get(endVertex).cost == Integer.MAX_VALUE ? -1 : mapV.get(endVertex).cost;\r\n\t\t\r\n\t\tif(smallestPath == -1)\r\n\t\t{\r\n\t\t\tshortestPath.add(\"None\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tfor(String node : path.get(endVertex))\r\n\t\t\t{\r\n\t\t\t\tshortestPath.add(node);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn smallestPath;\r\n\t}",
"@Test public void testPublic16() {\n Graph<Integer> graph= TestGraphs.testGraph5();\n List<Integer> shortestPath= new ArrayList<Integer>();\n\n assertEquals(5, graph.Dijkstra(131, 351, shortestPath));\n assertEquals(\"131 330 351\", TestGraphs.listToString(shortestPath));\n }",
"@Test public void testPublic18() {\n Graph<Integer> graph= TestGraphs.testGraph5();\n List<Integer> shortestPath= new ArrayList<Integer>();\n\n assertEquals(13, graph.Dijkstra(250, 141, shortestPath));\n assertEquals(\"250 351 132 141\", TestGraphs.listToString(shortestPath));\n }",
"@Test\n public void simpleGraph() {\n graph.edge(0, 1).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(1, 2).setDistance(1).set(speedEnc, 10, 10);\n\n // source edge does not exist -> no path\n assertNotFound(calcPath(0, 2, 5, 0));\n // target edge does not exist -> no path\n assertNotFound(calcPath(0, 2, 0, 5));\n // using NO_EDGE -> no path\n assertNotFound(calcPath(0, 2, NO_EDGE, 0));\n assertNotFound(calcPath(0, 2, 0, NO_EDGE));\n // using ANY_EDGE -> no restriction\n assertPath(calcPath(0, 2, ANY_EDGE, 1), 0.2, 2, 200, nodes(0, 1, 2));\n assertPath(calcPath(0, 2, 0, ANY_EDGE), 0.2, 2, 200, nodes(0, 1, 2));\n // edges exist -> they are used as restrictions\n assertPath(calcPath(0, 2, 0, 1), 0.2, 2, 200, nodes(0, 1, 2));\n }",
"@Test\n public void testShortestDistance2() {\n Vertex v1 = new Vertex(1, \"A\");\n Vertex v2 = new Vertex(2, \"B\");\n Vertex v3 = new Vertex(3, \"C\");\n\n Edge<Vertex> e1 = new Edge<>(v1, v2, 1);\n Edge<Vertex> e2 = new Edge<>(v2, v3, 1);\n Edge<Vertex> e3 = new Edge<>(v1, v3, 3);\n\n Graph<Vertex, Edge<Vertex>> g = new Graph<>();\n g.addVertex(v1);\n g.addVertex(v2);\n g.addVertex(v3);\n g.addEdge(e1);\n g.addEdge(e2);\n g.addEdge(e3);\n\n List<Vertex> expectedPath = new ArrayList<>();\n expectedPath.add(v1);\n expectedPath.add(v2);\n expectedPath.add(v3);\n\n assertTrue(g.edge(e1));\n assertTrue(g.vertex(v1));\n\n v1.updateName(\"test\");\n assertEquals(\"test\", v1.name());\n\n assertEquals(expectedPath, g.shortestPath(v1, v3));\n }",
"@Test\n void test015_testGetShortestPath() {\n try {\n christmasBuddENetwork.addFriendship(\"HarrE\", \"Prancer\");\n\n christmasBuddENetwork.addFriendship(\"Santa\", \"Rudolph\");\n christmasBuddENetwork.addFriendship(\"Comet\", \"Santa\");\n christmasBuddENetwork.addFriendship(\"Rudolph\", \"Comet\");\n\n christmasBuddENetwork.addFriendship(\"Grinch\", \"Comet\");\n christmasBuddENetwork.addFriendship(\"Grinch\", \"Donder\");\n\n List<User> shortestPathFromSantaToDonder =\n christmasBuddENetwork.getShortestPath(\"Santa\", \"Donder\");\n ArrayList<String> shortestPathFromSantaToGrinchList =\n new ArrayList<String>();\n for (int i = 0; i < shortestPathFromSantaToDonder.size(); i++) {\n User currentUser = shortestPathFromSantaToDonder.get(i);\n String userName = currentUser.getName();\n shortestPathFromSantaToGrinchList.add(userName);\n }\n int numElementsShortestPath = shortestPathFromSantaToDonder.size();\n if (numElementsShortestPath != 4) {\n fail(\"test015_testGetShortestPath: FAILED! :(. Did NOT return 2 \"\n + \"elements for the shortest path, but instead: \"\n + numElementsShortestPath);\n }\n if ((!shortestPathFromSantaToGrinchList.get(1).equals(\"Comet\"))\n || (!shortestPathFromSantaToGrinchList.get(2).equals(\"Grinch\"))) {\n fail(\"test015_testGetShortestPath: FAILED! :( Did NOT return the proper\"\n + \" BuddEs on the way!\");\n }\n } catch (Exception e) {\n fail(\"test015_testGetShortestPath: FAILED! :( Threw an incorrect \"\n + \"exception!\");\n }\n }",
"@Test\n public void directedRouting() {\n EdgeIteratorState rightNorth, rightSouth, leftSouth, leftNorth;\n graph.edge(0, 1).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(1, 2).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(2, 3).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(3, 4).setDistance(3).set(speedEnc, 10, 10);\n rightNorth = graph.edge(4, 10).setDistance(1).set(speedEnc, 10, 10);\n rightSouth = graph.edge(10, 5).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(5, 6).setDistance(2).set(speedEnc, 10, 10);\n graph.edge(6, 2).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(2, 7).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(7, 8).setDistance(9).set(speedEnc, 10, 10);\n leftSouth = graph.edge(8, 9).setDistance(1).set(speedEnc, 10, 10);\n leftNorth = graph.edge(9, 0).setDistance(1).set(speedEnc, 10, 10);\n\n // make paths fully deterministic by applying some turn costs at junction node 2\n setTurnCost(7, 2, 3, 1);\n setTurnCost(7, 2, 6, 3);\n setTurnCost(1, 2, 3, 5);\n setTurnCost(1, 2, 6, 7);\n setTurnCost(1, 2, 7, 9);\n\n final double unitEdgeWeight = 0.1;\n assertPath(calcPath(9, 9, leftNorth.getEdge(), leftSouth.getEdge()),\n 23 * unitEdgeWeight + 5, 23, (long) ((23 * unitEdgeWeight + 5) * 1000),\n nodes(9, 0, 1, 2, 3, 4, 10, 5, 6, 2, 7, 8, 9));\n assertPath(calcPath(9, 9, leftSouth.getEdge(), leftNorth.getEdge()),\n 14 * unitEdgeWeight, 14, (long) ((14 * unitEdgeWeight) * 1000),\n nodes(9, 8, 7, 2, 1, 0, 9));\n assertPath(calcPath(9, 10, leftSouth.getEdge(), rightSouth.getEdge()),\n 15 * unitEdgeWeight + 3, 15, (long) ((15 * unitEdgeWeight + 3) * 1000),\n nodes(9, 8, 7, 2, 6, 5, 10));\n assertPath(calcPath(9, 10, leftSouth.getEdge(), rightNorth.getEdge()),\n 16 * unitEdgeWeight + 1, 16, (long) ((16 * unitEdgeWeight + 1) * 1000),\n nodes(9, 8, 7, 2, 3, 4, 10));\n }",
"ShortestPath(UndirectedWeightedGraph graph, String startNodeId, String endNodeId) throws NotFoundNodeException {\r\n\t\t\r\n\t\tif (!graph.containsNode(startNodeId)) {\r\n\t\t\tthrow new NotFoundNodeException(graph, startNodeId);\r\n\t\t}\t\t\r\n\t\tif (!graph.containsNode(endNodeId)) {\r\n\t\t\tthrow new NotFoundNodeException(graph, endNodeId);\r\n\t\t}\t\r\n\r\n\t\tsrc = startNodeId;\r\n\t\tdst = endNodeId;\r\n\t\t\r\n\t\tif (endNodeId.equals(startNodeId)) {\r\n\t\t\tlength = 0;\r\n\t\t\tnumOfPath = 1;\r\n\t\t\tArrayList<String> path = new ArrayList<String>();\r\n\t\t\tpath.add(startNodeId);\r\n\t\t\tpathList.add(path);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// create a HashMap of updated distance from the starting node to every node\r\n\t\t\t// initially it is 0, inf, inf, inf, ...\r\n\t\t\tHashMap<String, Double> distance = new HashMap<String, Double>();\t\r\n\t\t\tfor (String nodeId : graph.getNodeList().keySet()) {\r\n\t\t\t\tif (nodeId.equals(startNodeId)) {\r\n\t\t\t\t\t// the starting node will always have 0 distance from itself\r\n\t\t\t\t\tdistance.put(nodeId, 0.0);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t// the others have initial distance is infinity\r\n\t\t\t\t\tdistance.put(nodeId, Double.MAX_VALUE);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// a HashMap of preceding node of each node\r\n\t\t\tHashMap<String, HashSet<String>> precedence = new HashMap<String, HashSet<String>>();\r\n\t\t\tfor (String nodeId : graph.getNodeList().keySet()) {\r\n\t\t\t\tif ( nodeId.equals(startNodeId) ) {\r\n\t\t\t\t\tprecedence.put(nodeId, null);\t// the start node will have no preceding node\r\n\t\t\t\t}\r\n\t\t\t\telse { \r\n\t\t\t\t\tprecedence.put(nodeId, new HashSet<String>());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//\r\n\t\t\tSet<String> unvisitedNode = new HashSet<String>();\r\n\t\t\tfor (String nodeId : graph.getNodeList().keySet()) {\r\n\t\t\t\tunvisitedNode.add(nodeId);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tdouble minUnvisitedLength;\r\n\t\t\tString minUnvisitedNode;\r\n\t\t\t// run loop while not all node is visited\r\n\t\t\twhile ( unvisitedNode.size() != 0 ) {\r\n\t\t\t\t// find the unvisited node with minimum current distance in distance list\r\n\t\t\t\tminUnvisitedLength = Double.MAX_VALUE;\r\n\t\t\t\tminUnvisitedNode = \"\";\r\n\t\t\t\tfor (String nodeId : unvisitedNode) {\r\n\t\t\t\t\tif (distance.get(nodeId) < minUnvisitedLength) {\r\n\t\t\t\t\t\tminUnvisitedNode = nodeId;\r\n\t\t\t\t\t\tminUnvisitedLength = distance.get(nodeId); \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// if there are no node that can be visited from the unvisitedNode, break the loop \r\n\t\t\t\tif (minUnvisitedLength == Double.MAX_VALUE) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t// remove the node from unvisitedNode\r\n\t\t\t\tunvisitedNode.remove(minUnvisitedNode);\r\n\t\t\t\t\r\n\t\t\t\t// update the distance of its neighbors\r\n\t\t\t\tfor (Node neighborNode : graph.getNodeList().get(minUnvisitedNode).getNeighbors().keySet()) {\r\n\t\t\t\t\tdouble distanceFromTheMinNode = distance.get(minUnvisitedNode) + graph.getNodeList().get(minUnvisitedNode).getNeighbors().get(neighborNode).getWeight();\r\n\t\t\t\t\t// if the distance of the neighbor can be shorter from the current node, change \r\n\t\t\t\t\t// its details in distance and precedence\r\n\t\t\t\t\tif ( distanceFromTheMinNode < distance.get(neighborNode.getId()) ) {\r\n\t\t\t\t\t\tdistance.replace(neighborNode.getId(), distanceFromTheMinNode);\r\n\t\t\t\t\t\t// renew the precedence of the neighbor node\r\n\t\t\t\t\t\tprecedence.put(neighborNode.getId(), new HashSet<String>());\r\n\t\t\t\t\t\tprecedence.get(neighborNode.getId()).add(minUnvisitedNode);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (distanceFromTheMinNode == distance.get(neighborNode.getId())) {\r\n\t\t\t\t\t\t// unlike dijkstra's algorithm, multiple path should be update into the precedence\r\n\t\t\t\t\t\t// if from another node the distance is the same, add it to the precedence\r\n\t\t\t\t\t\tprecedence.get(neighborNode.getId()).add(minUnvisitedNode);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t// if the current node in the process is the end node, we can stop the while loop here\r\n\t\t\t\tif (minUnvisitedNode == endNodeId) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif (distance.get(endNodeId) == Double.MAX_VALUE) {\r\n\t\t\t\t// in case there is no shortest path between the 2 nodes\r\n\t\t\t\tlength = 0;\r\n\t\t\t\tnumOfPath = 0;\r\n\t\t\t\tpathList = null;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// other wise we have these information\r\n\t\t\t\tlength = distance.get(endNodeId);\r\n\t\t\t\t//numOfPath = this.getNumPath(precedence, startNodeId, endNodeId);\r\n\t\t\t\tpathList = this.findPathList(precedence, startNodeId, endNodeId);\r\n\t\t\t\tnumOfPath = pathList.size();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\t// END ELSE\t\t\r\n\t}",
"private static void shortestPath(Graph graph, Character startNode, int algorithm) {\n Node currentNode = graph.getNode(startNode);\n\n // keep track of the nodes visited\n List<Character> nodesVisited = new ArrayList<>();\n\n // add the current node\n nodesVisited.add(currentNode.getName());\n\n // breadth first search to help keep track of the nodes we have already visited\n // helps with backtracking\n Stack<Node> visitingNodes = new Stack<>();\n\n // loop through the graph\n while (currentNode != graph.getNode('Z')) {\n // we have visited a node\n // add it to the stack\n // set true to since its been visited and it will be in the shortest path\n visitingNodes.add(currentNode);\n currentNode.setNodeVisited(true);\n currentNode.setInShortestPath(true);\n\n // get all the edges that are connected to the current node we are on\n List<Edge> adjacentNodes = currentNode.getNeighbors();\n\n // temp for next node\n Node nextNode = null;\n int weightDistanceTotal = Integer.MAX_VALUE;\n\n for (Edge i: adjacentNodes) {\n // testing\n // System.out.println(i.destination.getName());\n // System.out.println(i.destination.getDistanceToZ());\n\n // 1. always check to see if we have visited the node\n if (i.destination.isNodeVisited()) {\n // System.out.println(i.destination.getName() + \" is already in the path\");\n continue;\n }\n\n // 2. assign the next node to the destination\n if (nextNode == null) {\n nextNode = i.destination;\n }\n\n // compare distances\n if (algorithm == 1) {\n nextNode = updateNextNodeAlgo1(nextNode, i.destination);\n } else {\n NodeWithWeightDistanceTotal nodeWithWeightDistanceTotal = updateNextNodeAlgo2(nextNode, i, weightDistanceTotal);\n nextNode = nodeWithWeightDistanceTotal.node;\n weightDistanceTotal = nodeWithWeightDistanceTotal.weightDistanceTotal;\n }\n //if (nextNode.getDistanceToZ() > i.destination.getDistanceToZ()) {\n // nextNode = i.destination;\n //}\n }\n\n // next has no other edges\n if (nextNode == null) {\n // System.out.println(\"There no place to go from \" + currentNode.getName());\n // pop off the node we just visited\n nextNode = visitingNodes.pop();\n // its not in the shortest path to Z\n nextNode.setInShortestPath(false);\n // set the next node to the previous node\n nextNode = visitingNodes.pop();\n }\n\n // add the nodes we visit to keep track of the path\n nodesVisited.add(nextNode.getName());\n\n // System.out.println(Arrays.toString(nodesVisited.toArray()));\n // testing purposes to see if the node is on the shortest path\n\n// for (Character node: nodesVisited) {\n// Node boolVisit = graph.getNode(node);\n// System.out.println(boolVisit.isInShortestPath());\n// }\n\n // progress to the next node\n currentNode = nextNode;\n // when visiting the last node mark z in the shortest path\n if (currentNode.getName() == 'Z') {\n currentNode.setInShortestPath(true);\n }\n // testing\n // System.out.println(\"next node = \" + currentNode.getName());\n }\n\n // keep track of the path visited and the total addition of weights\n int pathCounter = 0;\n\n // construct the shortest path\n List<Node> shortestPath = new ArrayList<>();\n\n for (Character nodeVisitor: nodesVisited) {\n // get the node\n Node node = graph.getNode(nodeVisitor);\n\n // add to the shortest path\n if (node.isInShortestPath() && !shortestPath.contains(node)) {\n shortestPath.add(node);\n }\n }\n\n // print the shortest path\n for (int i = 0; i < shortestPath.size() - 1; i++) {\n currentNode = shortestPath.get(i);\n Node nextNode = shortestPath.get(i + 1);\n\n // find the weight of that node\n int weight = currentNode.findWeight(nextNode);\n pathCounter += weight;\n\n // System.out.println(\"weight \" + weight);\n // System.out.println(\"path total \" + pathCounter);\n }\n\n // final output\n String fullPathSequence = \"\";\n String shortestPathSequence = \"\";\n\n for (int i = 0; i < nodesVisited.size(); i++) {\n if (i != nodesVisited.size() - 1) {\n fullPathSequence += nodesVisited.get(i) + \" -> \";\n }\n }\n\n fullPathSequence += nodesVisited.get(nodesVisited.size() - 1);\n\n for (int i = 0; i < shortestPath.size(); i++) {\n if (i != shortestPath.size() - 1) {\n shortestPathSequence += shortestPath.get(i).getName() + \" -> \";\n }\n }\n\n if (currentNode.getName() == 'Z') {\n shortestPathSequence += \"Z\";\n } else {\n shortestPathSequence += shortestPath.get(shortestPath.size() - 1).getName();\n }\n\n System.out.println(\"Algorithm \" + algorithm + \" : \");\n System.out.println(\"Sequence of all nodes \" + fullPathSequence);\n System.out.println(\"Shortest path: \" + shortestPathSequence);\n System.out.println(\"Shortest path length: \" + pathCounter);\n System.out.println(\"\\n\");\n\n // reset the graph\n graph.graphReset();\n\n }",
"void shortestPath( final VertexType fromNode, Integer node );",
"@Override\n List<NodeData> pathFind() throws NoPathException {\n System.out.println(\"Starting Scenic\");\n\n frontier.add(start);\n\n while(!frontier.isEmpty()) {\n StarNode current = frontier.getLast();\n frontier.removeLast(); // pop the priority queue\n if(current.getXCoord() == goal.getXCoord() && current.getYCoord() == goal.getYCoord()) {\n // If we are at the goal, we need to backtrack through the shortest path\n System.out.println(\"At target!\");\n finalList.add(current); // we have to add the goal to the path before we start backtracking\n while(!(current.getXCoord() == start.getXCoord() && current.getYCoord() == start.getYCoord())) {\n finalList.add(current.getPreviousNode());\n current = current.getPreviousNode();\n System.out.println(current.getNodeID());\n }\n return finalList;\n }\n else {\n // we need to get all the neighbor nodes, identify their costs, and put them into the queue\n LinkedList<StarNode> neighbors = current.getNeighbors();\n // we also need to remove the previous node from the list of neighbors because we do not want to backtrack\n neighbors.remove(current.getPreviousNode());\n\n for (StarNode newnode : neighbors) {\n int nodePlace = this.listContainsId(frontier, newnode);\n if(nodePlace > -1) {\n if (frontier.get(nodePlace).getF() > actionCost(newnode) + distanceToGo(newnode, goal)) {\n System.out.println(\"Here\");\n frontier.remove(frontier.get(nodePlace));\n newnode.setPreviousNode(current);\n frontier.add(newnode);\n newnode.setF(actionCost(newnode) + distanceToGo(newnode, goal));\n }\n }\n else {\n newnode.setPreviousNode(current);\n frontier.add(newnode);\n newnode.setF(actionCost(newnode) + distanceToGo(newnode, goal));\n }\n\n // This fixes the problem with infinitely looping elevators (I hope)\n if(current.getNodeType().equals(\"ELEV\") && newnode.getNodeType().equals(\"ELEV\")) {\n for (Iterator<StarNode> iterator = newnode.neighbors.iterator(); iterator.hasNext();) {\n StarNode newneighbor = iterator.next();\n if (newneighbor.getNodeType().equals(\"ELEV\")) {\n // Remove the current element from the iterator and the list.\n iterator.remove();\n }\n }\n }\n if(current.getNodeType().equals(\"STAI\") && newnode.getNodeType().equals(\"STAI\")) {\n for (Iterator<StarNode> iterator = newnode.neighbors.iterator(); iterator.hasNext();) {\n StarNode newneighbor = iterator.next();\n if (newneighbor.getNodeType().equals(\"STAI\")) {\n // Remove the current element from the iterator and the list.\n iterator.remove();\n }\n }\n }\n // this is where the node is put in the right place in the queue\n Collections.sort(frontier);\n }\n }\n }\n throw new NoPathException(start.getLongName(), goal.getLongName());\n }",
"@Test\n public void testGetShortestPath04() {\n System.out.println(\"getShortestPath\");\n User userA = null;\n for (User user1 : sn10.getUsersList()) {\n if (user1.getNickname().equals(\"nick0\")) {\n userA = user1;\n }\n }\n User userB = null;\n for (User user1 : sn10.getUsersList()) {\n if (user1.getNickname().equals(\"nick7\")) {\n userB = user1;\n }\n }\n\n LinkedList<City> expResult = new LinkedList();\n\n LinkedList<City> result = new LinkedList();\n sn10.getShortestPath(userA, userB, result);\n assertFalse(expResult.equals(result));\n }",
"protected void verifyShortestPaths(final Map<String, ShortestPath> expectedPaths,\n final Graph graph, List<Path> paths) throws Exception {\n assertFalse(paths.isEmpty());\n Set<Vertex> unreachedVertices = new HashSet<Vertex>(graph.getVertices());\n unreachedVertices.remove(SOURCE_VERTEX);\n\n for (Path path : paths) {\n assertEquals(path.getStart(), SOURCE_VERTEX);\n unreachedVertices.remove(path.getEnd());\n List<Vertex> vertices = path.asList();\n \n // all edges should be in the original graph, hence they all\n // should be part of the graph.\n if (vertices.size() > 1) {\n Iterator<Vertex> verticesIterator = vertices.iterator();\n Vertex start = verticesIterator.next();\n Vertex end = verticesIterator.next();\n graph.getEdge(start, end);\n while (verticesIterator.hasNext()) {\n start = end;\n end = verticesIterator.next();\n graph.getEdge(start, end);\n }\n }\n\n ShortestPath expectedPath = expectedPaths.get(path.getEnd().label());\n assertNotNull(expectedPath);\n assertEquals(expectedPath.asList(), vertices);\n }\n\n // all vertices should have been reached\n assertTrue(unreachedVertices.isEmpty());\n }",
"public static Vector<int []> aStar(int[] startNode,int[] endNode, mapNode[][] nodes, String method){\n\t\t\t\tfor(int i = 0; i < nodes.length; i++)\r\n\t\t\t\t{\r\n\t\t\t\t\tfor(int j = 0; j < nodes[i].length;j++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tnodes[i][j].setTotCost(999999999);//set the initial distance to INF\r\n\t\t\t\t\t\tnodes[i][j].gridPosition[0] = i;//save current node x position\r\n\t\t\t\t\t\tnodes[i][j].gridPosition[1] = j;//save current node y position\r\n\t\t\t\t\t\tnodes[i][j].setNodeVistied(false);//set all nodes are not visited yet\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\r\n\t\tVector<int []> shortestPath;\r\n\t\tVector<mapNode> closeSet;//the set of nodes already evaluated\r\n\t\tcloseSet = new Vector<mapNode>();\r\n\t\tVector<mapNode> openSet;//the set of nodes to be evaluated\r\n\t\topenSet = new Vector<mapNode>();\r\n\t\tfloat bestCost;\r\n\t\t//Add the start node into open set\r\n\t\tmapNode start = new mapNode();\r\n\t\tnodes[startNode[0]][startNode[1]].setHeuristics(0);\r\n\t\tnodes[startNode[0]][startNode[1]].setTotCost(0);\r\n\t\tstart = nodes[startNode[0]][startNode[1]];\r\n\t\topenSet.add(start);\r\n\t\t\r\n\t\twhile(openSet.size() != 0)\r\n\t\t{\r\n\t\t\t//sort openSet from lowest cost to highest\r\n\t\t\tint j;\r\n\t\t\tfor(int i = 1; i < openSet.size(); i++){\r\n\t\t\t\tj = i;\r\n\t\t\t\twhile(j > 0 && openSet.get(j-1).getTotCost() > openSet.get(j).getTotCost()){\r\n\t\t\t\t\tCollections.swap(openSet, j, j-1);\r\n\t\t\t\t\tj = j-1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//the node in openset having the lowest cost\r\n\t\t\tmapNode tempNode = new mapNode();\r\n\t\t\ttempNode = openSet.get(0);\r\n\t\t\t\r\n\t\t\t//End case if the condition have approached\r\n\t\t\tif(tempNode.gridPosition[0] == endNode[0] && tempNode.gridPosition[1] == endNode[1]){\r\n\t\t\t\tshortestPath = nodes[endNode[0]][endNode[1]].getTotPath();\r\n\t\t\t\tif(shortestPath.size() == 1)\r\n\t\t\t\t{\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}\r\n\t\t\t\tshortestPath.add(endNode);\r\n\t\t\t\t// No result was found -- only the end node\r\n\t\t\t\treturn shortestPath;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tmapNode tempTopNode = new mapNode();\r\n\t\t\tmapNode tempBottomNode = new mapNode();\r\n\t\t\tmapNode tempLeftNode = new mapNode();\r\n\t\t\tmapNode tempRightNode = new mapNode();\r\n\t\t\t\r\n\t\t\t//remove current from open set\r\n\t\t\topenSet.remove(0);\r\n\t\t\t//add current to close set\r\n\t\t\tcloseSet.add(tempNode);\r\n\t\t\t\r\n\t\t\t//update Top node information from original nodes matrix\r\n\t\t\tif(tempNode.topNode != null)\r\n\t\t\t{\r\n\t\t\t\ttempTopNode = nodes[tempNode.topNode.gridPosition[0]][tempNode.topNode.gridPosition[1]];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\ttempTopNode = null;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//update Bottom node information from original nodes matrix\r\n\t\t\tif(tempNode.bottomNode != null)\r\n\t\t\t{\r\n\t\t\t\ttempBottomNode = nodes[tempNode.bottomNode.gridPosition[0]][tempNode.bottomNode.gridPosition[1]];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\ttempBottomNode = null;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//update Left node information from original nodes matrix\r\n\t\t\tif(tempNode.leftNode != null)\r\n\t\t\t{\r\n\t\t\t\ttempLeftNode = nodes[tempNode.leftNode.gridPosition[0]][tempNode.leftNode.gridPosition[1]];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\ttempLeftNode = null;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//update Right node information from original nodes matrix\r\n\t\t\tif(tempNode.rightNode != null)\r\n\t\t\t{\r\n\t\t\t\ttempRightNode = nodes[tempNode.rightNode.gridPosition[0]][tempNode.rightNode.gridPosition[1]];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\ttempRightNode = null;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Manhattan, Euclidean method\r\n\t\t\tif(method.equals(\"manhattan\")){\r\n\t\t\t\t//update neighbor nodes\r\n\t\t\t\t//update top Node\r\n\t\t\t\tif(tempTopNode != null){\r\n\t\t\t\t\tfloat hValue = tempNode.getHeuristics()+1;\r\n\t\t\t\t\tfloat nextCost = hValue+manhattan(tempTopNode.gridPosition, endNode, nodes);\r\n\t\t\t\t\tif(tempNode.getOwnElevation() < tempTopNode.getOwnElevation()){\r\n\t\t\t\t\t\tif(tempTopNode.getOwnElevation() == 999999999){\r\n\t\t\t\t\t\t\tnextCost = 999999999;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\thValue = tempNode.getHeuristics()+1+(tempTopNode.getOwnElevation()-tempNode.getOwnElevation());\r\n\t\t\t\t\t\t\tnextCost = hValue+manhattan(tempTopNode.gridPosition, endNode, nodes);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(checkCloseSet(closeSet,tempTopNode) == false && tempTopNode.getTotCost() > nextCost){\r\n\t\t\t\t\t\t//This node is not in closeSet or openSet\r\n\t\t\t\t\t\t//it is the first time that program has arrived this node\r\n\t\t\t\t\t\t//update cost\r\n\t\t\t\t\t\ttempTopNode.setHeuristics(hValue);\r\n\t\t\t\t\t\ttempTopNode.setTotCost(nextCost);\r\n\t\t\t\t\t\tVector<int[]> tempPath = new Vector<int[]>();\r\n\t\t\t\t\t\t//record the path\r\n\t\t\t\t\t\tfor(int m = 0; m < tempNode.getTotPath().size(); m++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tint[] tempXY = new int[2];\r\n\t\t\t\t\t\t\ttempXY = tempNode.getTotPath().get(m);\r\n\t\t\t\t\t\t\ttempPath.add(tempXY);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//check new node to see if it exists in path\r\n\t\t\t\t\t\tif(checkPositionInPath(tempPath, tempNode.gridPosition[0], tempNode.gridPosition[1]) == false)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tint[] tempXY2 = new int[2];\r\n\t\t\t\t\t\t\ttempXY2 = tempNode.gridPosition;\r\n\t\t\t\t\t\t\ttempPath.add(tempXY2);\r\n\t\t\t\t\t\t}\t\t\t\t\r\n\t\t\t\t\t\t//assign new path to the node\r\n\t\t\t\t\t\ttempTopNode.setTotPath(tempPath);\r\n\t\t\t\t\t\ttempTopNode.setStatus(Status.EXPLORED);\r\n\t\t\t\t\t\t//update data back to original matrix\r\n\t\t\t\t\t\tnodes[tempNode.topNode.gridPosition[0]][tempNode.topNode.gridPosition[1]] = tempTopNode;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(checkCloseSet(closeSet,tempTopNode) == false && checkOpenSet(openSet, tempTopNode) == false){\r\n\t\t\t\t\t\topenSet.add(tempTopNode);\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//update bottom node\r\n\t\t\t\tif(tempBottomNode != null){\r\n\t\t\t\t\tfloat hValue = tempNode.getHeuristics()+1;\r\n\t\t\t\t\tfloat nextCost = hValue+manhattan(tempBottomNode.gridPosition, endNode, nodes);\r\n\t\t\t\t\tif(tempNode.getOwnElevation() < tempBottomNode.getOwnElevation()){\r\n\t\t\t\t\t\tif(tempBottomNode.getOwnElevation() == 999999999){\r\n\t\t\t\t\t\t\tnextCost = 999999999;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\thValue = tempNode.getHeuristics()+1+(tempBottomNode.getOwnElevation()-tempNode.getOwnElevation());\r\n\t\t\t\t\t\t\tnextCost = hValue+manhattan(tempBottomNode.gridPosition, endNode, nodes);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(checkCloseSet(closeSet,tempBottomNode) == false && tempBottomNode.getTotCost() > nextCost){\r\n\t\t\t\t\t\t//This node is not in closeSet or openSet\r\n\t\t\t\t\t\t//it is the first time that program has arrived this node\r\n\t\t\t\t\t\t//update cost\r\n\t\t\t\t\t\ttempBottomNode.setHeuristics(hValue);\r\n\t\t\t\t\t\ttempBottomNode.setTotCost(nextCost);\r\n\t\t\t\t\t\tVector<int[]> tempPath = new Vector<int[]>();\r\n\t\t\t\t\t\t//record the path\r\n\t\t\t\t\t\tfor(int m = 0; m < tempNode.getTotPath().size(); m++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tint[] tempXY = new int[2];\r\n\t\t\t\t\t\t\ttempXY = tempNode.getTotPath().get(m);\r\n\t\t\t\t\t\t\ttempPath.add(tempXY);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//check new node to see if it exists in path\r\n\t\t\t\t\t\tif(checkPositionInPath(tempPath, tempNode.gridPosition[0], tempNode.gridPosition[1]) == false)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tint[] tempXY2 = new int[2];\r\n\t\t\t\t\t\t\ttempXY2 = tempNode.gridPosition;\r\n\t\t\t\t\t\t\ttempPath.add(tempXY2);\r\n\t\t\t\t\t\t}\t\t\t\t\r\n\t\t\t\t\t\t//assign new path to the node\r\n\t\t\t\t\t\ttempBottomNode.setTotPath(tempPath);\r\n\t\t\t\t\t\ttempBottomNode.setStatus(Status.EXPLORED);\r\n\t\t\t\t\t\t//update data back to original matrix\r\n\t\t\t\t\t\tnodes[tempNode.bottomNode.gridPosition[0]][tempNode.bottomNode.gridPosition[1]] = tempBottomNode;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(checkCloseSet(closeSet,tempBottomNode) == false && checkOpenSet(openSet, tempBottomNode) == false){\r\n\t\t\t\t\t\topenSet.add(tempBottomNode);\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//update Left node\r\n\t\t\t\tif(tempLeftNode != null){\r\n\t\t\t\t\tfloat hValue = tempNode.getHeuristics()+1;\r\n\t\t\t\t\tfloat nextCost =hValue+manhattan(tempLeftNode.gridPosition, endNode, nodes);\r\n\t\t\t\t\tif(tempNode.getOwnElevation() < tempLeftNode.getOwnElevation()){\r\n\t\t\t\t\t\tif(tempLeftNode.getOwnElevation() == 999999999){\r\n\t\t\t\t\t\t\tnextCost = 999999999;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\thValue = tempNode.getHeuristics()+1+(tempLeftNode.getOwnElevation()-tempNode.getOwnElevation());\r\n\t\t\t\t\t\t\tnextCost = hValue+manhattan(tempLeftNode.gridPosition, endNode, nodes);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(checkCloseSet(closeSet,tempLeftNode) == false && tempLeftNode.getTotCost() > nextCost){\r\n\t\t\t\t\t\t//This node is not in closeSet or openSet\r\n\t\t\t\t\t\t//it is the first time that program has arrived this node\r\n\t\t\t\t\t\t//update cost\r\n\t\t\t\t\t\ttempLeftNode.setHeuristics(hValue);\r\n\t\t\t\t\t\ttempLeftNode.setTotCost(nextCost);\r\n\t\t\t\t\t\tVector<int[]> tempPath = new Vector<int[]>();\r\n\t\t\t\t\t\t//record the path\r\n\t\t\t\t\t\tfor(int m = 0; m < tempNode.getTotPath().size(); m++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tint[] tempXY = new int[2];\r\n\t\t\t\t\t\t\ttempXY = tempNode.getTotPath().get(m);\r\n\t\t\t\t\t\t\ttempPath.add(tempXY);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//check new node to see if it exists in path\r\n\t\t\t\t\t\tif(checkPositionInPath(tempPath, tempNode.gridPosition[0], tempNode.gridPosition[1]) == false)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tint[] tempXY2 = new int[2];\r\n\t\t\t\t\t\t\ttempXY2 = tempNode.gridPosition;\r\n\t\t\t\t\t\t\ttempPath.add(tempXY2);\r\n\t\t\t\t\t\t}\t\t\t\t\r\n\t\t\t\t\t\t//assign new path to the node\r\n\t\t\t\t\t\ttempLeftNode.setTotPath(tempPath);\r\n\t\t\t\t\t\ttempLeftNode.setStatus(Status.EXPLORED);\r\n\t\t\t\t\t\t//update data back to original matrix\r\n\t\t\t\t\t\tnodes[tempNode.leftNode.gridPosition[0]][tempNode.leftNode.gridPosition[1]] = tempLeftNode;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(checkCloseSet(closeSet,tempLeftNode) == false && checkOpenSet(openSet, tempLeftNode) == false){\r\n\t\t\t\t\t\topenSet.add(tempLeftNode);\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//update Right node\r\n\t\t\t\tif(tempRightNode != null){\r\n\t\t\t\t\tfloat hValue = tempNode.getHeuristics()+1;\r\n\t\t\t\t\tfloat nextCost = hValue+manhattan(tempRightNode.gridPosition, endNode, nodes);\r\n\t\t\t\t\tif(tempNode.getOwnElevation() < tempRightNode.getOwnElevation()){\r\n\t\t\t\t\t\tif(tempRightNode.getOwnElevation() == 999999999){\r\n\t\t\t\t\t\t\tnextCost = 999999999;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\thValue = tempNode.getHeuristics()+1+(tempRightNode.getOwnElevation()-tempNode.getOwnElevation());\r\n\t\t\t\t\t\t\tnextCost = hValue+manhattan(tempRightNode.gridPosition, endNode, nodes);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(checkCloseSet(closeSet,tempRightNode) == false && tempRightNode.getTotCost() > nextCost){\r\n\t\t\t\t\t\t//This node is not in closeSet or openSet\r\n\t\t\t\t\t\t//it is the first time that program has arrived this node\r\n\t\t\t\t\t\t//update cost\r\n\t\t\t\t\t\ttempRightNode.setHeuristics(hValue);\r\n\t\t\t\t\t\ttempRightNode.setTotCost(nextCost);\r\n\t\t\t\t\t\tVector<int[]> tempPath = new Vector<int[]>();\r\n\t\t\t\t\t\t//record the path\r\n\t\t\t\t\t\tfor(int m = 0; m < tempNode.getTotPath().size(); m++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tint[] tempXY = new int[2];\r\n\t\t\t\t\t\t\ttempXY = tempNode.getTotPath().get(m);\r\n\t\t\t\t\t\t\ttempPath.add(tempXY);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//check new node to see if it exists in path\r\n\t\t\t\t\t\tif(checkPositionInPath(tempPath, tempNode.gridPosition[0], tempNode.gridPosition[1]) == false)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tint[] tempXY2 = new int[2];\r\n\t\t\t\t\t\t\ttempXY2 = tempNode.gridPosition;\r\n\t\t\t\t\t\t\ttempPath.add(tempXY2);\r\n\t\t\t\t\t\t}\t\t\t\t\r\n\t\t\t\t\t\t//assign new path to the node\r\n\t\t\t\t\t\ttempRightNode.setTotPath(tempPath);\r\n\t\t\t\t\t\ttempRightNode.setStatus(Status.EXPLORED);\r\n\t\t\t\t\t\t//update data back to original matrix\r\n\t\t\t\t\t\tnodes[tempNode.rightNode.gridPosition[0]][tempNode.rightNode.gridPosition[1]] = tempRightNode;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(checkCloseSet(closeSet,tempRightNode) == false && checkOpenSet(openSet, tempRightNode) == false){\r\n\t\t\t\t\t\topenSet.add(tempRightNode);\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//Manhattan, Euclidean method\r\n\t\t\telse if(method.equals(\"euclidean\")){\r\n\t\t\t\t//update neighbor nodes\r\n\t\t\t\t//update top Node\r\n\t\t\t\tif(tempTopNode != null){\r\n\t\t\t\t\tfloat hValue = tempNode.getHeuristics()+1;\r\n\t\t\t\t\tfloat nextCost = hValue+Euclidean(tempTopNode.gridPosition, endNode, nodes);\r\n\t\t\t\t\tif(tempNode.getOwnElevation() < tempTopNode.getOwnElevation()){\r\n\t\t\t\t\t\tif(tempTopNode.getOwnElevation() == 999999999){\r\n\t\t\t\t\t\t\tnextCost = 999999999;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\thValue = tempNode.getHeuristics()+1+(tempTopNode.getOwnElevation()-tempNode.getOwnElevation());\r\n\t\t\t\t\t\t\tnextCost = hValue+Euclidean(tempTopNode.gridPosition, endNode, nodes);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(checkCloseSet(closeSet,tempTopNode) == false && tempTopNode.getTotCost() > nextCost){\r\n\t\t\t\t\t\t//This node is not in closeSet or openSet\r\n\t\t\t\t\t\t//it is the first time that program has arrived this node\r\n\t\t\t\t\t\t//update cost\r\n\t\t\t\t\t\ttempTopNode.setHeuristics(hValue);\r\n\t\t\t\t\t\ttempTopNode.setTotCost(nextCost);\r\n\t\t\t\t\t\tVector<int[]> tempPath = new Vector<int[]>();\r\n\t\t\t\t\t\t//record the path\r\n\t\t\t\t\t\tfor(int m = 0; m < tempNode.getTotPath().size(); m++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tint[] tempXY = new int[2];\r\n\t\t\t\t\t\t\ttempXY = tempNode.getTotPath().get(m);\r\n\t\t\t\t\t\t\ttempPath.add(tempXY);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//check new node to see if it exists in path\r\n\t\t\t\t\t\tif(checkPositionInPath(tempPath, tempNode.gridPosition[0], tempNode.gridPosition[1]) == false)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tint[] tempXY2 = new int[2];\r\n\t\t\t\t\t\t\ttempXY2 = tempNode.gridPosition;\r\n\t\t\t\t\t\t\ttempPath.add(tempXY2);\r\n\t\t\t\t\t\t}\t\t\t\t\r\n\t\t\t\t\t\t//assign new path to the node\r\n\t\t\t\t\t\ttempTopNode.setTotPath(tempPath);\r\n\t\t\t\t\t\ttempTopNode.setStatus(Status.EXPLORED);\r\n\t\t\t\t\t\t//update data back to original matrix\r\n\t\t\t\t\t\tnodes[tempNode.topNode.gridPosition[0]][tempNode.topNode.gridPosition[1]] = tempTopNode;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(checkCloseSet(closeSet,tempTopNode) == false && checkOpenSet(openSet, tempTopNode) == false){\r\n\t\t\t\t\t\topenSet.add(tempTopNode);\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//update bottom node\r\n\t\t\t\tif(tempBottomNode != null){\r\n\t\t\t\t\tfloat hValue = tempNode.getHeuristics()+1;\r\n\t\t\t\t\tfloat nextCost = hValue+Euclidean(tempBottomNode.gridPosition, endNode, nodes);\r\n\t\t\t\t\tif(tempNode.getOwnElevation() < tempBottomNode.getOwnElevation()){\r\n\t\t\t\t\t\tif(tempBottomNode.getOwnElevation() == 999999999){\r\n\t\t\t\t\t\t\tnextCost = 999999999;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\thValue = tempNode.getHeuristics()+1+(tempBottomNode.getOwnElevation()-tempNode.getOwnElevation());\r\n\t\t\t\t\t\t\tnextCost = hValue+Euclidean(tempBottomNode.gridPosition, endNode, nodes);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(checkCloseSet(closeSet,tempBottomNode) == false && tempBottomNode.getTotCost() > nextCost){\r\n\t\t\t\t\t\t//This node is not in closeSet or openSet\r\n\t\t\t\t\t\t//it is the first time that program has arrived this node\r\n\t\t\t\t\t\t//update cost\r\n\t\t\t\t\t\ttempBottomNode.setHeuristics(hValue);\r\n\t\t\t\t\t\ttempBottomNode.setTotCost(nextCost);\r\n\t\t\t\t\t\tVector<int[]> tempPath = new Vector<int[]>();\r\n\t\t\t\t\t\t//record the path\r\n\t\t\t\t\t\tfor(int m = 0; m < tempNode.getTotPath().size(); m++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tint[] tempXY = new int[2];\r\n\t\t\t\t\t\t\ttempXY = tempNode.getTotPath().get(m);\r\n\t\t\t\t\t\t\ttempPath.add(tempXY);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//check new node to see if it exists in path\r\n\t\t\t\t\t\tif(checkPositionInPath(tempPath, tempNode.gridPosition[0], tempNode.gridPosition[1]) == false)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tint[] tempXY2 = new int[2];\r\n\t\t\t\t\t\t\ttempXY2 = tempNode.gridPosition;\r\n\t\t\t\t\t\t\ttempPath.add(tempXY2);\r\n\t\t\t\t\t\t}\t\t\t\t\r\n\t\t\t\t\t\t//assign new path to the node\r\n\t\t\t\t\t\ttempBottomNode.setTotPath(tempPath);\r\n\t\t\t\t\t\ttempBottomNode.setStatus(Status.EXPLORED);\r\n\t\t\t\t\t\t//update data back to original matrix\r\n\t\t\t\t\t\tnodes[tempNode.bottomNode.gridPosition[0]][tempNode.bottomNode.gridPosition[1]] = tempBottomNode;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(checkCloseSet(closeSet,tempBottomNode) == false && checkOpenSet(openSet, tempBottomNode) == false){\r\n\t\t\t\t\t\topenSet.add(tempBottomNode);\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//update Left node\r\n\t\t\t\tif(tempLeftNode != null){\r\n\t\t\t\t\tfloat hValue = tempNode.getHeuristics()+1;\r\n\t\t\t\t\tfloat nextCost =hValue+Euclidean(tempLeftNode.gridPosition, endNode, nodes);\r\n\t\t\t\t\tif(tempNode.getOwnElevation() < tempLeftNode.getOwnElevation()){\r\n\t\t\t\t\t\tif(tempLeftNode.getOwnElevation() == 999999999){\r\n\t\t\t\t\t\t\tnextCost = 999999999;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\thValue = tempNode.getHeuristics()+1+(tempLeftNode.getOwnElevation()-tempNode.getOwnElevation());\r\n\t\t\t\t\t\t\tnextCost = hValue+Euclidean(tempLeftNode.gridPosition, endNode, nodes);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(checkCloseSet(closeSet,tempLeftNode) == false && tempLeftNode.getTotCost() > nextCost){\r\n\t\t\t\t\t\t//This node is not in closeSet or openSet\r\n\t\t\t\t\t\t//it is the first time that program has arrived this node\r\n\t\t\t\t\t\t//update cost\r\n\t\t\t\t\t\ttempLeftNode.setHeuristics(hValue);\r\n\t\t\t\t\t\ttempLeftNode.setTotCost(nextCost);\r\n\t\t\t\t\t\tVector<int[]> tempPath = new Vector<int[]>();\r\n\t\t\t\t\t\t//record the path\r\n\t\t\t\t\t\tfor(int m = 0; m < tempNode.getTotPath().size(); m++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tint[] tempXY = new int[2];\r\n\t\t\t\t\t\t\ttempXY = tempNode.getTotPath().get(m);\r\n\t\t\t\t\t\t\ttempPath.add(tempXY);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//check new node to see if it exists in path\r\n\t\t\t\t\t\tif(checkPositionInPath(tempPath, tempNode.gridPosition[0], tempNode.gridPosition[1]) == false)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tint[] tempXY2 = new int[2];\r\n\t\t\t\t\t\t\ttempXY2 = tempNode.gridPosition;\r\n\t\t\t\t\t\t\ttempPath.add(tempXY2);\r\n\t\t\t\t\t\t}\t\t\t\t\r\n\t\t\t\t\t\t//assign new path to the node\r\n\t\t\t\t\t\ttempLeftNode.setTotPath(tempPath);\r\n\t\t\t\t\t\ttempLeftNode.setStatus(Status.EXPLORED);\r\n\t\t\t\t\t\t//update data back to original matrix\r\n\t\t\t\t\t\tnodes[tempNode.leftNode.gridPosition[0]][tempNode.leftNode.gridPosition[1]] = tempLeftNode;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(checkCloseSet(closeSet,tempLeftNode) == false && checkOpenSet(openSet, tempLeftNode) == false){\r\n\t\t\t\t\t\topenSet.add(tempLeftNode);\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//update Right node\r\n\t\t\t\tif(tempRightNode != null){\r\n\t\t\t\t\tfloat hValue = tempNode.getHeuristics()+1;\r\n\t\t\t\t\tfloat nextCost = hValue+Euclidean(tempRightNode.gridPosition, endNode, nodes);\r\n\t\t\t\t\tif(tempNode.getOwnElevation() < tempRightNode.getOwnElevation()){\r\n\t\t\t\t\t\tif(tempRightNode.getOwnElevation() == 999999999){\r\n\t\t\t\t\t\t\tnextCost = 999999999;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\thValue = tempNode.getHeuristics()+1+(tempRightNode.getOwnElevation()-tempNode.getOwnElevation());\r\n\t\t\t\t\t\t\tnextCost = hValue+Euclidean(tempRightNode.gridPosition, endNode, nodes);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(checkCloseSet(closeSet,tempRightNode) == false && tempRightNode.getTotCost() > nextCost){\r\n\t\t\t\t\t\t//This node is not in closeSet or openSet\r\n\t\t\t\t\t\t//it is the first time that program has arrived this node\r\n\t\t\t\t\t\t//update cost\r\n\t\t\t\t\t\ttempRightNode.setHeuristics(hValue);\r\n\t\t\t\t\t\ttempRightNode.setTotCost(nextCost);\r\n\t\t\t\t\t\tVector<int[]> tempPath = new Vector<int[]>();\r\n\t\t\t\t\t\t//record the path\r\n\t\t\t\t\t\tfor(int m = 0; m < tempNode.getTotPath().size(); m++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tint[] tempXY = new int[2];\r\n\t\t\t\t\t\t\ttempXY = tempNode.getTotPath().get(m);\r\n\t\t\t\t\t\t\ttempPath.add(tempXY);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//check new node to see if it exists in path\r\n\t\t\t\t\t\tif(checkPositionInPath(tempPath, tempNode.gridPosition[0], tempNode.gridPosition[1]) == false)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tint[] tempXY2 = new int[2];\r\n\t\t\t\t\t\t\ttempXY2 = tempNode.gridPosition;\r\n\t\t\t\t\t\t\ttempPath.add(tempXY2);\r\n\t\t\t\t\t\t}\t\t\t\t\r\n\t\t\t\t\t\t//assign new path to the node\r\n\t\t\t\t\t\ttempRightNode.setTotPath(tempPath);\r\n\t\t\t\t\t\ttempRightNode.setStatus(Status.EXPLORED);\r\n\t\t\t\t\t\t//update data back to original matrix\r\n\t\t\t\t\t\tnodes[tempNode.rightNode.gridPosition[0]][tempNode.rightNode.gridPosition[1]] = tempRightNode;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(checkCloseSet(closeSet,tempRightNode) == false && checkOpenSet(openSet, tempRightNode) == false){\r\n\t\t\t\t\t\topenSet.add(tempRightNode);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\r\n\t\t}\r\n\t\tshortestPath = nodes[endNode[0]][endNode[1]].getTotPath();\r\n\t\tif(shortestPath.size() == 1)\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tshortestPath.add(endNode);\r\n\t\t// No result was found -- only the end node\r\n\t\treturn shortestPath;\t\r\n\t}",
"public static void main(String[] args) {\n\t\tVertex A = new Vertex(\"A\");\n\t\tVertex B = new Vertex(\"B\");\n\t\tVertex C = new Vertex(\"C\");\n\t\tVertex D = new Vertex(\"D\");\n\t\tVertex E = new Vertex(\"E\");\n\n\t\tA.adjacencies = new Edge[]{ new Edge(B, 10),\tnew Edge(C, 3) };\n\t\tB.adjacencies = new Edge[]{\tnew Edge(C, 1), \tnew Edge(D, 2)};\n\t\tC.adjacencies = new Edge[]{ new Edge(B, 4), \tnew Edge(D, 8),\tnew Edge(E, 2)};\n\t\tD.adjacencies = new Edge[]{ new Edge(E, 7)};\n\t\tE.adjacencies = new Edge[]{ new Edge(D, 9)};\n\t\tVertex[] vertices = { A,B,C,D,E };\n\t\t\n\t\tcomputePaths(A);\n\t\t\n\t\tfor (Vertex v : vertices)\n\t\t{\n\t\t System.out.println(\"Distance to \" + v + \": \" + v.minDistance);\n\t\t List<Vertex> path = getShortestPathTo(v);\n\t\t System.out.println(\"Path: \" + path);\n\t\t}\n\t}",
"@Test\n\tpublic void multipleSolutionsTest(){\n\t\tDjikstrasMap m = new DjikstrasMap();\t//Creates new DjikstrasMap object\n\t\t\n\t\tm.addRoad(\"Guildford\", \"Portsmouth\", 20.5, \"M3\");\t//Adds a road from Guildford to portsmouth to the map\n m.addRoad(\"Portsmouth\", \"Guildford\", 20.5, \"M3\");\n \n m.addRoad(\"Guildford\", \"Winchester\", 20.5, \"A33\");\t//Adds a road from Guildford to winchester to the map\n m.addRoad(\"Winchester\", \"Guildford\", 20.5, \"A33\");\n \n m.addRoad(\"Winchester\", \"Fareham\", 20.5, \"M27\");\t//Adds a road from winchester to fareham to the map\n m.addRoad(\"Fareham\", \"Winchester\", 20.5, \"M27\");\n\t\t\n m.addRoad(\"Portsmouth\", \"Fareham\", 20.5, \"M25\");\t//Adds a road from fareham to portsmouth to the map\n m.addRoad(\"Fareham\", \"Portsmouth\", 20.5, \"M25\");\n \n m.findShortestPath(\"Fareham\");\t//Starts the algorithm to find the shortest path\n \n List<String> temp = new ArrayList<String>();\t//Holds the route plan\n temp = m.createRoutePlan(\"Guildford\");\t//Calls methods to assign the route plan to temp\n \n assertEquals(\"1. Take the M27 to Winchester\",temp.get(0));\t//tests that the different lines in the route plan are correct and that the algorithm did indeed take the shortest route\n assertEquals(\"2. Take the A33 to Guildford\", temp.get(1));\n assertEquals(\"\", temp.get(2));\n assertEquals(\"The Journey will take 41 hours and .00 minutes long.\", temp.get(3));\n assertEquals(\"\", temp.get(4));\n \n assertEquals(5, temp.size());\t//tests to see that the route plan is 5 line large as it should be\n\t}",
"private void calculateShortestDistances (GraphStructure graph,int startVertex,int destinationVertex) {\r\n\t\t//traverseRecursively(graph, startVertex);\r\n\t\tif(pathList.contains(destinationVertex)) {\r\n\t\t\tdistanceArray = new int [graph.getNumberOfVertices()];\r\n\t\t\tint numberOfVertices=graph.getNumberOfVertices();\r\n\t\t\tSet<Integer> spanningTreeSet = new HashSet<Integer>();\r\n\t\t\tArrays.fill(distanceArray,Integer.MAX_VALUE);\r\n\t\t\tdistanceArray[startVertex]=0;\r\n\t\t\tadjacencyList = graph.getAdjacencyList();\r\n\t\t\tList<Edge> list;\r\n\t\t\tlist = graph.getAdjacencyList()[startVertex];\r\n\t\t\tif(startVertex==destinationVertex) {\r\n\t\t\t\treturn;\r\n\t\t\t} else {\r\n\t\t\t\tfor(Edge value : list) {\r\n\t\t\t\t\tif(! isVisited[value.getVertex()]) {\r\n\t\t\t\t\t\tint sumOfWeightAndSourceVertexDistanceValue = distanceArray[startVertex] + value.getWeight();\r\n\t\t\t\t\t\tint distanceValueOfDestinationVertex = distanceArray[value.getVertex()];\r\n\t\t\t\t\t\tif( sumOfWeightAndSourceVertexDistanceValue < distanceValueOfDestinationVertex ) {\r\n\t\t\t\t\t\t\tdistanceArray[value.getVertex()] = sumOfWeightAndSourceVertexDistanceValue;\r\n\t\t\t\t\t\t\tshortestPathList.add(value.getVertex());\r\n\t\t\t\t\t\t\tcalculateShortestDistances(graph,value.getVertex(), distanceValueOfDestinationVertex);\r\n\t\t\t\t\t\t} \r\n\t\t\t\t\t} \r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t/*for(Integer value : spanningTreeSet) {\r\n\t\t\t\tSystem.out.print(value+\" \");\r\n\t\t\t}*/\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"No route is present between given vertices !\");\r\n\t\t}\r\n\t}",
"@Test\r\n public void graphTest(){\r\n DirectedGraph test= new DirectedGraph();\r\n\r\n //create shops and add to nodes list\r\n Shop one=new Shop(1,new Location(10,10));\r\n Shop two =new Shop(2,new Location(20,20));\r\n Shop three=new Shop(3,new Location(30,30));\r\n Shop four=new Shop(4,new Location(40,40));\r\n assertEquals(test.addNode(one),true);\r\n assertEquals(test.addNode(two),true);\r\n assertEquals(test.addNode(three),true);\r\n assertEquals(test.addNode(four),true);\r\n\r\n //try to add a duplicate\r\n assertEquals(test.addNode(new Shop(1,new Location(10,10))),false);\r\n\r\n //add edge\r\n assertEquals(test.addEdge(one,two,5),true);\r\n assertEquals(test.addEdge(one,three,2),true);\r\n assertEquals(test.addEdge(two,three,6),true);\r\n assertEquals(test.addEdge(four,two,8),true);\r\n\r\n //obtain a facility from the graph\r\n assertEquals(test.getFacility(one),one);\r\n\r\n //try to obtain a non-existent facility \r\n assertEquals(test.getFacility(new Shop(12,new Location(50,50))),null);\r\n\r\n //test closest neighbor \r\n assertEquals(test.returnClosestNeighbor(one),three);\r\n assertEquals(test.returnClosestNeighbor(two),one);\r\n }",
"@Test\n public void testDiameter() {\n Vertex v1 = new Vertex(1, \"A\");\n Vertex v2 = new Vertex(2, \"B\");\n Vertex v3 = new Vertex(3, \"C\");\n Vertex v4 = new Vertex(4, \"D\");\n\n Edge<Vertex> e1 = new Edge<>(v1, v2, 1);\n Edge<Vertex> e2 = new Edge<>(v2, v3, 2);\n Edge<Vertex> e3 = new Edge<>(v1, v3, 4);\n Edge<Vertex> e4 = new Edge<>(v2, v4, 5);\n Edge<Vertex> e5 = new Edge<>(v3, v4, 6);\n\n\n Graph<Vertex, Edge<Vertex>> g = new Graph<>();\n g.addVertex(v1);\n g.addVertex(v2);\n g.addVertex(v3);\n g.addVertex(v4);\n g.addEdge(e1);\n g.addEdge(e2);\n g.addEdge(e3);\n g.addEdge(e4);\n g.addEdge(e5);\n\n List<Vertex> shortestPath = g.shortestPath(v1, v3);\n\n assertEquals(3, g.pathLength(shortestPath));\n assertEquals(6, g.diameter());\n }",
"public void shortestPathsNodes() {\n for (int sourceNode = 0; sourceNode < wordGraph.V(); sourceNode++) {\n BreadthFirstDirectedPaths bfs = new BreadthFirstDirectedPaths(wordGraph, sourceNode);\n\n for (int goalNode = 0; goalNode < wordGraph.V(); goalNode++) {\n Iterable<Integer> shortestPath = bfs.pathTo(goalNode);\n int pathLength = -1;\n if (shortestPath != null) {\n for (int edge : shortestPath) {\n pathLength++;\n }\n }\n if (pathLength != -1) {\n }\n System.out.println(pathLength);\n }\n }\n }",
"@Test\n public void testGetShortestPath03() {\n System.out.println(\"getShortestPath\");\n User userA = null;\n for (User user1 : sn10.getUsersList()) {\n if (user1.getNickname().equals(\"nick0\")) {\n userA = user1;\n }\n }\n User userB = null;\n for (User user1 : sn10.getUsersList()) {\n if (user1.getNickname().equals(\"nick7\")) {\n userB = user1;\n }\n }\n\n LinkedList<City> expResult = new LinkedList();\n expResult.add(new City(new Pair(41.314965, -8.423371), \"city6\", 80));\n expResult.add(new City(new Pair(40.822244, -8.794953), \"city7\", 11));\n expResult.add(new City(new Pair(40.851360, -8.136585), \"city9\", 65));\n\n LinkedList<City> result = new LinkedList();\n sn10.getShortestPath(userA, userB, result);\n assertEquals(expResult, result);\n }",
"void shortestPaths( Set<Integer> nodes );",
"private static void findShortestPath(ArrayList<WeightedEdge> edges, int start, int dest, int nNodes) {\n int costs[] = new int[nNodes];\n int parents[] = new int[nNodes];\n boolean doneWithNode[] = new boolean[nNodes];\n\n // cost[i] has the cost of getting to node number i or is UNKNOWN if no cost figure out yet.\n // parent[i] contains the parent (or the way) we got to node i.\n // done[i] is true if we've already worked on all the children of node i.\n\n // Initialize the arrays.\n for (int i = 0; i<nNodes; i++) {\n costs[i] = UNKNOWN;\n parents[i] = UNKNOWN;\n doneWithNode[i] = false;\n }\n\n int node = start; // This is the node we are working on. Let's start with start node.\n costs[node] = 0; // The cost of getting to the start node is 0!\n\n // While not done processing all the nodes...\n\n // Loop through all the edges (edges array list).\n // Skip those edges whose source is doesn't match the node we're working on.\n\n // For edge (that has source of current node) figure out potential to\n // get it. (How much does it cost to get to node we're on? Add to\n // that the cost of the edge. That's the new price to set to dest of edge.\n\n // Is that a new low cost for that dest edge node?\n // Or is the dest edge node cost currently UNKNOWN? That means we have no cost.\n // If so, store the cost. Store the parent.\n\n // Once done with all the edges, mark the current node as\n // done being processed.\n doneWithNode[node] = true;\n\n // Get next node to work on.\n node = getLowestCostUnprocessedNode(costs, doneWithNode);\n\n // Done with while loop\n\n for (int i=0; i<parents.length; i++) {\n System.out.println(\"Node: \" + i + \" Cost: \" + costs[i] + \" Backtrace Parent: \" + parents[i]);\n }\n\n backtrace(dest, parents);\n }",
"public List<PathResult> findShortestPathsToEveryNode(final String rootNode, final Graph graph) {\n final List<String> vertices = graph.getVertices();\n final List<String> visitedVertices = startingVisitedNodes(rootNode);\n final Map<String, DijkstraEntry> table = createInitialTable(rootNode, vertices);\n\n for (int i = 0; i < visitedVertices.size(); i++) {\n final String currentVertex = visitedVertices.get(i);\n final List<String> unvisitedAdjacentVertices = getUnvisitedAdjacentVertices(\n currentVertex,\n graph,\n visitedVertices);\n\n unvisitedAdjacentVertices.forEach(vertex -> {\n final DijkstraEntry previousNodeEntry = table.get(currentVertex);\n\n final Integer cost =\n graph.getWeight(currentVertex, vertex) + previousNodeEntry\n .getShortestDistance();\n\n final DijkstraEntry entry = table.get(vertex);\n final Integer currentShortestDistance = entry.getShortestDistance();\n\n if (Objects.isNull(currentShortestDistance) || cost < currentShortestDistance) {\n final DijkstraEntry updatedEntry = entry.withDistance(cost)\n .withPreviousVertex(currentVertex);\n table.put(vertex, updatedEntry);\n }\n });\n\n final String unvisitedWithSmallestDistance = unvisitedWithSmallestDistance(\n unvisitedAdjacentVertices, table);\n\n if (unvisitedAdjacentVertices.isEmpty()) {\n break;\n }\n visitedVertices.add(unvisitedWithSmallestDistance);\n }\n\n return createPathResultsFromTable(rootNode, table, vertices);\n }",
"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 }",
"@Test(expected = Exception.class)\n public void testOnePillarMaze() throws Exception {\n shortestPath = MazeSolver.pStar(onePillarMaze, 1);\n }",
"public void computeAllPaths(String source)\r\n {\r\n Vertex sourceVertex = network_topology.get(source);\r\n Vertex u,v;\r\n double distuv;\r\n\r\n Queue<Vertex> vertexQueue = new PriorityQueue<Vertex>();\r\n \r\n \r\n // Switch between methods and decide what to do\r\n if(routing_method.equals(\"SHP\"))\r\n {\r\n // SHP, weight of each edge is 1\r\n sourceVertex.minDistance = 0;\r\n vertexQueue.add(sourceVertex);\r\n while(!vertexQueue.isEmpty())\r\n {\r\n u = vertexQueue.remove();\r\n for (String key : u.adjacentVertices.keySet())\r\n {\r\n v = network_topology.get(key);\r\n distuv = u.minDistance + 1;\r\n if(distuv < v.minDistance)\r\n {\r\n v.minDistance = distuv;\r\n v.previous = u;\r\n vertexQueue.add(v);\r\n }\r\n }\r\n \r\n }\r\n \r\n }\r\n \r\n else if (routing_method.equals(\"SDP\"))\r\n {\r\n // SDP, weight of each edge is it's propagation delay\r\n sourceVertex.minDistance = 0;\r\n vertexQueue.add(sourceVertex);\r\n while(!vertexQueue.isEmpty())\r\n {\r\n u = vertexQueue.remove();\r\n for (String key : u.adjacentVertices.keySet())\r\n {\r\n v = network_topology.get(key);\r\n distuv = u.minDistance + u.adjacentVertices.get(key).propDelay;\r\n if(distuv < v.minDistance)\r\n {\r\n v.minDistance = distuv;\r\n v.previous = u;\r\n vertexQueue.add(v);\r\n }\r\n } \r\n }\r\n }\r\n else if (routing_method.equals(\"LLP\"))\r\n {\r\n // LLP, weight each edge is activeCircuits/AvailableCircuits\r\n sourceVertex.minDistance = 0;\r\n vertexQueue.add(sourceVertex);\r\n while(!vertexQueue.isEmpty())\r\n {\r\n u = vertexQueue.remove();\r\n for (String key : u.adjacentVertices.keySet())\r\n {\r\n v = network_topology.get(key);\r\n distuv = Math.max(u.minDistance,u.adjacentGet(key).load());\r\n //System.out.println(u.adjacentGet(key).load());\r\n if(distuv < v.minDistance)\r\n {\r\n v.minDistance = distuv;\r\n v.previous = u;\r\n vertexQueue.add(v);\r\n }\r\n }\r\n }\r\n }\r\n }",
"@Test\n public void testPathAlongBorder() {\n try {\n //link row 1\n largeMaze.linkPillars(Maze.position(0, 0), Maze.position(1, 0));\n largeMaze.linkPillars(Maze.position(1, 0), Maze.position(2, 0));\n largeMaze.linkPillars(Maze.position(2, 0), Maze.position(3, 0));\n largeMaze.linkPillars(Maze.position(3, 0), Maze.position(4, 0));\n largeMaze.linkPillars(Maze.position(4, 0), Maze.position(4, 1));\n\n //link row 2\n largeMaze.linkPillars(Maze.position(4, 1), Maze.position(4, 2));\n\n //link row 3\n largeMaze.linkPillars(Maze.position(4, 2), Maze.position(4, 3));\n\n //link row 4\n largeMaze.linkPillars(Maze.position(4, 3), Maze.position(4, 4));\n\n //set beginning and end\n largeMaze.setBegin(Maze.position(0, 0));\n largeMaze.setEnd(Maze.position(4, 4));\n shortestPath = MazeSolver.pStar(largeMaze, 25);\n\n assertEquals(\"<0, 0>\", shortestPath.get(0).getCoordinateString());\n assertEquals(\"<1, 0>\", shortestPath.get(1).getCoordinateString());\n assertEquals(\"<2, 0>\", shortestPath.get(2).getCoordinateString());\n assertEquals(\"<3, 0>\", shortestPath.get(3).getCoordinateString());\n assertEquals(\"<4, 0>\", shortestPath.get(4).getCoordinateString());\n assertEquals(\"<4, 1>\", shortestPath.get(5).getCoordinateString());\n assertEquals(\"<4, 2>\", shortestPath.get(6).getCoordinateString());\n assertEquals(\"<4, 3>\", shortestPath.get(7).getCoordinateString());\n assertEquals(\"<4, 4>\", shortestPath.get(8).getCoordinateString());\n\n assertEquals(9, shortestPath.size());\n\n } catch (Exception e) {\n fail(\"Unexpected exception was thrown while linking pillars.\");\n }\n }",
"public void findShortestPath(String startName, String endName) {\n checkValidEndpoint(startName);\n checkValidEndpoint(endName);\n\n Vertex<String> start = vertices.get(startName);\n Vertex<String> end = vertices.get(endName);\n\n double totalDist; // totalDist must be update below\n\n Map<Vertex<String>, Double> distance = new HashMap<>();\n Map<Vertex<String>, Vertex<String>> previous = new HashMap<>();\n Set<Vertex<String>> explored = new HashSet<>();\n PriorityQueue<VertexDistancePair> pq = new PriorityQueue<>();\n\n\n\n addPQ(distance, start, pq, previous);\n\n\n\n dijkstraHelper(pq, end, explored, distance, previous);\n\n\n\n\n\n\n totalDist = distance.get(end);\n List<Edge<String>> path = getPath(end, start);\n printPath(path, totalDist);\n }",
"@Test\r\n public void edgesTest(){\r\n DirectedGraph test= new DirectedGraph();\r\n //create new shops \r\n Shop one=new Shop(1,new Location(10,10));\r\n Shop two =new Shop(2,new Location(20,20));\r\n Shop three=new Shop(3,new Location(30,30));\r\n Shop four=new Shop(4,new Location(40,40));\r\n\r\n //add them as nodes\r\n assertEquals(test.addNode(one),true);\r\n assertEquals(test.addNode(two),true);\r\n assertEquals(test.addNode(three),true);\r\n assertEquals(test.addNode(four),true);\r\n //create edges \r\n test.createEdges();\r\n\r\n //make sure everyone is connected properly \r\n assertEquals(test.getEdgeWeight(one,two),20);\r\n assertEquals(test.getEdgeWeight(one,three),40);\r\n assertEquals(test.getEdgeWeight(one,four),60);\r\n assertEquals(test.getEdgeWeight(two,one),20);\r\n assertEquals(test.getEdgeWeight(two,three),20);\r\n assertEquals(test.getEdgeWeight(two,four),40);\r\n assertEquals(test.getEdgeWeight(three,one),40);\r\n assertEquals(test.getEdgeWeight(three,two),20);\r\n assertEquals(test.getEdgeWeight(three,four),20);\r\n assertEquals(test.getEdgeWeight(four,one),60);\r\n assertEquals(test.getEdgeWeight(four,two),40);\r\n assertEquals(test.getEdgeWeight(four,three),20);\r\n }",
"public static void main(String[] args) {\n Grafo g = new Grafo(6); \r\n g.addAresta(5, 2); \r\n g.addAresta(5, 0); \r\n g.addAresta(4, 0); \r\n g.addAresta(4, 1); \r\n g.addAresta(2, 3); \r\n g.addAresta(3, 1); \r\n System.out.println(\"Grafo ordenado topologicamente pelo algoritmo de Kahn:\"); \r\n g.topologicalSort(); \r\n \r\n System.out.println(\"\\n\\n\\n\");\r\n \r\n // Cria um grafo e adiciona as arestas com seus pesos\r\n GrafoComplexo gc = new GrafoComplexo(6); \r\n gc.addAresta(0, 1, 5); \r\n gc.addAresta(0, 2, 3); \r\n gc.addAresta(1, 3, 6); \r\n gc.addAresta(1, 2, 2); \r\n gc.addAresta(2, 4, 4); \r\n gc.addAresta(2, 5, 2); \r\n gc.addAresta(2, 3, 7); \r\n gc.addAresta(3, 4, -1); \r\n gc.addAresta(4, 5, -2); \r\n \r\n int s = 1; \r\n System.out.println(\"Caminho mais curto desde a origem \" + s ); \r\n gc.shortestPath(s); \r\n }",
"@Test\n\tpublic void checkShortestRoute() {\n\t\tassertEquals(Trains.shortestRoute(\"A\",\"C\"), 9);\n\t\t//assertEquals(Trains.shortestRoute(\"B\",\"B\"), 9);\n\t}",
"@Test\n public void testShortestPath() {\n int[] route = new int[]{1, 2, 3, 4};\n List<TDoubleArrayList> travelTimes = new ArrayList<>();\n travelTimes.add(new TDoubleArrayList(new double[] {10d, 200d}));\n travelTimes.add(new TDoubleArrayList(new double[] {100d}));\n travelTimes.add(new TDoubleArrayList(new double[] {50d, 10d}));\n travelTimes.add(new TDoubleArrayList(new double[] {70d}));\n travelTimes.add(new TDoubleArrayList());\n\n TravelTimeMinimizingSplitter instance = new TravelTimeMinimizingSplitter();\n\n Collection<int[]> shortestPath = instance.shortestPath(route, travelTimes);\n\n assertEquals(3, shortestPath.size());\n\n assertTrue(shortestPath.stream().anyMatch(r -> Arrays.equals(r, new int[]{1})));\n assertTrue(shortestPath.stream().anyMatch(r -> Arrays.equals(r, new int[]{2})));\n assertTrue(shortestPath.stream().anyMatch(r -> Arrays.equals(r, new int[]{3, 4})));\n\n }",
"public void testAStarSearch() {\n\t\ttry {\r\n\t\t\t// EightPuzzleBoard extreme = new EightPuzzleBoard(new int[]\r\n\t\t\t// {2,0,5,6,4,8,3,7,1});\r\n\t\t\t// EightPuzzleBoard extreme = new EightPuzzleBoard(new int[]\r\n\t\t\t// {0,8,7,6,5,4,3,2,1});\r\n\t\t\tEightPuzzleBoard board = new EightPuzzleBoard(new int[] { 7, 1, 8,\r\n\t\t\t\t\t0, 4, 6, 2, 3, 5 });\r\n\r\n\t\t\tProblem problem = new Problem(board,\r\n\t\t\t\t\tnew EightPuzzleSuccessorFunction(),\r\n\t\t\t\t\tnew EightPuzzleGoalTest(), new ManhattanHeuristicFunction());\r\n\t\t\tSearch search = new AStarSearch(new GraphSearch());\r\n\t\t\tSearchAgent agent = new SearchAgent(problem, search);\r\n\t\t\tassertEquals(23, agent.getActions().size());\r\n\t\t\tassertEquals(\"906\", agent.getInstrumentation().getProperty(\r\n\t\t\t\t\t\"nodesExpanded\"));\r\n\t\t\tassertEquals(\"914\", agent.getInstrumentation().getProperty(\r\n\t\t\t\t\t\"queueSize\"));\r\n\t\t\tassertEquals(\"920\", agent.getInstrumentation().getProperty(\r\n\t\t\t\t\t\"maxQueueSize\"));\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"private Path aStar(AStarNode start, AStarNode end) {\n\n\t/*pre-search setup*/\n astarSetup(end);\n AStarNode current = start;\n current.updateDist(0.0F);\n ArrayList<AStarNode> openSet = new ArrayList<>(getNodes().size());\n addNode(openSet, start);\n start.setFound(true);\n\n while (!openSet.isEmpty()) { // While there are nodes to evaluate\n if (current.equals(end)) // When reached the destination\n return createPath(start, end);\n openSet.remove(current); // Removes the node whose shortest distance from start position is determined\n current.setVisited(true); // marking the field that is added to closedSet\n \n for (AStarNode neighbor : current.getConnections()) { \n if (!neighbor.isVisited() && !neighbor.found()) { // if it is not seen before, add to open list\n addNode(openSet,neighbor);\n neighbor.setFound(true);\n neighbor.setPrevious(current);\n neighbor.setHeruistic(end);\n neighbor.updateDist(current.getDist() + current.getDistTo(neighbor));\n }\n else if(!neighbor.isVisited()){ //If seen before, update cost.\n double tempGScore = current.getDist() + current.getDistTo(neighbor);\n if (neighbor.getDist() > tempGScore) {\n neighbor.updateDist(tempGScore);\n neighbor.setPrevious(current);\n neighbor.setHeruistic(end);\n }\n }\n }\n current = getMinFScore(openSet); // setting next node as a node with minimum fScore.\n }\n\t\n\t/*If search ends without returning a path, there is no possible path.*/\n throw new PathFindingAlgorithm.AlgorithmFailureException();\n }",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint cities = sc.nextInt();\n\t\tint roadlines = sc.nextInt();\n\t\tsc.nextLine(); // for reading string in nextline\n\t\tEdgeWeightedGraph edge = new EdgeWeightedGraph(cities);\n\t\t// The Time Complexity is O(E)\n\t\t// The road lines is the number of edges\n\t\tfor (int i = 0; i < roadlines; i++) {\n\t\t\tString[] tokens = sc.nextLine().split(\" \");\n\t\t\tedge.addEdge(new Edge(Integer.parseInt(tokens[0]), Integer.parseInt(tokens[1]),\n\t\t\t\tDouble.parseDouble(tokens[2])));\n\t\t}\n\t\tString caseToGo = sc.nextLine();\n\t\tswitch (caseToGo) {\n\t\tcase \"Graph\":\n\t\t\t//Print the Graph Object.\n\t\t\tSystem.out.println(edge);\n\t\t\tbreak;\n\n\t\tcase \"DirectedPaths\":\n\t\t\t// Handle the case of DirectedPaths, where two integers are given.\n\t\t\t// First is the source and second is the destination.\n\t\t\t// If the path exists print the distance between them.\n\t\t\t// Other wise print \"No Path Found.\"\n\t\t\tString[] input = sc.nextLine().split(\" \");\n\t\t\tDijkstraSP shortest = new DijkstraSP(\n edge, Integer.parseInt(input[0]));\n double distance = shortest.distTo(Integer.parseInt(input[1]));\n // The time complexity is O(1)\n if (!shortest.hasPathTo(Integer.parseInt(input[1]))) {\n \tSystem.out.println(\"No Path Found.\");\n } else {\n \tSystem.out.println(distance);\n }\n\t\t\tbreak;\n\n\t\tcase \"ViaPaths\":\n\t\t\t// Handle the case of ViaPaths, where three integers are given.\n\t\t\t// First is the source and second is the via is the one where path should pass throuh.\n\t\t\t// third is the destination.\n\t\t\t// If the path exists print the distance between them.\n\t\t\t// Other wise print \"No Path Found.\"\n\t\t\tString[] str1 = sc.nextLine().split(\" \");\n\t\t\tboolean flag1 = false;\n\t\t\tboolean flag2 = false;\n\t\t\tdouble distance1 = 0.0;\n\t\t\tdouble distance2 = 0.0;\n\t\t\tDijkstraSP shortest1 = new DijkstraSP(edge, Integer.parseInt(str1[0]));\n\t\t\t// Time Complexity: O(1)\n\t\t\tif (shortest1.hasPathTo(Integer.parseInt(str1[1]))) {\n\t\t\t\tflag1 = true;\n\t\t\t\tdistance1 = shortest1.distance(Integer.parseInt(str1[1]));\n\t\t\t}\n\t\t\tDijkstraSP shortest2 = new DijkstraSP(edge, Integer.parseInt(str1[1]));\n\t\t\t// Time Complexity: O(1)\n\t\t\tif (shortest2.hasPathTo(Integer.parseInt(str1[2]))) {\n\t\t\t\tflag2 = true;\n\t\t\t\tdistance2 = shortest2.distance(Integer.parseInt(str1[2]));\n\t\t\t}\n\t\t\tdouble Distance = distance1 + distance2;\n\t\t\t// Time Complexity: O(1)\n\t\t\tif (flag1 && flag2) {\n\t\t\t// Displays output upto 1 decimal point\n\t\t\tSystem.out.format(\"%.1f\", Distance);\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"No Path Found.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tSystem.out.println();\n ArrayList<Integer> path = new ArrayList<>();\n for (Edge eachlink : shortest1.pathTo(Integer.parseInt(str1[1]))) {\n int either = eachlink.either();\n int other = eachlink.other(eachlink.either());\n if (!path.contains(other)) {\n path.add(other);\n }\n if (!path.contains(either)) {\n path.add(either);\n }\n }\n for (Edge eachlink1 : shortest2.pathTo(Integer.parseInt(str1[2]))) {\n int either1 = eachlink1.either();\n int other1 = eachlink1.other(eachlink1.either());\n if (!path.contains(other1)) {\n path.add(other1);\n }\n if (!path.contains(either1)) {\n path.add(either1);\n }\n }\n for (int everyval : path) {\n System.out.print(everyval + \" \");\n }\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t}",
"@Test\n public void restrictedEdges() {\n int costlySource = graph.edge(0, 1).setDistance(5).set(speedEnc, 10, 10).getEdge();\n graph.edge(1, 2).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(2, 3).setDistance(1).set(speedEnc, 10, 10);\n int costlyTarget = graph.edge(3, 4).setDistance(5).set(speedEnc, 10, 10).getEdge();\n int cheapSource = graph.edge(0, 5).setDistance(1).set(speedEnc, 10, 10).getEdge();\n graph.edge(5, 6).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(6, 7).setDistance(1).set(speedEnc, 10, 10);\n int cheapTarget = graph.edge(7, 4).setDistance(1).set(speedEnc, 10, 10).getEdge();\n graph.edge(2, 6).setDistance(1).set(speedEnc, 10, 10);\n\n assertPath(calcPath(0, 4, cheapSource, cheapTarget), 0.4, 4, 400, nodes(0, 5, 6, 7, 4));\n assertPath(calcPath(0, 4, cheapSource, costlyTarget), 0.9, 9, 900, nodes(0, 5, 6, 2, 3, 4));\n assertPath(calcPath(0, 4, costlySource, cheapTarget), 0.9, 9, 900, nodes(0, 1, 2, 6, 7, 4));\n assertPath(calcPath(0, 4, costlySource, costlyTarget), 1.2, 12, 1200, nodes(0, 1, 2, 3, 4));\n }",
"public double dijkstra(NodoArista[][] adjacencyMatrix, int startVertex, int nodoBuscado, ListaEnlazada lista) {\n int nVertices = adjacencyMatrix[0].length;\n // shortestDistances[i] will hold the shortest distance from src to i\n double[] shortestDistances = new double[nVertices];\n double[] precios = new double[nVertices];\n // added[i] will true if vertex i is included / in shortest path tree or shortest distance from src to i is finalized \n boolean[] added = new boolean[nVertices];\n\n // Initialize all distances as INFINITE and added[] as false \n for (int vertexIndex = 0; vertexIndex < nVertices; vertexIndex++) {\n shortestDistances[vertexIndex] = Integer.MAX_VALUE;\n precios[vertexIndex] = Integer.MAX_VALUE;\n added[vertexIndex] = false;\n }\n // Distance of source vertex from itself is always 0 \n shortestDistances[startVertex] = 0;\n precios[startVertex] = 0;\n // Parent array to store shortest path tree \n int[] parents = new int[nVertices];\n // The starting vertex does not have a parent \n parents[startVertex] = NO_PARENT;\n\n // Find shortest path for all vertices \n for (int i = 1; i < nVertices; i++) {\n // Pick the minimum distance vertex from the set of vertices not yet processed. nearestVertex is always equal to startNode in first iteration. \n int nearestVertex = -1;\n double shortestDistance = Integer.MAX_VALUE;\n double precio = Integer.MAX_VALUE;\n for (int vertexIndex = 0; vertexIndex < nVertices; vertexIndex++) {\n if (!added[vertexIndex] && shortestDistances[vertexIndex] < shortestDistance) {\n nearestVertex = vertexIndex;\n shortestDistance = shortestDistances[vertexIndex];\n precio = precios[vertexIndex];\n }\n }\n\n // Mark the picked vertex as processed \n added[nearestVertex] = true;\n\n // Update dist value of the adjacent vertices of the picked vertex. \n for (int vertexIndex = 0; vertexIndex < nVertices; vertexIndex++) {\n double edgeDistance = adjacencyMatrix[nearestVertex][vertexIndex].getPeso();\n double precioActual = adjacencyMatrix[nearestVertex][vertexIndex].getPrecio();\n double edgePrice = adjacencyMatrix[nearestVertex][vertexIndex].getPrecio();\n if (edgeDistance > 0 && ((shortestDistance + edgeDistance) < shortestDistances[vertexIndex])) {\n parents[vertexIndex] = nearestVertex;\n shortestDistances[vertexIndex] = shortestDistance + edgeDistance;\n precios[vertexIndex] = precio + precioActual;\n }\n if (edgePrice > 0 && ((shortestDistance + edgeDistance) < shortestDistances[vertexIndex])) {\n parents[vertexIndex] = nearestVertex;\n shortestDistances[vertexIndex] = shortestDistance + edgeDistance;\n precios[vertexIndex] = precio + precioActual;\n }\n }\n }\n printSolution(startVertex, shortestDistances, parents);\n printSolutionPara(startVertex, shortestDistances, parents, nodoBuscado, lista);\n\n return precios[nodoBuscado];\n }",
"@Test\r\n\tpublic void test_Big_Graph() {\n\t\tweighted_graph g = new WGraph_DS();\r\n\t\tint size = 1000*1000;\r\n\t\tint ten=1;\r\n\t\tfor (int i = 0; i <size; i++) {\r\n\t\t\tg.addNode(i);\r\n\t\t}\r\n\r\n\t\tfor (int i = 0; i <size; i++) {\r\n\t\t\tint dest=i;\r\n\t\t\tg.connect(size-2, i, 0.23); \r\n\r\n\t\t\tif(i<size-1){\r\n\t\t\t\tg.connect(i,++dest,0.78);\r\n\t\t\t}\r\n\t\t\tif(i%2==0&&i<size-2) {\r\n\t\t\t\tg.connect(i,2+dest,0.94);\r\n\t\t\t}\t\r\n\r\n\t\t\tif(ten==i&&(i%2==0)) {\r\n\t\t\t\tfor (int j =0 ; j <size; j++) {\r\n\t\t\t\t\tg.connect(ten, j,0.56);\r\n\t\t\t\t\tg.connect(ten-2, j, 0.4);\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tten=ten*10;\r\n\t\t\t}\r\n\r\n\r\n\t\t}\r\n\r\n\r\n\t\tweighted_graph_algorithms algo = new WGraph_Algo();\r\n\t\talgo.init(g);\r\n\t\tassertTrue(algo.isConnected());\r\n\t\tassertEquals(algo.shortestPathDist(0, 999998),0.23);\r\n\t\tassertEquals(algo.shortestPathDist(0, 8),0.46);\r\n\t\tint expected2 []= {6,999998,8};\r\n\t\tint actual2 [] = new int [3];\r\n\t\tint i=0;\r\n\t\tfor(node_info n :algo.shortestPath(6, 8)) {\r\n\t\t\tactual2[i++]=n.getKey();\r\n\t\t}\r\n\t\tassertArrayEquals(expected2,actual2);\r\n\r\n\t}",
"@Test\n public void sourceEqualsTarget() {\n graph.edge(0, 1).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(0, 2).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(1, 2).setDistance(1).set(speedEnc, 10, 10);\n assertPath(calcPath(0, 0, 0, 1), 0.3, 3, 300, nodes(0, 1, 2, 0));\n assertPath(calcPath(0, 0, 1, 0), 0.3, 3, 300, nodes(0, 2, 1, 0));\n // without restrictions the weight should be zero\n assertPath(calcPath(0, 0, ANY_EDGE, ANY_EDGE), 0, 0, 0, nodes(0));\n // in some cases no path is possible\n assertNotFound(calcPath(0, 0, 1, 1));\n assertNotFound(calcPath(0, 0, 5, 1));\n }",
"@Override\n public List dijkstrasShortestPath(T start, T end) {\n Vertex<T> origin = new Vertex<>(start);\n Vertex<T> destination = new Vertex<>(end);\n List<Vertex<T>> path;\n\n settledNodes = new HashSet<>();\n unSettledNodes = new HashSet<>();\n distancesBetweenNodes = new HashMap<>();\n predecessors = new HashMap<>();\n\n distancesBetweenNodes.put(origin,0);\n unSettledNodes.add(origin);\n\n while(unSettledNodes.size() > 0){\n Vertex<T> minimumWeightedVertex = getMinimum(unSettledNodes);\n settledNodes.add(minimumWeightedVertex);\n unSettledNodes.remove(minimumWeightedVertex);\n findMinimumDistance(minimumWeightedVertex);\n }\n path = getPath(destination);\n return path;\n\n }",
"public void testDijkstra() {\n \t\tfinal Dijkstra model = new Dijkstra();\n \t\tfinal Formula noDeadlocks = model.dijkstraPreventsDeadlocksAssertion();\n \t\tfinal Solution sol = solve(noDeadlocks, model.bounds(6,6,6));\n //\t\tUNSATISFIABLE\n//\t\tp cnf 4344 18609\n //\t\tprimary variables: 444\n \t\tassertEquals(Solution.Outcome.UNSATISFIABLE, sol.outcome());\n \t\tassertEquals(444, sol.stats().primaryVariables());\n \t\tassertEquals(4344, sol.stats().variables());\n\t\tassertEquals(18609, sol.stats().clauses());\n \t}",
"@Test\n public void testShortestPath() {\n Pillar p = new Pillar(0, 0);\n Pillar q = new Pillar(0, 1);\n q.setPrevious(p);\n List<Pillar> path = MazeSolver.shortestPath(q);\n assertEquals(2, path.size());\n assertEquals(p, path.get(0));\n assertEquals(q, path.get(1));\n }",
"@Test\n public void test_shortcut_needed_basic() {\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, Double.POSITIVE_INFINITY);\n graph.addEdge(1, 2, edge++, 10, Double.POSITIVE_INFINITY);\n graph.addEdge(2, 3, edge++, 10, Double.POSITIVE_INFINITY);\n graph.addEdge(3, 4, edge++, 10, Double.POSITIVE_INFINITY);\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 void bellmanFord(IWeightedGraph<N, E> graph, int startnode) {\n\t\tif(graph == null){\n\t\t\tthrow new NullPointerException();\n\t\t}else if (startnode < 0 || startnode > graph.numberOfNodes()-1){\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\n\n\t\tfor(int i= 0; i<shortestPaths.length;i++){\n\t\t\tshortestPaths[i] = Double.POSITIVE_INFINITY;\n\t\t}\n\t\tshortestPaths[startnode] = 0;\n\n\t\tfor(int i= 1; i<graph.numberOfNodes(); i++){\n\t\t\tIterator<IEdge<E>> edgesIterator = graph.edgeIterator();\n\t\t\twhile(edgesIterator.hasNext()){\n\t\t\t\tIEdge<E> edge = edgesIterator.next();\n\t\t\t\tif(shortestPaths[edge.getSource()] + edge.getWeight() < shortestPaths[edge.getDestination()]){\n\t\t\t\t\tshortestPaths[edge.getDestination()] = shortestPaths[edge.getSource()] + edge.getWeight();\n\t\t\t\t\tpreviousNode[edge.getDestination()] = edge.getSource();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}",
"public void testGraphhopper(){\n GraphHopper hopper = new GraphHopperOSM().forServer();\n hopper.setDataReaderFile(GraphhopperProperties.getString(\"OSMFile\"));\n // where to store graphhopper files?\n hopper.setGraphHopperLocation(GraphhopperProperties.getString(\"LocationHopperData\"));\n hopper.setEncodingManager(new EncodingManager(GraphhopperProperties.getString(\"EncodingManager\")));\n\n // now this can take minutes if it imports or a few seconds for loading\n // of course this is dependent on the area you import\n hopper.importOrLoad();\n\n List<GHPoint> points = new ArrayList<>();\n points.add(new GHPoint(-17.7580821, -63.1746598));\n points.add(new GHPoint(-17.7584948, -63.1749769));\n points.add(new GHPoint(-17.7600252, -63.1712026));\n \n // simple configuration of the request object, see the GraphHopperServlet classs for more possibilities.\n GHRequest req = new GHRequest(points).\n setWeighting(GraphhopperProperties.getString(\"Weighting\")).\n setVehicle(GraphhopperProperties.getString(\"Vehicule\")).\n setLocale(Locale.US);\n GHResponse rsp = hopper.route(req);\n\n // first check for errors\n if(rsp.hasErrors()) {\n // handle them!\n // rsp.getErrors()\n System.out.println(\"ocurrio un error\");\n System.out.println(rsp.toString());\n return;\n }\n\n // use the best path, see the GHResponse class for more possibilities.\n PathWrapper path = rsp.getBest();\n\n // points, distance in meters and time in millis of the full path\n PointList pointList = path.getPoints();\n double distance = path.getDistance();\n long timeInMs = path.getTime();\n \n System.out.println(\"Distancia total--\"+distance);\n\n InstructionList il = path.getInstructions();\n // iterate over every turn instruction\n for(Instruction instruction : il) {\n System.out.println(instruction.getDistance());\n }\n\n // or get the json\n List<Map<String, Object>> iList = il.createJson();\n\n // or get the result as gpx entries:\n List<GPXEntry> list = il.createGPXList();\n }",
"public static void main(String[] args) {\n Graph graph = new Graph();\n graph.addEdge(0, 1);\n graph.addEdge(0, 4);\n\n graph.addEdge(1,0);\n graph.addEdge(1,5);\n graph.addEdge(1,2);\n graph.addEdge(2,1);\n graph.addEdge(2,6);\n graph.addEdge(2,3);\n\n graph.addEdge(3,2);\n graph.addEdge(3,7);\n\n graph.addEdge(7,3);\n graph.addEdge(7,6);\n graph.addEdge(7,11);\n\n graph.addEdge(5,1);\n graph.addEdge(5,9);\n graph.addEdge(5,6);\n graph.addEdge(5,4);\n\n graph.addEdge(9,8);\n graph.addEdge(9,5);\n graph.addEdge(9,13);\n graph.addEdge(9,10);\n\n graph.addEdge(13,17);\n graph.addEdge(13,14);\n graph.addEdge(13,9);\n graph.addEdge(13,12);\n\n graph.addEdge(4,0);\n graph.addEdge(4,5);\n graph.addEdge(4,8);\n graph.addEdge(8,4);\n graph.addEdge(8,12);\n graph.addEdge(8,9);\n graph.addEdge(12,8);\n graph.addEdge(12,16);\n graph.addEdge(12,13);\n graph.addEdge(16,12);\n graph.addEdge(16,17);\n graph.addEdge(17,13);\n graph.addEdge(17,16);\n graph.addEdge(17,18);\n\n graph.addEdge(18,17);\n graph.addEdge(18,14);\n graph.addEdge(18,19);\n\n graph.addEdge(19,18);\n graph.addEdge(19,15);\n LinkedList<Integer> visited = new LinkedList();\n List<ArrayList<Integer>> paths = new ArrayList<ArrayList<Integer>>();\n int currentNode = START;\n visited.add(START);\n new searchEasy().findAllPaths(graph, visited, paths, currentNode);\n for(ArrayList<Integer> path : paths){\n for (Integer node : path) {\n System.out.print(node);\n System.out.print(\" \");\n }\n System.out.println();\n }\n }",
"@Override\n\tpublic List<Path> getShortestRoute(Location src, Location dest, String edgePropertyName) {\n\t\t//array to keep track of visited vertexes\n\t\tboolean[] visited = new boolean[locations.size()];\n\t\t//array to store weights\n\t\tdouble[] weight = new double[locations.size()];\n\t\t//array to store predecessors\n\t\tLocation[] pre = new Location[locations.size()];\n\t\t//creates priority queue\n\t\tPriorityQueue<LocWeight> pq = new PriorityQueue<LocWeight>();\n\t\t// initializes every vertex misted mark to false\n\t\tfor (int i = 0; i < visited.length; i++)\n\t\t\tvisited[i] = false;\n\t\t// initializes every vertex's total weight to infinity\n\t\tfor (int i = 0; i < weight.length; i++)\n\t\t\tweight[i] = Double.POSITIVE_INFINITY;\n\t\t// initializes every vertex's predecessor to null\n\t\tfor (int i = 0; i < pre.length; i++)\n\t\t\tpre[i] = null;\n\t\t//sets start vertex's total weight to 0\n\t\tweight[locations.indexOf(src)] = 0;\n\t\t//insert start vertex in priroty queue\n\t\tpq.add(new LocWeight(src, 0.0));\n\t\t\n\t\tString[] edgeNames = getEdgePropertyNames();\n\t\tint indexProp = 0;\n\t\tfor (int i = 0; i < edgeNames.length; i++) {\n\t\t\tif (edgeNames[i].equalsIgnoreCase(edgePropertyName))\n\t\t\t\tindexProp = i;\n\t\t}\n\t\twhile (!pq.isEmpty()) {\n\t\t\tLocWeight c = pq.remove();\n\t\t\t//set C's visited mark to true\n\t\t\tvisited[locations.indexOf(c)] = true;\n\n\t\t\tList<Location> neighbors = getNeighbors(c.getLocation());\n\t\t\t//for each unvisited successor adjacent to C\n\t\t\tfor (int i = 0; i < neighbors.size(); i++) {\n\t\t\t\tif (visited[locations.indexOf(neighbors.get(i))] == false) {\n\t\t\t\t\t//change successor's total weight to equal C's weight + edge weight from C to successor\n\t\t\t\t\tweight[locations.indexOf(neighbors.get(i))] = c.getWeight() + getEdgeIfExists(c.getLocation(), neighbors.get(i)).getProperties().get(indexProp);\n\t\t\t\t\tpre[locations.indexOf(neighbors.get(i))] = c.getLocation();\n\t\t\t\t\tLocWeight succ = new LocWeight(neighbors.get(i), weight[locations.indexOf(neighbors.get(i))]);\n\t\t\t\t\t//if successor is already in pq, update its total weight\n\t\t\t\t\tif (pq.contains(succ)) {\n\t\t\t\t\t\tpq.remove(succ);\n\t\t\t\t\t}\n\t\t\t\t\t//if not already there, add\n\t\t\t\t\tpq.add(succ);\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\n\t\t\t\n\n\n\t\t}\n\t\t\n\t\tArrayList<Path> path = new ArrayList<Path>();\n\t\t//find predecessor of each vertex and construct shortest path then return it\n\t\tLocation curr1 = dest;\n\t\twhile (pre[locations.indexOf(curr1)] != null) {\n\t\t\tpath.add(getEdgeIfExists(pre[locations.indexOf(curr1)], curr1));\n\t\t\tcurr1 = pre[locations.indexOf(curr1)];\n\t\t}\n\t\t//to show path from the start\n\t\tfor (int i = path.size() - 1; i >= 0; i--)\n\t\t\tpath.add(path.remove(i));\n\n\n\t\treturn path;\n\t}",
"private static ArrayList<Connection> pathFindDijkstra(Graph graph, int start, int goal) {\n\t\tNodeRecord startRecord = new NodeRecord();\r\n\t\tstartRecord.setNode(start);\r\n\t\tstartRecord.setConnection(null);\r\n\t\tstartRecord.setCostSoFar(0);\r\n\t\tstartRecord.setCategory(OPEN);\r\n\t\t\r\n\t\tArrayList<NodeRecord> open = new ArrayList<NodeRecord>();\r\n\t\tArrayList<NodeRecord> close = new ArrayList<NodeRecord>();\r\n\t\topen.add(startRecord);\r\n\t\tNodeRecord current = null;\r\n\t\tdouble endNodeCost = 0;\r\n\t\twhile(open.size() > 0){\r\n\t\t\tcurrent = getSmallestCSFElementFromList(open);\r\n\t\t\tif(current.getNode() == goal){\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tGraphNode node = graph.getNodeById(current.getNode());\r\n\t\t\tArrayList<Connection> connections = node.getConnection();\r\n\t\t\tfor( Connection connection :connections){\r\n\t\t\t\t// get the cost estimate for end node\r\n\t\t\t\tint endNode = connection.getToNode();\r\n\t\t\t\tendNodeCost = current.getCostSoFar() + connection.getCost();\r\n\t\t\t\tNodeRecord endNodeRecord = new NodeRecord();\r\n\t\t\t\t// if node is closed skip it\r\n\t\t\t\tif(listContains(close, endNode))\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t// or if the node is in open list\r\n\t\t\t\telse if (listContains(open,endNode)){\r\n\t\t\t\t\tendNodeRecord = findInList(open, endNode);\r\n\t\t\t\t\t// print\r\n\t\t\t\t\t// if we didn't get shorter route then skip\r\n\t\t\t\t\tif(endNodeRecord.getCostSoFar() <= endNodeCost) {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// else node is not visited yet\r\n\t\t\t\telse {\r\n\t\t\t\t\tendNodeRecord = new NodeRecord();\r\n\t\t\t\t\tendNodeRecord.setNode(endNode);\r\n\t\t\t\t}\r\n\t\t\t\t//update the node\r\n\t\t\t\tendNodeRecord.setCostSoFar(endNodeCost);\r\n\t\t\t\tendNodeRecord.setConnection(connection);\r\n\t\t\t\t// add it to open list\r\n\t\t\t\tif(!listContains(open, endNode)){\r\n\t\t\t\t\topen.add(endNodeRecord);\r\n\t\t\t\t}\r\n\t\t\t}// end of for loop for connection\r\n\t\t\topen.remove(current);\r\n\t\t\tclose.add(current);\r\n\t\t}// end of while loop for open list\r\n\t\tif(current.getNode() != goal)\r\n\t\t\treturn null;\r\n\t\telse { //get the path\r\n\t\t\tArrayList<Connection> path = new ArrayList<>();\r\n\t\t\twhile(current.getNode() != start){\r\n\t\t\t\tpath.add(current.getConnection());\r\n\t\t\t\tint newNode = current.getConnection().getFromNode();\r\n\t\t\t\tcurrent = findInList(close, newNode);\r\n\t\t\t}\r\n\t\t\tCollections.reverse(path);\r\n\t\t\treturn path;\r\n\t\t}\r\n\t}",
"public static <V> void printAllShortestPaths(Graph<V> graph) {\n double[][] matrizPesos = graph.getGraphStructureAsMatrix();\n double[][] pesos = new double[matrizPesos.length][matrizPesos.length];\n V[] vertices = graph.getValuesAsArray();\n V[][] caminos = (V[][]) new Object[matrizPesos.length][matrizPesos.length];\n for (int x = 0; x < matrizPesos.length; x++) {\n for (int y = 0; y < matrizPesos.length; y++) {\n if (x == y) {\n pesos[x][y] = -1;\n } else {\n if (matrizPesos[x][y] == -1) {\n pesos[x][y] = Integer.MAX_VALUE; //Si no existe arista se pone infinito\n } else {\n pesos[x][y] = matrizPesos[x][y];\n }\n }\n caminos[x][y] = vertices[y];\n }\n }\n for (int x = 0; x < vertices.length; x++) { // Para cada uno de los vertices del grafo\n for (int y = 0; y < vertices.length; y++) { // Recorre la fila correspondiente al vertice\n for (int z = 0; z < vertices.length; z++) { //Recorre la columna correspondiente al vertice\n if (y != x && z != x) {\n double tam2 = pesos[y][x];\n double tam1 = pesos[x][z];\n if (pesos[x][z] != -1 && pesos[y][x] != -1) {\n double suma = pesos[x][z] + pesos[y][x];\n if (suma < pesos[y][z]) {\n pesos[y][z] = suma;\n caminos[y][z] = vertices[x];\n }\n }\n }\n }\n }\n }\n\n //Cuando se termina el algoritmo, se imprimen los caminos\n for (int x = 0; x < vertices.length; x++) {\n for (int y = 0; y < vertices.length; y++) {\n boolean seguir = true;\n int it1 = y;\n String hilera = \"\";\n while (seguir) {\n if (it1 != y) {\n hilera = vertices[it1] + \"-\" + hilera;\n } else {\n hilera += vertices[it1];\n }\n if (caminos[x][it1] != vertices[it1]) {\n int m = 0;\n boolean continuar = true;\n while (continuar) {\n if (vertices[m].equals(caminos[x][it1])) {\n it1 = m;\n continuar = false;\n } else {\n m++;\n }\n }\n } else {\n if (x == y) {\n System.out.println(\"El camino entre \" + vertices[x] + \" y \" + vertices[y] + \" es: \" + hilera);\n } else {\n hilera = vertices[x] + \"-\" + hilera;\n if (pesos[x][y] == Integer.MAX_VALUE) {\n System.out.println(\"El camino mas corto entre \" + vertices[x] + \" y \" + vertices[y] + \" es: infinito (no hay camino)\");\n } else {\n System.out.println(\"El camino mas corto entre \" + vertices[x] + \" y \" + vertices[y] + \" es: \" + hilera + \" con distancia de: \" + (pesos[x][y]));\n }\n }\n seguir = false;\n }\n }\n }\n System.out.println();\n }\n }",
"@Test(expected = Exception.class)\n public void testMazeWithoutBeginning() throws Exception {\n //link row 1\n smallMaze.linkPillars(Maze.position(0, 0), Maze.position(1, 0));\n smallMaze.linkPillars(Maze.position(1, 0), Maze.position(2, 0));\n smallMaze.linkPillars(Maze.position(1, 0), Maze.position(1, 1));\n\n //link row 2\n smallMaze.linkPillars(Maze.position(1, 1), Maze.position(2, 1));\n\n //link row 3\n smallMaze.linkPillars(Maze.position(0, 2), Maze.position(1, 2));\n smallMaze.linkPillars(Maze.position(1, 2), Maze.position(2, 2));\n\n //set end\n smallMaze.setEnd(Maze.position(2, 2));\n shortestPath = MazeSolver.pStar(smallMaze, 9);\n }",
"public List<node_info> shortestPath(int src, int dest);",
"@Test\n public void runTest()\n { // Pueblo start to finish 34.97s\n\n\n this.myMap = myReader.readMapFile(\"data/AlamosaNetwork.xml\");\n myMap.setupMapAsServer();\n this.testAgent001 = getTestAgent();\n\n //System.out.println(\"Intersections2: \"+myMap.getIntersections());\n\n testLW.log(Level.INFO, \"this is another nother test\");\n\n System.out.println(\"\\nStarting test. . .\");\n // Pueblo start to finish 34.97s\n // from.setId(\"1040921516\"); // from.setId(\"01\"); // 1040921516 // 2\n // to.setId(\"864162469\"); // to.setId(\"10\"); // 864162469 // 50\n Long startTime = System.nanoTime();\n\n //GRIDheapAlg greedy = new GRIDheapAlg();\n GRIDpathfinder theALG = new GRIDpathfinder(myMap, \"BPR\");\n //GRIDheapDynamicAlg dyna = new GRIDheapDynamicAlg(myMap); //\n //myPathGreedy = greedy.shortestPath(networkMap,\"1040921516\",\"864162469\");\n\n //GRIDselfishAlg test001 = new GRIDselfishAlg(testAgent001, networkMap, 0L); // GRIDpathrecalc GRIDselfishAlg\n //GRIDpathrecalc test001 = new GRIDpathrecalc(testAgent001, networkMap, 0L); // GRIDpathrecalc GRIDselfishAlg\n //GRIDroute outRoute = new GRIDroute();\n /*GRIDpathrecalc test001 = new GRIDpathrecalc(testAgent001, networkMap, 0L); // GRIDpathrecalc GRIDselfishAlg\n outRoute = test001.findPath();*/\n GRIDroute outRoute = theALG.findPath(testAgent001, 0L);\n\n //ListIterator<String> pathIterator = outRoute.Intersections.listIterator();\n\n /*assertNotNull(myMap);\n assertNotNull(outRoute);\n assertTrue(outRoute.Intersections.size() > 0);*/\n\n //System.out.println(\"\\nShortest path: \"+myPathGreedy);\n //System.out.println(\"\\nShortest path: \"+myPathDynamic);\n\n //System.out.print(\"\\nPath:\\n\");\n //for (String intrx : outRoute.getIntersections())\n //{\n // System.out.print(intrx);\n // if(!intrx.equals(testAgent001.getDestination()))\n // System.out.print(\",\");\n //}\n\n //ArrayList<String> tempPathList = myMap.getPathByRoad(outRoute.getIntersections());\n\n //System.out.print(\"\\n\\nPath by Link:\\n\");\n //for (String path : tempPathList)\n //{\n // System.out.print(path);\n // if(!tempPathList.isEmpty()\n // && !path.equals(tempPathList.get(tempPathList.size() - 1)))\n // System.out.print(\",\");\n // }\n\n if(outRoute.getAgent_ID() != \"Destination unreachable\"){\n logWriter.log(Level.INFO, \"Route is: \" + outRoute.toString());\n\n System.out.println(\"Route is: \" + testAgent001.getOrigin() + outRoute.toString()\n +\" \"+testAgent001.getDestination());\n\n System.out.println(\"\\n\\nCalculated Travel Time: \"+outRoute.getcalculatedTravelTime());\n }\n else{\n System.out.println(\"Destination Unreachable\");\n }\n\n long stopTime = System.nanoTime();\n long timeToRun = ((stopTime - startTime)/1000000);\n\n System.out.print(\"\\nTook \" + timeToRun/1000.0 + \" Seconds\");\n System.out.print(\"\\n\\nAnd we're done.\\n\");\n }",
"@Test\n public void should_cover_all_requirement_as_functional_test() throws Exception\n {\n source = StationFactory.build(A);\n target = StationFactory.build(C);\n route = new Route(source, target);\n route.setStations(Arrays.asList(source, StationFactory.build(B), target));\n\n routeCalculatorService = new DistanceOfRouteCalculatorService(graph);\n\n System.out.println(String.format(\"#1:%s\", routeCalculatorService.calculate(route)));\n\n /*\n 2. The distance of the route A-D.\n */\n source = StationFactory.build(A);\n target = StationFactory.build(D);\n route = new Route(source, target);\n route.setStations(Arrays.asList(source, target));\n\n System.out.println(String.format(\"#2:%s\", routeCalculatorService.calculate(route)));\n\n /*\n 3. The distance of the route A-D-C.\n */\n\n source = StationFactory.build(A);\n target = StationFactory.build(C);\n route = new Route(source, target);\n route.setStations(Arrays.asList(source, StationFactory.build(D), target));\n\n System.out.println(String.format(\"#3:%s\", routeCalculatorService.calculate(route)));\n\n /*\n 4. The distance of the route A-E-B-C-D.\n */\n\n source = StationFactory.build(A);\n target = StationFactory.build(D);\n route = new Route(source, target);\n route.setStations(Arrays.asList(source, StationFactory.build(E), StationFactory.build(B), StationFactory.build(C), target));\n\n System.out.println(String.format(\"#4:%s\", routeCalculatorService.calculate(route)));\n\n /*\n 5. The distance of the route A-E-D.\n */\n\n source = StationFactory.build(A);\n target = StationFactory.build(D);\n route = new Route(source, target);\n route.setStations(Arrays.asList(source, StationFactory.build(E), target));\n\n String message = \"\";\n try {\n routeCalculatorService.calculate(route);\n } catch (NoSuchRouteException e) {\n message = e.getMessage();\n }\n\n System.out.println(String.format(\"#5:%s\", message));\n\n /*\n 6. The number of trips starting at C and ending at C with a maximum of 3 stops. In the sample data\n below, there are two such trips: C-D-C (2 stops). and C-E-B-C (3 stops).\n */\n\n source = StationFactory.build(C);\n target = StationFactory.build(C);\n route = new Route(source, target);\n\n routeCalculatorService = new NumberOfRouteWithStopsCalculatorService(graph, new StopsCondition(LESSER_OR_EQUAL, 3));\n\n System.out.println(String.format(\"#6:%s\", routeCalculatorService.calculate(route)));\n\n\n /*\n 7. The number of trips starting at A and ending at C with exactly 4 stops. In the sample data below,\n there are three such trips: A to C (via B,C,D); A to C (via D,C,D); and A to C (via D,E,B).\n */\n\n source = StationFactory.build(A);\n target = StationFactory.build(C);\n route = new Route(source, target);\n\n routeCalculatorService = new NumberOfRouteWithStopsCalculatorService(graph, new StopsCondition(EQUALS, 4));\n\n System.out.println(String.format(\"#7:%s\", routeCalculatorService.calculate(route)));\n\n /*\n 8. The length of the shortest route (in terms of distance to travel) from A to C.\n */\n\n source = StationFactory.build(A);\n target = StationFactory.build(C);\n route = new Route(source, target);\n\n routeCalculatorService = new DistanceOfShortestRouteCalculatorService(graph);\n\n System.out.println(String.format(\"#8:%s\", routeCalculatorService.calculate(route)));\n\n\n /*\n 9. The length of the shortest route (in terms of distance to travel) from B to B.\n */\n\n source = StationFactory.build(B);\n target = StationFactory.build(B);\n route = new Route(source, target);\n\n routeCalculatorService = new DistanceOfShortestRouteCalculatorService(graph);\n\n System.out.println(String.format(\"#9:%s\", routeCalculatorService.calculate(route)));\n\n /*\n 10.The number of different routes from C to C with a distance of less than 30. In the sample data, the\n trips are: CDC, CEBC, CEBCDC, CDCEBC, CDEBC, CEBCEBC, CEBCEBCEBC.\n */\n\n source = StationFactory.build(C);\n target = StationFactory.build(C);\n route = new Route(source, target);\n\n routeCalculatorService = new NumberOfRouteWithDistancesCalculatorService(graph, new DistancesCondition(LESSTHAN, 30));\n\n System.out.println(String.format(\"#10:%s\", routeCalculatorService.calculate(route)));\n\n }",
"@Test\r\n\tpublic void testInputA() {\r\n\t\t//where there is 2 vertices but only 1 edge\r\n\t\tCompetitionDijkstra map1 = new CompetitionDijkstra(\"input-A.txt\", 55,60,92);\r\n\t\tCompetitionFloydWarshall map2= new CompetitionFloydWarshall(\"input-A.txt\", 60,60,92);\r\n\t\tassertEquals(-1, map1.timeRequiredforCompetition());\r\n\t\tassertEquals(-1, map2.timeRequiredforCompetition()); \t\r\n\t}",
"@Test\n public void test1() {\n System.out.println(\"A* Test i1\"); \n \n Solver solver = new Solver(new TileWorld(\"i1.png\"), SearchStrategy.A_STAR);\n AlgorithmResults expResult = new AlgorithmResults(580, 967);\n AlgorithmResults result = solver.solve();\n \n print(result, expResult);\n \n assertEquals(\"BestPathCost does not match!\", expResult.getBestPathCost(), result.getBestPathCost());\n }",
"@Test\n public void testMST3() {\n Vertex v1 = new Vertex(1, \"A\");\n Vertex v2 = new Vertex(2, \"B\");\n Vertex v3 = new Vertex(3, \"C\");\n Vertex v4 = new Vertex(4, \"D\");\n Vertex v5 = new Vertex(5, \"E\");\n Vertex v6 = new Vertex(6, \"F\");\n\n Edge<Vertex> e1 = new Edge<>(v1, v2, 1);\n Edge<Vertex> e2 = new Edge<>(v1, v3, 1);\n Edge<Vertex> e3 = new Edge<>(v3, v4, 1);\n Edge<Vertex> e4 = new Edge<>(v3, v5, 1);\n Edge<Vertex> e5 = new Edge<>(v3, v6, 1);\n Edge<Vertex> e6 = new Edge<>(v2, v4, 10);\n Edge<Vertex> e7 = new Edge<>(v1, v5, 10);\n Edge<Vertex> e8 = new Edge<>(v1, v5, 10);\n Edge<Vertex> e9 = new Edge<>(v5, v6, 10);\n\n\n Graph<Vertex, Edge<Vertex>> g = new Graph<>();\n g.addVertex(v1);\n g.addVertex(v2);\n g.addVertex(v3);\n g.addVertex(v4);\n g.addVertex(v5);\n g.addVertex(v6);\n g.addEdge(e1);\n g.addEdge(e2);\n g.addEdge(e3);\n g.addEdge(e4);\n g.addEdge(e5);\n g.addEdge(e6);\n g.addEdge(e7);\n g.addEdge(e8);\n g.addEdge(e9);\n\n List<Edge> expectedMST = new ArrayList<>();\n expectedMST.add(e1);\n expectedMST.add(e2);\n expectedMST.add(e3);\n expectedMST.add(e4);\n expectedMST.add(e5);\n\n List<Edge<Vertex>> actualMST = g.minimumSpanningTree();\n\n for (int i = 0; i < actualMST.size(); i++) {\n assertTrue(expectedMST.contains(actualMST.get(i)));\n }\n\n for (int i = 0; i < expectedMST.size(); i++) {\n assertTrue(actualMST.contains(expectedMST.get(i)));\n }\n }",
"private void findPath1(List<Coordinate> path) {\n\n // records the start coordinate in a specific sequence.\n ArrayList<Coordinate> starts = new ArrayList<>();\n // records the end coordinate in a specific sequence.\n ArrayList<Coordinate> ends = new ArrayList<>();\n // records the total cost of the path in a specific sequence.\n ArrayList<Integer> cost = new ArrayList<>();\n\n for (Coordinate o1 : originCells) {\n for (Coordinate d1 : destCells) {\n Graph graph = new Graph(getEdge(map));\n graph.dijkstra(o1);\n graph.printPath(d1);\n starts.add(o1);\n ends.add(d1);\n cost.add(graph.getPathCost(d1));\n }\n }\n int index = getMinIndex(cost);\n\n Graph graph = new Graph(getEdge(map));\n graph.dijkstra(starts.get(index));\n graph.printPath(ends.get(index));\n for (Graph.Node node : graph.getPathReference()) {\n path.add(node.coordinate);\n }\n setSuccess(path);\n }",
"@Test\r\n public void testGetRoute() {\r\n // Test 1 (Short Path)\r\n Path route = backend.getRoute(\"Observatory & Babcock\", \"Liden & Babcock\");\r\n // Verify distance is correct\r\n if(route.getDistance() != 460)\r\n fail(\"Failed to get shortest path\");\r\n // Verify path starts at 'Observatory & Babcock' and ends at 'Liden & Babcock'\r\n if(!route.getPath().get(0).getName().equalsIgnoreCase(\"Observatory & Babcock\") ||\r\n !route.getPath().get(1).getName().equalsIgnoreCase(\"Liden & Babcock\"))\r\n fail(\"Failed to get shortest path\");\r\n\r\n //Test 2 (Short Path w/ POIs)\r\n route = backend.getRoute(\"Mills & Johnson\", \"Brooks & Johnson\");\r\n // Verify distance is correct\r\n if(route.getDistance() != 441)\r\n fail(\"Failed to get shortest path\");\r\n // Verify point of interest\r\n if(!route.getPOI().get(0).equalsIgnoreCase(\"Grand Central\"))\r\n fail(\"Failed to find point of interest\");\r\n }",
"public ShortestPath(IWeightedGraph<N,E> graph, int startNode) {\n\t\tthis.graph = graph;\n\t\tthis.startNode = startNode;\n\t\tthis.shortestPaths = new double[graph.numberOfNodes()];\n\t\tthis.previousNode = new int[graph.numberOfNodes()];\n\t\tbellmanFord(this.graph, this.startNode);\n\t}",
"public static void expandirNodo(Nodo nodoAexp , ArrayList<Nodo>frontera ,\n \t\t HeuristicaInterf heur, HashMap <String, String> mapaEstadosgen ){ \n //listado de nodos posibles al expandir\n ArrayList <Accion> acciones = nodoAexp.estado.accionesPosibles(null);\n Iterator<Accion> itrAcciones = acciones.iterator();\n\n \n int mejorCosto = -1 ;\n \n ArrayList<Nodo> mejoresNodos = new ArrayList<Nodo>();\n \n int costoTotalNodo = 0 ;\n \n \twhile (itrAcciones.hasNext()) {\n \t\t\n Accion accion = itrAcciones.next();\n \n Tablero nuevoEstado = nodoAexp.estado.clonar();\n nuevoEstado.mover( accion ); \n \n //control para evitar evaluar heuristicas para estados ya generados\n String hashmatriz = nuevoEstado.toStrHash();\n \n if ( mapaEstadosgen.containsKey( hashmatriz )){\n \tcontinue ;\n }\n \n mapaEstadosgen.put(hashmatriz, hashmatriz);\n \n \n // se obtine el costo del posible nodo a expandir y se crea un tablero con el estado correspóndiente\n int costoH = heur.heuristica (nuevoEstado.matriz, Problema.MATRIZ_META );\n \n Nodo nuevoNodo = new Nodo(nodoAexp,nuevoEstado,accion,costoH );\n \n costoTotalNodo = nuevoNodo.getCosto();\n \n if ( mejorCosto < 0 ) mejorCosto = costoTotalNodo ;\n \n if (costoTotalNodo <= mejorCosto ){\n\t\t\n \tmejorCosto = costoTotalNodo ;\n \t\n \tmejoresNodos.add( nuevoNodo );\n } \n \n //System.out.println(nuevoNodo.getAccion()+\" queda \"+nuevoEstado.toString()+\" costo \"+nuevoNodo.getCosto());\n \n \t}\n \tint tam = mejoresNodos.size();\n \t\n \tfor(int i = 0 ; i <tam ; i++){\n \t\tif( mejoresNodos.get(i).getCosto() <= mejorCosto )\n \t\t\t\n \t\t\tfrontera.add(mejoresNodos.get( i ));\n \t}\n }",
"public static String graphTest(GraphInterface subject) {\n // Let the Test begin!\n System.out.println(\"Test beginnt...\");\n if (subject.getNumberOfVertices() != 10)\n return \"FEHLER: Liste nicht mit 10 Knoten initialisiert!\";\n // Lets now check the fail-safes\n subject.addEdge(11, 1, 1);\n subject.addEdge(-1, 2, 1);\n subject.removeEdge(13, 3);\n subject.removeEdge(-3, 3);\n subject.removeEdge(6, 0);// Does not exist (But the vertices do)!\n\n if (subject.getWeight(7, 0) != 0)\n return \"FEHLER: getWeight(7, 0): Kante 7<->0 existiert nicht!\";\n\n if (subject.getWeight(-7, 0) != 0)\n return \"FEHLER: getWeight(-7, 0):Kante -7<->0 existiert nicht!\";\n\n if (subject.getWeight(17, 0) != 0)\n return \"FEHLER: getWeight(17, 0): Kante 17<->0 existiert nicht!\";\n\n if (subject.getDegree(-10) != -1)\n return \"FEHLER: getDegree(-10): Knoten -10 existiert nicht!\";\n\n if (subject.getDegree(140) != -1)\n return \"FEHLER: getDegree(140): Knoten 140 existiert nicht!\";\n\n if (subject.getDegree(0) == -1)\n return \"FEHLER: getDegree(0): Knoten 0 existiert (Und hat Kanten)!\";\n\n if (subject.getNeighbours(-3) != null)\n return \"FEHLER: getNeighbours(-3): Knoten -3 existiert nicht!\";\n\n if (subject.getNeighbours(13) != null)\n return \"FEHLER: getNeighbours(13): Knoten 13 existiert nicht!\";\n\n // lets check if there are NO edges\n for (int i = 0; i < 10; i++)\n if (subject.getDegree(i) != 0)\n return \"FEHLER: getDegree(\" + i + \")!=0\";\n for (int i = 0; i < 10; i++)\n if (subject.getNeighbours(i).length != 0)\n return \"FEHLER: getNeighbours(\" + i + \").length!=0\";\n // create a network and check it\n for (int edge = 0; edge < edges.length; edge++) {\n if (subject.getWeight(edges[edge][0], edges[edge][1]) != 0)\n return \"FEHLER: getWeight(\" + edges[edge][0] + \", \"\n + edges[edge][1] + \")!=0\";\n subject.addEdge(edges[edge][0], edges[edge][1], edges[edge][2]);\n if (subject.getWeight(edges[edge][0], edges[edge][1]) != edges[edge][2])\n return \"FEHLER: getWeight(\" + edges[edge][0] + \", \"\n + edges[edge][1] + \")!=\" + edges[edge][2];\n int[] tempNeighbours = subject.getNeighbours(edges[edge][0]);\n boolean foundFlag = false;\n for (int j = 0; j < tempNeighbours.length; j++)\n if (edges[edge][1] == tempNeighbours[j]) {\n foundFlag = true;\n break;\n }\n if (!foundFlag)\n return \"Fehler: getNeighbours(\" + edges[edge][0]\n + \") enth�lt nicht die vorhandene Kante '\"\n + edges[edge][1] + \"'!\";\n }\n\n // and finally: delete some edges\n for (int edge = 0; edge < edges.length; edge++) {\n subject.addEdge(edges[edge][0], edges[edge][1], 14);\n if (subject.getWeight(edges[edge][0], edges[edge][1]) != 14)\n return \"FEHLER: getWeight(\" + edges[edge][0] + \", \"\n + edges[edge][1] + \")!=14\";\n subject.removeEdge(edges[edge][0], edges[edge][1]);\n if (subject.getWeight(edges[edge][0], edges[edge][1]) != 0)\n return \"FEHLER: getWeight(\" + edges[edge][0] + \", \"\n + edges[edge][1] + \")!=0\";\n }\n\n return \"Keine Fehler gefunden!\\n\";\n }",
"@Test\n public void finiteUTurnCosts() {\n int right0 = graph.edge(0, 1).setDistance(10).set(speedEnc, 10, 10).getEdge();\n graph.edge(1, 2).setDistance(10).set(speedEnc, 10, 10);\n graph.edge(2, 3).setDistance(10).set(speedEnc, 10, 10);\n graph.edge(3, 4).setDistance(10).set(speedEnc, 10, 10);\n graph.edge(4, 5).setDistance(10).set(speedEnc, 10, 10);\n graph.edge(5, 2).setDistance(1000).set(speedEnc, 10, 10);\n int left6 = graph.edge(1, 6).setDistance(10).set(speedEnc, 10, 10).getEdge();\n int left0 = graph.edge(0, 7).setDistance(10).set(speedEnc, 10, 10).getEdge();\n graph.edge(7, 8).setDistance(10).set(speedEnc, 10, 10);\n graph.edge(8, 9).setDistance(10).set(speedEnc, 10, 10);\n int right6 = graph.edge(9, 6).setDistance(10).set(speedEnc, 10, 10).getEdge();\n\n // enforce p-turn (using the loop in clockwise direction)\n setRestriction(0, 1, 6);\n setRestriction(5, 4, 3);\n\n assertPath(calcPath(0, 6, right0, left6), 107.0, 1070, 107000, nodes(0, 1, 2, 3, 4, 5, 2, 1, 6));\n // if the u-turn cost is finite it depends on its value if we rather do the p-turn or do an immediate u-turn at node 2\n assertPath(calcPath(0, 6, right0, left6, createWeighting(5000)), 107.0, 1070, 107000, nodes(0, 1, 2, 3, 4, 5, 2, 1, 6));\n assertPath(calcPath(0, 6, right0, left6, createWeighting(40)), 44, 40, 44000, nodes(0, 1, 2, 1, 6));\n\n assertPath(calcPath(0, 6, left0, right6), 4, 40, 4000, nodes(0, 7, 8, 9, 6));\n assertPath(calcPath(0, 6, left0, left6), 111, 1110, 111000, nodes(0, 7, 8, 9, 6, 1, 2, 3, 4, 5, 2, 1, 6));\n // if the u-turn cost is finite we do a u-turn at node 1 (not at node 7 at the beginning!)\n assertPath(calcPath(0, 6, left0, left6, createWeighting(40)), 46.0, 60, 46000, nodes(0, 7, 8, 9, 6, 1, 6));\n }",
"private void findPath2(List<Coordinate> path) {\n List<Integer> cost = new ArrayList<>(); // store the total cost of each path\n // store all possible sequences of way points\n ArrayList<List<Coordinate>> allSorts = new ArrayList<>();\n int[] index = new int[waypointCells.size()];\n for (int i = 0; i < index.length; i++) {// generate the index reference list\n index[i] = i;\n }\n permutation(index, 0, index.length - 1);\n for (Coordinate o1 : originCells) {\n for (Coordinate d1 : destCells) {\n for (int[] ints1 : allOrderSorts) {\n List<Coordinate> temp = getOneSort(ints1, waypointCells);\n temp.add(0, o1);\n temp.add(d1);\n int tempCost = 0;\n for (int i = 0; i < temp.size() - 1; i++) {\n Graph graph = new Graph(getEdge(map));\n Coordinate start = temp.get(i);\n graph.dijkstra(start);\n Coordinate end = temp.get(i + 1);\n graph.printPath(end);\n tempCost = tempCost + graph.getPathCost(end);\n if (graph.getPathCost(end) == Integer.MAX_VALUE) {\n tempCost = Integer.MAX_VALUE;\n break;\n }\n }\n cost.add(tempCost);\n allSorts.add(temp);\n }\n }\n }\n System.out.println(\"All sorts now have <\" + allSorts.size() + \"> items.\");\n List<Coordinate> best = allSorts.get(getMinIndex(cost));\n generatePath(best, path);\n setSuccess(path);\n }",
"@Test \r\n void insert_two_vertexs_then_create_edge(){\r\n graph.addVertex(\"A\");\r\n graph.addVertex(\"B\");\r\n graph.addEdge(\"A\", \"B\");\r\n List<String> adjacentA = graph.getAdjacentVerticesOf(\"A\");\r\n List<String> adjacentB = graph.getAdjacentVerticesOf(\"B\");\r\n if(!adjacentA.contains(\"B\")) { \r\n fail();\r\n }\r\n if(adjacentB.contains(\"A\")) { \r\n fail();\r\n }\r\n }",
"public static void exampleGraph() {\n\t\t// create a simple FNSS topology\n\t\tTopology topology = new Topology();\n\t\ttopology.addEdge(\"1\", \"2\", new Edge());\n\t\ttopology.addEdge(\"2\", \"3\", new Edge());\n\t\t\n\t\t// convert to JGraphT\n\t\tGraph<String, Edge> graph = JGraphTConverter.getGraph(topology);\n\t\t\n\t\t// Find shortest paths\n\t\tString source = \"3\";\n\t\tString destination = \"1\";\n\t\tList<Edge> sp = DijkstraShortestPath.findPathBetween(graph, source, destination);\n\t\t\n\t\t// Print results\n\t\tSystem.out.println(\"Shortest path from \" + source + \" to \" + destination + \":\");\n\t\tfor (Edge e : sp) {\n\t\t\tSystem.out.println(graph.getEdgeSource(e) + \" -> \" + graph.getEdgeTarget(e));\n\t\t}\n\t}",
"@Override\n\tpublic boolean findPath(PathfindingNode start, PathfindingNode end, ArrayList<PathfindingNode> path) \n\t{\n\t\tpath.clear();\n\t\t\n\t\t_visited.clear();\n\t\t_toVisit.clear();\n\t\t_parents.clear();\n\t\t_costsFromStart.clear();\n\t\t_totalCosts.clear();\n\n\t\t_costsFromStart.put(start, 0);\n\t\t_toVisit.add(start);\n\t\t_parents.put(start, null);\n\t\t\n\t\twhile (!_toVisit.isEmpty() && !_toVisit.contains(end))\n\t\t{\n\t\t\tPathfindingNode m = _toVisit.remove();\n\t\t\t\n\t\t\tint mCost = _costsFromStart.get(m);\n\t\t\t\n\t\t\tfor (int i = 0; i < m.getNeighbors().size(); ++i)\n\t\t\t{\n\t\t\t\tPathfindingNodeEdge n = m.getNeighbors().get(i);\n\t\t\t\tif (n.getNeighbor() != null && !_visited.contains(n.getNeighbor()))\n\t\t\t\t{\n\t\t\t\t\tint costFromSource = mCost + n.getCost();\n\t\t\t\t\tint totalCost = costFromSource + _estimator.estimate(n.getNeighbor(), end);\n\t\t\t\t\tif (!_toVisit.contains(n.getNeighbor()) || totalCost < _totalCosts.get(n.getNeighbor()))\n\t\t\t\t\t{\n\t\t\t\t\t\t_parents.put(n.getNeighbor(), m);\n\t\t\t\t\t\t_costsFromStart.put(n.getNeighbor(), costFromSource);\n\t\t\t\t\t\t_totalCosts.put(n.getNeighbor(), totalCost);\n\t\t\t\t\t\tif (_toVisit.contains(n.getNeighbor()))\n\t\t\t\t\t\t\t_toVisit.remove(n.getNeighbor());\n\t\t\t\t\t\t_toVisit.add(n.getNeighbor());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t_visited.add(m);\n\t\t}\n\t\t\n\t\tif (_toVisit.contains(end))\n\t\t{\n\t\t\t_reversePath.clear();\n\t\t\t\n\t\t\tPathfindingNode current = end;\n\t\t\twhile (current != null)\n\t\t\t{\n\t\t\t\t_reversePath.push(current);\n\t\t\t\tcurrent = _parents.get(current);\n\t\t\t}\n\t\t\t\n\t\t\twhile (!_reversePath.isEmpty())\n\t\t\t\tpath.add(_reversePath.pop());\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tpath.add(start);\n\t\t\treturn false;\n\t\t}\n\t}",
"@Test\n public void blockArea() {\n EdgeIteratorState edge1 = graph.edge(0, 1).setDistance(10).set(speedEnc, 10, 10);\n graph.edge(1, 2).setDistance(10).set(speedEnc, 10, 10);\n EdgeIteratorState edge2 = graph.edge(2, 3).setDistance(10).set(speedEnc, 10, 10);\n graph.edge(0, 4).setDistance(100).set(speedEnc, 10, 10);\n graph.edge(4, 5).setDistance(100).set(speedEnc, 10, 10);\n graph.edge(5, 6).setDistance(100).set(speedEnc, 10, 10);\n graph.edge(6, 3).setDistance(100).set(speedEnc, 10, 10);\n\n // usually we would take the direct route\n assertPath(calcPath(0, 3, ANY_EDGE, ANY_EDGE), 3, 30, 3000, nodes(0, 1, 2, 3));\n\n // with forced edges we might have to go around\n assertPath(calcPath(0, 3, 3, ANY_EDGE), 40, 400, 40000, nodes(0, 4, 5, 6, 3));\n assertPath(calcPath(0, 3, ANY_EDGE, 6), 40, 400, 40000, nodes(0, 4, 5, 6, 3));\n\n // with avoided edges we also have to take a longer route\n assertPath(calcPath(0, 3, ANY_EDGE, ANY_EDGE, createAvoidEdgeWeighting(edge1)), 40, 400, 40000, nodes(0, 4, 5, 6, 3));\n assertPath(calcPath(0, 3, ANY_EDGE, ANY_EDGE, createAvoidEdgeWeighting(edge2)), 40, 400, 40000, nodes(0, 4, 5, 6, 3));\n\n // enforcing forbidden start/target edges still does not allow using them\n assertNotFound(calcPath(0, 3, edge1.getEdge(), edge2.getEdge(), createAvoidEdgeWeighting(edge1)));\n assertNotFound(calcPath(0, 3, edge1.getEdge(), edge2.getEdge(), createAvoidEdgeWeighting(edge2)));\n\n // .. even when the nodes are just next to each other\n assertNotFound(calcPath(0, 1, edge1.getEdge(), ANY_EDGE, createAvoidEdgeWeighting(edge1)));\n assertNotFound(calcPath(0, 1, ANY_EDGE, edge2.getEdge(), createAvoidEdgeWeighting(edge2)));\n }",
"@Test\n public void notConnectedDueToRestrictions() {\n int sourceNorth = graph.edge(0, 1).setDistance(1).set(speedEnc, 10, 10).getEdge();\n int sourceSouth = graph.edge(0, 3).setDistance(2).set(speedEnc, 10, 10).getEdge();\n int targetNorth = graph.edge(1, 2).setDistance(3).set(speedEnc, 10, 10).getEdge();\n int targetSouth = graph.edge(3, 2).setDistance(4).set(speedEnc, 10, 10).getEdge();\n\n assertPath(calcPath(0, 2, sourceNorth, targetNorth), 0.4, 4, 400, nodes(0, 1, 2));\n assertNotFound(calcPath(0, 2, sourceNorth, targetSouth));\n assertNotFound(calcPath(0, 2, sourceSouth, targetNorth));\n assertPath(calcPath(0, 2, sourceSouth, targetSouth), 0.6, 6, 600, nodes(0, 3, 2));\n }",
"void dijkstra(int graph[][], int src) {\n int dist[] = new int[V]; // The output array. dist[i] will hold\n // the shortest distance from src to i\n\n // sptSet[i] will true if vertex i is included in shortest\n Boolean sptSet[] = new Boolean[V];\n\n for (int i = 0; i < V; i++) {\n dist[i] = Integer.MAX_VALUE;\n sptSet[i] = false;\n }\n\n dist[src] = 0;\n\n // Find shortest path for all vertices\n for (int count = 0; count < V-1; count++) {\n\n int u = minDistance(dist, sptSet);\n\n // Mark the picked vertex as processed\n sptSet[u] = true;\n\n // Update dist value of the adjacent vertices of the\n // picked vertex.\n for (int v = 0; v < V; v++)\n\n\n if (!sptSet[v] && graph[u][v]!=0 &&\n dist[u] != Integer.MAX_VALUE &&\n dist[u]+graph[u][v] < dist[v])\n dist[v] = dist[u] + graph[u][v];\n }\n\n printSolution(dist, V);\n }",
"private static void disjkstraAlgorithm(Node sourceNode, GraphBuilder graph){\n PriorityQueue<Node> smallestDisQueue = new PriorityQueue<>(graph.nodeArr.size(), new Comparator<Node>() {\n @Override\n public int compare(Node first, Node sec) {\n if(first.distance == Integer.MAX_VALUE && sec.distance == Integer.MAX_VALUE){\n return 0;\n }\n else if(first.distance == Integer.MAX_VALUE && sec.distance != Integer.MAX_VALUE){\n return 1;\n } else if(first.distance != Integer.MAX_VALUE && sec.distance == Integer.MAX_VALUE){\n return -1;\n }\n else\n return (int) (first.distance - sec.distance);\n }\n });\n\n smallestDisQueue.add(sourceNode); //add the node to the queue\n\n // until all vertices are know get the vertex with smallest distance\n\n while(!smallestDisQueue.isEmpty()) {\n\n Node currNode = smallestDisQueue.poll();\n// System.out.println(\"Curr: \");\n// System.out.println(currNode);\n if(currNode.known)\n continue; //do nothing if the currNode is known\n\n currNode.known = true; // otherwise, set it to be known\n\n for(Edge connectedEdge : currNode.connectingEdges){\n Node nextNode = connectedEdge.head;\n if(!nextNode.known){ // Visit all neighbors that are unknown\n\n long weight = connectedEdge.weight;\n if(currNode.distance == Integer.MAX_VALUE){\n continue;\n }\n else if(nextNode.distance == Integer.MAX_VALUE && currNode.distance == Integer.MAX_VALUE) {\n continue;\n }\n\n else if(nextNode.distance> weight + currNode.distance){//Update their distance and path variable\n smallestDisQueue.remove(nextNode); //remove it from the queue\n nextNode.distance = weight + currNode.distance;\n\n smallestDisQueue.add(nextNode); //add it again to the queue\n nextNode.pathFromSouce = currNode;\n\n// System.out.println(\"Next: \");\n// System.out.println(nextNode);\n }\n }\n }\n// System.out.println(\"/////////////\");\n }\n }",
"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}",
"@Test(expected = Exception.class)\n public void testZeroPillarMaze() throws Exception {\n shortestPath = MazeSolver.pStar(zeroPillarMaze, 0);\n }",
"private void findBestPath(){\n\t\t// The method will try to find the best path for every starting point and will use the minimum\n\t\tfor(int start = 0; start < this.getDimension(); start++){\n\t\t\tfindBestPath(start);\t\n\t\t}\t\n\t}",
"public ShortestPathMatrix<V,E> allPairsShortestPaths();",
"@Override\n public boolean isConnected() { //i got help from the site https://www.geeksforgeeks.org/shortest-path-unweighted-graph/\n if(this.ga.edgeSize()<this.ga.nodeSize()-1) return false;\n initializeInfo();//initialize all the info fields to be null for the algorithm to work\n if(this.ga.nodeSize()==0||this.ga.nodeSize()==1) return true;//if there is not node or one its connected\n WGraph_DS copy = (WGraph_DS) (copy());//create a copy graph that the algorithm will on it\n LinkedList<node_info> qValues = new LinkedList<>();//create linked list that will storage all nodes that we didn't visit yet\n int firstNodeKey = copy.getV().iterator().next().getKey();//first key for get the first node(its doesnt matter which node\n node_info first = copy.getNode(firstNodeKey);//get the node\n qValues.add(first);//without limiting generality taking the last node added to graph\n int counterVisitedNodes = 0;//counter the times we change info of node to \"visited\"\n while (qValues.size() != 0) {\n node_info current = qValues.removeFirst();\n if (current.getInfo() != null) continue;//if we visit we can skip to the next loop because we have already marked\n current.setInfo(\"visited\");//remark the info\n counterVisitedNodes++;\n\n Collection<node_info> listNeighbors = copy.getV(current.getKey());//create a collection for the neighbors list\n LinkedList<node_info> Neighbors = new LinkedList<>(listNeighbors);//create the neighbors list\n if (Neighbors == null) continue;\n for (node_info n : Neighbors) {\n if (n.getInfo() == null) {//if there is a node we didn't visited it yet, we will insert it to the linkedList\n qValues.add(n);\n }\n }\n }\n if (this.ga.nodeSize() != counterVisitedNodes) return false;//check that we visited all of the nodes\n\n return true;\n }",
"public Path getShortestPath() {\n\t\tNodeRecord startRecord = new NodeRecord(start, null, 0.0f, (float) heuristic.estimate(start), Category.OPEN);\n\n\t\t// Initialize the open list\n\t\tPathFindingList open = new PathFindingList();\n\t\topen.addRecordByEstimatedTotalCost(startRecord);\n\t\trecords.set(Integer.parseInt(startRecord.node.id), startRecord);\n\t\tNodeRecord current = null;\n\t\t\n\t\t// Iterate through processing each node\n\t\twhile (!open.isEmpty()) {\n\t\t\t// Find smallest element in the open list using estimatedTotalCost\n\t\t\tcurrent = open.getSmallestNodeRecordByEstimatedTotalCost();\n\n\t\t\t// If its the goal node, terminate\n\t\t\tif (current.node.equals(end)) break;\n\n\t\t\t// Otherwise get its outgoing connections\n\t\t\tArrayList<DefaultWeightedEdge> connections = g.getConnections(current.node);\n\t\t\t\n\t\t\t// Loop through each connection\n\t\t\tfor (DefaultWeightedEdge connection : connections) {\n\t\t\t\t// Get the cost and other information for end node\n\t\t\t Vertex endNode = g.graph.getEdgeTarget(connection);\n\t\t\t int endNodeRecordIndex = Integer.parseInt(endNode.id);\n NodeRecord endNodeRecord = records.get(endNodeRecordIndex); // this is potentially null but we handle it\n\t\t\t\tdouble newEndNodeCost = current.costSoFar + g.graph.getEdgeWeight(connection);\n\t\t\t\tdouble endNodeHeuristic = 0;\n\t\t\t\t\n\t\t\t\t// if node is closed we may have to skip, or remove it from closed list\t\n\t\t\t\tif( endNodeRecord != null && endNodeRecord.category == Category.CLOSED ){ \n\t\t\t\t\t// Find the record corresponding to the endNode\n\t\t\t\t\tendNodeRecord = records.get(endNodeRecordIndex);\n\n\t\t\t\t\t// If we didn't find a shorter route, skip\n\t\t\t\t\tif (endNodeRecord.costSoFar <= newEndNodeCost) continue;\n\n\t\t\t\t\t// Otherwise remove it from closed list\n\t\t\t\t\trecords.get(endNodeRecordIndex).category = Category.OPEN;\n\n\t\t\t\t\t// Use node's old cost values to calculate its heuristic to save computation\n\t\t\t\t\tendNodeHeuristic = endNodeRecord.estimatedTotalCost - endNodeRecord.costSoFar;\n\n\t\t\t\t// Skip if node is open and we've not found a better route\n\t\t\t\t} else if( endNodeRecord != null && endNodeRecord.category == Category.OPEN ){ \n\t\t\t\t\t// Here we find the record in the open list corresponding to the endNode\n\t\t\t\t\tendNodeRecord = records.get(endNodeRecordIndex);\n\n\t\t\t\t\t// If our route isn't better, skip\n\t\t\t\t\tif (endNodeRecord.costSoFar <= newEndNodeCost) continue;\n\n\t\t\t\t\t// Use the node's old cost values to calculate its heuristic to save computation\n\t\t\t\t\tendNodeHeuristic = endNodeRecord.estimatedTotalCost - endNodeRecord.costSoFar;\n\n\t\t\t\t// Otherwise we know we've got an unvisited node, so make a new record\n\t\t\t\t} else { // if endNodeRecord.category == Category.UNVISITED\n\t\t\t\t endNodeRecord = new NodeRecord();\n\t\t\t\t\tendNodeRecord.node = endNode;\n\t\t\t\t\trecords.set(endNodeRecordIndex, endNodeRecord);\n\n\t\t\t\t\t// Need to calculate heuristic since this is new\n\t\t\t\t\tendNodeHeuristic = heuristic.estimate(endNode);\n\t\t\t\t}\n\t\t\t\t\n\n\t\t\t\t// We're here if we need to update the node\n\t\t\t\t// update the cost, estimate, and connection\n\t\t\t\tendNodeRecord.costSoFar = newEndNodeCost;\n\t\t\t\tendNodeRecord.edge = connection;\n\t\t\t\tendNodeRecord.estimatedTotalCost = newEndNodeCost + endNodeHeuristic;\n\n\t\t\t\t// Add it to the open list\n\t\t\t\tif ( endNodeRecord.category != Category.OPEN ) {\n\t\t\t\t\topen.addRecordByEstimatedTotalCost(endNodeRecord);\n\t\t\t\t\tendNodeRecord.category = Category.OPEN;\n\t\t\t\t\trecords.set(endNodeRecordIndex, endNodeRecord);\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\n\t\t\t// We’ve finished looking at the connections for\n\t\t\t// the current node, so add it to the closed list\n\t\t\t// and remove it from the open list\n\t\t\topen.removeRecord(current);\n\t\t\tcurrent.category = Category.CLOSED;\n\t\t\trecords.set(Integer.parseInt(current.node.id), current);\n\t\t}\n\t\t\n\t\t// We’re here if we’ve either found the goal, or\n\t\t// if we’ve no more nodes to search, find which.\n\t\tif (!current.node.equals(end)) {\n\t\t\t// Ran out of nodes without finding the goal, no solution\n\t\t\treturn null;\n\t\t} else {\n\t\t // Compile the list of connections in the path\n\t\t\tArrayList<DefaultWeightedEdge> path = new ArrayList<>();\n\n\t\t\twhile (!current.node.equals(start)) {\n\t\t\t\tpath.add(current.edge);\n\t\t\t\t// Set current (NodeRecord) to is source.\n\t\t\t\tcurrent = records.get( Integer.parseInt(g.graph.getEdgeSource(current.edge).id) );\n\t\t\t}\n\n\t\t\t// Reverse the path, and return it\n\t\t\tCollections.reverse(path);\n\t\t\treturn new Path(g, path);\n\t\t}\n\n\t}",
"public Dijkstra(Grafo<K, Integer> grafo, Vertice<K, Integer> vertOrigem) {\n\t\t\n\t\tthis.vertices = grafo.getVertices();\n\t\tthis.vertOrigem = vertOrigem;\n\t\t\n\t\tint total = vertices.size();\n\t\tboolean visitado[] = new boolean[total];\n\t\tthis.solucao = new Object[total][2]; // [0] = distancia [1] = vertice adjacente\n\t\t\n\t\tfor (int i = 0; i < total; i++) {\n\t\t\tsolucao[i][0] = Integer.MAX_VALUE;\n\t\t}\n\t\t\n\t\tint vIndex = vertices.indexOf(vertOrigem);\n\t\tsolucao[vIndex][0] = 0;\n\t\tsolucao[vIndex][1] = vertOrigem;\n\t\t\n\t\twhile (true) {\n\t\t\t\n\t\t\tint min = Integer.MAX_VALUE;\n\t\t\tVertice<K, Integer> y = null;\n\t\t\t\n\t\t\tfor (int z = 0; z < total; z++) {\n\t\t\t\tif (visitado[z]) continue;\n\t\t\t\tif ((Integer)solucao[z][0] < min) {\n\t\t\t\t\tmin = (Integer)solucao[z][0];\n\t\t\t\t\ty = vertices.get(z);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (min == Integer.MAX_VALUE) break;\n\t\t\t\n\t\t\tint yIndex = vertices.indexOf(y);\n\t\t\t\n\t\t\tList<Aresta<K, Integer>> arestas = y.getArestas();\n\t\t\tfor (Aresta<K, Integer> a:arestas) {\n\t\t\t\t\n\t\t\t\tVertice<K, Integer> w = a.getVertices()[0];\n\t\t\t\tint wIndex = vertices.indexOf(w);\n\t\t\t\tif (visitado[wIndex]) continue;\n\t\t\t\t\n\t\t\t\tif ((Integer)solucao[yIndex][0] + a.getValor() < (Integer)solucao[wIndex][0]) {\n\t\t\t\t\tsolucao[wIndex][0] = (Integer)solucao[yIndex][0] + a.getValor();\n\t\t\t\t\tsolucao[wIndex][1] = y;\n\t\t }\n\t\t\t}\n\t\t\t\n\t\t\tvisitado[yIndex] = true;\n\t\t\t\n\t\t}\n\t\t\n\t}",
"public Path shortestPath(Vertex a, Vertex b) {\n // If a or b aren't present in the set of vertices throw an exception\n if (!myGraph.containsKey(b) || !myGraph.containsKey(a)) {\n throw new IllegalArgumentException(\"One of the vertices isn't valid\");\n }\n /* Create a map of Vertices to VertexInfos. Fill it with VertexInfos for all\n vertices that each have no previous vertex and and a cost of INFINITY */\n Map<Vertex, VertexInfo> vertInfos = new HashMap<Vertex, VertexInfo>();\n for (Vertex v : vertices()) {\n vertInfos.put(v, new VertexInfo(v, null, INFINITY));\n }\n /* Create a PriorityQueue for VertexInfos */\n PriorityQueue<VertexInfo> viQueue = new PriorityQueue<VertexInfo>();\n /* Create a VertexInfo for the start Vertex 'a' with a cost of 0. This uses a copy of Vertex a&b for immutability */\n Vertex copyA = new Vertex(a.getLabel());\n Vertex copyB = new Vertex(b.getLabel());\n\n VertexInfo vi_a = new VertexInfo(copyA, null, 0);\n /* Add VerxtexInfo for a to PQ and map it to it's VertexInfo */\n viQueue.add(vi_a);\n vertInfos.put(a, vi_a);\n while(!viQueue.isEmpty()) {\n /* Remove the VertexInfo with lowest cost */\n Vertex curr = viQueue.poll().getVertex();\n /* Check all adjacent Vertices of curr Vertex */\n for (Vertex v : adjacentVertices(curr)) {\n /* Calculate cost to get to v through curr */\n int cost = vertInfos.get(curr).getCost() + edgeCost(curr, v);\n /* If cost through curr is lower than previous */\n if (cost < vertInfos.get(v).getCost()) {\n /* Remove v's VertexInfo from PQ */\n viQueue.remove(vertInfos.get(v));\n /* Overwrite previous value of v in map\n Add updated VerexInfo to PQ */\n VertexInfo vi = new VertexInfo(v, curr, cost);\n vertInfos.put(v,vi);\n viQueue.add(vi);\n }\n }\n }\n /* Create ArrayList for path */\n List<Vertex> path = new ArrayList<Vertex>();\n \n /* Add each vertex and it's previous vertex to path until a null vertex is reached */\n for (Vertex vert = copyB; vert != null; vert = vertInfos.get(vert).getPrev()) {\n path.add(vert);\n }\n\n /* Reverse order of path */ \n Collections.reverse(path);\n /* Create new Path object with corresponding parameters */\n if(path.contains(copyA)){\n Path pathToB = new Path(path, vertInfos.get(copyB).getCost());\n return pathToB;\n } else {\n return null;\n }\n }",
"public void computeShortestPath() throws IllegalStateException;",
"public static void main(String[] args) {\n\t\tint[] vertex= {0,1,2,3,4};\r\n\t\tint[][] graph= {{100,3,100,100,5},{100,100,8,5,3},{100,100,100,100,100},{100,100,2,100,100},{100,100,100,4,100}};\r\n\t\tint[] dist= {0,100,100,100,100};\r\n\t\tint i=0;\r\n\t\tint tvc=1;\r\n\t\twhile(tvc<5) {\r\n\t\t\tfor(int j=0;j<vertex.length;j++) {\r\n\t\t\t\tif(dist[j]>graph[i][j]+dist[i]) {\r\n\t\t\t\t\tdist[j]=graph[i][j]+dist[i];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttvc++;\r\n\t\t\ti++;\r\n\t\t}\r\n\t\tSystem.out.println(\"Shortest path (distance from source):\");\r\n\t\tSystem.out.println(\"a: \"+dist[0]);\r\n\t\tSystem.out.println(\"b: \"+dist[1]);\r\n\t\tSystem.out.println(\"c: \"+dist[2]);\r\n\t\tSystem.out.println(\"d: \"+dist[3]);\r\n\t\tSystem.out.println(\"e: \"+dist[4]);\r\n\t}",
"private LinkedList<Node> aStarPath() throws PathNotFoundException {\n\n // Set of nodes already evaluated\n List<Node> closedSet = new ArrayList<Node>();\n\n // Set of nodes visited, but not evaluated\n List<Node> openSet = new ArrayList<Node>();\n openSet.add(start);\n\n\n // Map of node with shortest path leading to it\n Map<Node, Node> cameFrom = new HashMap<>();\n\n // Map of cost of navigating from start to node\n Map<Node, Double> costFromStart = new HashMap<>();\n costFromStart.put(start, 0.0);\n\n // Map of cost of navigating path from start to end through node\n Map<Node, Double> costThrough = new HashMap<>();\n costThrough.put(start, heuristic(start, end));\n\n while (!openSet.isEmpty()){\n\n Node current = lowestCostThrough(openSet, costThrough);\n\n if(current.equals(end)){\n return reconstructPath(cameFrom, current);\n }\n\n openSet.remove(current);\n closedSet.add(current);\n\n for(Node neighbor: current.getNodes()) {\n if (closedSet.contains(neighbor)) {\n continue;\n }\n\n double tentativeCost = costFromStart.get(current) + distanceBetween(current, neighbor);\n\n if (!openSet.contains(neighbor)) { // found new neighbor\n openSet.add(neighbor);\n } else if (tentativeCost >= costFromStart.get(neighbor)) { // not a better path\n continue;\n }\n\n cameFrom.put(neighbor, current);\n costFromStart.put(neighbor, tentativeCost);\n costThrough.put(neighbor, tentativeCost + heuristic(neighbor, end));\n\n }\n }\n // no path\n throw pathNotFound;\n }",
"@Test\n void test08_getAllAdjacentVertices() {\n graph.addEdge(\"a\", \"b\");\n graph.addEdge(\"a\", \"c\"); // add two edges\n\n List<String> check = new ArrayList<>();\n check.add(\"b\");\n check.add(\"c\"); // create mock up adjacent list\n\n if (!check.equals(graph.getAdjacentVerticesOf(\"a\"))) { // checks if both are same\n fail(\"graph didn't record adjacent vertices correctly\");\n }\n }",
"@Override\n\tpublic List<node_data> shortestPath(int src, int dest) {\n\t\tList<node_data> ans = new ArrayList<>();\n\t\tthis.shortestPathDist(src, dest);\n\t\tif(this.GA.getNode(src).getWeight() == Integer.MAX_VALUE || this.GA.getNode(dest).getWeight() == Integer.MAX_VALUE){\n\t\t\tSystem.out.print(\"There is not a path between the nodes.\");\n\t\t\treturn null;\n\t\t}\n\t\tgraph copied = this.copy();\n\t\ttransPose(copied);\n\t\tnode_data first = copied.getNode(dest);\n\t\tans.add(first);\n\t\twhile (first.getKey() != src) {\n\t\t\tCollection<edge_data> temp = copied.getE(first.getKey());\n\t\t\tdouble check= first.getWeight();\n\t\t\tif(temp!=null) {\n\t\t\t\tfor (edge_data edge : temp) {\n\t\t\t\t\tif (copied.getNode(edge.getDest()).getWeight() + edge.getWeight() == check) {\n\t\t\t\t\t\tfirst = copied.getNode(edge.getDest());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tans.add(first);\n\t\t}\n\t\tList<node_data> ans2 = new ArrayList<>();\n\t\tfor (int i = ans.size()-1;i>=0;i--){\n\t\t\tans2.add(ans.get(i));\n\t\t}\n\t\treturn ans2;\n\t}",
"private static void simpleDijikstra(final DirectedGraph directedGraph,\n final Map<String, Integer> currentShortestPaths,\n final String start, final Set<String> visitedSet, final String destination) {\n // Terminate when we have visited all the nodes or if our start value isn't in our dijikstra table\n if (containsAndNotNull(currentShortestPaths, start) && visitedSet.size() != currentShortestPaths.keySet().size()) {\n compareDistanceAndReplace(directedGraph, currentShortestPaths, start);\n visitedSet.add(start);\n // Calculate the next current smallest node that hasn't been visited and not infinity\n final Optional<Map.Entry<String, Integer>> optionalSmallest =\n currentShortestPaths.entrySet().stream()\n .filter(node -> !visitedSet.contains(node.getKey()) && node.getValue() != null)\n .min(Comparator.comparingInt(Map.Entry::getValue));\n // Continue to next node if there is one available\n optionalSmallest.ifPresent(smallest -> {\n // No need to continue if the next smallest node is our destination\n if (!smallest.getKey().equals(destination)) {\n simpleDijikstra(directedGraph, currentShortestPaths, smallest.getKey(), visitedSet, destination);\n }\n });\n }\n }",
"@Test\n public void tr2()\n {\n Graph graph = new Graph(2);\n Set<Integer> sources = new TreeSet<Integer>();\n Set<Integer> targets = new TreeSet<Integer>();\n sources.add(0);\n targets.add(1);\n graph.addEdge(0,1);\n assertTrue(graph.reachable(sources, targets));\n\n\n }",
"public static void main(String[] args) {\n generateAndSaveExampleGraph();\n\n\n /*\n * select graph for prepairing and handling by algorhytm\n * determine graph source from config.xml:\n * config case = ?\n * 1 - from matrix\n * 2 - from edges list\n * 3 - from xml\n * */\n //read configCase\n Integer configCase = 0;\n try {\n configCase = (Integer) XMLSerializer.read( \"config.xml\");\n } catch (Exception e) {\n e.printStackTrace();\n }\n //determine case\n EuclidDirectedGraph graph = null;\n switch (configCase){\n case 1:\n graph = getGraphFromMatrix();\n break;\n case 2:\n graph = getGraphFromEdgesList();\n break;\n case 3:\n graph = getGraphFromXML();\n break;\n default:\n return;\n\n }\n //find all sources and sinks\n ArrayList<BoundsGraphVertex> sources = new ArrayList<>();\n ArrayList<BoundsGraphVertex> sinks = new ArrayList<>();\n //get all sources and sinks\n for (Map.Entry<BoundsGraphVertex, Map<BoundsGraphVertex, Double>> vertexEntry : graph.getMap().entrySet()) {\n //if there are no edges from vertex then its sink\n if (vertexEntry.getValue().isEmpty()) {\n sinks.add(vertexEntry.getKey());\n } else {\n //mark all vertexes which have incoming edges\n for (BoundsGraphVertex dest : vertexEntry.getValue().keySet()) {\n dest.setMarked(true);\n }\n }\n }\n //all unmarked vertexes are sources\n for (BoundsGraphVertex vertex : graph) {\n if (!vertex.isMarked()) sources.add(vertex);\n }\n\n /*\n * First algorithm: for each source-sink pair get path using euclid heuristics\n * */\n List<BoundsGraphVertex> minPath = null;\n Double minLength = Double.MAX_VALUE;\n for (BoundsGraphVertex source :\n sources) {\n for (BoundsGraphVertex sink :\n sinks) {\n //need use path storage list because algorhytm returns only double val of length.\n //path will be saved in this storage.\n List<BoundsGraphVertex> pathStorage = new ArrayList<>();\n //do algo\n Double length = Algorithms.shortestEuclidDijkstraFibonacciPathWithHeuristics(graph, source, sink, pathStorage, minLength);\n //check min\n if (minLength > length) {\n minLength = length;\n minPath = pathStorage;\n }\n\n }\n }\n\n /*\n * Second algorithm: for each source get better sink\n * */\n minPath = null;\n minLength = Double.MAX_VALUE;\n for (BoundsGraphVertex source :\n sources) {\n //need use path storage list because algorhytm returns only double val of length.\n //path will be saved in this storage.\n List<BoundsGraphVertex> pathStorage = new ArrayList<>();\n //do algo\n Double length = Algorithms.shortestEuclidDijkstraFibonacciPathToManySinks(graph, source, sinks, pathStorage, minLength);\n //check min\n if (minLength > length) {\n minLength = length;\n minPath = pathStorage;\n }\n }\n try {\n XMLSerializer.write(minPath, \"output.xml\", false);\n XMLSerializer.write(minLength, \"output.xml\", true);\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n\n }",
"public void shortestPaths(int source) {\n\n\t\tlong start = 0;\n\t\tlong stop;\n\t\tfor (int v = 0; v < vertexList.length; v++) {\n\t\t\tedgeList[v] = new Edge(vertexList[v].id, rand, 5000);\n\t\t}\n\t\t// creating object of fibonacci\n\t\tFHeap pq = new FHeap();\n\t\t// creating a map for checking\n\t\tMap<Integer, FHeap.Node> check = new HashMap<Integer, FHeap.Node>();\n\t\t// storing the mst costs\n\n\t\tfor (int v = 0; v < vertexList.length; v++) {\n\t\t\tcheck.put(vertexList[v].id,\n\t\t\t\t\tpq.enqueue(vertexList[v].id, Double.POSITIVE_INFINITY));\n\t\t}\n\t\tstart = System.currentTimeMillis();\n\t\t// allot cost 0 to initial node\n\t\tpq.decreaseKey(check.get(vertexList[source].id), 0.0);\n\n\t\twhile (!pq.isEmpty()) {\n\t\t\t// take the current node and get its minimum cost\n\t\t\tFHeap.Node current = pq.dequeueMin();\n\n\t\t\t// store the values in the table\n\t\t\tresult.put(current.getValue(), current.getCost());\n\n\t\t\t// update the costs\n\t\t\tfor (Neighbor nbr = vertexList[current.getValue()].adjList; nbr != null; nbr = nbr.next) {\n\n\t\t\t\t// edge is not added if shortest cost is known\n\t\t\t\tif (result.containsKey(vertexList[nbr.vertexNumber].id))\n\t\t\t\t\tcontinue;\n\n\t\t\t\t// update cost to shortest\n\t\t\t\tFHeap.Node finalCost = check\n\t\t\t\t\t\t.get(vertexList[nbr.vertexNumber].id);\n\t\t\t\tif (nbr.weight < finalCost.getCost())\n\t\t\t\t\tpq.decreaseKey(finalCost, nbr.weight);\n\t\t\t}\n\t\t}\n\t\tstop = System.currentTimeMillis();\n\t\t// computing the time\n\t\ttime = stop - start;\n\n\t\t// calculate the MST cost\n\t\tfor (int i = 0; i < vertexList.length; i++) {\n\t\t\tsumHeapCost = (int) (sumHeapCost + result.get(i));\n\t\t}\n\t\t// for printing in case of input from file in fibonacci mode\n\t\n\t\t// System.out.println(sumHeapCost);\n\t}",
"public Queue<Station> approxShortestPath(Station start, Station end)\n {\n //Create a hash from station IDs to extra data needed for this algorithm.\n HashMap<String, ApproxSearchExtra> station_extras =\n new HashMap<String, ApproxSearchExtra>();\n for (Station station : getStations())\n station_extras.put(station.getId(), new ApproxSearchExtra());\n\n HashSet<Station> closed = new HashSet<Station>();\n HashSet<Station> open = new HashSet<Station>();\n open.add(start);\n\n while (open.size() > 0)\n {\n //Current is the item in the open set with the lowest estimated cost.\n Station current = null;\n ApproxSearchExtra current_extra = null;\n for (Station element : open)\n {\n if (current == null && current_extra == null)\n {\n current = element;\n current_extra = station_extras.get(element.getId());\n }\n else\n {\n ApproxSearchExtra extra = station_extras.get(element.getId());\n if (extra.estimated_cost < current_extra.estimated_cost)\n {\n current = element;\n current_extra = extra;\n }\n }\n }\n\n //If the current station is the end station, then we're done.\n if (current == end)\n return buildApproxShortestPathResult(end, station_extras);\n\n //Station is no longer in the open set and is now in the closed set\n //because it was traversed.\n open.remove(current);\n closed.add(current);\n\n for (Station neighbour : getAdjacentStations(current))\n {\n //Do nothing if neighbour is already in the closed set.\n if (closed.contains(neighbour))\n continue;\n\n ApproxSearchExtra neighbour_extra =\n station_extras.get(neighbour.getId());\n\n //Cost of movement to this neighbour.\n float attempt_cost = current_extra.cost + current.distance(neighbour);\n\n //If not in the open set, add the neighbour to the open set so that it\n //will be traversed later.\n if (!open.contains(neighbour))\n open.add(neighbour);\n //If this path is more costly than another path to this station, then\n //this path cannot be optimal.\n else if (attempt_cost >= neighbour_extra.cost)\n continue;\n\n //This is now the best path to this neighbour. Store this information.\n neighbour_extra.came_from = current;\n neighbour_extra.cost = attempt_cost;\n neighbour_extra.estimated_cost = attempt_cost +\n neighbour.distance(end);\n }\n }\n\n return null;\n }"
] | [
"0.7208018",
"0.7186748",
"0.7085574",
"0.69262093",
"0.68303096",
"0.67900336",
"0.6753441",
"0.6748905",
"0.6742554",
"0.66635996",
"0.659788",
"0.65816045",
"0.6572075",
"0.6531801",
"0.6501777",
"0.6411482",
"0.6334679",
"0.63210416",
"0.62895226",
"0.62394345",
"0.6231189",
"0.6229514",
"0.6193991",
"0.6134155",
"0.61317194",
"0.6125496",
"0.6122316",
"0.6118779",
"0.6113555",
"0.61070967",
"0.61029863",
"0.6098347",
"0.6092166",
"0.60261947",
"0.6013515",
"0.59856486",
"0.5969734",
"0.5960687",
"0.59544474",
"0.5953739",
"0.5938961",
"0.59382504",
"0.5933083",
"0.5927412",
"0.59239745",
"0.59126115",
"0.59108883",
"0.5896093",
"0.5886072",
"0.5885195",
"0.5885139",
"0.5861155",
"0.5860723",
"0.5855979",
"0.58480996",
"0.5839983",
"0.58363867",
"0.58351403",
"0.5824266",
"0.5816945",
"0.58052534",
"0.5803947",
"0.5797726",
"0.5771618",
"0.5770591",
"0.5757029",
"0.5751852",
"0.5748025",
"0.57479477",
"0.57464737",
"0.57442635",
"0.57389075",
"0.5733734",
"0.57316077",
"0.5729569",
"0.57283175",
"0.57264256",
"0.572336",
"0.5722312",
"0.5720552",
"0.5699084",
"0.5696107",
"0.56959313",
"0.5694604",
"0.5685767",
"0.5678798",
"0.56707644",
"0.5670285",
"0.5668611",
"0.56582683",
"0.56572413",
"0.56553936",
"0.56549466",
"0.5650832",
"0.5650621",
"0.564638",
"0.5644777",
"0.5640234",
"0.56253874",
"0.56204134"
] | 0.68892205 | 4 |
[END on_start_check_user] [START onactivityresult] | @Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
Log.d("check", "in onActivityResult");
// Result returned from launching the Intent from GoogleSignInApi.getSignInIntent(...);
if (requestCode == RC_SIGN_IN) {
Log.d("sign in", "1");
GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);
if (result.isSuccess()) {
// session.setLogin(true);
// Google Sign In was successful, authenticate with Firebase
GoogleSignInAccount account = result.getSignInAccount();
firebaseAuthWithGoogle(account);
} else {
Log.d("failed to google signin", "10");
// Google Sign In failed, update UI appropriately
// [START_EXCLUDE]
// updateUI(null);
// [END_EXCLUDE]
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void onSuccess(@AttentionSuccessCodes int result, long timestamp) {\n if (!userState.mCurrentAttentionCheck.mIsFulfilled) {\n callbackInternal.onSuccess(result, timestamp);\n userState.mCurrentAttentionCheck.mIsFulfilled = true;\n }\n\n synchronized (mLock) {\n userState.mAttentionCheckCache = new AttentionCheckCache(\n SystemClock.uptimeMillis(), result,\n timestamp);\n }\n StatsLog.write(\n StatsLog.ATTENTION_MANAGER_SERVICE_RESULT_REPORTED,\n result);\n }",
"public void receiveResultaddUserToApplication(\n boolean result\n ) {\n }",
"@Override\r\n\tpublic void onAccountMatch(int result, String userId)\r\n\t{\n\r\n\t}",
"@Override\n\tpublic void resultActivityCall(int requestCode, int resultCode, Intent data) {\n\n\t}",
"@Override\n\tprotected void onActivityResult(int requestCode, int resultCode, Intent data) {\n\t\tlog.info(\"In results\");\n\t\tsuper.onActivityResult(requestCode, resultCode, data);\n\t\tif (requestCode == 234) {\n\t\t\t\n\t\t\t// Activity2 is over - see what happened\n\t\t\tif (resultCode == Activity.RESULT_OK) {\n\t\t\t\t\n\t\t\t\t //if(person_name.isEmpty()){\n\t\t\t\t\t// Toast.makeText(MainActivity.this, \"No one logged in\", Toast.LENGTH_LONG).show();\t\t \n\t\t\t\t// }\n\t\t\t\t// else {\n\t\t\t\t\t Toast.makeText(Main_Activity.this, \"User Created\", Toast.LENGTH_LONG).show();\t\t \n\t\t\t\t\t Bundle received = data.getExtras();\n\t\t\t\t\t login.setClickable(false);\n\t login.setBackgroundColor(Color.GRAY);\n\t // create.setClickable(false);\n\t // create.setBackgroundColor(Color.GRAY);\n\t logout.setClickable(true);\n\t logout.setBackgroundColor(getResources().getColor(R.color.CornflowerBlue));\n\t sync.setClickable(true);\n\t sync.setBackgroundColor(getResources().getColor(R.color.CornflowerBlue));\n\t\t\t\t//person_name = received.getString(\"name\");\n\t\t\t\tString u = received.getString(\"user\");\n\t\t\t\tuserName = u;\n\t\t\t\tlog.info(\"person name is: \"+userName);\n\t\t\t\t\t\n\t\t\t\n\t\t\t\t// }\n\t\t\t}\n\t\t\telse if(resultCode == Activity.RESULT_FIRST_USER){\n\t\t\t\t Toast.makeText(Main_Activity.this, \"User already exists\", Toast.LENGTH_LONG).show();//finishActivity(123);\n\t\t\t}\n\t\t\telse if(resultCode == Activity.RESULT_CANCELED){\n\t\t\t\t //Toast.makeText(MainActivity.this, \"User already exists\", Toast.LENGTH_LONG).show();//finishActivity(123);\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t}",
"@Override\n\t\t\tpublic void onStartInMainThread(Object result)\n\t\t\t{\n\t\t\t\tsuper.onStartInMainThread(result);\n\t\t\t\tif (mStartType == 1)\n\t\t\t\t{\n\t\t\t\t\tnDialog = SDDialogUtil.showLoading(\"正在检测新版本...\");\n\t\t\t\t}\n\t\t\t}",
"@Override\n\tpublic void onActivityResult(int requestCode, int resultCode, Intent data) {\n\t\tif (resultCode != -1 && resultCode !=0) {\n\t\t\tappState.userID = data.getStringExtra(\"uid\");\n\t\t\tappState.userName = data.getStringExtra(\"name\");\n\t\t\tappState.note = data.getStringExtra(\"note\");\t\n\t\t\tif (\"none\".equals(appState.userID)) {\n\t\t\t\tnew AlertDialog.Builder(getActivity())\n\t\t\t\t.setTitle(\"No user found\")\n\t\t\t\t.setMessage(\"There's no user found in your device, please ADD one in User page.\")\n//\t\t\t\t.setNegativeButton(\"Cancel\",\n//\t\t\t\t\t\tnew DialogInterface.OnClickListener() {\n//\t\t\t\t\t\t\t@Override\n//\t\t\t\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n//\t\t\t\t\t\t\t\t//this.s = \"Negative\";\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t})\n\t\t\t\t.setPositiveButton(\"Confirm\", new DialogInterface.OnClickListener() {\n\t\t\t\t\t\t\tpublic void onClick(DialogInterface dialog, int whichButton) {\n\t\t\t\t\t\t\t}\n\t\t\t\t}).show();\n\t\t\t} else {\n\t\t\t\ttv_user1_dianzichen.setTextColor(Color.BLACK);\n\t\t\t\ttv_user2_dianzichen.setTextColor(Color.BLACK);\n\t\t\t\t\n\t\t\t\tupdateUI();\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t}",
"@Override\n synchronized public void onTaskCompletionResult() {\n if (DataContainer.getInstance().pullValueBoolean(DataKeys.PLAY_REFERRER_FETCHED, context) && DataContainer.getInstance().pullValueBoolean(DataKeys.GOOGLE_AAID_FETCHED, context)) {\n deviceInformationUtils.prepareInformations();\n deviceInformationUtils.debugData();\n long lastLaunch = pullValueLong(ITrackingConstants.CONF_LAST_LAUNCH_INTERNAL, context);\n trackLaunchHandler(lastLaunch);\n }\n }",
"@Override\r\n\r\n public void getResult(String result) {\n Log.d(\"myApp_AWS\", \"Registration:\" + result);\r\n\r\n if (!result.equals(\"\\\"Appliance Registration Successful\\\"\")) {\r\n\r\n runOnUiThread(new Runnable() {\r\n @Override\r\n public void run() {\r\n Toast.makeText(Rinnai11eRegistration.this, \"Web Services Error.\",\r\n Toast.LENGTH_LONG).show();\r\n }\r\n });\r\n } else {\r\n runOnUiThread(new Runnable() {\r\n @Override\r\n public void run() {\r\n Toast.makeText(Rinnai11eRegistration.this, \"Update Successful.\",\r\n Toast.LENGTH_LONG).show();\r\n }\r\n });\r\n }\r\n }",
"@Override\n\t\t\t\t\tpublic void onSuccess(Integer result) {\n\t\t\t\t\t\tif (result == 0) {\n\t\t\t\t\t\t\tgetApplyDialog();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tToastUtil.showToast(context, \"无法获取游戏信息\");\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}",
"@Override\r\n\tpublic void onHeartbeat(int result)\r\n\t{\n\t\tif (result == AirtalkeeAccount.ACCOUNT_RESULT_ERR_SINGLE)\r\n\t\t{\r\n\t\t\tAirServices.iOperator.putString(KEY_PWD, \"\");\r\n\t\t}\r\n\t\tif (accountListener != null)\r\n\t\t{\r\n\t\t\taccountListener.onMmiHeartbeatException(result);\r\n\t\t}\r\n\t}",
"@Override\n protected void onStart() {\n checkUserStatus();\n super.onStart();\n }",
"void onResult(int ret);",
"@Override\n public void handleResult(Result rawResult) {\n Toast.makeText(this, rawResult.toString(),Toast.LENGTH_LONG).show();\n User user = SharedPrefManager.getInstance(this).getUser();\n if(user.getId().equals(rawResult.toString().substring(1,rawResult.toString().length())))\n {\n SharedPreferences sharedPreferences = this.getSharedPreferences(\"simplifiedcodingsharedpref\", Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putString(\"scan_status\",\"1\");\n editor.apply();\n Intent in = new Intent(ScanActivity.this, StudentHomePage.class);\n startActivity(in);\n finish();\n }\n else {\n Toast.makeText(this, \"Invalid SAP ID\", Toast.LENGTH_LONG).show();\n onBackPressed();\n }\n }",
"public void receiveResultcheckIfUserExist(\r\n net.agef.jobexchange.webservice.tests.util.UserWSStub.CheckIfUserExistResponse result\r\n ) {\r\n }",
"@Override\n\tpublic void onTaskComplete(JSONObject result) {\n\t\tString valid = null; \n\t\tString nickname = null;\n\t\tString regDate = null;\n\t\ttry {\n\t\t\tvalid = result.getString(\"validation\");\n\t\t} catch (JSONException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t//Toast.makeText(Signin.this, \"beforeIF\", Toast.LENGTH_SHORT).show();\n\t\tif(valid.equals(\"badName\")){\n\t\t\tToast.makeText(Signin.this, \"Bad User Name!\", Toast.LENGTH_SHORT).show();\n\t\t}\n\t\telse if(valid.equals(\"badPw\")){\n\t\t\tToast.makeText(Signin.this, \"Wrong Password!\", Toast.LENGTH_SHORT).show();\n\n\t\t}\n\t\telse if(valid.equals(\"pass\")){\n\t\t\ttry {\n\t\t\t\tnickname = result.getString(\"nickname\");\n\t\t\t\tregDate = result.getString(\"regDate\");\n\t\t\t} catch (JSONException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tToast.makeText(Signin.this, \"YO~\", Toast.LENGTH_SHORT).show();\n\t\t\tToast.makeText(Signin.this, nickname, Toast.LENGTH_SHORT).show();\n\t\t\tToast.makeText(Signin.this, regDate, Toast.LENGTH_SHORT).show();\n\t\t}\n\t\telse{\n\t\t\tToast.makeText(Signin.this, \"ΤόΤό\", Toast.LENGTH_SHORT).show();\n\n\t\t}\n\t}",
"@Override\n\t\tprotected void onPostExecute(ResultUserLogin result) {\n\t\t\tsuper.onPostExecute(result);\n//\t\t\tif(result.getRet() == 0){\n//\t\t\t\t//\n//\t\t\t}else{\n//\t\t\t\tresult.getMsg()\n//\t\t\t}\n\t\t}",
"@Override\n protected void onStart() {\n checkUserStatus();\n\n super.onStart();\n }",
"public void receiveResultsMS_User_Defined(\n com.xteam.tourismpay.PFTMXStub.SMS_User_DefinedResponse result) {\n }",
"public void executeTruefaceFlow(ParseUser user) {\r\n if (user != null) {\r\n Cache.putData(CatchValue.USER_ACTIVE_FR, LoginUserActivity.this, false, Cache.CACHE_LOCATION_DISK);\r\n if (TextUtils.isEmpty(user.getString(\"status\"))) {\r\n dismissProgressDialog();\r\n showUserModeAlertDialog(text);\r\n mLoginEmailView.setText(\"\");\r\n mLoginPasswordView.setText(\"\");\r\n } else {\r\n activeUser = user.getString(\"status\");\r\n if (activeUser.equalsIgnoreCase(\"active\")) {\r\n session.createLoginSession(String.valueOf(user), user.getEmail());\r\n boolean face_value = user.getBoolean(\"hasFRenabled\");\r\n Log.e(\"face_value: \", \" ### \" + face_value);\r\n if (face_value == false) {\r\n dismissProgressDialog();\r\n Intent intent = new Intent(this, MainActivity.class);\r\n startActivity(intent);\r\n finish();\r\n } else {\r\n if (user.has(\"enforce_enroll\")) {\r\n enroll = user.getBoolean(\"enforce_enroll\");\r\n }\r\n Log.e(\"Enforc_false\", String.valueOf(enroll));\r\n if (enroll) {\r\n Intent mainIntent = new Intent(LoginUserActivity.this, MainActivity.class);\r\n startActivity(mainIntent);\r\n finish();\r\n } else {\r\n Intent i = new Intent(LoginUserActivity.this, EnrollActivity.class);\r\n i.putExtra(\"Intent\", \"Login\");\r\n startActivity(i);\r\n finish();\r\n }\r\n }\r\n } else {\r\n dismissProgressDialog();\r\n showUserModeAlertDialog(text);\r\n mLoginEmailView.setText(\"\");\r\n }\r\n }\r\n Log.e(\"active_user\", \"### \" + activeUser);\r\n }\r\n }",
"@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n //Checking which request we're responding to\n if (requestCode == 1) {\n //Making sure the request was successful\n if (resultCode == RESULT_OK) {\n\n //display a toast message if the username could not be resolved on the server\n Toast.makeText(getApplicationContext(), \"Username Not Found On Server\", Toast.LENGTH_SHORT).show();\n\n }\n }\n }",
"@Subscribe(threadMode = ThreadMode.MAIN)\n public void onGreenRobotEvent(ICheckPermissionResult result)\n {\n\n if (userInterfaceManager != null)\n {\n userInterfaceManager.setUserInterface(result);\n }\n\n }",
"public void receiveResultcheckIfInwentUserExist(\r\n net.agef.jobexchange.webservice.tests.util.UserWSStub.CheckIfInwentUserExistResponse result\r\n ) {\r\n }",
"public void receiveResultgetUserInfo(\n org.wso2.carbon.appfactory.application.mgt.service.xsd.UserInfoBean[] result\n ) {\n }",
"public void processFinish(int result) {\n MyApp myApp = (MyApp) getApplication();\n\n if (myApp.match[myApp.division()].size() > 0) {\n inflateMe();\n }\n\n }",
"@Override\n protected void onReceiveResult(int resultCode, Bundle resultData) {\n switch (resultCode) {\n case 1:\n Log.d(TAG,\"yay running\");\n break;\n case 0:\n Log.d(TAG,\"yay finish\");\n break;\n case -1:\n Log.d(TAG,\"yay error\");\n break;\n }\n }",
"void AddUserListener(String uid, final UserResult result);",
"public void onResult(boolean[] results, String errorMsg);",
"@Override\n\t\tprotected void onPostExecute(String result) {\n\t\t\tsuper.onPostExecute(result);\n\t\t\t\n\t\t\tif(response2.contains(\"success\"))\n\t\t\t{\n\t\t\t\tapr_parsingmethod();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tToast.makeText(getApplicationContext(), \"No users approved yet.\", Toast.LENGTH_SHORT).show();\n\t\t\t}\n\t\t}",
"@Override\n\tsynchronized public void onResultReceived(AntPlusBikePowerPcc result,\n\t\t\tRequestAccessResult resultCode, DeviceState initialDeviceState) {\n\n\t\ttry {\n\t\t\tif ((null != result) && (RequestAccessResult.SUCCESS == resultCode)) {\n\t\t\t\tshowResultStatus(context, result.getDeviceName(), result.supportsRssi(), resultCode, initialDeviceState);\n\t\t\t\tpwrPcc = result;\n\t\t\t\tstate = State.RUNNING;\n\t\t\t\tsubscribeToEvents();\n\t\t\t} else {\n\t\t\t\tpwrPcc = null;\n\t\t\t\tstate = State.FAILED;\n\t\t\t}\n\t\t}\n\t\tcatch(Exception ex) {\n\t\t\tLog.e(MODULE_TAG, ex.getMessage());\n\t\t}\n\t}",
"@Override\r\n\r\n public void getResult(String result) {\n Log.d(\"myApp_AWS\", \"Registration:\" + result);\r\n\r\n if (!result.equals(\"\\\"Successful Registration\\\"\")) {\r\n runOnUiThread(new Runnable() {\r\n @Override\r\n public void run() {\r\n Toast.makeText(Rinnai11eRegistration.this, \"Web Services Error.\",\r\n Toast.LENGTH_LONG).show();\r\n }\r\n });\r\n } else {\r\n\r\n runOnUiThread(new Runnable() {\r\n @Override\r\n public void run() {\r\n Toast.makeText(Rinnai11eRegistration.this, \"Update Successful.\",\r\n Toast.LENGTH_LONG).show();\r\n }\r\n });\r\n }\r\n }",
"@Override\n public void OnActivityResultReceived(int requestCode, int resultCode, Intent data) {\n\n }",
"void onResult(AIResponse result);",
"@Override\n\tpublic String checkuser() {\n\t\ttry {\n\t\t\tMap<String,String> sParam = new LinkedHashMap<String,String>();\n\t\t\tsParam.put(\"userid\", userid);\n\t\t\tsParam.put(\"serverid\", serverid+\"\");\n\t\t\tHttp hp = Http.getInstance();\n\t\t\tString result = hp.hp(CHECK_PATH, sParam, \"get\");\n\t\t\t JSONObject jsonobject = JSONObject.fromObject(result);\n\t\t\t String lv = jsonobject.getString(\"lv\");\n\t\t\t return \"{\\\"status\\\":\\\"0\\\",\\\"battlevalue\\\":\\\"0\\\",\\\"lv\\\":\\\"\"+lv+\"\\\"}\"; \t\t//test\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\treturn \"{\\\"status\\\":\\\"1\\\",\\\"battlevalue\\\":\\\"0\\\",\\\"lv\\\":\\\"0\\\"}\"; \t\t//test\n\t\t}\n\t}",
"@Override\r\n public void onResult(boolean result)\r\n {\n if(result){\r\n handler.sendMessage(handler.obtainMessage(SHOWTOAST, \"Start Calibration ,successful\"));\r\n }\r\n else{\r\n handler.sendMessage(handler.obtainMessage(SHOWTOAST, \"Start Calibration ,fail\"));\r\n }\r\n }",
"@Override\n\tprotected void onPostExecute(String result) {\n\t\tpDialog.dismiss();\n\t\tif(result!=null)\n\t\t{\n\t\t\tif(result.equalsIgnoreCase(\"0\"))\n\t\t\t{\n\t\t\t\tToast.makeText(context, \"Some Error Occured Please try again\", Toast.LENGTH_LONG).show();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(result.equalsIgnoreCase(\"3\"))\n\t\t\t\t{\n\t\t\t\t\tToast.makeText(context, \"No Network Found\", Toast.LENGTH_LONG).show();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(result.equalsIgnoreCase(\"2\"))\n\t\t\t\t\t{\n\t\t\t\t\t\tToast.makeText(context, \"This Activity is Already planned\", Toast.LENGTH_LONG).show();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tToast.makeText(context, \"Planned Successfully\", Toast.LENGTH_LONG).show();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tToast.makeText(context, \"Some Error Occured Please try again\", Toast.LENGTH_LONG).show();\n\t\t}\n\t\tmListView.startRefreshing();\n\t}",
"@Override\n public void onPromptAndCollectUserInformationResponse(PromptAndCollectUserInformationResponse arg0) {\n\n }",
"private void startPersonalActivity(String user_id) {\n }",
"@Override\r\n public void onSuccess(RestRequest request, RestResponse result) {\n result.consumeQuietly();\r\n runOnUiThread(new Runnable() {\r\n\r\n @Override\r\n public void run() {\r\n // Network component doesn’t report app layer status.\r\n // Use the Mobile SDK RestResponse.isSuccess() method to check\r\n // whether the REST request itself succeeded.\r\n\r\n try {\r\n\r\n Log.d(\"APITest\", \"success entered\");\r\n\r\n }\r\n catch (Exception e) {\r\n //showError(MainActivity.this, e);\r\n }\r\n\r\n }\r\n });\r\n\r\n }",
"public void receiveResultisApplicationIdAvailable(\n boolean result\n ) {\n }",
"protected void activeActivity() {\n\t\tLog.i(STARTUP, \"active activity\");\n\t\tcheckActiveActivity();\n\t}",
"@Override\n\tprotected void onActivityResult(int requestCode, int resultCode, Intent data) {\n\t\tsuper.onActivityResult(requestCode, resultCode, data);\n\t\tswitch(requestCode){\n\t\tcase 0:\t\t\t\n\t\t\tif(resultCode == RESULT_OK){\n\t\t\t\tLog.d(TAG, Integer.toString(RESULT_OK));\n\t\t\t\tString u_signup, p_signup;\n\t\t\t\tu_signup = data.getStringExtra(\"username\");\n\t\t\t\tp_signup = data.getStringExtra(\"password\");\n\t\t\t\tLog.d(TAG, u_signup);\n\t\t\t\tintent = new Intent(getApplicationContext(), Timeline.class);\n\t\t\t\tintent.putExtra(\"first_time\", true); //Setting Boolean first_time to true\n\t\t\t\tintent.putExtra(\"username\", u_signup);\n\t\t\t\tintent.putExtra(\"password\", p_signup);\n\t\t\t\tstartActivity(intent);\n\t\t\t}\n\t\t}\n\t}",
"public void getStarted(View view)\n {\n\n if(ParseUser.getCurrentUser().getUsername()!=null)\n {\n\n\n ParseUser.getCurrentUser().put(\"riderOrdriver\",currentUserIs);\n\n\n ParseUser.getCurrentUser().saveInBackground(new SaveCallback() {\n @Override\n public void done(ParseException e) {\n if(e == null)\n {\n Log.i(\"userSaved as \",ParseUser.getCurrentUser().getUsername()); //save in the object of that user the type\n }else\n {\n Log.i(\"error in saving\",e.toString());\n\n }\n\n }\n });\n\n activityStartType(currentUserIs);\n }\n\n }",
"@Override\n public void onSuccess(JSONObject results) {\n OneSignal.onesignalLog(OneSignal.LOG_LEVEL.VERBOSE, \"Set external user id done with results: \" + results.toString());\n try {\n if (results.has(\"push\") && results.getJSONObject(\"push\").has(\"success\")) {\n boolean isPushSuccess = results.getJSONObject(\"push\").getBoolean(\"success\");\n OneSignal.onesignalLog(OneSignal.LOG_LEVEL.VERBOSE, \"Set external user id for push status: \" + isPushSuccess);\n }\n } catch (JSONException e) {\n e.printStackTrace();\n }\n try {\n if (results.has(\"email\") && results.getJSONObject(\"email\").has(\"success\")) {\n boolean isEmailSuccess = results.getJSONObject(\"email\").getBoolean(\"success\");\n OneSignal.onesignalLog(OneSignal.LOG_LEVEL.VERBOSE, \"Sets external user id for email status: \" + isEmailSuccess);\n }\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }",
"@Override\n protected void onPostExecute(Boolean result) {\n super.onPostExecute(result);\n techStatus = (TextView)findViewById(R.id.techStatus);\n if(check ==0){\n techStatus.setText(\"You are now Busy\");\n }\n if(check == 1){\n techStatus.setText(\"You are now Available\");\n }\n if(check == 2){\n techStatus.setText(\"You are not Available\");\n }\n }",
"@Override\r\n\t\tprotected void onPostExecute(Integer result) {\r\n\t\t\t// TODO Auto-generated method stub\r\n\t\t\tsuper.onPostExecute(result);\r\n\r\n\t\t\tif (result == 1) {\r\n\t\t\t\tAlertDialog.Builder alert = new AlertDialog.Builder(\r\n\t\t\t\t\t\tgetActivity());\r\n\t\t\t\talert.setMessage(\"Load instruction performed\");\r\n\t\t\t\talert.setTitle(\"Success\");\r\n\t\t\t\talert.setPositiveButton(\"Okay\",\r\n\t\t\t\t\t\tnew DialogInterface.OnClickListener() {\r\n\r\n\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\tpublic void onClick(DialogInterface arg0, int arg1) {\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\talert.show();\r\n\t\t\t} else if (result == 0) {\r\n\t\t\t\tAlertDialog.Builder alert = new AlertDialog.Builder(\r\n\t\t\t\t\t\tgetActivity());\r\n\t\t\t\talert.setMessage(\"Failed\");\r\n\t\t\t\talert.setTitle(\"try again\");\r\n\t\t\t\talert.show();\r\n\r\n\t\t\t}\r\n\r\n\t\t}",
"private void getStatusOfActivitiesForUser(User theCurrentUser, JSONObject theJsonInput, JSONObject theJsonReturn) {\n \tEntityManager em = EMF.get().createEntityManager();\n \tString apiStatus = ApiStatusCode.SUCCESS;\n\t\tString currentUserId = KeyFactory.keyToString(theCurrentUser.getKey());\n\t\t\n\t\ttry {\n\t\t\tList<String> activityIds = new ArrayList<String>();\n\t\t\tif(theJsonInput.has(\"activities\")) {\n\t\t\t\tJSONArray activityIdsJsonArray = theJsonInput.getJSONArray(\"activities\");\n\t\t\t\tint activityIdsJsonArraySize = activityIdsJsonArray.length();\n\t\t\t\tlog.info(\"activityIds json array length = \" + activityIdsJsonArraySize);\n\t\t\t\tfor(int i=0; i<activityIdsJsonArraySize; i++) {\n\t\t\t\t\tJSONObject activityIdJsonObj = activityIdsJsonArray.getJSONObject(i);\n\t\t\t\t\tactivityIds.add(activityIdJsonObj.getString(\"activityId\"));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t \t// Activity IDs are required.\n\t \tif(activityIds.size() == 0) {\n\t \t\tapiStatus = ApiStatusCode.ACTIVITY_IDS_REQUIRED;\n\t \t} else {\n\t\t\t\tActivityVote activityVote = null;\n\t\t\t\t// Package requested activities into JSON\n\t\t\t\tJSONArray jsonActivitiesArray = new JSONArray();\n\t\t\t\tfor(String activityId : activityIds) {\n\t\t\t\t\tJSONObject jsonActivityObj = new JSONObject();\n\t\t\t\t\tjsonActivityObj.put(\"activityId\", activityId);\n\t\t\t\t\tString activityStatus = ActivityVote.NONE_STATUS;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tactivityVote = (ActivityVote)em.createNamedQuery(\"ActivityVote.getByActivityIdAndUserId\")\n\t\t\t\t\t\t\t.setParameter(\"activityId\", activityId)\n\t\t\t\t\t\t\t.setParameter(\"userId\", currentUserId)\n\t\t\t\t\t\t\t.getSingleResult();\n\t\t\t\t\t\tlog.info(\"activityVote retrieved successfully. Current status = \" + activityVote.getStatus());\n\t\t\t\t\t\tactivityStatus = activityVote.getStatus();\n\t\t\t\t\t} catch (NoResultException e) {\n\t\t\t\t\t\t// Not an error - actually, it's one of the expected results\n\t\t\t\t\t} catch (NonUniqueResultException e) {\n\t\t\t\t\t\tlog.severe(\"should never happen - two or more activityVotes have same activity id and user id\");\n\t\t\t\t\t\tthis.setStatus(Status.SERVER_ERROR_INTERNAL);\n\t\t\t\t\t}\n\t\t\t\t\tjsonActivityObj.put(\"vote\", activityStatus);\n\t\t\t\t\tjsonActivitiesArray.put(jsonActivityObj);\n\t\t\t\t}\n\t\t\t\tlog.info(\"JSON object built successfully\");\n\t\t\t\ttheJsonReturn.put(\"activities\", jsonActivitiesArray);\n\t \t}\n\t\t} catch (JSONException e) {\n\t\t\tlog.severe(\"error converting json representation into a JSON object\");\n\t\t\tthis.setStatus(Status.SERVER_ERROR_INTERNAL);\n\t\t} finally {\n\t\t em.close();\n\t\t}\n \t\n\t\ttry {\n\t\t\ttheJsonReturn.put(\"apiStatus\", apiStatus);\n\t\t} catch (JSONException e) {\n\t\t\tlog.severe(\"error creating JSON return object\");\n\t\t\te.printStackTrace();\n\t\t}\n \treturn;\n }",
"private void verifyUser(){\n getValues();\n boolean validate;\n\n validate = db.authenticateUser(username, password);\n\n if (validate) {\n\n Cursor cursor = db.fetchData(username,password);\n cursor.moveToFirst();\n\n String contact = cursor.getString(3);\n\n session.createLoginSession(username, password, contact);\n\n Toast.makeText(this, \"[SYSTEM]: Login Successful! \", Toast.LENGTH_SHORT).show();\n\n Intent i = new Intent(this, MainActivity.class);\n startActivity(i);\n finish();\n } else {\n Toast.makeText(this, \"FAIL!\", Toast.LENGTH_SHORT).show();\n }\n }",
"@Override\n\tpublic String checkuser() {\n\t\ttry {\n\t\t\tMap<String, String> sParam = new LinkedHashMap<String, String>();\n\t\t\tsParam.put(\"uid\", userid);\n\t\t\tsParam.put(\"serverid\", serverid+\"\");\n\t\t\tHttp h = Http.getInstance();\n\t\t\tString SubmitResult = h.hp(QST_CHECK_PATH,sParam,\"get\");\n\t\t\t\n//\t\t\tString SubmitResult = Http.hp(QST_CHECK_PATH+\"?uid=\"+userid+\"&serverid=\"+serverid);\n\t\t\t int a = SubmitResult.indexOf(\"{\");\n\t\t\t int b = SubmitResult.lastIndexOf(\"}\");\n\t\t\t SubmitResult = SubmitResult.substring(a, b+1);\n\n\t\t\t return SubmitResult;\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\treturn \"网络出错!\";\n\t\t}\n\t}",
"public static void handleSuccess(final RpcResponse resultData, final Activity activity, final LoginCallback loginCallback) {\n LoginReturnData returnValue = (LoginReturnData) resultData.returnValue;\n final int code = resultData.code;\n SDKLogger.d(TAG, \"asyncExecute code = \" + code);\n if (code == 3000) {\n Session session = null;\n try {\n if (resultData.returnValue != null) {\n SDKLogger.d(TAG, \"asyncExecute returnValue not null \");\n if (!TbAuthContext.needSession || TextUtils.equals(TbAuthContext.sSceneCode, \"10010\")) {\n session = SessionConvert.convertLoginDataToSeesion(returnValue);\n } else {\n ((SessionService) AliMemberSDK.getService(SessionService.class)).refreshWhenLogin(Site.TAOBAO, returnValue);\n session = ((SessionService) AliMemberSDK.getService(SessionService.class)).getSession();\n }\n }\n final Session finalSession = session;\n ((MemberExecutorService) AliMemberSDK.getService(MemberExecutorService.class)).postUITask(new Runnable() {\n public void run() {\n RpcPresenter.doWhenResultOk(activity, loginCallback, finalSession);\n }\n });\n } catch (Exception e) {\n e.printStackTrace();\n }\n } else if (code == 13060) {\n String doubleCheckUrl = returnValue.h5Url;\n SDKLogger.d(TAG, \"asyncExecute doubleCheckUrl = \" + doubleCheckUrl);\n if (!TextUtils.isEmpty(doubleCheckUrl) && activity != null) {\n Activity startFrom = activity;\n CallbackContext.setActivity(startFrom);\n Intent intent = new Intent(startFrom, TbAuthWebViewActivity.class);\n intent.putExtra(\"url\", doubleCheckUrl);\n intent.putExtra(\"token\", returnValue.token);\n intent.putExtra(\"scene\", returnValue.scene);\n TbAuthWebViewActivity.token = returnValue.token;\n TbAuthWebViewActivity.scene = returnValue.scene;\n activity.startActivityForResult(intent, RequestCode.OPEN_DOUBLE_CHECK);\n }\n } else {\n ((MemberExecutorService) AliMemberSDK.getService(MemberExecutorService.class)).postUITask(new Runnable() {\n public void run() {\n SDKLogger.d(RpcPresenter.TAG, \"15 : \" + resultData.message);\n RpcPresenter.doWhenResultFail(activity, loginCallback, 15, \"login:code \" + code + \" \" + resultData.message);\n }\n });\n }\n }",
"@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n // Either way, check log in again\n checkAccessAndLoggIn();\n }",
"@Override\r\n protected void onPostExecute(String result) {\n int intresult = Integer.parseInt(result);\r\n recorderActivity.lastcc = intresult;\r\n if(intresult >= 0){\r\n //Success to UI using res Recorder activity has boolean of let user take movie\r\n recorderActivity.HideWarningButton();\r\n }\r\n else if(intresult == -10)\r\n {\r\n //Too Dark\r\n recorderActivity.ShowWarningButton();\r\n }\r\n else if(intresult == -11)\r\n {\r\n //Unacceptable\r\n recorderActivity.ShowWarningButton();\r\n }\r\n else if(intresult < 0 && intresult > -10){\r\n //user is risking a bad movie\r\n recorderActivity.ShowWarningButton();\r\n }\r\n }",
"@Override\n protected void onPostExecute(UserInfo newUser) {\n if (flagAlreadyCollected) {\n Toast.makeText(getBaseContext(), \"Ecard already collected\",\n Toast.LENGTH_SHORT).show();\n Intent intent = new Intent(getBaseContext(), ActivityDetails.class);\n // passing UserInfo is made possible through Parcelable\n intent.putExtra(\"userinfo\", newUser);\n startActivity(intent);\n if (dialog.isShowing()) {\n dialog.dismiss();\n }\n } else if (flagCardDoesnotExist) {\n Toast.makeText(getBaseContext(), \"Ecard invalid\", Toast.LENGTH_SHORT)\n .show();\n if (dialog.isShowing()) {\n dialog.dismiss();\n }\n } else if (deletedNoteId != null && !flagCardDoesnotExist) {\n Intent intent = new Intent(getBaseContext(), ActivityScanned.class);\n // passing UserInfo is made possible through Parcelable\n intent.putExtra(\"userinfo\", newUser);\n intent.putExtra(\"offlineMode\", false);\n intent.putExtra(\"deletedNoteId\", deletedNoteId);\n startActivity(intent);\n if (dialog.isShowing()) {\n dialog.dismiss();\n }\n } else {\n // upon successful scan and pull of info\n Intent intent = new Intent(getBaseContext(), ActivityScanned.class);\n // passing UserInfo is made possible through Parcelable\n intent.putExtra(\"userinfo\", newUser);\n intent.putExtra(\"offlineMode\", false);\n intent.putExtra(\"deletedNoteId\", (String) null);\n startActivity(intent);\n if (dialog.isShowing()) {\n dialog.dismiss();\n }\n }\n }",
"public static void joinSingleLiveActivity(Context cnx, LiveResult item){\n\n\n loge(\"ACTIVITYUTILS\", toGson(item) );\n\n Intent intent = new Intent(cnx, HostPKLiveActivity.class);\n\n intent.putExtra(Global.Constants.TAB_KEY, 3);\n intent.putExtra(Global.Constants.KEY_IS_ROOM_OWNER, false);\n intent.putExtra(Global.Constants.KEY_CREATE_ROOM, false);\n\n intent.putExtra(Global.Constants.KEY_ROOM_NAME, item.getAdd_broadcast_title());\n intent.putExtra(Global.Constants.KEY_ROOM_ID, item.getRoom_id());\n\n intent.putExtra(Global.Constants.KEY_ROOM_OWNER_ID, item.getUser_id());\n intent.putExtra(Global.Constants.USER_PROFILE, item.getImage());\n intent.putExtra(Global.Constants.USERNAME, item.getUser_name());\n intent.putExtra(Global.Constants.TAB_KEY, Integer.parseInt(item.getBroadcasting_type()));\n intent.putExtra(Global.Constants.BROADCAST_ID, item.getAdd_broadcast_id());\n intent.putExtra(Global.Constants.BROADCASTERID, item.getUser_id());\n\n intent.putExtra(Global.Constants.USER_GENDER, item.getGender());\n intent.putExtra(Global.Constants.USER_AGE, item.getAge());\n\n putUserLevel(intent, item.getDiamond(), item.getLevel(), item.getHeart(), item.getMy_xp());\n\n intent.putExtra(Global.Constants.COUNTDOWN, item.getCount_down_in_sec());\n\n cnx.startActivity(intent);\n }",
"public void receiveResultgetUsersOfApplication(\n java.lang.String[] result\n ) {\n }",
"public boolean Main(HomeActivity activity, UserSession session);",
"public boolean execActivityResultAdapter( int result, Intent data ) {\n log_d( \"execActivityResultAdapter()\" ); \t\n\t\t// no action if debug\n if ( BT_DEBUG_SERVICE ) return true;\n\t\t// When the request to enable Bluetooth returns\n\t\tif ( result == Activity.RESULT_OK ) {\n\t\t\tlog_d( \"RESULT OK\" );\n\t\t\t// Bluetooth is now enabled, so set up a chat session\n\t\t\tinitService();\n\t\t// If user did not enable Bluetooth or an error occured\t\t\t\n\t\t} else {\n\t\t\tlog_d( \"RESULT NG\" );\n\t\t\treturn false;\t\t\t \t\n\t\t}\n\t\treturn true;\t\n\t}",
"@Override\r\n\t\tprotected void onPostExecute(Object result) {\n\t\t\tsuper.onPostExecute(result);\r\n\t\t\tif (result != null && (Boolean) result) {\r\n\t\t\t\tIntent intent = new Intent();\r\n\t\t\t\tBundle bundle = new Bundle();\r\n\t\t\t\tbundle.putString(MainActivity.TAG, \"1000\");\r\n\t\t\t\tintent.putExtras(bundle);\r\n\t\t\t\tintent.setAction(ReciverContents.PaySuccess);\r\n\t\t\t\tactivcty.sendBroadcast(intent);\r\n\t\t\t}\r\n\r\n\t\t}",
"@Override\n \t\tprotected void onPostExecute(Object result) {\n \t\t\tmNowLoggingIn = false;\n \t\t\tString[] msgs = (String[]) result;\n \t\t\t/*\n \t\t\tfor (int i = 0; i < msgs.length; i++) {\n \t\t\t\tif (!msgs[i].equals(\"\")) {\n \t\t\t\t\tToast.makeText(\n \t\t\t\t\t\tLetuseeActivity.this,\n \t\t\t\t\t\tmsgs[i],\n \t\t\t\t\t\tToast.LENGTH_SHORT\n \t\t\t\t\t).show();\n \t\t\t\t}\n \t\t\t}\n \t\t\t*/\n \t\t\tif (msgs[1].equals(getString(R.string.tips_associated))) {\n \t\t\t\tToast.makeText(\n \t\t\t\t\tEntranceActivity.this,\n \t\t\t\t\tR.string.tips_associated,\n \t\t\t\t\tToast.LENGTH_LONG\n \t\t\t\t).show();\n \t\t\t}\n \t\t\tif (!msgs[2].equals(\"\")\n \t\t\t\t&& !msgs[2].equals(getString(R.string.tips_alreadylast))\n \t\t\t\t&& !msgs[2].equals(getString(R.string.err_wrongversioninfos))\n \t\t\t\t&& !msgs[2].equals(getString(R.string.err_noversioninfos))\n \t\t\t\t&& !msgs[2].equals(getString(R.string.err_noversion))\n \t\t\t) {\n \t\t\t\tString[] infos = msgs[2].split(\",\");\n \t\t\t\tIntent intent = new Intent();\n \t\t\t\tintent.putExtra(\"code\", infos[0]);\n \t\t\t\tintent.putExtra(\"name\", infos[1]);\n \t\t\t\tintent.putExtra(\"newname\", infos[2]);\n\t\t\t\tintent.putExtra(\"newcontent\", getString(R.string.locale).equals(\"en\") ? \"\" : infos[5]);\n \t\t\t\tintent.setClass(EntranceActivity.this, UpdateActivity.class);\n \t\t\t\tstartActivity(intent);\n \t\t\t}\n \t\t\t\n \t\t\tSina sina = WeiboPage.getSina();\n \t\t\tif (sina != null && sina.isLoggedIn()) {\n \t\t\t\tRegLoginActivity.updateTitle(\n \t\t\t\t\tR.id.ivTitleIcon, R.id.tvTitleName,\n \t\t\t\t\tsina.getLoggedInUser()\n \t\t\t\t);\n \t\t\t}\n \t\t\t\t\n \t\t\tsuper.onPostExecute(result);\n \t\t}",
"@SuppressLint(\"StaticFieldLeak\")\n private void checkEpireDate (){\n new AsyncTask<String, String, String>() {\n\n @Override\n protected String doInBackground(String... strings) {\n //Store url\n String url = strings[0];\n //Get user_id\n String user_id = new UserDetails(HomeActivity.this).getUserAccount().getUser().getUser_id();\n //Attach user_id to the url\n url += \"&userid=\"+user_id;\n //Make request\n return new ThisApp().post(3000,3000,url,\"\");\n }\n\n @Override\n protected void onPostExecute(String s) {\n //Toast.makeText(HomeActivity.this,s,Toast.LENGTH_LONG).show();\n super.onPostExecute(s);\n }\n }.execute(ThisApp.ACC_SUBSCRIBTION_EXP_DATE_CHECK_URL);\n }",
"public void showResultToUser(CommandResult result) {\n final ArrayList<Task> relevantTasks = result.getRelevantTasks();\n if (relevantTasks != null) {\n showToUser(getIndexedListViewOfTasks(relevantTasks));\n }\n showToUser(result.feedbackToUser);\n }",
"void onActivityReady();",
"private void goToResultActivity() {\n try {\n stopCountdown();\n if (isOnline()) {\n List<Contact> testDetails = db.getPracticeTestDetailByID(Integer.parseInt(mSchoolId), Integer.parseInt(mStudentId), Integer.parseInt(testId));\n ansString = \"\";\n extraParam = \"2 Date :: \" + currentDateandTimeTemp;\n if (testDetails != null && testDetails.size() > 0) {\n ansString = testDetails.get(0).getTestAnsString();\n testTicks = testDetails.get(0).getTestTicks();\n if (ansString == null || ansString.isEmpty()) {\n ansString = \"\";\n extraParam = \"-1\";\n }\n if (testTicks == null || testTicks.isEmpty()) {\n testTicks = \"\";\n }\n /* if (ansString != null && !ansString.isEmpty()) {*/\n Log.e(\"ansString\", ansString);\n frame_progress.setVisibility(View.VISIBLE);\n progressBar.setVisibility(View.VISIBLE);\n String mStudentId = Datastorage.GetStudentId(getApplicationContext());\n String mSchoolId = Datastorage.GetSchoolId(getApplicationContext());\n String mYearId = Datastorage.GetCurrentYearId(getApplicationContext());\n String deviceId = Settings.Secure.getString(getContentResolver(), Settings.Secure.ANDROID_ID);\n String mDeviceDetail = Build.DEVICE + \"|||\" + Build.MODEL + \"|||\" + Build.ID\n + \"|||\" + Build.PRODUCT + \"|||\" + Build.VERSION.SDK\n + \"|||\" + Build.VERSION.RELEASE + \"|||\" + Build.VERSION.INCREMENTAL;\n Call<AppService> call = ((MyApplication) getApplicationContext()).getmRetrofitInterfaceAppService()\n .SetPracticeTestAnsV3(mStudentId, mSchoolId, mYearId, testId, ansString, SchoolDetails.appname + \"\", Constants.CODEVERSION, Constants.PLATFORM, extraParam, testTicks, deviceId, mDeviceDetail);\n call.enqueue(new Callback<AppService>() {\n @Override\n public void onResponse(Call<AppService> call, Response<AppService> response) {\n try {\n progressBar.setVisibility(View.GONE);\n frame_progress.setVisibility(View.GONE);\n AppService tmps = response.body();\n if (tmps != null && tmps.getResponse() != null && !tmps.getResponse().isEmpty()\n && tmps.getResponse().equalsIgnoreCase(\"1\") && !tmps.getStrResult().isEmpty()) {\n db.deleteTestRecords(rowTestID);\n Intent i = new Intent(PracticeTestQAActivity.this, PracticeTestResultActivity.class);\n i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n // i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n // i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);\n i.putExtra(\"testId\", testId);\n i.putExtra(\"testName\", testName);\n i.putExtra(\"refereshflag\", \"1\");\n startActivity(i);\n PracticeTestQAActivity.this.finish();\n onClickAnimation();\n Toast.makeText(PracticeTestQAActivity.this, tmps.getStrResult(), Toast.LENGTH_SHORT).show();\n } else {\n Toast.makeText(PracticeTestQAActivity.this, tmps.getStrResult(), Toast.LENGTH_SHORT).show();\n }\n } catch (Exception ex) {\n btn_next.setEnabled(true);\n progressBar.setVisibility(View.GONE);\n frame_progress.setVisibility(View.GONE);\n Constants.writelog(\"PracticeTestQAActivity\", \"setTestAns 2062:\" + ex.getMessage());\n } finally {\n ansString = \"\";\n }\n }\n\n @Override\n public void onFailure(Call<AppService> call, Throwable t) {\n progressBar.setVisibility(View.GONE);\n btn_next.setEnabled(true);\n frame_progress.setVisibility(View.GONE);\n Constants.writelog(\"PracticeTestQAActivity\", \"setTestAns 1589:\" + t.getMessage());\n }\n });\n /* }else {\n Intent i = new Intent(PracticeTestQAActivity.this, PracticeTestResultActivity.class);\n i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n // i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n // i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);\n i.putExtra(\"testId\", testId);\n i.putExtra(\"testName\", testName);\n i.putExtra(\"refereshflag\", \"1\");\n startActivity(i);\n PracticeTestQAActivity.this.finish();\n onClickAnimation();\n }*/\n } else {\n Intent i = new Intent(PracticeTestQAActivity.this, PracticeTestResultActivity.class);\n i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n // i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n // i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);\n i.putExtra(\"testId\", testId);\n i.putExtra(\"testName\", testName);\n i.putExtra(\"refereshflag\", \"1\");\n startActivity(i);\n PracticeTestQAActivity.this.finish();\n onClickAnimation();\n }\n } else {\n btn_next.setEnabled(true);\n progressBar.setVisibility(View.GONE);\n frame_progress.setVisibility(View.GONE);\n Toast.makeText(this, SchoolDetails.MsgNoInternet, Toast.LENGTH_SHORT).show();\n }\n } catch (Exception e) {\n btn_next.setEnabled(true);\n Constants.writelog(\"PracticeTestQAActivity\", \"goToResultActivity 1787:\" + e.getMessage());\n }\n }",
"@Override\n protected void onPostExecute(Void result) {\n Intent intent = new Intent(game_play.this, user_input.class);\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK|Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(intent);\n finish();\n }",
"@Override\n public void onSuccess(Boolean result)\n {\n if (result)\n {\n System.out.println(\"user info successfully updated!\");\n Window.alert(\"Successfully updated!\");\n }\n else\n {\n System.out.println(\"something is wrong on the server side!\");\n }\n }",
"@Override\r\n\tprotected void onPostExecute(JSONObject result) {\n\t\tIntent i = new Intent(context,LiveRace.class);\r\n\t\ti.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\r\n\t\tcontext.startActivity(i);\r\n\r\n\t}",
"@Override\n\t\tprotected void onPostExecute(String result) {\n\t\t\tsuper.onPostExecute(result);\n\t\t\t\n\t\t\tif(response1.contains(\"success\"))\n\t\t\t{\n\t\t\t\trg_parsingmethod();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tToast.makeText(getApplicationContext(), \"No new registrations\", Toast.LENGTH_SHORT).show();\n\t\t\t}\n\t\t}",
"private void signInResultHandler(GoogleSignInResult result) {\n if (result.isSuccess()) {\n acct = result.getSignInAccount();\n m_tvStatus.setText(R.string.status_signedin);\n try {\n m_tvDispName.setText(acct.getDisplayName());\n m_tvEmail.setText(acct.getEmail());\n }\n catch (NullPointerException e) {\n Log.d(TAG, \"Error retrieving some account information\");\n Toast.makeText(MainActivity.this, \"Oops! Please double check your account info.\", Toast.LENGTH_SHORT).show();\n }\n\n checkAGWALoginStatus(acct);\n Account_Email = acct.getEmail();\n\n }\n else {\n Status status = result.getStatus();\n int statusCode = status.getStatusCode();\n\n // Constant Value: 12501 (API)\n if (statusCode == GoogleSignInStatusCodes.SIGN_IN_CANCELLED) {\n m_tvStatus.setText(R.string.status_signincancelled);\n }\n\n // Constant Value: 12500 (API)\n else if (statusCode == GoogleSignInStatusCodes.SIGN_IN_FAILED) {\n m_tvStatus.setText(R.string.status_signinfail);\n }\n else {\n m_tvStatus.setText(R.string.status_nullresult);\n }\n }\n }",
"public void invokeBehaviour() {\n\t\tIntent i = alertMe.createIntentFromSession();\n\t\ti.setClass(this, AlertMeBehaviour.class);\n startActivityForResult(i, AlertMeConstants.INVOKE_STATUS); \n }",
"@Override\n\t\tprotected void onPostExecute(Void result) {\n\t\t\tsuper.onPostExecute(result);\n\t\t\tprogressDialog.dismiss();\n\t\t\tif(!flag)\n\t\t\t{\n\t\t\tToast.makeText(getApplicationContext(),err, Toast.LENGTH_LONG).show();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (arr[0].equalsIgnoreCase(\"1\"))\n\t\t\t\t{\n\t\t\t\t\tputOnShare();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\tToast.makeText(getApplicationContext(), \"Credentials are incorrect\\nPlease check the settings\", Toast.LENGTH_LONG).show();\n\t\t\t}\n\t\t\t}",
"public void alertUser(int status){\r\n\r\n }",
"private void getUserInfo(boolean checkAccessTokenResult, final AccessToken accessToken) {\n if (!checkAccessTokenResult) {\n //access token is not valid refresh\n RequestParams params = new RequestParams(WeChatManager.getRefreshAccessTokenUrl(sURLRefreshAccessToken, accessToken));\n x.http().request(HttpMethod.GET, params, new Callback.CommonCallback<String>() {\n @Override\n public void onSuccess(String result) {\n parseRefreshAccessTokenResult(result);\n }\n\n @Override\n public void onError(Throwable ex, boolean isOnCallback) {\n }\n\n @Override\n public void onCancelled(CancelledException cex) {\n }\n\n @Override\n public void onFinished() {\n }\n });\n }\n\n showLoading();\n //get userinfo\n RequestParams requestParams = new RequestParams(WeChatManager.getUserInfoUrl(sURLUserInfo, accessToken));\n x.http().request(HttpMethod.GET, requestParams, new Callback.CommonCallback<String>() {\n @Override\n public void onSuccess(String result) {\n userinfo = new Gson().fromJson(result, UserInfoWX.class);\n\n String device_id= JPushInterface.getRegistrationID(LoginActivity.this);\n RequestParams entity = new RequestParams(Configurations.URL_THIRD_PARTY_LOGIN);\n entity.addParameter(Configurations.OPEN_ID, userinfo.getUnionid());\n entity.addParameter(Configurations.NICKNAME, userinfo.getNickname());\n entity.addParameter(Configurations.AVATOR, userinfo.getHeadimgurl());\n entity.addParameter(\"from\", \"wx\");\n entity.addParameter(Configurations.REG_ID,device_id);\n\n\n long timeStamp= TimeUtil.getCurrentTime();\n entity.addParameter(Configurations.TIMESTAMP, String.valueOf(timeStamp));\n entity.addParameter(Configurations.DEVICE_ID,device_id );\n\n Map<String,String> map=new TreeMap<>();\n map.put(Configurations.OPEN_ID, userinfo.getUnionid());\n map.put(Configurations.NICKNAME, userinfo.getNickname());\n map.put(Configurations.AVATOR, userinfo.getHeadimgurl());\n map.put(\"from\", \"wx\");\n map.put(Configurations.REG_ID,device_id);\n entity.addParameter(Configurations.SIGN, SignUtils.createSignString(device_id,timeStamp,map));\n\n\n x.http().request(HttpMethod.POST, entity, new CommonCallback<String>() {\n @Override\n public void onSuccess(String result) {\n LogUtil.d(TAG, result);\n hideLoading();\n\n try {\n JSONObject object = new JSONObject(result);\n if (object.getInt(Configurations.STATUSCODE) == 200) {\n User user = JSON.parseObject(object.getJSONObject(\"results\").getString(\"user\"), User.class);\n SharedPrefUtil.loginSuccess(SharedPrefUtil.LOGIN_VIA_WECHAT);\n UserUtils.saveUserInfo(user);\n\n MobclickAgent.onProfileSignIn(\"WeChat\", user.getNickname());\n finish();\n } else {\n ToastUtil.showShort(LoginActivity.this, object.getString(Configurations.STATUSMSG));\n }\n\n } catch (JSONException e) {\n e.printStackTrace();\n }\n\n }\n\n @Override\n public void onError(Throwable ex, boolean isOnCallback) {\n hideLoading();\n }\n\n @Override\n public void onCancelled(CancelledException cex) {\n }\n\n @Override\n public void onFinished() {\n }\n });\n\n\n }\n\n @Override\n public void onError(Throwable ex, boolean isOnCallback) {\n }\n\n @Override\n public void onCancelled(CancelledException cex) {\n }\n\n @Override\n public void onFinished() {\n }\n });\n }",
"@Override\r\n\t\t\tpublic void done(User user, BmobException ex) {\n\t\t\t\tprogress.dismiss();\r\n\t\t\t\tif(ex==null){\r\n\t\t\t\t\tToast.makeText(mContext, \"登录成功\", Toast.LENGTH_LONG).show();\r\n\t\t\t\t\tIntent intent = new Intent(LoginActivity.this,GeXingQmActivity.class);\r\n\t\t\t\t\tbllUsrCache.editUsrCache(userSysID, BaseConstant.USER_PHONE,phoneNum);\r\n\t\t\t\t\tstartActivity(intent);\r\n\t\t\t\t\tfinish();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tToast.makeText(mContext, \"登录失败:code=\"+ex.getErrorCode()+\",错误描述:\"+ex.getLocalizedMessage(), Toast.LENGTH_LONG).show();\r\n\t\t\t\t}\r\n\t\t\t}",
"@Override\n\tprotected void onResume()\n\t{\n\t\tsuper.onResume();\n\t\tAirtalkeeUserInfo.getInstance().setOnUserInfoListener(this);\n\t\tcheckBrodcast();\n\t}",
"@Override\r\n\tprotected void onActivityResult(int requestCode, int resultCode, Intent data) {\n\t\tsuper.onActivityResult(requestCode, resultCode, data);\r\n\t\tswitch(requestCode){\r\n\t\tcase QUERYACTIVITYCODE:{\r\n\t\t\tif(resultCode==Activity.RESULT_OK){\r\n\r\n\t\t\t\ttv_query.setText(data.getStringExtra(\"codestr\"));\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t//Toast.makeText(CircleActivity.this, \"未登录\", Toast.LENGTH_LONG).show();;\r\n\t\t\t\t;\r\n\t\t}\r\n\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}",
"private static void checkStatus() {\n\r\n\t\tDate date = new Date();\r\n\t\tSystem.out.println(\"Checking at :\"+date.toString());\r\n\t\tString response = \"\";\r\n\t\ttry {\r\n\t\t\tresponse = sendGET(GET_URL_COVAXIN);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t//System.out.println(response.toString());\r\n\t\tArrayList<Map> res = formatResponse(response);\r\n\r\n\t\tres = checkAvailability(res);\r\n\t\tif(res.size()>0)\r\n\t\t\tnotifyUser(res);\r\n\t\t//System.out.println(emp.toString());\r\n\t}",
"void getUser(String uid, final UserResult result);",
"public void on_code_read(String result){\n Intent intent = new Intent(ScanActivity.this, TargetActivity.class);\n intent.putExtra(\"result\", result);\n startActivity(intent);\n }",
"public void test030301() {\n\t\tActivityMonitor activityMonitor = getInstrumentation().addMonitor(MainActivity.class.getName(), null, false);\n\t\t//User click \"Change User\"\n\t\tactivity.runOnUiThread(new Runnable(){\n\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tassertTrue(UserButton.performClick());\t\n\n\t\t\t\t// opening a dialog\n\t\t \t// access the alert dialog using the getDialog() method created in the activity\n\t\t\t\tAlertDialog d = (AlertDialog) activity.getDialog();\t\t\t\t\n\t\t\t}\t\n\t\t});\n\t\t\n\t\t// get current activity\t\t\t\n\t\tMainActivity myActivity = getActivity();\n\t\t// click \"Claimant\" button and start next activity\n\t\tmyActivity.runOnUiThread(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tActivityMonitor activityMonitor00 = getInstrumentation().addMonitor(ClaimantClaimListActivity.class.getName(), null, false);\n\t\t\t\t// click button and open next activity.\n\t\t\t\tClaimantButton.performClick();\n\t\t\t\tClaimantClaimListActivity nextActivity = (ClaimantClaimListActivity) getInstrumentation().waitForMonitorWithTimeout(activityMonitor00, 10000);\n\t\t\t\t// next activity is opened and captured.\n\t\t\t\tassertNotNull(nextActivity);\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\t * Test for US03.03.01 Basic Flow 1\n\t\t\t\t */\n\t\t\t\t// view which is expected to be present on the screen\t\t\t\n\t\t\t\tfinal View decorView1 = nextActivity.getWindow().getDecorView();\n\t\t\t\t// layout of claim list\n\t\t\t\tlistView = (ListView) nextActivity.findViewById(ca.ualberta.CMPUT301W15T06.R.id.claimListView);\n\t\t\t\t// check if it is on screen\n\t\t\t\tViewAsserts.assertOnScreen(decorView1, listView);\n\t\t\t\t// check whether the Button object's width and height attributes match the expected values\n\t\t\t\tfinal ViewGroup.LayoutParams layoutParams11 = listView.getLayoutParams();\n\t\t\t\tassertEquals(layoutParams11.width, WindowManager.LayoutParams.MATCH_PARENT);\n\t\t\t\tassertEquals(layoutParams11.height, WindowManager.LayoutParams.WRAP_CONTENT);\t\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\t * Test for US03.03.01 Basic Flow 2,3\n\t\t\t\t */\n\t\t\t\t// Click the menu option\n\t\t\t\tint count_be = u.getClaimList().size();\n\t\t\t\tActivityMonitor am = getInstrumentation().addMonitor(ClaimantClaimListActivity.class.getName(), null, false);\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\t * Test for US03.03.01 Basic Flow 4\n\t\t\t\t */\n\t\t\t\tgetInstrumentation().invokeMenuActionSync(nextActivity,ca.ualberta.CMPUT301W15T06.R.id.filter, 1);\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\t * Test for US03.03.01 Basic Flow 5\n\t\t\t\t */\t\t\n\t\t\t\t// test alert dialog (contains saved tags)\n\t\t\t\tAlertDialog d = (AlertDialog) nextActivity.getDialog();\n\t\t\t\tassertNotNull(d);\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\t * Test for US03.03.01 Basic Flow 6a\n\t\t\t\t */\n\t\t\t\t//\"Filter Model\" button\n\t\t\t\tButton positiveButton = d.getButton(DialogInterface.BUTTON_POSITIVE);\n\t\t\t\tassertNotNull(positiveButton);\n\t\t\t\tpositiveButton.performClick();\n\n\t\t\t\t/*\n\t\t\t\t * Test for US03.03.01 Basic Flow 6b\n\t\t\t\t */\n\t\t\t\t//\"show all model\" button\n\t\t\t\tButton negativeButton = d.getButton(DialogInterface.BUTTON_NEGATIVE);\n\t\t\t\tassertNotNull(negativeButton);\n\t\t\t\tnegativeButton.performClick();\n\t\t\t\t// all claims are shown\n\t\t\t\tint count_all = u.getClaimList().size();\n\t\t\t\tassertEquals(count_be, count_all);\n\n\t\t\t\t//finish activity\n\t\t\t\tnextActivity.finish();\t\t\t\t\n\t\t\t}\n\t\t});\n\t\tactivity.finish();\n\t}",
"public boolean execActivityResult( int request, int result, Intent data ) {\n\t\tboolean ret = true;\n switch ( request) {\n\t\t\tcase REQUEST_DEVICE_CONNECT:\n\t\t\t\texecActivityResultDevice( result, data );\n \tbreak;\n \tcase REQUEST_ADAPTER_ENABLE:\n\t\t\t\tret = execActivityResultAdapter( result, data );\n \tbreak; \n \t}\n return ret;\n }",
"public void checkIfUserIsSame(){\n if(!FirebaseAuth.getInstance().getCurrentUser().getUid().equals(getIntent().getStringExtra(\"uID\"))) {\n Log.i(\"XXX\", \"passed NOT SAME USER\");\n checkIfUserIsFriend();\n }else{\n userStatus = \"same user\";\n ((RelativeLayout) findViewById(R.id.loadingPanel)).setVisibility(View.GONE);\n }\n }",
"private void ListenerForAsynctask() {\n\t\tAsyncTaskCall.setCallback(new CallbacksFromAsynctask() {\r\n\t\t\t@Override\r\n\t\t\tpublic void onCallbackRecieved(int requestCode, int statuscode,\r\n\t\t\t\t\tString result) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\td.dismissCustomSpinProgress();\r\n\t\t\t\tSystem.out.println(\"s\" + statuscode + \"r\" + requestCode);\r\n\t\t\t\tif (statuscode == 1) {\r\n\t\t\t\t\tif (requestCode == 1) {\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tJSONObject obj = new JSONObject(result);\r\n\t\t\t\t\t\t\tSystem.out.println(\"res\" + result);\r\n\t\t\t\t\t\t\tif (obj.optString(\"is_present\").equals(\"2\")) {\r\n\t\t\t\t\t\t\t\tSystem.out.println(\"service login success....\");\r\n\r\n\t\t\t\t\t\t\t\tToast.makeText(TrainerHomeActivity.this,\r\n\t\t\t\t\t\t\t\t\t\t\"Success\", 500).show();\r\n\t\t\t\t\t\t\t\tIntent i = new Intent(TrainerHomeActivity.this,\r\n\t\t\t\t\t\t\t\t\t\tHomeActivity.class);\r\n\t\t\t\t\t\t\t\tstartActivity(i);\r\n\t\t\t\t\t\t\t\tfinish();\r\n\t\t\t\t\t\t\t\toverridePendingTransition(\r\n\t\t\t\t\t\t\t\t\t\tR.anim.open_translate,\r\n\t\t\t\t\t\t\t\t\t\tR.anim.close_translate);\r\n\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t// if failed\r\n\t\t\t\t\t\t\t\tToast.makeText(\r\n\t\t\t\t\t\t\t\t\t\tTrainerHomeActivity.this,\r\n\t\t\t\t\t\t\t\t\t\t\"Something went wrong, please try again later!\",\r\n\t\t\t\t\t\t\t\t\t\t500).show();\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} catch (JSONException e) {\r\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\t\trunOnUiThread(new Runnable() {\r\n\t\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\t\t\t// d.showSingleButtonDialog(\r\n\t\t\t\t\t\t\t\t\t// TrainerHomeActivity.this,\r\n\t\t\t\t\t\t\t\t\t// \"Internal Error\");\r\n\r\n\t\t\t\t\t\t\t\t\td.showSingleButtonDialog(\r\n\t\t\t\t\t\t\t\t\t\t\tTrainerHomeActivity.this,\r\n\t\t\t\t\t\t\t\t\t\t\t\"Internal Error\");\r\n\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}\r\n\t\t\t}\r\n\t\t});\r\n\t}",
"@Override\n protected void onPostExecute(String result) {\n super.onPostExecute(result);\n if (mprogress != null && mprogress.isShowing() && !LoginActivity.this.isFinishing()) {\n mprogress.dismiss();\n }\n\n if (result != null) {\n if (result.equalsIgnoreCase(\"DOWNLD\")) {\n Toast.makeText(LoginActivity.this, \"New Apk Version has been Installed..!\", Toast.LENGTH_LONG).show();\n } else {\n\n new GetServerDate().execute();\n }\n } else {\n\n new GetServerDate().execute();\n\n }\n\n }",
"@Override\n public void onResult(Bundle bundle) {\n final String result = bundle.getString(DiabetesAppConnection.RESULT_KEY, \"\");\n\n if (result.equals(DiabetesAppConnection.RESULT_UNAUTHORIZED)) {\n mResult.setText(\"Unauthorized\");\n mReadData.setEnabled(false);\n mPushData.setEnabled(false);\n return;\n }\n\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n mResult.setText(\"PushData result = \" + result);\n }\n });\n }",
"@Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n\n //check password and username before proceeding to login page\n Intent intent = new Intent(MainActivity.this, LoginSuccessActivity.class);\n intent.putExtra(\"USERNAME\", inputUsername);\n intent.putExtra(\"PASSWORD\", inputPassword);\n startTrackerService();\n startActivityForResult(intent, 1);\n } else {\n // password does not match email\n Toast.makeText(MainActivity.this, \"Invalid Password\", Toast.LENGTH_SHORT).show();\n }\n\n }",
"public java.lang.String getUserAvaibility(int status) throws android.os.RemoteException;",
"@Override\n public void onActivityResult(int requestCode, int resultCode, Intent data) {\n IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);\n if (result != null) {\n if (result.getContents() == null) {\n Toast.makeText(this, \"Result Not Found\", Toast.LENGTH_LONG).show();\n } else {\n partNumber = result.getContents();\n new BackgroundTaskScanQrCode().execute();\n }\n } else {\n super.onActivityResult(requestCode, resultCode, data);\n }\n }",
"protected void onPostExecute(Void result) {\n\t\t\tif (progressDialog.isShowing()) {\n if(isInUserBoard) {\n Intent intent = new Intent(LoginActivity.this, MainActivity.class);\n progressDialog.dismiss();\n startActivity(intent);\n }\n else {\n alertDialog.setMessage(PROGRESS_ERROR);\n alertDialog.show();\n progressDialog.dismiss();\n\n }\n\t\t\t}\n\t\t\telse {\n\t alertDialog.setMessage(PROGRESS_ERROR);\n\t alertDialog.show();\n progressDialog.dismiss();\n\n }\n\t\t}",
"public void onTestStart(ITestResult result) {\n\t\t\r\n\t}",
"public void onTestStart(ITestResult result) {\n\t\t\r\n\t}",
"@Subscribe\n public void onUserInfosSucceededEventReceived(LoginSucceededEvent event) {\n Log.d(TAG,\"onuserinfosucceeded\");\n if (view != null) {\n view.hideLoader();\n view.goListScreen(event.getUserName());\n }\n }",
"void doActivity();",
"public void receiveResultcheckServerStatus(\n loadbalance.LoadBalanceStub.CheckServerStatusResponse result\n ) {\n }",
"private void showResults() {\n verifyFCMToken(this);\n progressDialog.cancel();\n Toast.makeText(RegisterActivity.this, \"Welcome!\", Toast.LENGTH_SHORT).show();\n Intent intent = new Intent(this, MainActivity.class);\n startActivity(intent);\n }",
"public void onActivityResult(int requestCode, int resultCode, Intent intent) {\n if (requestCode == 0) {\n if (resultCode == RESULT_OK) {\n boolean found = false;\n String contents = intent.getStringExtra(\"SCAN_RESULT\");\n for (int i = 0; i < arrayAdapter.getCount(); i++) {\n if(arrayAdapter.getItem(i).getQRID().equals(contents)) {\n found = true;\n if(!viewers_listview.isItemChecked(i)){\n checkAttendance(i);\n } else {\n Toast toast = Toast.makeText(this, getResources().getString(R.string.attendance_already_confirmed) + \" \" + arrayAdapter.getItem(i).getName(), Toast.LENGTH_SHORT);\n toast.show();\n }\n break;\n }\n }\n if(!found) {\n Toast toast = Toast.makeText(this, getResources().getString(R.string.id_not_found), Toast.LENGTH_SHORT);\n toast.show();\n }\n }\n }\n }",
"@Override\r\n public void onResult(String result)\r\n {\n handler.sendMessage(handler.obtainMessage(SHOWTOAST, \"SN = \"+result));\r\n }",
"@Override\n public void onLoggedInVerified(User user) {\n bakery.toastShort(user.getEmail());\n loadTaskActivity();\n }",
"public void run() {\n if (resultType == 1) {\n onSignupSuccess();\n } else if(resultType==2){\n onSignupFailed(\"Cannot create user.\");\n }else{\n onSignupFailed(\"Network unavailable.\");\n }\n progressDialog.dismiss();\n }",
"@Override\r\n\tprotected void onActivityResult(int requestCode, int resultCode, Intent data) {\n\t\tif(requestCode== check && resultCode== RESULT_OK){\r\n\t\t\tArrayList<String> results = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);\r\n\t\t\tListView_Result.setAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,results));\r\n\r\n\t\t\t\r\n\t\t}\r\n\t\tsuper.onActivityResult(requestCode, resultCode, data);\r\n\t\t\r\n\t}",
"@Override\n\tpublic void onUserIdGetByPhoneNum(int result, AirContact contact)\n\t{\n\n\t}",
"@Override\n\tpublic void onActivityResult(int requestCode, int resultCode, Intent data) {\n\t\tsuper.onActivityResult(requestCode, resultCode, data);\n\t\t\n\n\t\tif(requestCode == QUESTION_DETAIL_START_REQUEST && resultCode == QUESTION_DETAIL_END_REQUEST)\n {\n\t\t\tnew ApacheHttpThread().start();\n }\n\t\t\n\t\tif(requestCode == ADD_QUESTION_START_REQUEST && resultCode == ADD_QUESTION_END_REQUEST)\n {\n\t\t\t//Thread.sleep(6);\n\t\t\t new ApacheHttpThread().start();\n\t\t\t\n }\n\t\t\n\t\tif(requestCode == USER_LOGIN_START_REQUEST && resultCode == USER_LOGIN_END_REQUEST)\n {\n\t\t\tLog.d(\"user login start @@@\", \"666666\");\n\n\t\t\t// Toast.makeText(getActivity(), \"66666\", Toast.LENGTH_SHORT).show();\n\t\t\t// Thread.sleep(6);\n\t\t\t// new ApacheHttpThread().start();\n\t\t\tFragment homeContent = null;\n\t\t\thomeContent = new homeFragment();\n\n\t\t\tTestURLActivity fca = (TestURLActivity) getActivity();\n\t\t\tfca.switchContent(homeContent);\n\n }\n\t\t\n\t\tif(requestCode == QUESTION_DETAIL_START_REQUEST_2 && resultCode == QUESTION_DETAIL_END_REQUEST_2)\n {\n\t\t\tToast.makeText(getActivity(), \"77777\", Toast.LENGTH_SHORT).show();\n\t\t\t// Thread.sleep(6);\n\t\t\t// new ApacheHttpThread().start();\n\t\t\tFragment homeContent = null;\n\t\t\thomeContent = new homeFragment();\n\n\t\t\tTestURLActivity fca = (TestURLActivity) getActivity();\n\t\t\tfca.switchContent(homeContent);\n\t\t\t\n\t\t\t\n\t\t\tLog.d(\"question start @@@\", \"777777\");\n\n }\n\t\n\t\t\n\t}"
] | [
"0.5905918",
"0.5890543",
"0.58271825",
"0.58027005",
"0.5797931",
"0.579471",
"0.57450676",
"0.5725053",
"0.5669895",
"0.5660169",
"0.56567645",
"0.56372434",
"0.5606239",
"0.56028324",
"0.5597441",
"0.5588796",
"0.5564296",
"0.555388",
"0.55519533",
"0.5532067",
"0.553032",
"0.55184275",
"0.5511994",
"0.54680103",
"0.5461191",
"0.5458896",
"0.54482746",
"0.54316247",
"0.5426449",
"0.5423114",
"0.54217535",
"0.54198545",
"0.5419111",
"0.54184914",
"0.5417472",
"0.54139984",
"0.5408544",
"0.5400912",
"0.5387466",
"0.5385474",
"0.537874",
"0.5376116",
"0.53731257",
"0.5371171",
"0.53591204",
"0.5358865",
"0.5357419",
"0.53464",
"0.53308517",
"0.5329586",
"0.53203744",
"0.5315157",
"0.5306839",
"0.53045094",
"0.53013045",
"0.5295702",
"0.5293888",
"0.5286127",
"0.5281141",
"0.52722305",
"0.52689976",
"0.52681416",
"0.5267265",
"0.52656716",
"0.52653396",
"0.5265101",
"0.525514",
"0.525252",
"0.524341",
"0.524308",
"0.5242272",
"0.5241775",
"0.52343553",
"0.5233675",
"0.52289796",
"0.52264994",
"0.52236307",
"0.52208173",
"0.52206093",
"0.5218818",
"0.5211829",
"0.5209966",
"0.5207382",
"0.5206485",
"0.52058655",
"0.5204615",
"0.5203868",
"0.52021897",
"0.52018803",
"0.52018803",
"0.52014",
"0.51986194",
"0.51941174",
"0.5186507",
"0.5185269",
"0.5183666",
"0.5180721",
"0.5180424",
"0.5176203",
"0.5173265",
"0.5172719"
] | 0.0 | -1 |
[END onactivityresult] [START auth_with_google] | private void firebaseAuthWithGoogle(GoogleSignInAccount acct) {
Log.d(TAG, "firebaseAuthWithGoogle:" + acct.getId());
// [START_EXCLUDE silent]
showProgressDialog();
// [END_EXCLUDE]
AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);
mAuth.signInWithCredential(credential)
.addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (task.isSuccessful()) {
// Sign in success, update UI with the signed-in user's information
Log.d(TAG, "signInWithCredential:success");
FirebaseUser user = mAuth.getCurrentUser();
session.setLogin(true);
db.addUser(user.getDisplayName(), user.getEmail(), user.getUid());
Intent intent = new Intent(SignInActivity.this, MainActivity.class);
startActivity(intent);
finish();
// updateUI(user);
} else {
// If sign in fails, display a message to the user.
Log.w(TAG, "signInWithCredential:failure", task.getException());
Toast.makeText(SignInActivity.this, "Authentication failed.",
Toast.LENGTH_SHORT).show();
// updateUI(null);
}
// [START_EXCLUDE]
hideProgressDialog();
// [END_EXCLUDE]
}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void signInWithGoogle() {\n Intent signInIntent = mGoogleSignInClient.getSignInIntent();\n startActivityForResult(signInIntent, ConstantValue.GOOGLE_SIGN_IN);\n }",
"public final void signInWithGoogle() {\n ActivityResult.startGoogleLogin(activity, googleApiClient);\n }",
"private void firebaseAuthWithGoogle(GoogleSignInAccount acct) {\n Toast.makeText(this, getResources().getString(R.string.autenticandoseGoogle) + \" \" + acct.getId(), Toast.LENGTH_SHORT).show();\n\n showProgressDialog();\n\n AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);\n mAuth.signInWithCredential(credential)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n Toast.makeText(getApplicationContext(), getResources().getString(R.string.autenticadoGoogle), Toast.LENGTH_SHORT).show();\n FirebaseUser user = mAuth.getCurrentUser();\n updateUI(user);\n finish();\n } else {\n Toast.makeText(getApplicationContext(), getResources().getString(R.string.autenticacionFallida), Toast.LENGTH_SHORT).show();\n updateUI(null);\n }\n hideProgressDialog();\n\n\n }\n });\n }",
"private void googleSignIn() {\n\n Intent signInIntent = mGoogleSignInClient.getSignInIntent();\n startActivityForResult(signInIntent, RC_SIGN_IN);\n }",
"public void continueWithGoogle(View view) {\n Intent signInIntent = mGoogleSignInClient.getSignInIntent();\n startActivityForResult(signInIntent, 99);\n }",
"private void signInWithGoogle() {\n Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);\n startActivityForResult(signInIntent, RC_SIGN_IN);\n }",
"private void googleSignIn() {\n Intent signInIntent = mGoogleSignInClient.getSignInIntent();\n startActivityForResult(signInIntent, SIGN_IN);\n }",
"@Override\n public void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n mCallbackManager.onActivityResult(requestCode, resultCode, data); // DATA CALLBACK FOR FACEBOOK\n if (data != null) {\n progressDialog.show();\n progressDialog.setMessage(\"Logging you in...\");\n if (requestCode == 9001 && resultCode == RESULT_OK) {\n Task<GoogleSignInAccount> task = GoogleSignIn.getSignedInAccountFromIntent(data);\n try {\n // Google Sign In was successful, authenticate with Firebase\n GoogleSignInAccount account = task.getResult(ApiException.class);\n assert account != null;\n firebaseAuthWithGoogle(account.getIdToken());\n } catch (ApiException e) {\n e.printStackTrace();\n Toast.makeText(this, e.getMessage(), Toast.LENGTH_SHORT).show();\n }\n }\n }else {\n progressDialog.dismiss();\n }\n }",
"@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == RC_SIGN_IN) {\n GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);\n\n System.out.println(\"result status code\" + result.getStatus());\n if (result.isSuccess()) {\n onSucessGoogleLogin(result);\n\n } else {\n // Google Sign In failed, update UI appropriately\n Utility.logData(\"Login unsuccessful\");\n Utility.showShortToast(\"Login unsuccessful\");\n }\n\n }\n super.onActivityResult(requestCode, resultCode, data);\n }",
"@Override\n public void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n Log.d(\"check\", \"in onActivityResult\");\n // Result returned from launching the Intent from GoogleSignInApi.getSignInIntent(...);\n if (requestCode == RC_SIGN_IN) {\n Log.d(\"sign in\", \"1\");\n GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);\n if (result.isSuccess()) {\n // session.setLogin(true);\n\n // Google Sign In was successful, authenticate with Firebase\n GoogleSignInAccount account = result.getSignInAccount();\n firebaseAuthWithGoogle(account);\n } else {\n Log.d(\"failed to google signin\", \"10\");\n // Google Sign In failed, update UI appropriately\n // [START_EXCLUDE]\n // updateUI(null);\n // [END_EXCLUDE]\n }\n }\n }",
"@Override\n public void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n\n // Result returned from launching the Intent from GoogleSignInApi.getSignInIntent(...);\n if (requestCode == RC_SIGN_IN) {\n Task<GoogleSignInAccount> task = GoogleSignIn.getSignedInAccountFromIntent(data);\n try {\n // Google Sign In was successful, authenticate with Firebase\n GoogleSignInAccount account = task.getResult(ApiException.class);\n firebaseAuthWithGoogle(account);\n\n } catch (ApiException e) {\n // Google Sign In failed, update UI appropriately\n Log.w(TAG, \"Google sign in failed\", e);\n // [START_EXCLUDE]\n updateUI(null);\n // [END_EXCLUDE]\n }\n }else {\n mCallbackManager.onActivityResult(requestCode, resultCode, data);\n }\n }",
"private void onSucessGoogleLogin(GoogleSignInResult result) {\n\n GoogleSignInAccount account = result.getSignInAccount();\n\n mUser = new UserModel();\n mUser.createUser(Objects.requireNonNull(account).getIdToken(), account.getDisplayName(), account.getEmail(), Objects.requireNonNull(account.getPhotoUrl()).toString(), account.getPhotoUrl());\n// SessionManager.getInstance().createUser(mUser);\n if (mUser.getIdToken() != null) {\n AuthCredential credential = GoogleAuthProvider.getCredential(mUser.getIdToken(), null);\n firebaseAuthWithGoogle(credential);\n }\n\n\n }",
"public interface IGoogle {\n void onInitAOuth(SignInButton signInButton, GoogleSignInOptions gso, GoogleApiClient googleApiClient);\n\n void onStartAOuth();\n\n void onActivityResult(int requestCode, int resultCode, Intent data);\n\n void onSignInAOth();\n\n void onSignOutAOth();\n\n void onRevokeAccess();\n}",
"@Override\n public void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n\n // Result returned from launching the Intent from GoogleSignInApi.getSignInIntent(...);\n if (requestCode == RC_SIGN_IN) {\n GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);\n if (result.isSuccess()) {\n // Google Sign In was successful, authenticate with Firebase\n GoogleSignInAccount account = result.getSignInAccount();\n firebaseAuthWithGoogle(account);\n } else {\n // Google Sign In failed, update UI appropriately\n // [START_EXCLUDE]\n Log.d(\"FAILED\", \"FAILED\");\n // [END_EXCLUDE]\n }\n }\n }",
"private void firebaseAuthWithGoogle(GoogleSignInAccount acct) {\n\r\n AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);\r\n mauth.signInWithCredential(credential)\r\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\r\n @Override\r\n public void onComplete(@NonNull Task<AuthResult> task) {\r\n if (task.isSuccessful()) {\r\n\r\n progressDialog.dismiss();\r\n\r\n Intent intent=new Intent(Gmailaccountactivity.this,MainActivity.class);\r\n startActivity(intent);\r\n\r\n\r\n // Sign in success, update UI with the signed-in user's information\r\n // Log.d(TAG, \"signInWithCredential:success\");\r\n // FirebaseUser user = auth.getCurrentUser();\r\n // String name=user.getDisplayName();\r\n// String email=user.getEmail();\r\n//\r\n// String photourl=user.getPhotoUrl().toString();\r\n//\r\n// HashMap<String,Object>gmailinfo=new HashMap<>();\r\n// gmailinfo.put(\"username\",name);\r\n// gmailinfo.put(\"imageurl\",photourl);\r\n//\r\n//\r\n// String uid=auth.getCurrentUser().getUid();\r\n//\r\n// rotref.child(uid).setValue(gmailinfo).addOnCompleteListener(new OnCompleteListener<Void>()\r\n// {\r\n// @Override\r\n// public void onComplete(@NonNull Task<Void> task) {\r\n//\r\n// if (task.isSuccessful())\r\n// {\r\n// progressDialog.dismiss();\r\n// Toast.makeText(Gmailaccountactivity.this, \"successfully logging\", Toast.LENGTH_SHORT).show();\r\n// Intent intent=new Intent(Gmailaccountactivity.this,MainActivity.class);\r\n// startActivity(intent);\r\n// }\r\n// else {\r\n// progressDialog.dismiss();\r\n// Toast.makeText(Gmailaccountactivity.this, \"error: \"+task.getException().toString(), Toast.LENGTH_SHORT).show();\r\n// }\r\n//\r\n// }\r\n// });\r\n\r\n\r\n // updateUI(user);\r\n } else {\r\n\r\n progressDialog.dismiss();\r\n // If sign in fails, display a message to the user.\r\n //Log.w(TAG, \"signInWithCredential:failure\", task.getException());\r\n// Snackbar.make(findViewById(R.id.main_layout), \"Authentication Failed.\", Snackbar.LENGTH_SHORT).show();\r\n// updateUI(null);\r\n }\r\n\r\n // ...\r\n }\r\n });\r\n }",
"public void getGoogleToken() {\n String googleEmail = sharedpreferences.getString(\"GoogleEmail\", \"\");\n String scopes = sharedpreferences.getString(\"GoogleScopes\", \"\");\n if (!\"\".equals(googleEmail)) {\n MyAsyncTask asyncTask = new MyAsyncTask(googleEmail, scopes, this.getBaseContext());\n asyncTask.delegate = this;\n asyncTask.execute();\n }\n }",
"private void firebaseAuthWithGoogle(GoogleSignInAccount acct) {\n\n AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);\n mFirebaseAuth.signInWithCredential(credential)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n FirebaseUser user = mFirebaseAuth.getCurrentUser();\n //Toast.makeText(SignInActivity.this, R.string.sign_in_successful, Toast.LENGTH_SHORT).show();\n hideSignInWithGoogleLoadingIndicator();\n returnToCallingActivity();\n } else {\n // If sign in fails, display a message to the user.\n Log.w(DEBUG_TAG, \"signInWithCredential:failure\", task.getException());\n Toast.makeText(SignInActivity.this, R.string.failed_to_sign_in_with_credentials, Toast.LENGTH_SHORT).show();\n //Snackbar.make(findViewById(R.id.main_layout), \"Authentication Failed.\", Snackbar.LENGTH_SHORT).show();\n }\n }\n });\n }",
"@Override\n public void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n\n //facebook login\n// mCallbackManager.onActivityResult(requestCode, resultCode, data);\n\n // Result returned from launching the Intent from GoogleSignInApi.getSignInIntent(...);\n if (requestCode == RC_SIGN_IN) {\n Task<GoogleSignInAccount> task = GoogleSignIn.getSignedInAccountFromIntent(data);\n try {\n // Google Sign In was successful, authenticate with Firebase\n GoogleSignInAccount account = task.getResult(ApiException.class);\n firebaseAuthWithGoogle(account);\n } catch (ApiException e) {\n // Google Sign In failed, update UI appropriately\n Log.w(TAG, \"Google sign in failed\", e);\n // [START_EXCLUDE]\n// updateUI(null);\n // [END_EXCLUDE]\n }\n }\n }",
"private void firebaseAuthWithGoogle(GoogleSignInAccount acct) {\n\n AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);\n if(Constants.mAuth==null){\n Constants.mAuth= FirebaseAuth.getInstance();\n Log.d(Constants.TAG,\"mAuth new Instance\");\n }\n Constants.mAuth.signInWithCredential(credential)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n // Sign in success, update UI with the signed-in user's information\n Log.d(Constants.TAG, \"signInResult:google success\");\n Constants.user=Constants.mAuth.getCurrentUser();\n SharedPreferences sharedPreferences=getSharedPreferences(Constants.LoginSharedPref.SHARED_PREF_NAME,MODE_PRIVATE);\n SharedPreferences.Editor editor=sharedPreferences.edit();\n editor.putBoolean(Constants.LoginSharedPref.PREVIOUSLY_STARTED,true);\n editor.putBoolean(Constants.LoginSharedPref.LOGGED_IN,true);\n String email=Constants.user.getEmail();\n String name=Constants.user.getDisplayName();\n Uri photoUrl=Constants.user.getPhotoUrl();\n editor.putString(Constants.LoginSharedPref.LOGIN_EMAIL,email);\n editor.putString(Constants.LoginSharedPref.LOGIN_URENAME,name);\n if(photoUrl!=null) {\n Log.d(Constants.TAG,\" Photo Url Extract: \"+photoUrl.toString());\n editor.putString(Constants.LoginSharedPref.PROFILE_URL, photoUrl.toString());\n }\n editor.putBoolean(Constants.LoginSharedPref.IS_EMAIL_VERIFIED,true);\n editor.commit();\n progressBar.setVisibility(View.GONE);\n contentHome.setVisibility(View.VISIBLE);\n Intent intent=new Intent(HomeActivity.this,MainActivity.class);\n startActivity(intent);\n finish();\n } else {\n // If sign in fails, display a message to the user.\n progressBar.setVisibility(View.GONE);\n contentHome.setVisibility(View.VISIBLE);\n Log.d(Constants.TAG, \"signInResult:google with firebase failure\", task.getException());\n Toast.makeText(HomeActivity.this, \"An error occured while signing in. Check your network connection \",\n Toast.LENGTH_SHORT).show();\n }\n\n // ...\n }\n });\n }",
"private void RegisterGoogleSignup() {\n\n\t\ttry {\n\t\t\tLocalData data = new LocalData(SplashActivity.this);\n\n\t\t\tArrayList<String> asName = new ArrayList<String>();\n\t\t\tArrayList<String> asValue = new ArrayList<String>();\n\n\t\t\tasName.add(\"email\");\n\t\t\tasName.add(\"firstname\");\n\t\t\tasName.add(\"gender\");\n\t\t\tasName.add(\"id\");\n\t\t\tasName.add(\"lastname\");\n\t\t\tasName.add(\"name\");\n\t\t\t// asName.add(\"link\");\n\n\t\t\tasName.add(\"device_type\");\n\t\t\tasName.add(\"device_id\");\n\t\t\tasName.add(\"gcm_id\");\n\t\t\tasName.add(\"timezone\");\n\n\t\t\tasValue.add(data.GetS(LocalData.EMAIL));\n\t\t\tasValue.add(data.GetS(LocalData.FIRST_NAME));\n\t\t\tasValue.add(data.GetS(LocalData.GENDER));\n\t\t\tasValue.add(data.GetS(LocalData.ID));\n\t\t\tasValue.add(data.GetS(LocalData.LAST_NAME));\n\t\t\tasValue.add(data.GetS(LocalData.NAME));\n\t\t\t// asValue.add(data.GetS(LocalData.LINK));\n\n\t\t\tasValue.add(\"A\");\n\n\t\t\tString android_id = Secure\n\t\t\t\t\t.getString(SplashActivity.this.getContentResolver(),\n\t\t\t\t\t\t\tSecure.ANDROID_ID);\n\n\t\t\tasValue.add(android_id);\n\n\t\t\tLocalData data1 = new LocalData(SplashActivity.this);\n\t\t\tasValue.add(data1.GetS(\"gcmId\"));\n\t\t\tasValue.add(Main.GetTimeZone());\n\t\t\tString sURL = StringURLs.getQuery(StringURLs.GOOGLE_LOGIN, asName,\n\t\t\t\t\tasValue);\n\n\t\t\tConnectServer connectServer = new ConnectServer();\n\t\t\tconnectServer.setMode(ConnectServer.MODE_POST);\n\t\t\tconnectServer.setContext(SplashActivity.this);\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\n\t\t\t\t\tLog.d(\"JSON DATA\", sJSON);\n\n\t\t\t\t\ttry {\n\n\t\t\t\t\t\tif (sJSON.length() != 0) {\n\t\t\t\t\t\t\tJSONObject object = new JSONObject(sJSON);\n\t\t\t\t\t\t\tJSONObject response = object\n\t\t\t\t\t\t\t\t\t.getJSONObject(JSONStrings.JSON_RESPONSE);\n\t\t\t\t\t\t\tString sResult = response\n\t\t\t\t\t\t\t\t\t.getString(JSONStrings.JSON_SUCCESS);\n\n\t\t\t\t\t\t\tif (sResult.equalsIgnoreCase(\"1\") == true) {\n\n\t\t\t\t\t\t\t\tString user_id = response.getString(\"userid\");\n\n\t\t\t\t\t\t\t\tLocalData data = new LocalData(\n\t\t\t\t\t\t\t\t\t\tSplashActivity.this);\n\t\t\t\t\t\t\t\tdata.Update(\"userid\", user_id);\n\t\t\t\t\t\t\t\tdata.Update(\"name\", response.getString(\"name\"));\n\n\t\t\t\t\t\t\t\tGetNotificationCount();\n\n\t\t\t\t\t\t\t} else if (sResult.equalsIgnoreCase(\"0\") == true) {\n\n\t\t\t\t\t\t\t\tString msgcode = jsonObject.getJSONObject(\n\t\t\t\t\t\t\t\t\t\t\"response\").getString(\"msgcode\");\n\n\t\t\t\t\t\t\t\tToast.makeText(\n\t\t\t\t\t\t\t\t\t\tSplashActivity.this,\n\t\t\t\t\t\t\t\t\t\tMain.getStringResourceByName(\n\t\t\t\t\t\t\t\t\t\t\t\tSplashActivity.this, msgcode),\n\t\t\t\t\t\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tToast.makeText(\n\t\t\t\t\t\t\t\t\tSplashActivity.this,\n\t\t\t\t\t\t\t\t\tMain.getStringResourceByName(\n\t\t\t\t\t\t\t\t\t\t\tSplashActivity.this, \"c100\"),\n\t\t\t\t\t\t\t\t\tToast.LENGTH_LONG).show();\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(\n\t\t\t\t\t\t\t\tSplashActivity.this,\n\t\t\t\t\t\t\t\tMain.getStringResourceByName(\n\t\t\t\t\t\t\t\t\t\tSplashActivity.this, \"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\tToast.makeText(SplashActivity.this,\n\t\t\t\t\tMain.getStringResourceByName(SplashActivity.this, \"c100\"),\n\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t}\n\t}",
"private void firebaseAuthWithGoogle(GoogleSignInAccount acct) {\n AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);\n mAuth.signInWithCredential(credential)\n .addOnSuccessListener(this, authResult -> {\n FirebaseUser user = mAuth.getCurrentUser();\n googleSignIn = 1;\n startActivity(new Intent(LoginActivity.this, HomeMainActivity.class));\n finish();\n })\n .addOnFailureListener(this, e -> Toast.makeText(LoginActivity.this, \"Authentication failed.\",\n Toast.LENGTH_SHORT).show());\n }",
"@Override\n protected void onActivityResult(\n int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n switch(requestCode) {\n case REQUEST_GOOGLE_PLAY_SERVICES:\n if (resultCode != RESULT_OK) {\n mOutputText.setText(\n \"This app requires Google Play Services. Please install \" +\n \"Google Play Services on your device and relaunch this app.\");\n } else {\n getResultsFromApi();\n }\n break;\n case REQUEST_ACCOUNT_PICKER:\n if (resultCode == RESULT_OK && data != null &&\n data.getExtras() != null) {\n String accountName =\n data.getStringExtra(AccountManager.KEY_ACCOUNT_NAME);\n if (accountName != null) {\n\n\n userId = accountName;\n //save User Email Id\n SharedPreferences mPrefs = getSharedPreferences(\"label\", 0);SharedPreferences.Editor mEditor = mPrefs.edit();mEditor.putString(\"UserId\", userId).apply();\n\n SharedPreferences settings =\n getPreferences(Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = settings.edit();\n editor.putString(PREF_ACCOUNT_NAME, accountName);\n editor.apply();\n mCredential.setSelectedAccountName(accountName);\n getResultsFromApi();\n }\n }\n break;\n case REQUEST_AUTHORIZATION:\n if (resultCode == RESULT_OK) {\n getResultsFromApi();\n }\n break;\n }\n }",
"@Override\r\n public void onActivityResult(\r\n int requestCode, int resultCode, Intent data) {\r\n super.onActivityResult(requestCode, resultCode, data);\r\n switch (requestCode) {\r\n case REQUEST_GOOGLE_PLAY_SERVICES:\r\n if (resultCode != RESULT_OK) {\r\n Log.i(TAG,\"This app requires Google Play Services. Please install \" +\r\n \"Google Play Services on your device and relaunch this app.\");\r\n Toast.makeText(getActivity(),\r\n \"This app requires Google Play Services. Please install \" +\r\n \"Google Play Services on your device and relaunch this app.\", Toast.LENGTH_LONG).show();\r\n } else {\r\n getResultsFromApi();\r\n }\r\n break;\r\n case REQUEST_ACCOUNT_PICKER:\r\n if (resultCode == RESULT_OK && data != null &&\r\n data.getExtras() != null) {\r\n String accountName =\r\n data.getStringExtra(AccountManager.KEY_ACCOUNT_NAME);\r\n if (accountName != null) {\r\n SharedPreferences settings =\r\n getActivity().getPreferences(Context.MODE_PRIVATE);\r\n SharedPreferences.Editor editor = settings.edit();\r\n editor.putString(PREF_ACCOUNT_NAME, accountName);\r\n editor.apply();\r\n mCredential.setSelectedAccountName(accountName);\r\n getResultsFromApi();\r\n }\r\n }\r\n break;\r\n case REQUEST_AUTHORIZATION:\r\n if (resultCode == RESULT_OK) {\r\n getResultsFromApi();\r\n }\r\n break;\r\n }\r\n }",
"@Override\n public void onClick(View view) {\n Intent intent = googleSignInClient.getSignInIntent();\n //Start activity for result\n startActivityForResult(intent, 100);\n }",
"private void attemptCreateAccountWithGoogle() {\n // Configure sign-in to request the user's ID, email address, and basic profile. ID and\n // basic profile are included in DEFAULT_SIGN_IN.\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestEmail()\n .build();\n if (mGoogleApiClient == null) {\n // Build a GoogleApiClient with access to GoogleSignIn.API and the options above.\n mGoogleApiClient = new GoogleApiClient.Builder(this)\n .enableAutoManage(this, this)\n .addApi(Auth.GOOGLE_SIGN_IN_API, gso)\n .build();\n }\n\n Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);\n startActivityForResult(signInIntent, RC_SIGN_IN);\n }",
"protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n Util.Log.i(TAG, \"onActivityResult: requestCode: %b resultCode: %b\", requestCode == RC_SIGN_IN,\n resultCode==Activity.RESULT_OK);\n if (requestCode == RC_SIGN_IN) {\n// IdpResponse response = IdpResponse.fromResultIntent(data);\n GoogleSignInResult response = Auth.GoogleSignInApi.getSignInResultFromIntent(data);\n // Successfully signed in\n if (resultCode == Activity.RESULT_OK) {\n Task<GoogleSignInAccount> task = GoogleSignIn.getSignedInAccountFromIntent(data);\n try {\n // Google Sign In was successful, authenticate with Firebase\n account = task.getResult(ApiException.class);\n AuthCredential credential = GoogleAuthProvider.getCredential(account.getIdToken()\n , null);\n mAuth.signInWithCredential(credential).addOnCompleteListener(this);\n\n } catch (ApiException e) {\n Util.Log.d(TAG, \"sign in attempt failed\");\n progressMsg.setText(getString(R.string.progress_failed_signin));\n }\n } else {\n // Sign in failed\n\n progressBar.setVisibility(View.GONE);\n if (response == null) {\n Log.d(TAG, \"null response object\");\n progressMsg.setText(getString(R.string.progress_null_response));\n return;\n }\n int gStatusCode = response.getStatus().getStatusCode();\n Log.d(TAG, String.format(\"failed sign-in in response:(%d) %s\",gStatusCode, response.toString()));\n switch (gStatusCode) {\n case CommonStatusCodes.NETWORK_ERROR:\n case CommonStatusCodes.TIMEOUT:\n progressMsg.setText(getString(R.string.progress_no_internet));\n break;\n default:\n progressMsg.setText(GoogleSignInStatusCodes\n .getStatusCodeString(gStatusCode));\n }\n }\n }\n super.onActivityResult(requestCode, resultCode, data);\n }",
"private void firebaseAuthWithGoogle(GoogleSignInAccount acct) {\n\n AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);\n mAuth.signInWithCredential(credential)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n // Sign in success, update UI with the signed-in user's information\n //Log.d(TAG, \"signInWithCredential:success\");\n FirebaseUser user = mAuth.getCurrentUser();\n mGoogleSignInClient.signOut();\n updateUI(user);\n } else {\n // If sign in fails, display a message to the user.\n //Log.w(TAG, \"signInWithCredential:failure\", task.getException());\n //Snackbar.make(findViewById(R.id.main_layout), \"Authentication Failed.\", Snackbar.LENGTH_SHORT).show();\n updateUI(null);\n }\n\n // ...\n }\n });\n }",
"public static interface GoogleAuthenticationListener {\n\n /**\n * A non recoverable error happened while attempting to acquire an OAuth token.\n * @param throwable the unrecoverable error.\n */\n void onAuthenticationError(Throwable throwable);\n\n /**\n * An OAuth token was successfully acquired.\n *\n * @param token the acquired token.\n */\n void onAuthenticationSucceeded(String token);\n\n /**\n * An attempt to re-authenticate might succeed.\n */\n void onRetryAuthentication();\n }",
"private void firebaseAuthWithGoogle(GoogleSignInAccount acct) {\n Log.d(TAG, \"firebaseAuthWithGoogle:\" + acct.getId());\n // [START_EXCLUDE silent]\n showProgressDialog();\n // [END_EXCLUDE]\n\n AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);\n mAuth.signInWithCredential(credential)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n // Sign in success, update UI with the signed-in user's information\n Log.d(TAG, \"signInWithCredential:success\");\n FirebaseUser user = mAuth.getCurrentUser();\n\n Intent intent = new Intent(SplashActivity.this, MainIntoActivity.class);\n startActivity(intent);\n finish();\n\n } else {\n // If sign in fails, display a message to the user.\n Log.w(TAG, \"signInWithCredential:failure\", task.getException());\n Toast.makeText(SplashActivity.this, \"Authentication failed.\",\n Toast.LENGTH_SHORT).show();\n Log.d(\"FAILED\", \"FAILED\");\n }\n\n // [START_EXCLUDE]\n hideProgressDialog();\n // [END_EXCLUDE]\n }\n });\n }",
"private void configureGoogleSignIn() {\n // Configure sign-in to request the user's ID, email address, and basic\n // profile. ID and basic profile are included in DEFAULT_SIGN_IN.\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestEmail()\n .build();\n\n // Build a GoogleSignInClient with the options specified by gso.\n mGoogleSignInClient = GoogleSignIn.getClient(this, gso);\n\n // Check for existing Google Sign In account, if the user is already signed in\n // the GoogleSignInAccount will be non-null.\n// GoogleSignInAccount account = GoogleSignIn.getLastSignedInAccount(this);\n\n // Set the dimensions of the sign-in button.\n// googleSignInButton = findViewById(R.id.sign_in_button);\n// googleSignInButton.setSize(SignInButton.SIZE_STANDARD);\n// googleSignInButton.setOnClickListener(this);\n\n btn_google_login = navigationView.getHeaderView(1).findViewById(R.id.btn_google_login);\n btn_google_login.setOnClickListener(this);\n }",
"@Override\n protected void onActivityResult(\n int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n switch(requestCode) {\n case REQUEST_GOOGLE_PLAY_SERVICES:\n if (resultCode != RESULT_OK) {\n Toast.makeText(getApplicationContext(), R.string.str_gplay_svcs_install, Toast.LENGTH_LONG).show();\n finish();\n } else {\n getResultsFromApi(this);\n }\n break;\n case REQUEST_ACCOUNT_PICKER:\n if (resultCode == RESULT_OK && data != null &&\n data.getExtras() != null) {\n String accountName =\n data.getStringExtra(AccountManager.KEY_ACCOUNT_NAME);\n if (accountName != null) {\n SharedPreferences settings =\n getPreferences(Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = settings.edit();\n editor.putString(PREF_ACCOUNT_NAME, accountName);\n editor.apply();\n mCredential.setSelectedAccountName(accountName);\n getResultsFromApi(this);\n }\n }\n break;\n case REQUEST_AUTHORIZATION:\n if (resultCode == RESULT_OK) {\n getResultsFromApi(this);\n }\n break;\n }\n }",
"private void firebaseAuthWithGoogle(GoogleSignInAccount acct) {\n Log.d(TAG, \"firebaseAuthWithGoogle:\" + acct.getId());\n // [START_EXCLUDE silent]\n// showProgressDialog();\n // [END_EXCLUDE]\n\n AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);\n mAuth.signInWithCredential(credential)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n // Sign in success, update UI with the signed-in user's information\n Log.d(TAG, \"signInWithCredential:success\");\n FirebaseUser user = mAuth.getCurrentUser();\n Toast.makeText(current,\"Sign \"+user.getEmail(),Toast.LENGTH_LONG).show();\n\n updateUI(user);\n updateCurrentUser(user);\n } else {\n // If sign in fails, display a message to the user.\n Log.w(TAG, \"signInWithCredential:failure\", task.getException());\n Toast.makeText(current,\"Failed\"+task.getException().toString(),Toast.LENGTH_LONG).show();\n updateUI(null);\n }\n\n // [START_EXCLUDE]\n// hideProgressDialog();\n // [END_EXCLUDE]\n }\n });\n }",
"@Override\n public void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n if(requestCode == 1) {\n if(resultCode == MAIN_ACTIVITY_LOGOUT) {\n setEnabledAuthProvider(AuthProviderType.FACEBOOK);\n setEnabledAuthProvider(AuthProviderType.GOOGLE);\n showFirebaseLoginPrompt();\n }\n }\n }",
"private void startGoogleGamesSignIn () {\n\t\tfinal GPPSignIn s = GPPSignIn.sharedInstance();\n\t\tGPGManager m = GPGManager.sharedInstance();\n\n\t\tgamesAuthBlock = new GPGReAuthenticationBlock() {\n\t\t\t@Override\n\t\t\tpublic void invoke (boolean requiresKeychainWipe, NSError error) {\n\t\t\t\t// If you hit this, auth has failed and you need to authenticate.\n\t\t\t\t// Most likely you can refresh behind the scenes\n\t\t\t\tif (requiresKeychainWipe) {\n\t\t\t\t\ts.signOut();\n\t\t\t\t}\n\t\t\t\ts.authenticate();\n\t\t\t}\n\t\t};\n\n\t\t// pass the GPPSignIn to the GPGManager.\n\t\tm.signIn(s, gamesAuthBlock);\n\t}",
"private void FirebaseGoogleAuth(GoogleSignInAccount acct) {\n if (acct != null) {\n AuthCredential authCredential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);\n mAuth.signInWithCredential(authCredential).addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n Toast.makeText(MainActivity.this, \"Successful\", Toast.LENGTH_SHORT).show();\n FirebaseUser user = mAuth.getCurrentUser();\n\n updateUI(user);\n\n } else {\n Toast.makeText(MainActivity.this, \"Failed\", Toast.LENGTH_SHORT).show();\n updateUI(null);\n }\n }\n });\n }\n else{\n Toast.makeText(MainActivity.this, \"acc failed\", Toast.LENGTH_SHORT).show();\n }\n }",
"private void firebaseAuthWithGoogle(String idToken) {\n AuthCredential credential = GoogleAuthProvider.getCredential(idToken, null);\n mAuth.signInWithCredential(credential)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n // Sign in success, update UI with the signed-in user's information\n FirebaseUser user = mAuth.getCurrentUser();\n assert user != null;\n Toast.makeText(SignUpActivity.this, \"Signed in as: \" + user.getDisplayName(), Toast.LENGTH_SHORT).show();\n progressDialog.dismiss();\n UpdateUI();\n }\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n e.printStackTrace();\n Toast.makeText(SignUpActivity.this, e.getMessage(), Toast.LENGTH_SHORT).show();\n }\n });\n }",
"private void configureGoogleSignIn() {\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestIdToken(getString(R.string.default_web_client_id))\n .requestEmail()\n .build();\n\n googleApiClient = new GoogleApiClient.Builder(getApplicationContext()).enableAutoManage(this, new GoogleApiClient.OnConnectionFailedListener() {\n @Override\n public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {\n Toast.makeText(LoginActivity.this, \"Error\", Toast.LENGTH_LONG).show();\n }\n }).addApi(Auth.GOOGLE_SIGN_IN_API, gso).build();\n }",
"private void signIn()\n {\n Intent intent = Auth.GoogleSignInApi.getSignInIntent(googleApiClient);\n // If user was already signed in earlier, log them out first\n if(signOutCode != 0)\n {\n signOut();\n }\n\n // Runtime permission for locations and network\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 ActivityCompat.requestPermissions(MainActivity.this, new String[]{\n android.Manifest.permission.INTERNET,\n android.Manifest.permission.ACCESS_COARSE_LOCATION,\n android.Manifest.permission.ACCESS_FINE_LOCATION,\n android.Manifest.permission.ACCESS_NETWORK_STATE,\n android.Manifest.permission.SYSTEM_ALERT_WINDOW,\n android.Manifest.permission.WRITE_EXTERNAL_STORAGE\n\n }, PERMISSION);\n }\n startActivityForResult(intent, IntentConstants.INTENT_GOOGLE_REQUEST_CODE);\n\n }",
"private void handleSignInResult(GoogleSignInResult result) {\n Log.v(\"SIGNIN STATUS\", \"SIGNIN RESULT: \" + result.getStatus().getStatusMessage());\n Log.v(\"SIGNIN STATUS\", \"SIGNIN CODE: \" + result.getStatus().getStatusCode());\n if (result.isSuccess()) {\n // Signed in successfully\n GoogleSignInAccount acct = result.getSignInAccount();\n IlliniBusApplication myApplication = (IlliniBusApplication) getApplication();\n myApplication.signIn(acct);\n Intent intent = new Intent(StartActivity.this, MainActivity.class);\n startActivity(intent);\n } else {\n Toast.makeText(getApplicationContext(), \"Failed to Login!\",\n Toast.LENGTH_LONG).show();\n }\n }",
"private void configureGoogleClient() {\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n // for the requestIdToken, this is in the values.xml file that\n // is generated from your google-services.json\n .requestIdToken(getString(R.string.default_web_client_id))\n .requestEmail()\n .build();\n // Build a GoogleSignInClient with the options specified by gso.\n googleSignInClient = GoogleSignIn.getClient(this, gso);\n // Initialize Firebase Auth\n firebaseAuth = FirebaseAuth.getInstance();\n }",
"@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tgetAccessTokenFromGoogle(code);\n\t\t\t\t\t}",
"private void setupGoogleSignin() {\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestIdToken(getString(R.string.default_web_client_id))\n .requestEmail()\n .build();\n\n // Build a GoogleApiClient with access to the Google Sign-In API and the\n // options specified by gso.\n mGoogleApiClient = new GoogleApiClient.Builder(this)\n .enableAutoManage(this /* FragmentActivity */, this /* OnConnectionFailedListener */)\n .addApi(Auth.GOOGLE_SIGN_IN_API, gso)\n .build();\n }",
"@Override\n public void onActivityResult(int requestCode, int resultCode, Intent data) {\n Log.d(LGN, \"Resultado de Solicitud\");\n super.onActivityResult(requestCode, resultCode, data);\n try {\n Log.d(LGN, \"onActivityResult: \" + requestCode);\n if (requestCode == GOOGLE_SIGNIN_REQUEST) {\n Log.d(LGN, \"Respuesta de Google\");\n GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);\n Log.d(LGN, result.getStatus() + \"\");\n Log.d(LGN, resultCode + \"\");\n Log.d(LGN, data + \"\");\n if (result.isSuccess()) {\n Log.d(LGN, \"Respuesta Buena\");\n GoogleSignInAccount user = result.getSignInAccount();\n AuthCredential credential = GoogleAuthProvider.getCredential(user.getIdToken(), null);\n mAuth.signInWithCredential(credential)\n .addOnCompleteListener(new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n Log.d(LGN, \"Login con Google correcta: \" + task.isSuccessful());\n if (task.isSuccessful()) {\n isNew = task.getResult().getAdditionalUserInfo().isNewUser();\n Log.d(LGN, \"Antiguedad: \" + (isNew ? \"Nuevo\" : \"Antiguo\"));\n if (isNew) {\n Log.d(LGN, \"Es nuevo\");\n FirebaseUser currentUser = FirebaseAuth.getInstance().getCurrentUser();\n uid = currentUser.getUid();\n\n for (UserInfo profile : currentUser.getProviderData()) {\n correo = profile.getEmail();\n }\n\n Usuario usuario = new Usuario();\n usuario.setNombre(currentUser.getDisplayName());\n usuario.setCorreo(correo);\n usuario.setExp(0);\n usuario.setMonedas(0);\n usuario.setAvatar(currentUser.getPhotoUrl() != null ? currentUser.getPhotoUrl().toString() : null);\n\n DatabaseReference usuarioData = FirebaseDatabase.getInstance().getReference(\"usuario\");\n usuarioData.child(currentUser.getUid()).setValue(usuario)\n .addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n if (task.isSuccessful()) {\n createColecciones(uid);\n Log.d(LGN, \"Usuario con Google Creado\");\n Toast.makeText(LoginActivity.this, \"Usuario Creado\", Toast.LENGTH_SHORT).show();\n } else {\n Log.d(LGN, \"Error en la creacion\");\n Log.e(LGN, \"onFailure\", task.getException());\n }\n }\n });\n\n /* Intent home = new Intent(LoginActivity.this, AvatarActivity.class);\n startActivity(home);\n finish();*/\n\n } else {\n Log.d(LGN, \"Es antiguo\");\n }\n } else {\n loginPanel.setVisibility(View.VISIBLE);\n progressBar.setVisibility(View.GONE);\n Log.e(LGN, \"Login con Google incorrecta:\", task.getException());\n Toast.makeText(LoginActivity.this, \"Autenticacion Fallida.\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n } else {\n loginPanel.setVisibility(View.VISIBLE);\n progressBar.setVisibility(View.GONE);\n Log.e(LGN, \"Sesion con Google Errada!\");\n }\n } else if (FACEBOOK_SIGNIN_REQUEST == requestCode) {\n Log.d(LGN, \"Respuesta de Facebook\");\n mCallbackManager.onActivityResult(requestCode, resultCode, data);\n }\n } catch (Throwable t) {\n try {\n loginPanel.setVisibility(View.VISIBLE);\n progressBar.setVisibility(View.GONE);\n Log.e(TAG, \"onThrowable: \" + t.getMessage(), t);\n if (getApplication() != null)\n Toast.makeText(getApplication(), t.getMessage(), Toast.LENGTH_LONG).show();\n } catch (Throwable x) {\n }\n }\n }",
"@Test\n public void getGoogleAuthUrlTest() throws ApiException {\n InlineResponse2002 response = api.getGoogleAuthUrl();\n\n // TODO: test validations\n }",
"public void UserSignInMethod(){\n // Passing Google Api Client into Intent.\n Intent AuthIntent = Auth.GoogleSignInApi.getSignInIntent(googleApiClient);\n startActivityForResult(AuthIntent, REQUEST_SIGN_IN_CODE);\n }",
"private void firebaseAuthWithGoogle(GoogleSignInAccount acct) {\n\n AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);\n fbAuth.signInWithCredential(credential)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n // Sign in success, update UI with the signed-in user's information\n //Log.d(TAG, \"signInWithCredential:success\");\n FirebaseUser user = fbAuth.getCurrentUser();\n UserModel userModel=new UserModel();\n userModel.setEmail(user.getEmail());\n userModel.setDisplayName(user.getDisplayName());\n userModel.setPhotoUrl(user.getPhotoUrl().toString());\n userModel.setUid(user.getUid());\n UserFBDB userFBDB = new UserFBDB();\n userFBDB.save(userModel);\n updateUI(user);\n } else {\n // If sign in fails, display a message to the user.\n //Log.w(TAG, \"signInWithCredential:failure\", task.getException());\n Exception ex=task.getException();\n signupWithGoogleBtn.setVisibility(View.VISIBLE);\n mProgress.setVisibility(View.INVISIBLE);\n Toast.makeText(SignupActivity.this, \"Authentication failed.\",\n Toast.LENGTH_SHORT).show();\n //updateUI(null);\n }\n\n // ...\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Log.d(\"singn\", e.getMessage());\n }\n });\n }",
"private void googleSignInResult(GoogleSignInResult result) {\n if (result.isSuccess()) {\n // add to shared preferences\n GoogleSignInAccount account = result.getSignInAccount();\n userName = account.getDisplayName();\n userEmail = account.getEmail();\n userGoogleId = account.getId();\n userPhotoUrl = account.getPhotoUrl();\n\n editor.putString(getString(R.string.shared_prefs_key_username), userName);\n editor.putString(getString(R.string.shared_prefs_key_email), userEmail);\n editor.putString(getString(R.string.shared_prefs_key_google_id), userGoogleId);\n editor.putString(getString(R.string.shared_prefs_key_user_photo_url), userPhotoUrl.toString());\n\n editor.apply();\n\n // add to firebase users\n member = new Member();\n member.setUsername(userName);\n member.setEmail(userEmail);\n member.setId(userGoogleId);\n member.setPhotoUrl(userPhotoUrl.toString());\n member.setLoginType(getString(R.string.login_type_google));\n\n rref.orderByChild(getString(R.string.firebase_key_email)).equalTo(member.getEmail()).addListenerForSingleValueEvent(\n new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot dataSnapshot) {\n String key;\n if (dataSnapshot.exists()) {\n key = dataSnapshot.getChildren().iterator().next().getKey();\n firebaseKey = key;\n getUserDetailsFromFirebase();\n } else {\n // new user\n key = rref.push().getKey();\n }\n editor.putString(getString(R.string.shared_prefs_key_firebasekey), key);\n editor.apply();\n\n Map<String, Object> userUpdates = new HashMap<>();\n\n userUpdates.put(key + \"/\" + getString(R.string.firebase_key_username), userName);\n userUpdates.put(key + \"/\" + getString(R.string.firebase_key_google_id), userGoogleId);\n userUpdates.put(key + \"/\" + getString(R.string.firebase_key_photo_url), userPhotoUrl.toString());\n userUpdates.put(key + \"/\" + getString(R.string.firebase_key_login_type), getString(R.string.login_type_google));\n userUpdates.put(key + \"/\" + getString(R.string.firebase_key_email), userEmail);\n\n rref.updateChildren(userUpdates);\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError databaseError) {\n }\n }\n );\n\n } else {\n gotoMainActivity();\n }\n }",
"GoogleAuthenticatorKey createCredentials();",
"boolean authorize(\n String secret,\n int verificationCode,\n int window)\n throws GoogleAuthenticatorException;",
"private void signInResultHandler(GoogleSignInResult result) {\n if (result.isSuccess()) {\n acct = result.getSignInAccount();\n m_tvStatus.setText(R.string.status_signedin);\n try {\n m_tvDispName.setText(acct.getDisplayName());\n m_tvEmail.setText(acct.getEmail());\n }\n catch (NullPointerException e) {\n Log.d(TAG, \"Error retrieving some account information\");\n Toast.makeText(MainActivity.this, \"Oops! Please double check your account info.\", Toast.LENGTH_SHORT).show();\n }\n\n checkAGWALoginStatus(acct);\n Account_Email = acct.getEmail();\n\n }\n else {\n Status status = result.getStatus();\n int statusCode = status.getStatusCode();\n\n // Constant Value: 12501 (API)\n if (statusCode == GoogleSignInStatusCodes.SIGN_IN_CANCELLED) {\n m_tvStatus.setText(R.string.status_signincancelled);\n }\n\n // Constant Value: 12500 (API)\n else if (statusCode == GoogleSignInStatusCodes.SIGN_IN_FAILED) {\n m_tvStatus.setText(R.string.status_signinfail);\n }\n else {\n m_tvStatus.setText(R.string.status_nullresult);\n }\n }\n }",
"private void showGoogleAccountPicker() {\n Intent googlePicker = AccountPicker.newChooseAccountIntent(null, null,\n new String[]{GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE}, true, null, null, null, null);\n startActivityForResult(googlePicker, PICK_ACCOUNT_REQUEST);\n }",
"private void firebaseAuthWithGoogle(GoogleSignInAccount acct) {\n AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);\n mAuth.signInWithCredential(credential)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n //inicio de sesion exitoso\n //Recuperacion de los datos del usuario logueado\n FirebaseUser user = mAuth.getCurrentUser();\n //llamado a la vista inicial de usuario autenticado\n startActivity(new Intent(Login.this,Principal.class));\n finish();\n\n } else {\n // Fallo el inicio de sesion con firebase.\n Toast.makeText(Login.this, R.string.errorInicioSesion,\n Toast.LENGTH_SHORT).show();\n\n }\n\n }\n });\n }",
"private void firebaseAuthWithGoogle(GoogleSignInAccount acct) {\n Log.d(TAG, \"firebaseAuthWithGoogle:\" + acct.getId());\n\n AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);\n mAuth.signInWithCredential(credential)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n // Sign in success, update UI with the signed-in user's information\n Log.d(TAG, \"signInWithCredential:success\");\n FirebaseUser user = mAuth.getCurrentUser();\n updateUI(user);\n showHideProgressDialog(false);\n onAuthSuccess(mAuth.getCurrentUser());\n } else {\n // If sign in fails, display a message to the user.\n Log.w(TAG, \"signInWithCredential:failure\", task.getException());\n Toast.makeText(Login.this, \"Authentication failed.\",\n Toast.LENGTH_SHORT).show();\n showHideProgressDialog(false);\n updateUI(null);\n }\n }\n });\n }",
"private void acquireGooglePlayServices() {\n GoogleApiAvailability apiAvailability =\n GoogleApiAvailability.getInstance();\n final int connectionStatusCode =\n apiAvailability.isGooglePlayServicesAvailable(mActivity);\n if (apiAvailability.isUserResolvableError(connectionStatusCode)) {\n Log.d(Util.TAG_GOOGLE, \"\" + connectionStatusCode);\n // showGooglePlayServicesAvailabilityErrorDialog(connectionStatusCode);\n }\n }",
"@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == RC_SIGN_IN) {\n // The Task returned from this call is always completed, no need to attach\n // a listener.\n Task<GoogleSignInAccount> task = GoogleSignIn.getSignedInAccountFromIntent(data);\n handleSignInResult(task);\n } else {\n callbackManager.onActivityResult(requestCode, resultCode, data);\n }\n\n super.onActivityResult(requestCode, resultCode, data);\n }",
"private void signIn(){\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestIdToken(getString(R.string.default_web_client_id))\n .requestEmail()\n .build();\n\n GoogleSignInClient mGoogleSignInClient = GoogleSignIn.getClient(this, gso);\n Intent signInIntent = mGoogleSignInClient.getSignInIntent();\n startActivityForResult(signInIntent, Constants.RC_SIGN_IN);\n\n }",
"public GoogleAuthenticatorAccount() {\n }",
"public void getResponseGoogle(String googleToken, final AsyncHandler<lrAccessToken> handler)\n\t {\n\t\t \tMap<String, String> params = new HashMap<String, String>();\n\t\t \tparams.put(\"key\",AKey);\n\t\t \tparams.put(\"google_access_token\",googleToken);\n\t\t \tproviderHandler(Endpoint.API_V2_ACCESS_TOKEN_GOOGLE, params, handler);\n\t }",
"public interface IGoogleServices {\n void signIn();\n void signOut();\n void changeUser();\n boolean isConnected();\n boolean isConnecting();\n}",
"private void acquireGooglePlayServices() {\r\n GoogleApiAvailability apiAvailability = GoogleApiAvailability.getInstance();\r\n final int connectionStatusCode = apiAvailability.isGooglePlayServicesAvailable(getActivity());\r\n if (apiAvailability.isUserResolvableError(connectionStatusCode)) {\r\n showGooglePlayServicesAvailabilityErrorDialog(connectionStatusCode);\r\n }\r\n }",
"private void initGoogleClient() {\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestIdToken(getString(R.string.default_web_client_id))\n .requestEmail()\n .build();\n\n mGoogleSignInClient = GoogleSignIn.getClient(this, gso);\n\n // [START initialize_auth]\n // Initialize Firebase Auth\n // [END initialize_auth]\n }",
"@Override\n public void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode,resultCode,data);\n\n if (requestCode == RES_CODE_SIGN_IN) {\n GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);\n signInResultHandler(result);\n }\n }",
"@Override\n\tprotected void onActivityResult(int requestCode, int resultCode, Intent data) {\n\t\tswitch (requestCode) {\n\t\tcase 0:\n\t\t\tif (resultCode != Activity.RESULT_OK || data == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfinal String code = data.getStringExtra(FIELD_NAME_CODE);\n\t\t\tfinal String state = data.getStringExtra(FIELD_NAME_STATE);\n\t\t\tif (code != null) {\n\t\t\t\tThread th = new Thread(new Runnable() {\n\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\tgetAccessTokenFromGoogle(code);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t});\n\t\t\t\tth.start();\n\t\t\t} else {\n\t\t\t\tToast.makeText(this, \"�ڵ� ȹ�� ����\", Toast.LENGTH_SHORT).show();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tsuper.onActivityResult(requestCode, resultCode, data);\n\t}",
"private void acquireGooglePlayServices() {\n GoogleApiAvailability apiAvailability =\n GoogleApiAvailability.getInstance();\n final int connectionStatusCode =\n apiAvailability.isGooglePlayServicesAvailable(getActivity());\n if (apiAvailability.isUserResolvableError(connectionStatusCode)) {\n showGooglePlayServicesAvailabilityErrorDialog(connectionStatusCode);\n }\n }",
"private void initFBGoogleSignIn() {\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestIdToken(WEB_CLIENT_ID)\n .requestEmail()\n .build();\n\n Context context = getContext();\n mGoogleApiClient = new GoogleApiClient.Builder(context)\n .enableAutoManage(getActivity(), new GoogleApiClient.OnConnectionFailedListener() {\n @Override\n public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {\n mGoogleSignInTextView.setText(connectionResult.getErrorMessage());\n }\n }).addApi(Auth.GOOGLE_SIGN_IN_API, gso).build();\n }",
"boolean authorize(String secret, int verificationCode)\n throws GoogleAuthenticatorException;",
"private void setGoogleLoginSetting() {\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestIdToken(getString(R.string.default_web_client_id))\n .requestEmail()\n .build();\n\n mAuth = FirebaseAuth.getInstance();\n googleSignInClient = GoogleSignIn.getClient(this, gso);\n\n googleApiClient = new GoogleApiClient.Builder(this)\n .enableAutoManage(this, new GoogleApiClient.OnConnectionFailedListener() {\n @Override\n public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {\n Log.d(Constant.TAG, \"Login fail\");\n }\n })\n .addApi(Auth.GOOGLE_SIGN_IN_API, gso)\n .build();\n\n // auto login\n GoogleSignInAccount account = GoogleSignIn.getLastSignedInAccount(this);\n if(account!=null)\n firebaseAuthWithGoogle(account);\n }",
"boolean getIsGoogleCn();",
"@Override\n public void onLoginGoogle(Activity activity, final ILoginModelListener modelListener) {\n if (NetworkUtils.isNetworkAvailable(activity)){\n GoogleSignInClient mGoogleSignInClient;\n GoogleApiClient googleApiClient;\n GoogleSignInOptions googleSignInOptions= GoogleSignInOptionUtils.getGoogleSignInOptions(activity);\n\n mGoogleSignInClient = GoogleSignIn.getClient(activity,googleSignInOptions);\n\n googleApiClient = new GoogleApiClient.Builder(activity)\n .enableAutoManage((FragmentActivity) activity, new GoogleApiClient.OnConnectionFailedListener() {\n @Override\n public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {\n modelListener.onLoginFailed(\"No Internet\");\n }\n\n })\n\n .build();\n Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(googleApiClient);\n activity.startActivityForResult(signInIntent, LoginActivity.REQUEST_CODE_GOOGLE);\n\n } else {\n modelListener.onLoginFailed(\"No Internet! Please check your connect\");\n }\n }",
"private void signIn() {\n mGoogleSignInClient = buildGoogleSignInClient();\n startActivityForResult(mGoogleSignInClient.getSignInIntent(), REQUEST_CODE_SIGN_IN);\n }",
"@Override\n\t\t\t\t\tpublic boolean loginWithGoogle(String userName, String password) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}",
"private void signIn() {\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestEmail()\n .build();\n\n // Build a GoogleSignInClient with the options specified by gso.\n GoogleSignInClient mGoogleSignInClient = GoogleSignIn.getClient(getActivity(), gso);\n\n // Starting the intent prompts the user to select a Google account to sign in with\n Intent signInIntent = mGoogleSignInClient.getSignInIntent();\n startActivityForResult(signInIntent, RC_SIGN_IN);\n }",
"private void handleResult(GoogleSignInResult result)\n {\n // If login success\n if(result.isSuccess())\n {\n // Obtain user properties from sign in\n GoogleSignInAccount account = result.getSignInAccount();\n String name = account.getDisplayName();\n String email = account.getEmail();\n String imageUrl = account.getPhotoUrl().toString();\n\n // Pass the values to the landing page\n Intent intent = new Intent(MainActivity.this, LandingPageActivity.class);\n intent.putExtra(IntentConstants.INTENT_SIGNIN_NAME, name);\n intent.putExtra(IntentConstants.INTENT_SIGNIN_EMAIL, email);\n intent.putExtra(IntentConstants.INTENT_SIGNIN_PHOTO, imageUrl);\n intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n startActivity(intent);\n finish();\n }\n else\n {\n Toast.makeText(getApplicationContext(), \"Unable to sign in. Try again\", Toast.LENGTH_SHORT).show();\n }\n\n }",
"@Override\r\n public void onComplete(@NonNull Task<AuthResult> task) {\n if(!task.isSuccessful())\r\n {\r\n Toast.makeText(MainActivity.this,\"Some Error Occured,Please try again later\",Toast.LENGTH_LONG).show();\r\n }\r\n if(task.isSuccessful())\r\n {\r\n Toast.makeText(MainActivity.this,\"Regristration Successful\",Toast.LENGTH_LONG).show();\r\n }\r\n }",
"private void acquireGooglePlayServices() {\n GoogleApiAvailability apiAvailability =\n GoogleApiAvailability.getInstance();\n final int connectionStatusCode =\n apiAvailability.isGooglePlayServicesAvailable(this);\n if (apiAvailability.isUserResolvableError(connectionStatusCode)) {\n showGooglePlayServicesAvailabilityErrorDialog(connectionStatusCode);\n }\n }",
"private void acquireGooglePlayServices() {\n GoogleApiAvailability apiAvailability =\n GoogleApiAvailability.getInstance();\n final int connectionStatusCode =\n apiAvailability.isGooglePlayServicesAvailable(this);\n if (apiAvailability.isUserResolvableError(connectionStatusCode)) {\n showGooglePlayServicesAvailabilityErrorDialog(connectionStatusCode);\n }\n }",
"private void acquireGooglePlayServices() {\n GoogleApiAvailability apiAvailability =\n GoogleApiAvailability.getInstance();\n final int connectionStatusCode =\n apiAvailability.isGooglePlayServicesAvailable(this);\n if (apiAvailability.isUserResolvableError(connectionStatusCode)) {\n showGooglePlayServicesAvailabilityErrorDialog(connectionStatusCode);\n }\n }",
"boolean hasIsGoogleCn();",
"@Override\n public void onAuthenticationError(FirebaseError firebaseError) {\n Log.d(TAG, \"Firebase authentication error with Google: \" + firebaseError);\n mFirebaseAuthCallback.onReceivedFirebaseAuth(null, firebaseError);\n }",
"@Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (!task.isSuccessful()) {\n Toast.makeText(MainActivity.this, \"Authentication failed.\",\n Toast.LENGTH_SHORT).show();\n }\n }",
"public interface ResponseListener {\n void onResponce(GoogleResponse response);\n}",
"@Override\n public void onAuthenticated(AuthData authData) {\n Log.d(TAG, \"Google user authenticated: \" + authData.getUid());\n mFirebaseAuthCallback.onReceivedFirebaseAuth(authData, null);\n }",
"boolean authorizeUser(String userName, int verificationCode)\n throws GoogleAuthenticatorException;",
"private void signIn() {\n Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);\n startActivityForResult(signInIntent, SIGN_IN_CODE);\n }",
"private void signIn() {\n Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);\n startActivityForResult(signInIntent, RC_SIGN_IN);\n }",
"private void signIn() {\n Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);\n startActivityForResult(signInIntent, RC_SIGN_IN);\n }",
"private void signIn() {\n Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);\n startActivityForResult(signInIntent, RC_SIGN_IN);\n }",
"private void signIn() {\n Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);\n startActivityForResult(signInIntent, RC_SIGN_IN);\n }",
"public void getResultsFromApi() {\n if (! isGooglePlayServicesAvailable()) {\n acquireGooglePlayServices();\n } else if (mCredential.getSelectedAccountName() == null) {\n mFragment.chooseAccount();\n } else if (! isDeviceOnline()) {\n // mOutputText.setText(\"No network connection available.\");\n } else if (mService == null){\n Log.d(Util.TAG_GOOGLE, mCredential.getSelectedAccountName());\n HttpTransport transport = AndroidHttp.newCompatibleTransport();\n JsonFactory jsonFactory = JacksonFactory.getDefaultInstance();\n mService = new com.google.api.services.gmail.Gmail.Builder(\n transport, jsonFactory, mCredential)\n .setApplicationName(\"Gmail API Android Quickstart\")\n .build();\n mFragment.readEmails();\n }\n }",
"@Override\n public void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n\n // Result returned from launching the Intent from GoogleSignInClient.getSignInIntent(...);\n if (requestCode == RC_SIGN_IN) {\n // The Task returned from this call is always completed, no need to attach\n // a listener.\n Task<GoogleSignInAccount> task = GoogleSignIn.getSignedInAccountFromIntent(data);\n handleSignInResult(task);\n\n }\n }",
"@SuppressWarnings(\"UnusedDeclaration\")\n boolean authorizeUser(\n String userName,\n int verificationCode,\n int window)\n throws GoogleAuthenticatorException;",
"@Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n\n if (!task.isSuccessful()) {\n //Log.d(\"Memorization Game\", \"Problem signing in: \" + task.getException());\n showErrorDialog(\"There was a problem signing in\");\n } else {\n //SharedPreferences mpreference = getSharedPreferences(\"user_email\", Context.MODE_PRIVATE);\n //mpreference.edit().putString(\"email\",email).apply();\n Intent intent = new Intent(Activity_login.this, Home.class);\n finish();\n startActivity(intent);\n }\n\n }",
"private void googleSignOut() {\n googleSignInClient.signOut();\n }",
"private void handleSignInResult(GoogleSignInResult result) {\n if (result.isSuccess()) {\n // Signed in successfully, show authenticated UI.\n GoogleSignInAccount acct = result.getSignInAccount();\n test = (TextView) findViewById(R.id.tvTest);\n //ImageView prof = (ImageView) findViewById(R.id.iv_profile_icon);\n String personName = acct.getDisplayName();\n String personEmail = acct.getEmail();\n String personId = acct.getId();\n Uri personPhoto = acct.getPhotoUrl();\n\n test.setText(\"Logged in as: \" + personName);\n\n currentUser = new User(personName);\n if(currentUser == null) {\n Snackbar snackbar = Snackbar.make(\n coordinatorLayout, \"Logged in as \"+personName+\", but User class is NULL\",\n Snackbar.LENGTH_LONG);\n snackbar.show();\n }else{\n Snackbar snackbar = Snackbar.make(\n coordinatorLayout, \"Logged in as \"+personName+\". Welcome!\",\n Snackbar.LENGTH_LONG);\n snackbar.show();\n if (service != null) {\n service.setUserID(currentUser.getName());\n }\n }\n\n //mStatusTextView.setText(getString(R.string.signed_in_fmt, acct.getDisplayName()));\n //updateUI(true);\n } else {\n test = (TextView) findViewById(R.id.tvTest);\n test.setText(\"Please login with Google Login\");\n }\n }",
"private void signIn() {\n Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);\n startActivityForResult(signInIntent, RC_SIGN_IN);\n finish();\n }",
"private void processSignInResult(GoogleSignInResult result) {\n if (result.isSuccess()) {\n GoogleSignInAccount signInAccount = result.getSignInAccount();\n String name = signInAccount.getDisplayName();\n String email = signInAccount.getEmail();\n String imgURL = signInAccount.getPhotoUrl().toString();\n\n listActivityIntent.putExtra(GOOGLE_ACCOUNT_NAME, name);\n listActivityIntent.putExtra(GOOGLE_ACCOUNT_EMAIL,email );\n listActivityIntent.putExtra(GOOGLE_ACCOUNT_IMGURL,imgURL );\n login(true);\n } else {\n login(false);\n }\n }",
"private void signIn() {\n Intent signInIntent = mGoogleSignInClient.getSignInIntent();\n startActivityForResult(signInIntent, RC_SIGN_IN);\n }",
"private void signIn() {\n Intent signInIntent = mGoogleSignInClient.getSignInIntent();\n startActivityForResult(signInIntent, RC_SIGN_IN);\n }",
"private void signIn() {\n Intent signInIntent = mGoogleSignInClient.getSignInIntent();\n startActivityForResult(signInIntent, RC_SIGN_IN);\n }",
"private static void logoutGoogle(Context context) {\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestEmail()\n .build();\n\n // Build a GoogleSignInClient with the options specified by gso.\n GoogleSignInClient mGoogleSignInClient = GoogleSignIn.getClient(context, gso);\n\n mGoogleSignInClient.signOut();\n ((AppCompatActivity) context).finish();\n context.startActivity(new Intent(context, Login.class));\n }"
] | [
"0.7153405",
"0.6980162",
"0.69776356",
"0.69698954",
"0.69519305",
"0.69465184",
"0.692313",
"0.6757498",
"0.6751792",
"0.670028",
"0.6586455",
"0.6555029",
"0.6529486",
"0.6503771",
"0.65020305",
"0.6407122",
"0.6401328",
"0.6375363",
"0.63712573",
"0.6369708",
"0.63486856",
"0.6339536",
"0.6299502",
"0.62898993",
"0.6285186",
"0.6253877",
"0.6248413",
"0.62420034",
"0.6217397",
"0.6208798",
"0.6180382",
"0.6167743",
"0.6141884",
"0.614042",
"0.61260813",
"0.6110276",
"0.6102178",
"0.60866755",
"0.6082162",
"0.60816973",
"0.60697204",
"0.6047384",
"0.60127085",
"0.5994057",
"0.5991465",
"0.5989907",
"0.5962646",
"0.5956459",
"0.5949666",
"0.59406555",
"0.5934994",
"0.5922237",
"0.5919702",
"0.5917641",
"0.5914079",
"0.5911715",
"0.59085476",
"0.59052676",
"0.58950347",
"0.58939946",
"0.5889793",
"0.5875891",
"0.587224",
"0.58348787",
"0.5812991",
"0.58098114",
"0.58090085",
"0.5806166",
"0.5803547",
"0.5794796",
"0.57941675",
"0.57856476",
"0.5783306",
"0.57475615",
"0.57419187",
"0.57419187",
"0.57419187",
"0.57394236",
"0.57149106",
"0.57118356",
"0.5710224",
"0.57101727",
"0.5701246",
"0.5699413",
"0.5693382",
"0.5693382",
"0.5693382",
"0.5693382",
"0.56824267",
"0.5670827",
"0.5661807",
"0.5658265",
"0.5655165",
"0.5653928",
"0.56520915",
"0.5632928",
"0.5630931",
"0.5630931",
"0.5630931",
"0.56208485"
] | 0.59648037 | 46 |
[END auth_with_google] [START signin] | private void signIn() {
Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);
startActivityForResult(signInIntent, RC_SIGN_IN);
finish();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void signInWithGoogle() {\n Intent signInIntent = mGoogleSignInClient.getSignInIntent();\n startActivityForResult(signInIntent, ConstantValue.GOOGLE_SIGN_IN);\n }",
"private void signInWithGoogle() {\n Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);\n startActivityForResult(signInIntent, RC_SIGN_IN);\n }",
"private void googleSignIn() {\n\n Intent signInIntent = mGoogleSignInClient.getSignInIntent();\n startActivityForResult(signInIntent, RC_SIGN_IN);\n }",
"private void signIn() {\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestEmail()\n .build();\n\n // Build a GoogleSignInClient with the options specified by gso.\n GoogleSignInClient mGoogleSignInClient = GoogleSignIn.getClient(getActivity(), gso);\n\n // Starting the intent prompts the user to select a Google account to sign in with\n Intent signInIntent = mGoogleSignInClient.getSignInIntent();\n startActivityForResult(signInIntent, RC_SIGN_IN);\n }",
"private void googleSignIn() {\n Intent signInIntent = mGoogleSignInClient.getSignInIntent();\n startActivityForResult(signInIntent, SIGN_IN);\n }",
"private void signIn(){\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestIdToken(getString(R.string.default_web_client_id))\n .requestEmail()\n .build();\n\n GoogleSignInClient mGoogleSignInClient = GoogleSignIn.getClient(this, gso);\n Intent signInIntent = mGoogleSignInClient.getSignInIntent();\n startActivityForResult(signInIntent, Constants.RC_SIGN_IN);\n\n }",
"private void signIn() {\n mGoogleSignInClient = buildGoogleSignInClient();\n startActivityForResult(mGoogleSignInClient.getSignInIntent(), REQUEST_CODE_SIGN_IN);\n }",
"public final void signInWithGoogle() {\n ActivityResult.startGoogleLogin(activity, googleApiClient);\n }",
"private void signIn() {\n Intent signInIntent = mGoogleSignInClient.getSignInIntent();\n startActivityForResult(signInIntent, RC_SIGN_IN);\n }",
"private void signIn() {\n Intent signInIntent = mGoogleSignInClient.getSignInIntent();\n startActivityForResult(signInIntent, RC_SIGN_IN);\n }",
"private void signIn() {\n Intent signInIntent = mGoogleSignInClient.getSignInIntent();\n startActivityForResult(signInIntent, RC_SIGN_IN);\n }",
"private void signIn()\n {\n Intent intent = Auth.GoogleSignInApi.getSignInIntent(googleApiClient);\n // If user was already signed in earlier, log them out first\n if(signOutCode != 0)\n {\n signOut();\n }\n\n // Runtime permission for locations and network\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 ActivityCompat.requestPermissions(MainActivity.this, new String[]{\n android.Manifest.permission.INTERNET,\n android.Manifest.permission.ACCESS_COARSE_LOCATION,\n android.Manifest.permission.ACCESS_FINE_LOCATION,\n android.Manifest.permission.ACCESS_NETWORK_STATE,\n android.Manifest.permission.SYSTEM_ALERT_WINDOW,\n android.Manifest.permission.WRITE_EXTERNAL_STORAGE\n\n }, PERMISSION);\n }\n startActivityForResult(intent, IntentConstants.INTENT_GOOGLE_REQUEST_CODE);\n\n }",
"private void signIn() {\n Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);\n startActivityForResult(signInIntent, RC_SIGN_IN);\n }",
"private void signIn() {\n Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);\n startActivityForResult(signInIntent, RC_SIGN_IN);\n }",
"private void signIn() {\n Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);\n startActivityForResult(signInIntent, RC_SIGN_IN);\n }",
"private void signIn() {\n Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);\n startActivityForResult(signInIntent, RC_SIGN_IN);\n }",
"private void signIn() {\n Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);\n startActivityForResult(signInIntent, SIGN_IN_CODE);\n }",
"private void signIn() {\n // [START_EXCLUDE silent]\n // [END_EXCLUDE]\n Intent signInIntent = mGoogleSignInClient.getSignInIntent();\n startActivityForResult(signInIntent, RC_SIGN_IN);\n }",
"private void signInFeature() {\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestEmail()\n .build();\n mGoogleApiClient = new GoogleApiClient.Builder(this)\n .enableAutoManage(this, this)\n .addApi(Auth.GOOGLE_SIGN_IN_API, gso)\n .build();\n\n Button signInButton = (Button) findViewById(R.id.login_button);\n signInButton.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n signIn();\n }\n });\n }",
"private void signInMethod() {\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestIdToken(getString(R.string.default_web_client_id))\n .requestEmail()\n .build();\n\n // Build a GoogleSignInClient with the options specified by gso.\n mGoogleSignInClient = GoogleSignIn.getClient(this, gso);\n }",
"private void signIn() {\n Utility.showLoader(this);\n mGoogleApiClient.clearDefaultAccountAndReconnect();\n\n Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);\n startActivityForResult(signInIntent, RC_SIGN_IN);\n }",
"private void startGoogleGamesSignIn () {\n\t\tfinal GPPSignIn s = GPPSignIn.sharedInstance();\n\t\tGPGManager m = GPGManager.sharedInstance();\n\n\t\tgamesAuthBlock = new GPGReAuthenticationBlock() {\n\t\t\t@Override\n\t\t\tpublic void invoke (boolean requiresKeychainWipe, NSError error) {\n\t\t\t\t// If you hit this, auth has failed and you need to authenticate.\n\t\t\t\t// Most likely you can refresh behind the scenes\n\t\t\t\tif (requiresKeychainWipe) {\n\t\t\t\t\ts.signOut();\n\t\t\t\t}\n\t\t\t\ts.authenticate();\n\t\t\t}\n\t\t};\n\n\t\t// pass the GPPSignIn to the GPGManager.\n\t\tm.signIn(s, gamesAuthBlock);\n\t}",
"private void setupGoogleSignin() {\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestIdToken(getString(R.string.default_web_client_id))\n .requestEmail()\n .build();\n\n // Build a GoogleApiClient with access to the Google Sign-In API and the\n // options specified by gso.\n mGoogleApiClient = new GoogleApiClient.Builder(this)\n .enableAutoManage(this /* FragmentActivity */, this /* OnConnectionFailedListener */)\n .addApi(Auth.GOOGLE_SIGN_IN_API, gso)\n .build();\n }",
"public void UserSignInMethod(){\n // Passing Google Api Client into Intent.\n Intent AuthIntent = Auth.GoogleSignInApi.getSignInIntent(googleApiClient);\n startActivityForResult(AuthIntent, REQUEST_SIGN_IN_CODE);\n }",
"private void configureGoogleSignIn() {\n // Configure sign-in to request the user's ID, email address, and basic\n // profile. ID and basic profile are included in DEFAULT_SIGN_IN.\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestEmail()\n .build();\n\n // Build a GoogleSignInClient with the options specified by gso.\n mGoogleSignInClient = GoogleSignIn.getClient(this, gso);\n\n // Check for existing Google Sign In account, if the user is already signed in\n // the GoogleSignInAccount will be non-null.\n// GoogleSignInAccount account = GoogleSignIn.getLastSignedInAccount(this);\n\n // Set the dimensions of the sign-in button.\n// googleSignInButton = findViewById(R.id.sign_in_button);\n// googleSignInButton.setSize(SignInButton.SIZE_STANDARD);\n// googleSignInButton.setOnClickListener(this);\n\n btn_google_login = navigationView.getHeaderView(1).findViewById(R.id.btn_google_login);\n btn_google_login.setOnClickListener(this);\n }",
"public void continueWithGoogle(View view) {\n Intent signInIntent = mGoogleSignInClient.getSignInIntent();\n startActivityForResult(signInIntent, 99);\n }",
"private void firebaseAuthWithGoogle(GoogleSignInAccount acct) {\n Toast.makeText(this, getResources().getString(R.string.autenticandoseGoogle) + \" \" + acct.getId(), Toast.LENGTH_SHORT).show();\n\n showProgressDialog();\n\n AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);\n mAuth.signInWithCredential(credential)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n Toast.makeText(getApplicationContext(), getResources().getString(R.string.autenticadoGoogle), Toast.LENGTH_SHORT).show();\n FirebaseUser user = mAuth.getCurrentUser();\n updateUI(user);\n finish();\n } else {\n Toast.makeText(getApplicationContext(), getResources().getString(R.string.autenticacionFallida), Toast.LENGTH_SHORT).show();\n updateUI(null);\n }\n hideProgressDialog();\n\n\n }\n });\n }",
"private void configureGoogleSignIn() {\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestIdToken(getString(R.string.default_web_client_id))\n .requestEmail()\n .build();\n\n googleApiClient = new GoogleApiClient.Builder(getApplicationContext()).enableAutoManage(this, new GoogleApiClient.OnConnectionFailedListener() {\n @Override\n public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {\n Toast.makeText(LoginActivity.this, \"Error\", Toast.LENGTH_LONG).show();\n }\n }).addApi(Auth.GOOGLE_SIGN_IN_API, gso).build();\n }",
"private void startSignIn() {\n Intent signInIntent = mGoogleSignInClient.getSignInIntent();\n startActivityForResult(signInIntent, RC_SIGN_IN);\n }",
"private void RegisterGoogleSignup() {\n\n\t\ttry {\n\t\t\tLocalData data = new LocalData(SplashActivity.this);\n\n\t\t\tArrayList<String> asName = new ArrayList<String>();\n\t\t\tArrayList<String> asValue = new ArrayList<String>();\n\n\t\t\tasName.add(\"email\");\n\t\t\tasName.add(\"firstname\");\n\t\t\tasName.add(\"gender\");\n\t\t\tasName.add(\"id\");\n\t\t\tasName.add(\"lastname\");\n\t\t\tasName.add(\"name\");\n\t\t\t// asName.add(\"link\");\n\n\t\t\tasName.add(\"device_type\");\n\t\t\tasName.add(\"device_id\");\n\t\t\tasName.add(\"gcm_id\");\n\t\t\tasName.add(\"timezone\");\n\n\t\t\tasValue.add(data.GetS(LocalData.EMAIL));\n\t\t\tasValue.add(data.GetS(LocalData.FIRST_NAME));\n\t\t\tasValue.add(data.GetS(LocalData.GENDER));\n\t\t\tasValue.add(data.GetS(LocalData.ID));\n\t\t\tasValue.add(data.GetS(LocalData.LAST_NAME));\n\t\t\tasValue.add(data.GetS(LocalData.NAME));\n\t\t\t// asValue.add(data.GetS(LocalData.LINK));\n\n\t\t\tasValue.add(\"A\");\n\n\t\t\tString android_id = Secure\n\t\t\t\t\t.getString(SplashActivity.this.getContentResolver(),\n\t\t\t\t\t\t\tSecure.ANDROID_ID);\n\n\t\t\tasValue.add(android_id);\n\n\t\t\tLocalData data1 = new LocalData(SplashActivity.this);\n\t\t\tasValue.add(data1.GetS(\"gcmId\"));\n\t\t\tasValue.add(Main.GetTimeZone());\n\t\t\tString sURL = StringURLs.getQuery(StringURLs.GOOGLE_LOGIN, asName,\n\t\t\t\t\tasValue);\n\n\t\t\tConnectServer connectServer = new ConnectServer();\n\t\t\tconnectServer.setMode(ConnectServer.MODE_POST);\n\t\t\tconnectServer.setContext(SplashActivity.this);\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\n\t\t\t\t\tLog.d(\"JSON DATA\", sJSON);\n\n\t\t\t\t\ttry {\n\n\t\t\t\t\t\tif (sJSON.length() != 0) {\n\t\t\t\t\t\t\tJSONObject object = new JSONObject(sJSON);\n\t\t\t\t\t\t\tJSONObject response = object\n\t\t\t\t\t\t\t\t\t.getJSONObject(JSONStrings.JSON_RESPONSE);\n\t\t\t\t\t\t\tString sResult = response\n\t\t\t\t\t\t\t\t\t.getString(JSONStrings.JSON_SUCCESS);\n\n\t\t\t\t\t\t\tif (sResult.equalsIgnoreCase(\"1\") == true) {\n\n\t\t\t\t\t\t\t\tString user_id = response.getString(\"userid\");\n\n\t\t\t\t\t\t\t\tLocalData data = new LocalData(\n\t\t\t\t\t\t\t\t\t\tSplashActivity.this);\n\t\t\t\t\t\t\t\tdata.Update(\"userid\", user_id);\n\t\t\t\t\t\t\t\tdata.Update(\"name\", response.getString(\"name\"));\n\n\t\t\t\t\t\t\t\tGetNotificationCount();\n\n\t\t\t\t\t\t\t} else if (sResult.equalsIgnoreCase(\"0\") == true) {\n\n\t\t\t\t\t\t\t\tString msgcode = jsonObject.getJSONObject(\n\t\t\t\t\t\t\t\t\t\t\"response\").getString(\"msgcode\");\n\n\t\t\t\t\t\t\t\tToast.makeText(\n\t\t\t\t\t\t\t\t\t\tSplashActivity.this,\n\t\t\t\t\t\t\t\t\t\tMain.getStringResourceByName(\n\t\t\t\t\t\t\t\t\t\t\t\tSplashActivity.this, msgcode),\n\t\t\t\t\t\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tToast.makeText(\n\t\t\t\t\t\t\t\t\tSplashActivity.this,\n\t\t\t\t\t\t\t\t\tMain.getStringResourceByName(\n\t\t\t\t\t\t\t\t\t\t\tSplashActivity.this, \"c100\"),\n\t\t\t\t\t\t\t\t\tToast.LENGTH_LONG).show();\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(\n\t\t\t\t\t\t\t\tSplashActivity.this,\n\t\t\t\t\t\t\t\tMain.getStringResourceByName(\n\t\t\t\t\t\t\t\t\t\tSplashActivity.this, \"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\tToast.makeText(SplashActivity.this,\n\t\t\t\t\tMain.getStringResourceByName(SplashActivity.this, \"c100\"),\n\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t}\n\t}",
"private void firebaseAuthWithGoogle(GoogleSignInAccount acct) {\n Log.d(TAG, \"firebaseAuthWithGoogle:\" + acct.getId());\n // [START_EXCLUDE silent]\n showProgressDialog();\n // [END_EXCLUDE]\n\n AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);\n mAuth.signInWithCredential(credential)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n // Sign in success, update UI with the signed-in user's information\n Log.d(TAG, \"signInWithCredential:success\");\n FirebaseUser user = mAuth.getCurrentUser();\n\n Intent intent = new Intent(SplashActivity.this, MainIntoActivity.class);\n startActivity(intent);\n finish();\n\n } else {\n // If sign in fails, display a message to the user.\n Log.w(TAG, \"signInWithCredential:failure\", task.getException());\n Toast.makeText(SplashActivity.this, \"Authentication failed.\",\n Toast.LENGTH_SHORT).show();\n Log.d(\"FAILED\", \"FAILED\");\n }\n\n // [START_EXCLUDE]\n hideProgressDialog();\n // [END_EXCLUDE]\n }\n });\n }",
"@Override\n public void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n Log.d(\"check\", \"in onActivityResult\");\n // Result returned from launching the Intent from GoogleSignInApi.getSignInIntent(...);\n if (requestCode == RC_SIGN_IN) {\n Log.d(\"sign in\", \"1\");\n GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);\n if (result.isSuccess()) {\n // session.setLogin(true);\n\n // Google Sign In was successful, authenticate with Firebase\n GoogleSignInAccount account = result.getSignInAccount();\n firebaseAuthWithGoogle(account);\n } else {\n Log.d(\"failed to google signin\", \"10\");\n // Google Sign In failed, update UI appropriately\n // [START_EXCLUDE]\n // updateUI(null);\n // [END_EXCLUDE]\n }\n }\n }",
"private void firebaseAuthWithGoogle(GoogleSignInAccount acct) {\n\n AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);\n mFirebaseAuth.signInWithCredential(credential)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n FirebaseUser user = mFirebaseAuth.getCurrentUser();\n //Toast.makeText(SignInActivity.this, R.string.sign_in_successful, Toast.LENGTH_SHORT).show();\n hideSignInWithGoogleLoadingIndicator();\n returnToCallingActivity();\n } else {\n // If sign in fails, display a message to the user.\n Log.w(DEBUG_TAG, \"signInWithCredential:failure\", task.getException());\n Toast.makeText(SignInActivity.this, R.string.failed_to_sign_in_with_credentials, Toast.LENGTH_SHORT).show();\n //Snackbar.make(findViewById(R.id.main_layout), \"Authentication Failed.\", Snackbar.LENGTH_SHORT).show();\n }\n }\n });\n }",
"private void firebaseAuthWithGoogle(GoogleSignInAccount acct) {\n AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);\n mAuth.signInWithCredential(credential)\n .addOnSuccessListener(this, authResult -> {\n FirebaseUser user = mAuth.getCurrentUser();\n googleSignIn = 1;\n startActivity(new Intent(LoginActivity.this, HomeMainActivity.class));\n finish();\n })\n .addOnFailureListener(this, e -> Toast.makeText(LoginActivity.this, \"Authentication failed.\",\n Toast.LENGTH_SHORT).show());\n }",
"private void firebaseAuthWithGoogle(GoogleSignInAccount acct) {\n\n AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);\n mAuth.signInWithCredential(credential)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n // Sign in success, update UI with the signed-in user's information\n //Log.d(TAG, \"signInWithCredential:success\");\n FirebaseUser user = mAuth.getCurrentUser();\n mGoogleSignInClient.signOut();\n updateUI(user);\n } else {\n // If sign in fails, display a message to the user.\n //Log.w(TAG, \"signInWithCredential:failure\", task.getException());\n //Snackbar.make(findViewById(R.id.main_layout), \"Authentication Failed.\", Snackbar.LENGTH_SHORT).show();\n updateUI(null);\n }\n\n // ...\n }\n });\n }",
"private void startSignIn() {\n\n Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);\n startActivityForResult(signInIntent, RES_CODE_SIGN_IN);\n }",
"@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == RC_SIGN_IN) {\n GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);\n\n System.out.println(\"result status code\" + result.getStatus());\n if (result.isSuccess()) {\n onSucessGoogleLogin(result);\n\n } else {\n // Google Sign In failed, update UI appropriately\n Utility.logData(\"Login unsuccessful\");\n Utility.showShortToast(\"Login unsuccessful\");\n }\n\n }\n super.onActivityResult(requestCode, resultCode, data);\n }",
"void signInComplete();",
"@Override\n public void onClick(View view) {\n Intent intent = googleSignInClient.getSignInIntent();\n //Start activity for result\n startActivityForResult(intent, 100);\n }",
"private void initGoogleClient() {\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestIdToken(getString(R.string.default_web_client_id))\n .requestEmail()\n .build();\n\n mGoogleSignInClient = GoogleSignIn.getClient(this, gso);\n\n // [START initialize_auth]\n // Initialize Firebase Auth\n // [END initialize_auth]\n }",
"public void didFinishLaunching () {\n\t\tGPPSignIn signIn = GPPSignIn.sharedInstance();\n\t\tsignIn.setClientID(clientId);\n\n\t\t// set scopes\n\t\tArrayList<NSString> scopes = new ArrayList<NSString>();\n\t\tscopes.add(new NSString(\"https://www.googleapis.com/auth/plus.login\"));\n\t\tscopes.add(new NSString(\"https://www.googleapis.com/auth/games\"));\n\t\tscopes.add(new NSString(\"https://www.googleapis.com/auth/appstate\"));\n\t\tsignIn.setScopes(new NSArray<NSString>(scopes));\n\n\t\tsignIn.setDelegate(this);\n\t\tsignIn.setShouldFetchGoogleUserID(fetchId);\n\t\tsignIn.setShouldFetchGoogleUserEmail(fetchEmail);\n\t\tsignIn.setShouldFetchGooglePlusUser(fetchName);\n\n\t\t// try to sign in silently\n\t\tsignIn.trySilentAuthentication();\n\n\t\t// define blocks\n\t\trevealBlock = new GPGAchievementDidRevealBlock() {\n\t\t\t@Override\n\t\t\tpublic void invoke (GPGAchievementState state, NSError error) {\n\t\t\t\tif (error != null) {\n\t\t\t\t\tSystem.out.println(\"Error while revealing achievement!\");\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tincrementBlock = new GPGAchievementDidIncrementBlock() {\n\t\t\t@Override\n\t\t\tpublic void invoke (boolean newlyUnlocked, int currentSteps, NSError error) {\n\t\t\t\tif (error != null) {\n\t\t\t\t\tSystem.out.println(\"Error while revealing!\");\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tunlockBlock = new GPGAchievementDidUnlockBlock() {\n\t\t\t@Override\n\t\t\tpublic void invoke (boolean newlyUnlocked, NSError error) {\n\t\t\t\tif (error != null) {\n\t\t\t\t\tSystem.out.println(\"Error while unlocking!\");\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tcloudCompletionHandler = new GPGAppStateWriteResultHandler() {\n\t\t\t@Override\n\t\t\tpublic void invoke (GPGAppStateWriteStatus status, NSError error) {\n\t\t\t\tswitch (status) {\n\t\t\t\tcase GPGAppStateWriteStatusSuccess:\n\t\t\t\t\tSystem.out.println(\"cloud save succeeded!\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase GPGAppStateWriteStatusBadKeyDataOrVersion:\n\t\t\t\t\tSystem.out.println(\"cloud save failed: bad key or version\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase GPGAppStateWriteStatusConflict:\n\t\t\t\t\tSystem.out.println(\"cloud save failed: conflict\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase GPGAppStateWriteStatusKeysQuotaExceeded:\n\t\t\t\t\tSystem.out.println(\"cloud save failed: keys quota exceeded\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase GPGAppStateWriteStatusNotFound:\n\t\t\t\t\tSystem.out.println(\"cloud save failed: not found\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase GPGAppStateWriteStatusSizeExceeded:\n\t\t\t\t\tSystem.out.println(\"cloud save failed: size exceeded\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase GPGAppStateWriteStatusUnknownError:\n\t\t\t\t\tSystem.out.println(\"cloud save failed: unknown error\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tpostScoreCompletionHandler = new GPGScoreReportScoreBlock() {\n\t\t\t@Override\n\t\t\tpublic void invoke (GPGScoreReport report, NSError error) {\n\t\t\t\tif (error != null) {\n\t\t\t\t\tSystem.out.println(\"score posting failed!\");\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}",
"private void firebaseAuthWithGoogle(GoogleSignInAccount acct) {\n Log.d(TAG, \"firebaseAuthWithGoogle:\" + acct.getId());\n // [START_EXCLUDE silent]\n// showProgressDialog();\n // [END_EXCLUDE]\n\n AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);\n mAuth.signInWithCredential(credential)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n // Sign in success, update UI with the signed-in user's information\n Log.d(TAG, \"signInWithCredential:success\");\n FirebaseUser user = mAuth.getCurrentUser();\n Toast.makeText(current,\"Sign \"+user.getEmail(),Toast.LENGTH_LONG).show();\n\n updateUI(user);\n updateCurrentUser(user);\n } else {\n // If sign in fails, display a message to the user.\n Log.w(TAG, \"signInWithCredential:failure\", task.getException());\n Toast.makeText(current,\"Failed\"+task.getException().toString(),Toast.LENGTH_LONG).show();\n updateUI(null);\n }\n\n // [START_EXCLUDE]\n// hideProgressDialog();\n // [END_EXCLUDE]\n }\n });\n }",
"private void configureGoogleClient() {\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n // for the requestIdToken, this is in the values.xml file that\n // is generated from your google-services.json\n .requestIdToken(getString(R.string.default_web_client_id))\n .requestEmail()\n .build();\n // Build a GoogleSignInClient with the options specified by gso.\n googleSignInClient = GoogleSignIn.getClient(this, gso);\n // Initialize Firebase Auth\n firebaseAuth = FirebaseAuth.getInstance();\n }",
"public interface IGoogle {\n void onInitAOuth(SignInButton signInButton, GoogleSignInOptions gso, GoogleApiClient googleApiClient);\n\n void onStartAOuth();\n\n void onActivityResult(int requestCode, int resultCode, Intent data);\n\n void onSignInAOth();\n\n void onSignOutAOth();\n\n void onRevokeAccess();\n}",
"private void createRequest() {\n GoogleSignInOptions gso = new GoogleSignInOptions\n .Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestIdToken(getString(R.string.default_web_client_id))\n .requestEmail()\n .build();\n\n googleApiClient = new GoogleApiClient.Builder(this)\n .enableAutoManage(this, this)\n .addApi(Auth.GOOGLE_SIGN_IN_API, gso)\n .build();\n\n signInButton = (SignInButton) findViewById(R.id.sign_in_button);\n signInButton.setSize(SignInButton.SIZE_WIDE);\n signInButton.setColorScheme(signInButton.COLOR_DARK);\n signInButton.setOnClickListener((v) -> {\n Intent intent = Auth.GoogleSignInApi.getSignInIntent(googleApiClient);\n startActivityForResult(intent, SIGN_IN_CODE);\n });\n }",
"private void firebaseAuthWithGoogle(String idToken) {\n AuthCredential credential = GoogleAuthProvider.getCredential(idToken, null);\n mAuth.signInWithCredential(credential)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n // Sign in success, update UI with the signed-in user's information\n FirebaseUser user = mAuth.getCurrentUser();\n assert user != null;\n Toast.makeText(SignUpActivity.this, \"Signed in as: \" + user.getDisplayName(), Toast.LENGTH_SHORT).show();\n progressDialog.dismiss();\n UpdateUI();\n }\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n e.printStackTrace();\n Toast.makeText(SignUpActivity.this, e.getMessage(), Toast.LENGTH_SHORT).show();\n }\n });\n }",
"GoogleAuthenticatorKey createCredentials();",
"private void startSignIn() {\n Intent intent = AuthUI.getInstance().createSignInIntentBuilder()\n .setIsSmartLockEnabled(!BuildConfig.DEBUG)\n .setAvailableProviders(Arrays.asList(\n new AuthUI.IdpConfig.EmailBuilder().build(),\n new AuthUI.IdpConfig.GoogleBuilder().build()))\n .setLogo(R.mipmap.ic_launcher)\n .build();\n\n startActivityForResult(intent, RC_SIGN_IN);\n }",
"private void signIn() {\n }",
"public interface IGoogleServices {\n void signIn();\n void signOut();\n void changeUser();\n boolean isConnected();\n boolean isConnecting();\n}",
"private void googleSignOut() {\n googleSignInClient.signOut();\n }",
"@Override\n public void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n\n // Result returned from launching the Intent from GoogleSignInApi.getSignInIntent(...);\n if (requestCode == RC_SIGN_IN) {\n GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);\n if (result.isSuccess()) {\n // Google Sign In was successful, authenticate with Firebase\n GoogleSignInAccount account = result.getSignInAccount();\n firebaseAuthWithGoogle(account);\n } else {\n // Google Sign In failed, update UI appropriately\n // [START_EXCLUDE]\n Log.d(\"FAILED\", \"FAILED\");\n // [END_EXCLUDE]\n }\n }\n }",
"@Override\n public void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n mCallbackManager.onActivityResult(requestCode, resultCode, data); // DATA CALLBACK FOR FACEBOOK\n if (data != null) {\n progressDialog.show();\n progressDialog.setMessage(\"Logging you in...\");\n if (requestCode == 9001 && resultCode == RESULT_OK) {\n Task<GoogleSignInAccount> task = GoogleSignIn.getSignedInAccountFromIntent(data);\n try {\n // Google Sign In was successful, authenticate with Firebase\n GoogleSignInAccount account = task.getResult(ApiException.class);\n assert account != null;\n firebaseAuthWithGoogle(account.getIdToken());\n } catch (ApiException e) {\n e.printStackTrace();\n Toast.makeText(this, e.getMessage(), Toast.LENGTH_SHORT).show();\n }\n }\n }else {\n progressDialog.dismiss();\n }\n }",
"private void firebaseAuthWithGoogle(GoogleSignInAccount acct) {\n\n AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);\n if(Constants.mAuth==null){\n Constants.mAuth= FirebaseAuth.getInstance();\n Log.d(Constants.TAG,\"mAuth new Instance\");\n }\n Constants.mAuth.signInWithCredential(credential)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n // Sign in success, update UI with the signed-in user's information\n Log.d(Constants.TAG, \"signInResult:google success\");\n Constants.user=Constants.mAuth.getCurrentUser();\n SharedPreferences sharedPreferences=getSharedPreferences(Constants.LoginSharedPref.SHARED_PREF_NAME,MODE_PRIVATE);\n SharedPreferences.Editor editor=sharedPreferences.edit();\n editor.putBoolean(Constants.LoginSharedPref.PREVIOUSLY_STARTED,true);\n editor.putBoolean(Constants.LoginSharedPref.LOGGED_IN,true);\n String email=Constants.user.getEmail();\n String name=Constants.user.getDisplayName();\n Uri photoUrl=Constants.user.getPhotoUrl();\n editor.putString(Constants.LoginSharedPref.LOGIN_EMAIL,email);\n editor.putString(Constants.LoginSharedPref.LOGIN_URENAME,name);\n if(photoUrl!=null) {\n Log.d(Constants.TAG,\" Photo Url Extract: \"+photoUrl.toString());\n editor.putString(Constants.LoginSharedPref.PROFILE_URL, photoUrl.toString());\n }\n editor.putBoolean(Constants.LoginSharedPref.IS_EMAIL_VERIFIED,true);\n editor.commit();\n progressBar.setVisibility(View.GONE);\n contentHome.setVisibility(View.VISIBLE);\n Intent intent=new Intent(HomeActivity.this,MainActivity.class);\n startActivity(intent);\n finish();\n } else {\n // If sign in fails, display a message to the user.\n progressBar.setVisibility(View.GONE);\n contentHome.setVisibility(View.VISIBLE);\n Log.d(Constants.TAG, \"signInResult:google with firebase failure\", task.getException());\n Toast.makeText(HomeActivity.this, \"An error occured while signing in. Check your network connection \",\n Toast.LENGTH_SHORT).show();\n }\n\n // ...\n }\n });\n }",
"@Override\n public void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n\n // Result returned from launching the Intent from GoogleSignInApi.getSignInIntent(...);\n if (requestCode == RC_SIGN_IN) {\n Task<GoogleSignInAccount> task = GoogleSignIn.getSignedInAccountFromIntent(data);\n try {\n // Google Sign In was successful, authenticate with Firebase\n GoogleSignInAccount account = task.getResult(ApiException.class);\n firebaseAuthWithGoogle(account);\n\n } catch (ApiException e) {\n // Google Sign In failed, update UI appropriately\n Log.w(TAG, \"Google sign in failed\", e);\n // [START_EXCLUDE]\n updateUI(null);\n // [END_EXCLUDE]\n }\n }else {\n mCallbackManager.onActivityResult(requestCode, resultCode, data);\n }\n }",
"@Override\n public void onSignInClicked() {\n Prefs.setSignedIn(true);\n // Proceed to Main and finish\n proceedToMainActivityAndFinish();\n }",
"private void firebaseAuthWithGoogle(GoogleSignInAccount acct) {\n Log.d(TAG, \"firebaseAuthWithGoogle:\" + acct.getId());\n // [START_EXCLUDE silent]\n showProgressDialog();\n // [END_EXCLUDE]\n\n AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);\n mAuth.signInWithCredential(credential)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n // Sign in success, update UI with the signed-in user's information\n Log.d(TAG, \"signInWithCredential:success\");\n FirebaseUser user = mAuth.getCurrentUser();\n\n session.setLogin(true);\n db.addUser(user.getDisplayName(), user.getEmail(), user.getUid());\n\n Intent intent = new Intent(SignInActivity.this, MainActivity.class);\n startActivity(intent);\n finish();\n\n // updateUI(user);\n } else {\n // If sign in fails, display a message to the user.\n Log.w(TAG, \"signInWithCredential:failure\", task.getException());\n Toast.makeText(SignInActivity.this, \"Authentication failed.\",\n Toast.LENGTH_SHORT).show();\n // updateUI(null);\n }\n\n // [START_EXCLUDE]\n hideProgressDialog();\n // [END_EXCLUDE]\n }\n });\n }",
"@Override\n protected void onStart(){\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestEmail()\n .build();\n\n // Build a GoogleSignInClient with the options specified by gso.\n mGoogleSignInClient = GoogleSignIn.getClient(this, gso);\n super.onStart();\n }",
"private void userSignIn() {\n GoogleSignInAccount account = GoogleSignIn.getLastSignedInAccount(this);\n if (GoogleSignIn.hasPermissions(account, new Scope(SCOPES))) {\n updateUI(account);\n mAccount = account.getAccount();\n Intent intent = new Intent(this, HomeActivity.class);\n intent.putExtra(ACCOUNT, mAccount);\n startActivity(intent);\n System.out.println(\"Exit Intent !!!!!!!!!!!!!!!!\");\n\n findViewById(R.id.disconnect_button).setVisibility(View.VISIBLE);\n\n } else {\n updateUI(null);\n }\n }",
"@Override public void onSignInButtonClicked() {\n mSignInClicked = true;\n mGoogleApiClient.connect();\n }",
"@Override\n\t\t\t\t\tpublic boolean loginWithGoogle(String userName, String password) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}",
"@NonNull\n public Task<AuthResult> silentSignIn(@NonNull Context context,\n @NonNull List<IdpConfig> configs) {\n if (mAuth.getCurrentUser() != null) {\n throw new IllegalArgumentException(\"User already signed in!\");\n }\n\n final Context appContext = context.getApplicationContext();\n final IdpConfig google =\n ProviderUtils.getConfigFromIdps(configs, GoogleAuthProvider.PROVIDER_ID);\n final IdpConfig email =\n ProviderUtils.getConfigFromIdps(configs, EmailAuthProvider.PROVIDER_ID);\n\n if (google == null && email == null) {\n throw new IllegalArgumentException(\"No supported providers were supplied. \" +\n \"Add either Google or email support.\");\n }\n\n final GoogleSignInOptions googleOptions;\n if (google == null) {\n googleOptions = null;\n } else {\n GoogleSignInAccount last = GoogleSignIn.getLastSignedInAccount(appContext);\n if (last != null && last.getIdToken() != null) {\n return mAuth.signInWithCredential(GoogleAuthProvider.getCredential(\n last.getIdToken(), null));\n }\n\n googleOptions = google.getParams()\n .getParcelable(ExtraConstants.GOOGLE_SIGN_IN_OPTIONS);\n }\n\n // If Play services are not available we can't attempt to use the credentials client.\n if (!GoogleApiUtils.isPlayServicesAvailable(context)) {\n return Tasks.forException(\n new FirebaseUiException(ErrorCodes.PLAY_SERVICES_UPDATE_CANCELLED));\n }\n\n return GoogleApiUtils.getCredentialsClient(context)\n .request(new CredentialRequest.Builder()\n // We can support both email and Google at the same time here because they\n // are mutually exclusive. If a user signs in with Google, their email\n // account will automatically be upgraded (a.k.a. replaced) with the Google\n // one, meaning Smart Lock won't have to show the picker UI.\n .setPasswordLoginSupported(email != null)\n .setAccountTypes(google == null ? null :\n ProviderUtils.providerIdToAccountType(GoogleAuthProvider\n .PROVIDER_ID))\n .build())\n .continueWithTask(task -> {\n Credential credential = task.getResult().getCredential();\n String email1 = credential.getId();\n String password = credential.getPassword();\n\n if (TextUtils.isEmpty(password)) {\n return GoogleSignIn.getClient(appContext,\n new GoogleSignInOptions.Builder(googleOptions)\n .setAccountName(email1)\n .build())\n .silentSignIn()\n .continueWithTask(task1 -> {\n AuthCredential authCredential = GoogleAuthProvider\n .getCredential(\n task1.getResult().getIdToken(), null);\n return mAuth.signInWithCredential(authCredential);\n });\n } else {\n return mAuth.signInWithEmailAndPassword(email1, password);\n }\n });\n }",
"private void attemptCreateAccountWithGoogle() {\n // Configure sign-in to request the user's ID, email address, and basic profile. ID and\n // basic profile are included in DEFAULT_SIGN_IN.\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestEmail()\n .build();\n if (mGoogleApiClient == null) {\n // Build a GoogleApiClient with access to GoogleSignIn.API and the options above.\n mGoogleApiClient = new GoogleApiClient.Builder(this)\n .enableAutoManage(this, this)\n .addApi(Auth.GOOGLE_SIGN_IN_API, gso)\n .build();\n }\n\n Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);\n startActivityForResult(signInIntent, RC_SIGN_IN);\n }",
"private void firebaseAuthWithGoogle(GoogleSignInAccount acct) {\n Log.d(TAG, \"firebaseAuthWithGoogle:\" + acct.getId());\n\n AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);\n mAuth.signInWithCredential(credential)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n // Sign in success, update UI with the signed-in user's information\n Log.d(TAG, \"signInWithCredential:success\");\n FirebaseUser user = mAuth.getCurrentUser();\n updateUI(user);\n showHideProgressDialog(false);\n onAuthSuccess(mAuth.getCurrentUser());\n } else {\n // If sign in fails, display a message to the user.\n Log.w(TAG, \"signInWithCredential:failure\", task.getException());\n Toast.makeText(Login.this, \"Authentication failed.\",\n Toast.LENGTH_SHORT).show();\n showHideProgressDialog(false);\n updateUI(null);\n }\n }\n });\n }",
"@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == RC_SIGN_IN) {\n // The Task returned from this call is always completed, no need to attach\n // a listener.\n Task<GoogleSignInAccount> task = GoogleSignIn.getSignedInAccountFromIntent(data);\n handleSignInResult(task);\n } else {\n callbackManager.onActivityResult(requestCode, resultCode, data);\n }\n\n super.onActivityResult(requestCode, resultCode, data);\n }",
"private void firebaseAuthWithGoogle(GoogleSignInAccount acct) {\n AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);\n mAuth.signInWithCredential(credential)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n //inicio de sesion exitoso\n //Recuperacion de los datos del usuario logueado\n FirebaseUser user = mAuth.getCurrentUser();\n //llamado a la vista inicial de usuario autenticado\n startActivity(new Intent(Login.this,Principal.class));\n finish();\n\n } else {\n // Fallo el inicio de sesion con firebase.\n Toast.makeText(Login.this, R.string.errorInicioSesion,\n Toast.LENGTH_SHORT).show();\n\n }\n\n }\n });\n }",
"private void FirebaseGoogleAuth(GoogleSignInAccount acct) {\n if (acct != null) {\n AuthCredential authCredential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);\n mAuth.signInWithCredential(authCredential).addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n Toast.makeText(MainActivity.this, \"Successful\", Toast.LENGTH_SHORT).show();\n FirebaseUser user = mAuth.getCurrentUser();\n\n updateUI(user);\n\n } else {\n Toast.makeText(MainActivity.this, \"Failed\", Toast.LENGTH_SHORT).show();\n updateUI(null);\n }\n }\n });\n }\n else{\n Toast.makeText(MainActivity.this, \"acc failed\", Toast.LENGTH_SHORT).show();\n }\n }",
"@Given(\"^Open SignIn site$\")\t\t\t\t\t\n public void Open_SignIn_site() throws Throwable \t\t\t\t\t\t\t\n { \t\t\n \tdriver.navigate().to(\"https://accounts.google.com/ServiceLogin/identifier?flowName=GlifWebSignIn&flowEntry=AddSession\");\n driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\t\t\t\t\t\n }",
"private void initFBGoogleSignIn() {\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestIdToken(WEB_CLIENT_ID)\n .requestEmail()\n .build();\n\n Context context = getContext();\n mGoogleApiClient = new GoogleApiClient.Builder(context)\n .enableAutoManage(getActivity(), new GoogleApiClient.OnConnectionFailedListener() {\n @Override\n public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {\n mGoogleSignInTextView.setText(connectionResult.getErrorMessage());\n }\n }).addApi(Auth.GOOGLE_SIGN_IN_API, gso).build();\n }",
"private void signIn() {\n final String email = ((EditText)findViewById(R.id.etSignInEmail)).getText().toString();\n final String password = ((EditText)findViewById(R.id.etSignInPassword)).getText().toString();\n\n mAuth.signInWithEmailAndPassword(email, password).addOnCompleteListener(new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n // Sign in success\n updateUI();\n } else {\n // Sign in failure\n Toast.makeText(LoginActivity.this, \"Incorrect email and/or password.\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n }",
"private void onSignInClicked() {\n mState.enableConnection();\n mState.mShouldResolve = true;\n mState.mSignInClicked = true;\n mState.connectGoogleGames();\n\n // Show a message to the user that we are signing in.\n status.setText(\"Connecting...\");\n }",
"@Override\n public void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n\n //facebook login\n// mCallbackManager.onActivityResult(requestCode, resultCode, data);\n\n // Result returned from launching the Intent from GoogleSignInApi.getSignInIntent(...);\n if (requestCode == RC_SIGN_IN) {\n Task<GoogleSignInAccount> task = GoogleSignIn.getSignedInAccountFromIntent(data);\n try {\n // Google Sign In was successful, authenticate with Firebase\n GoogleSignInAccount account = task.getResult(ApiException.class);\n firebaseAuthWithGoogle(account);\n } catch (ApiException e) {\n // Google Sign In failed, update UI appropriately\n Log.w(TAG, \"Google sign in failed\", e);\n // [START_EXCLUDE]\n// updateUI(null);\n // [END_EXCLUDE]\n }\n }\n }",
"private void configureSignup() {\n\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestIdToken(this.getResources().getString(R.string.web_client_id))\n .requestEmail().build();\n\n // Build a GoogleApiClient with access to GoogleSignIn.API and the options above.\n mGoogleApiClient = new GoogleApiClient.Builder(this)\n .enableAutoManage(this /* FragmentActivity */, this /* OnConnectionFailedListener */)\n .addApi(Auth.GOOGLE_SIGN_IN_API, gso)\n .build();\n\n\n mGoogleApiClient.connect();\n }",
"boolean authorize(\n String secret,\n int verificationCode,\n int window)\n throws GoogleAuthenticatorException;",
"@Override\n public void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n\n // Result returned from launching the Intent from GoogleSignInClient.getSignInIntent(...);\n if (requestCode == RC_SIGN_IN) {\n // The Task returned from this call is always completed, no need to attach\n // a listener.\n Task<GoogleSignInAccount> task = GoogleSignIn.getSignedInAccountFromIntent(data);\n handleSignInResult(task);\n\n }\n }",
"void showSignInInterstitial();",
"private void firebaseAuthWithGoogle(GoogleSignInAccount acct) {\n\r\n AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);\r\n mauth.signInWithCredential(credential)\r\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\r\n @Override\r\n public void onComplete(@NonNull Task<AuthResult> task) {\r\n if (task.isSuccessful()) {\r\n\r\n progressDialog.dismiss();\r\n\r\n Intent intent=new Intent(Gmailaccountactivity.this,MainActivity.class);\r\n startActivity(intent);\r\n\r\n\r\n // Sign in success, update UI with the signed-in user's information\r\n // Log.d(TAG, \"signInWithCredential:success\");\r\n // FirebaseUser user = auth.getCurrentUser();\r\n // String name=user.getDisplayName();\r\n// String email=user.getEmail();\r\n//\r\n// String photourl=user.getPhotoUrl().toString();\r\n//\r\n// HashMap<String,Object>gmailinfo=new HashMap<>();\r\n// gmailinfo.put(\"username\",name);\r\n// gmailinfo.put(\"imageurl\",photourl);\r\n//\r\n//\r\n// String uid=auth.getCurrentUser().getUid();\r\n//\r\n// rotref.child(uid).setValue(gmailinfo).addOnCompleteListener(new OnCompleteListener<Void>()\r\n// {\r\n// @Override\r\n// public void onComplete(@NonNull Task<Void> task) {\r\n//\r\n// if (task.isSuccessful())\r\n// {\r\n// progressDialog.dismiss();\r\n// Toast.makeText(Gmailaccountactivity.this, \"successfully logging\", Toast.LENGTH_SHORT).show();\r\n// Intent intent=new Intent(Gmailaccountactivity.this,MainActivity.class);\r\n// startActivity(intent);\r\n// }\r\n// else {\r\n// progressDialog.dismiss();\r\n// Toast.makeText(Gmailaccountactivity.this, \"error: \"+task.getException().toString(), Toast.LENGTH_SHORT).show();\r\n// }\r\n//\r\n// }\r\n// });\r\n\r\n\r\n // updateUI(user);\r\n } else {\r\n\r\n progressDialog.dismiss();\r\n // If sign in fails, display a message to the user.\r\n //Log.w(TAG, \"signInWithCredential:failure\", task.getException());\r\n// Snackbar.make(findViewById(R.id.main_layout), \"Authentication Failed.\", Snackbar.LENGTH_SHORT).show();\r\n// updateUI(null);\r\n }\r\n\r\n // ...\r\n }\r\n });\r\n }",
"@Override\n\tpublic void onSignInSucceeded() {\n\n\t}",
"private void firebaseAuthLogin() {\n startActivityForResult(AuthUI.getInstance()\n .createSignInIntentBuilder()\n .setAvailableProviders(getProvider())\n .setLogo(R.drawable.logo_login)\n .setTheme(R.style.LoginTheme)\n .setIsSmartLockEnabled(false)\n .setTosAndPrivacyPolicyUrls(\n \"https://www.freeprivacypolicy.com/privacy/view/3ccea0b97b785480095259db0c31569d\",\n \"https://www.freeprivacypolicy.com/privacy/view/3ccea0b97b785480095259db0c31569d\")\n .build(), REQUEST_CODE_LOGIN);\n }",
"protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n Util.Log.i(TAG, \"onActivityResult: requestCode: %b resultCode: %b\", requestCode == RC_SIGN_IN,\n resultCode==Activity.RESULT_OK);\n if (requestCode == RC_SIGN_IN) {\n// IdpResponse response = IdpResponse.fromResultIntent(data);\n GoogleSignInResult response = Auth.GoogleSignInApi.getSignInResultFromIntent(data);\n // Successfully signed in\n if (resultCode == Activity.RESULT_OK) {\n Task<GoogleSignInAccount> task = GoogleSignIn.getSignedInAccountFromIntent(data);\n try {\n // Google Sign In was successful, authenticate with Firebase\n account = task.getResult(ApiException.class);\n AuthCredential credential = GoogleAuthProvider.getCredential(account.getIdToken()\n , null);\n mAuth.signInWithCredential(credential).addOnCompleteListener(this);\n\n } catch (ApiException e) {\n Util.Log.d(TAG, \"sign in attempt failed\");\n progressMsg.setText(getString(R.string.progress_failed_signin));\n }\n } else {\n // Sign in failed\n\n progressBar.setVisibility(View.GONE);\n if (response == null) {\n Log.d(TAG, \"null response object\");\n progressMsg.setText(getString(R.string.progress_null_response));\n return;\n }\n int gStatusCode = response.getStatus().getStatusCode();\n Log.d(TAG, String.format(\"failed sign-in in response:(%d) %s\",gStatusCode, response.toString()));\n switch (gStatusCode) {\n case CommonStatusCodes.NETWORK_ERROR:\n case CommonStatusCodes.TIMEOUT:\n progressMsg.setText(getString(R.string.progress_no_internet));\n break;\n default:\n progressMsg.setText(GoogleSignInStatusCodes\n .getStatusCodeString(gStatusCode));\n }\n }\n }\n super.onActivityResult(requestCode, resultCode, data);\n }",
"private void setGoogleLoginSetting() {\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestIdToken(getString(R.string.default_web_client_id))\n .requestEmail()\n .build();\n\n mAuth = FirebaseAuth.getInstance();\n googleSignInClient = GoogleSignIn.getClient(this, gso);\n\n googleApiClient = new GoogleApiClient.Builder(this)\n .enableAutoManage(this, new GoogleApiClient.OnConnectionFailedListener() {\n @Override\n public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {\n Log.d(Constant.TAG, \"Login fail\");\n }\n })\n .addApi(Auth.GOOGLE_SIGN_IN_API, gso)\n .build();\n\n // auto login\n GoogleSignInAccount account = GoogleSignIn.getLastSignedInAccount(this);\n if(account!=null)\n firebaseAuthWithGoogle(account);\n }",
"@Override\n public void onRegistrationAccomplished() {\n Prefs.setSignedIn(true);\n // Proceed to Main\n proceedToMainActivityAndFinish();\n }",
"private void firebaseAuthWithGoogle(GoogleSignInAccount acct) {\n\n AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);\n fbAuth.signInWithCredential(credential)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n // Sign in success, update UI with the signed-in user's information\n //Log.d(TAG, \"signInWithCredential:success\");\n FirebaseUser user = fbAuth.getCurrentUser();\n UserModel userModel=new UserModel();\n userModel.setEmail(user.getEmail());\n userModel.setDisplayName(user.getDisplayName());\n userModel.setPhotoUrl(user.getPhotoUrl().toString());\n userModel.setUid(user.getUid());\n UserFBDB userFBDB = new UserFBDB();\n userFBDB.save(userModel);\n updateUI(user);\n } else {\n // If sign in fails, display a message to the user.\n //Log.w(TAG, \"signInWithCredential:failure\", task.getException());\n Exception ex=task.getException();\n signupWithGoogleBtn.setVisibility(View.VISIBLE);\n mProgress.setVisibility(View.INVISIBLE);\n Toast.makeText(SignupActivity.this, \"Authentication failed.\",\n Toast.LENGTH_SHORT).show();\n //updateUI(null);\n }\n\n // ...\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Log.d(\"singn\", e.getMessage());\n }\n });\n }",
"private static GoogleApiClient getClient(@NonNull Context context) {\n final String serverClientId = context.getString(R.string.server_client_id);\n final GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestIdToken(serverClientId)\n .requestEmail()\n .build();\n\n // Build a GoogleApiClient with access to the Google Sign-In API\n return new GoogleApiClient.Builder(context)\n .addApi(Auth.GOOGLE_SIGN_IN_API, gso)\n .build();\n }",
"public static interface GoogleAuthenticationListener {\n\n /**\n * A non recoverable error happened while attempting to acquire an OAuth token.\n * @param throwable the unrecoverable error.\n */\n void onAuthenticationError(Throwable throwable);\n\n /**\n * An OAuth token was successfully acquired.\n *\n * @param token the acquired token.\n */\n void onAuthenticationSucceeded(String token);\n\n /**\n * An attempt to re-authenticate might succeed.\n */\n void onRetryAuthentication();\n }",
"private void handleSignInResult(GoogleSignInResult result) {\n Log.v(\"SIGNIN STATUS\", \"SIGNIN RESULT: \" + result.getStatus().getStatusMessage());\n Log.v(\"SIGNIN STATUS\", \"SIGNIN CODE: \" + result.getStatus().getStatusCode());\n if (result.isSuccess()) {\n // Signed in successfully\n GoogleSignInAccount acct = result.getSignInAccount();\n IlliniBusApplication myApplication = (IlliniBusApplication) getApplication();\n myApplication.signIn(acct);\n Intent intent = new Intent(StartActivity.this, MainActivity.class);\n startActivity(intent);\n } else {\n Toast.makeText(getApplicationContext(), \"Failed to Login!\",\n Toast.LENGTH_LONG).show();\n }\n }",
"public GoogleAuthenticatorAccount() {\n }",
"public void login () {\n\t\tGPPSignIn.sharedInstance().authenticate();\n\t}",
"private void signIn(String email, String password){\n mAuth.signInWithEmailAndPassword(email, password)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n // Sign in success, update UI with the signed-in user's information\n FirebaseUser user = mAuth.getCurrentUser();\n textViewStatus.setText(\"Signed In\");\n } else {\n // If sign in fails, display a message to the user.\n Toast.makeText(MainActivity.this, \"Authentication failed.\",\n Toast.LENGTH_SHORT).show();\n textViewStatus.setText(\"Signed Out\");\n }\n\n // ...\n }\n });\n }",
"@Override\n public void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode,resultCode,data);\n\n if (requestCode == RES_CODE_SIGN_IN) {\n GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);\n signInResultHandler(result);\n }\n }",
"public void getGoogleToken() {\n String googleEmail = sharedpreferences.getString(\"GoogleEmail\", \"\");\n String scopes = sharedpreferences.getString(\"GoogleScopes\", \"\");\n if (!\"\".equals(googleEmail)) {\n MyAsyncTask asyncTask = new MyAsyncTask(googleEmail, scopes, this.getBaseContext());\n asyncTask.delegate = this;\n asyncTask.execute();\n }\n }",
"@Override\n public void onLoginGoogle(Activity activity, final ILoginModelListener modelListener) {\n if (NetworkUtils.isNetworkAvailable(activity)){\n GoogleSignInClient mGoogleSignInClient;\n GoogleApiClient googleApiClient;\n GoogleSignInOptions googleSignInOptions= GoogleSignInOptionUtils.getGoogleSignInOptions(activity);\n\n mGoogleSignInClient = GoogleSignIn.getClient(activity,googleSignInOptions);\n\n googleApiClient = new GoogleApiClient.Builder(activity)\n .enableAutoManage((FragmentActivity) activity, new GoogleApiClient.OnConnectionFailedListener() {\n @Override\n public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {\n modelListener.onLoginFailed(\"No Internet\");\n }\n\n })\n\n .build();\n Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(googleApiClient);\n activity.startActivityForResult(signInIntent, LoginActivity.REQUEST_CODE_GOOGLE);\n\n } else {\n modelListener.onLoginFailed(\"No Internet! Please check your connect\");\n }\n }",
"void onSignInButtonClicked();",
"public interface AuthManager {\n\n void signInGoogle(GoogleSignInAccount acct, Subscriber<String> signInSubscriber, CreateUser createUser);\n\n void signOut(Subscriber<String> signOutSubscriber);\n\n boolean isSignedIn();\n\n String getCurrentUserId();\n\n String getCurrentUserEmail();\n\n Uri getPhotoUrl();\n}",
"@Override\n\tpublic void loginGPGS() {\n\t\ttry {\n\t\t\trunOnUiThread(new Runnable() {\n\t\t\t\tpublic void run() {\n\t\t\t\t\tgameHelper.beginUserInitiatedSignIn();\n\t\t\t\t}\n\t\t\t});\n\t\t} catch (final Exception ex) {\n\t\t}\n\n\t}",
"public void run() {\n Intent mInHome = new Intent(MainActivity.this,GoogleLoginActivity.class);\n MainActivity.this.startActivity(mInHome);\n MainActivity.this.finish();\n }",
"void onSignInButtonClicked(String userEmail, String userPassword);",
"private void createRequest() {\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestIdToken(getString(default_web_client_id))\n .requestEmail()\n .build();\n\n mGoogleSignInClient = GoogleSignIn.getClient(Signup.this, gso);\n\n\n }",
"GoogleAuthenticatorKey createCredentials(String userName);",
"@SuppressWarnings(\"UnusedDeclaration\")\n boolean authorizeUser(\n String userName,\n int verificationCode,\n int window)\n throws GoogleAuthenticatorException;"
] | [
"0.7785888",
"0.75681806",
"0.75617373",
"0.75269616",
"0.7520809",
"0.75104624",
"0.7377567",
"0.7339498",
"0.72633374",
"0.72633374",
"0.72633374",
"0.7237999",
"0.723239",
"0.723239",
"0.723239",
"0.723239",
"0.7215158",
"0.71908486",
"0.716748",
"0.71637326",
"0.68581784",
"0.68483835",
"0.68378997",
"0.6813733",
"0.67545724",
"0.67532104",
"0.6615923",
"0.6562522",
"0.6555331",
"0.64985585",
"0.6485983",
"0.64851576",
"0.6473283",
"0.6415679",
"0.640485",
"0.64031905",
"0.6390914",
"0.63779956",
"0.63746834",
"0.6352798",
"0.6347495",
"0.6338583",
"0.6326484",
"0.6316026",
"0.6275326",
"0.6263477",
"0.6255797",
"0.6242781",
"0.6239425",
"0.62350947",
"0.6227001",
"0.6212755",
"0.62026834",
"0.61988336",
"0.6195211",
"0.6193106",
"0.6172495",
"0.6162762",
"0.6155635",
"0.614616",
"0.6126677",
"0.6125879",
"0.61001",
"0.6098003",
"0.60786",
"0.6077016",
"0.60518265",
"0.60180557",
"0.6010051",
"0.59821755",
"0.59765846",
"0.59728223",
"0.59547615",
"0.5950355",
"0.59394634",
"0.5935249",
"0.5913764",
"0.5893095",
"0.5884616",
"0.5876477",
"0.58642125",
"0.58535236",
"0.58274156",
"0.5822046",
"0.58035725",
"0.5796847",
"0.5794657",
"0.5792603",
"0.57614565",
"0.57576025",
"0.57516634",
"0.5748351",
"0.57349664",
"0.57333606",
"0.5718062",
"0.5715674",
"0.57135886",
"0.57003534",
"0.56970364",
"0.5684989"
] | 0.72089493 | 17 |
this method will be running on UI thread pdLoading.dismiss(); | @Override
protected void onPostExecute(String result) {
List<DataPlant> data = new ArrayList<>();
if (!result.equals("failed")) {
try {
JSONArray jArray = new JSONArray(result);
JSONObject user = jArray.getJSONObject(0);
String name = user.getString("name");
String email = user.getString("email");
String uid = user.getString("unique_id");
db.addUser(name, email, uid);
session.setLogin(true);
Toast.makeText(getApplicationContext(), "로그인에 성공했습니다!", Toast.LENGTH_LONG).show();
// db.updatePlant(email);
Log.d("로그인 성공", "1");
Intent intent = new Intent(SignInActivity.this, MainActivity.class);
startActivity(intent);
finish();
} catch (JSONException e) {
// You to understand what actually error is and handle it appropriately
Toast.makeText(getApplicationContext(), e.toString(), Toast.LENGTH_LONG).show();
Toast.makeText(getApplicationContext(), result.toString(), Toast.LENGTH_LONG).show();
}
} else {
Toast.makeText(getApplicationContext(), "로그인에 실패했습니다!", Toast.LENGTH_LONG).show();
// db.updatePlant(email);
Log.d("로그인 실패", "1");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void dismissProgressLoading() {\n if (progressDialog != null) {\n progressDialog.dismiss();\n }\n }",
"protected void dismissLoading()\n {\n progressBar.dismiss();\n }",
"@Override\n public void hideLoading() {\n if (progressDialog!=null && progressDialog.isShowing()){\n progressDialog.dismiss();\n }\n }",
"public void hideLoadingDialog() {\n if (isDestroyingActivity())\n return;\n if (mProgressDialog != null && mProgressDialog.isShowing()) {\n mProgressDialog.dismiss();\n mProgressDialog = null;\n }\n }",
"@Override\n protected void onPreExecute() {\n showLoadingProgressDialog();\n }",
"@Override\n protected void onPreExecute() {\n showLoadingProgressDialog();\n }",
"@Override\n\t\tprotected void onPreExecute() {\n\t\t\tshowLoadingProgressDialog();\n\t\t}",
"@MainThread\n @Override\n protected void onStopLoading() {\n super.onStopLoading();\n cancelLoadHelper();\n }",
"@Override\n protected void onPreExecute() {\n\n pd.setMessage(\"Please Wait....\");\n pd.show();\n pd.setCancelable(false);\n\n }",
"@Override\n protected void onStopLoading() {\n cancelLoad();\n }",
"private void displayLoader() {\n pDialog = new ProgressDialog(AddReviewActivity.this);\n pDialog.setMessage(\"Adding Review...Please wait...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }",
"@Override\n protected void onPreExecute() {\n\n pd1.setMessage(\"Please Wait....\");\n pd1.show();\n pd1.setCancelable(false);\n\n }",
"@Override\nprotected void onStopLoading() {\n cancelLoad();\n }",
"@Override\n protected void onPreExecute() {\n super.onPreExecute();\n loading = ProgressDialog.show(this.context, \"Fetching Data\",\"Please Wait...\",true,true);\n }",
"@Override\n protected void onStopLoading() {\n cancelLoad();\n }",
"@Override\n protected void onStartLoading() {\n progressBar.setVisibility(View.VISIBLE);\n forceLoad();\n }",
"@Override\n\tprotected void onPause() {\n\t\tLog.i(\"lei\", \" LoadingActivity onPause\");\n\t\t//ScreenUtil._progressDialog.dismiss();\n\t\t///ScreenUtil.hideLoading();\n\t\tsuper.onPause();\n\t}",
"private void displayLoader() {\n pDialog = new ProgressDialog(DangKyActivity.this);\n pDialog.setMessage(\"Vui lòng đợi trong giây lát...\");\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n\n }",
"@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pd = new ProgressDialog(activity);\n pd.setMessage(\"Loading, Please Wait.....\");\n pd.setCancelable(false);\n pd.show();\n }",
"public void onStopLoading() {\n boolean cancelLoad = cancelLoad();\n }",
"public void onStopLoading() {\n boolean cancelLoad = cancelLoad();\n }",
"@Override\n\t\tprotected void onPreExecute() {\n\t\t\t// TODO Auto-generated method stub\n\t\t\tsuper.onPreExecute();\n\t\t\tpd = ProgressDialogUtil.createDialogNoTitle(context, \"loading...\");\n\t\t\tpd.show();\n\t\t}",
"public void onStopLoading() {\n cancelLoad();\n }",
"@Override\n\t\t \tprotected void onPreExecute() {\n\t\t try {\n\t\t\t \tpd=new ProgressDialog(Styles_Dialog.this);\n\t\t\t \tpd.setMessage(\"Loading\");\n\t\t\t \tpd.show();\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t\te.printStackTrace();\n\t\t}\n\t\t \t\n\t\t \t}",
"protected final void showLoadingDialog() {\n }",
"@Override\n\t\tprotected void onPreExecute()\n\t\t{\n\t\t\tsuper.onPreExecute();\n\t\t\tpDialog = new ProgressDialog(MainActivity.this);\n\t\t\tpDialog.setMessage(\"Loading....\");\n\t\t\tpDialog.setCancelable(true);\n\t\t\tpDialog.show();\n\t\t}",
"@Override\n protected void onPreExecute() {\n mLytContainerLayout.setVisibility(View.GONE);\n mToolbar.setVisibility(View.GONE);\n mPrgLoading.setVisibility(View.VISIBLE);\n }",
"@Override\n protected void onStopLoading() {\n // Attempt to cancel the current load task if possible.\n cancelLoad();\n }",
"@Override\n protected void onStopLoading() {\n // Attempt to cancel the current load task if possible.\n cancelLoad();\n }",
"@Override\n protected void onStopLoading() {\n // Attempt to cancel the current load task if possible.\n cancelLoad();\n }",
"@Override\n public void hiddenLoading() {\n Log.i(Tag, \"hiddenLoading\");\n }",
"protected void hideLoader() {\n\n if (progressBar != null) {\n progressBar.setVisibility(View.INVISIBLE);\n }\n if(getActivity()!=null) {\n getActivity().getWindow().clearFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE);\n }\n\n }",
"@Override\n\t\tprotected void onPreExecute() {\n\t\t\tpdia = new ProgressDialog(mContext);\n\t\t\tpdia.setMessage(\"Loading...\");\n\t\t\tpdia.show();\n\t\t\tsuper.onPreExecute();\n\t\t}",
"@Override\n protected void onPreExecute() {\n progressDialog= new ProgressDialog(getActivity());\n progressDialog.setMessage(\"loading..\");\n progressDialog.setIndeterminate(false);\n progressDialog.show();\n }",
"@Override\n protected void onPreExecute() {\n\n\n dialog = new ProgressDialog(MainArea.this);\n dialog.setTitle(\"Loading Results\");\n dialog.setMessage(\"Please Wait Results Are Loading For You....\");\n dialog.setCanceledOnTouchOutside(false);\n dialog.show();\n super.onPreExecute();\n }",
"protected void onPreExecute() {\r\n \tdialog = new ProgressDialog(context);\r\n \t\tdialog.setMessage(\"Loading...\");\r\n \t\tdialog.show();\r\n }",
"@Override\n\t\tprotected void onPreExecute() {\n\t\t\tloadingView.setVisibility(View.VISIBLE);\n\t\t}",
"@Override\n protected void onPreExecute() {\n pd = ProgressDialog.show(Events_and_Festivals.this, \"One Moment\", \"Loading Events and Festivals in the Toronto Area ...\", true, false);\n }",
"@Override\r\n\t\tprotected void onPreExecute() {\n\t\t\tpd.setVisibility(View.VISIBLE);\r\n\t\t\t// pd.setCancelable(true);\r\n\t\t\t// pd.setCanceledOnTouchOutside(true);\r\n\t\t\t// pd.setCanceledOnTouchOutside(true);\r\n\t\t}",
"private void dismissProgressIndication() {\n if (mProgressDialog != null && mProgressDialog.isShowing()) {\n try{\n mProgressDialog.dismiss(); // safe even if already dismissed\n }catch(Exception e){\n Log.i(TAG, \"dismiss exception: \" + e);\t\n }\n mProgressDialog = null;\n }\n }",
"private void setLoadingDisplay() {\n if (swipeRefreshing) {\n footer.clear();\n setRefreshing(true);\n } else if (loading) {\n footer.setLoading();\n }\n }",
"public void offProgressDialog(){\n if(dialogProgresIndeterminate != null && dialogProgresIndeterminate.isShowing()){\n dialogProgresIndeterminate.dismiss();\n }\n }",
"private void hideLoading()\n {\n relLoadingPanel.setVisibility(View.GONE);\n ViewHelper.setViewGroupEnabled(scrMainContainer, true);\n }",
"@Override \n\t protected void onStopLoading() {\n\t // Attempt to cancel the current load task if possible.\n\t cancelLoad();\n\t }",
"@Override \n\t protected void onStopLoading() {\n\t // Attempt to cancel the current load task if possible.\n\t cancelLoad();\n\t }",
"@Override\n protected void onPreExecute() {\n super.onPreExecute();\n pDialog = new ProgressDialog(Integrationforkhalti.this);\n pDialog.setMessage(\"Loading Please wait...\");\n pDialog.setIndeterminate(true);\n pDialog.setCancelable(false);\n pDialog.show();\n }",
"@Override\r\n\t\t\t\t\tpublic void onLoadingCancelled(String arg0, View arg1) {\n\t\t\t\t\t}",
"@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tpDialog = new ProgressDialog(activity);\n\t\t\tpDialog.setMessage(\"Loading...\");\n\t\t\tpDialog.setIndeterminate(false);\n\t\t\tpDialog.setCancelable(true);\n\t\t\tpDialog.show();\n\t\t}",
"@Override\n public void onError(Throwable e) {\n uiHelper.dismissLoadingDialog();\n }",
"@Override\n public void onError(Throwable e) {\n uiHelper.dismissLoadingDialog();\n }",
"@Override\n public void onError(Throwable e) {\n uiHelper.dismissLoadingDialog();\n }",
"@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\taProgressDialog = new ProgressDialog(TargetProducts.this);\n\t\t\taProgressDialog.setMessage(\"Loading Report...\");\n\t\t\taProgressDialog.setIndeterminate(true);\n\t\t\taProgressDialog.setCanceledOnTouchOutside(true);\n\t\t\taProgressDialog.show();\n\t\t}",
"@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\taProgressDialog = new ProgressDialog(TargetProducts.this);\n\t\t\taProgressDialog.setMessage(\"Loading Report...\");\n\t\t\taProgressDialog.setIndeterminate(true);\n\t\t\taProgressDialog.setCanceledOnTouchOutside(true);\n\t\t\taProgressDialog.show();\n\t\t}",
"private void hideLoadingAndUpdate() {\n image.setVisibility(View.VISIBLE);\n loadingBar.setVisibility(View.INVISIBLE);\n shareBtn.setVisibility(shareBtnVisibility);\n\n }",
"private void showProgressDialog(){\n progressDialog=ProgressDialog.show(context,\"\",\"Loading...Please wait...\");\n\n\n }",
"@Override\n public void onCancelled(DatabaseError databaseError) {\n progressDialog.dismiss();\n\n }",
"@Override\n public void onCancelled(DatabaseError databaseError) {\n progressDialog.dismiss();\n\n }",
"@Override\n public void onCancelled(DatabaseError databaseError) {\n progressDialog.dismiss();\n\n }",
"@Override\n\t\tprotected void onPreExecute() {\n\t\t\tpdia = new ProgressDialog(mContext);\n\t\t\tpdia.setMessage(\"Loading Circles...\");\n\t\t\tpdia.show();\n\t\t\tsuper.onPreExecute();\n\t\t}",
"@Override\n protected void onPostExecute(String result) {\n super.onPostExecute(result);\n if (pd.isShowing()) {\n pd.dismiss();\n }\n }",
"@Override\n\t\tprotected void onPreExecute() {\n\t\t\tprogressDialog = ProgressDialog.show(MainActivity.this, \"\",\n\t\t\t\t\t\"Loading...\");\n\t\t}",
"protected void showLoading()\n {\n progressBar = new ProgressDialog(this);\n progressBar.setTitle(\"Loading\");\n progressBar.setMessage(\"Wait while loading...\");\n progressBar.setCancelable(false); // disable dismiss by tapping outside of the dialog\n progressBar.show();\n }",
"public void hideProgressDialog() {\r\n\t\trunOnUiThread(new Runnable() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void run() {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tif (progress.isShowing())\r\n\t\t\t\t\t\tprogress.dismiss();\r\n\t\t\t\t} catch (Throwable e) {\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}",
"@Override\n protected void onPreExecute() {\n super.onPreExecute();\n // Show the progress in load\n pDialog = new ProgressDialog(UpdateTimeTable.this);\n pDialog.setMessage(\"Please wait...\");\n pDialog.setCancelable(false);\n pDialog.show();\n \n }",
"@Override\n protected void onPreExecute() {\n super.onPreExecute();\n settLoadingScr.setVisibility(View.VISIBLE);\n\n }",
"@Override\n protected void onPreExecute() {\n super.onPreExecute();\n settLoadingScr.setVisibility(View.VISIBLE);\n\n }",
"@Override\n public Void call(Long aLong) {\n if (mShowLoading) {\n mView.showLoading(true);\n }\n return null;\n }",
"public void startLoading() {\n projects.clear();\n processContainer.setVisibility(View.VISIBLE);\n progressSpinner.setVisibility(View.VISIBLE);\n progressText.setVisibility(View.VISIBLE);\n progressText.setText(\"Getting Items...\"); // Text updated using SetProgress()\n listView.setVisibility(View.GONE);\n }",
"@Override\n\t\t\tpublic void onLoadingCancelled(String imageUri, View view) {\n\t\t\t\tif (progressbar != null)\n\t\t\t\t\tprogressbar.setVisibility(View.GONE);\n\t\t\t}",
"@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\t\t\tpDialog1 = new ProgressDialog(Doctorslist.this);\n\t\t\tpDialog1.setMessage(\"Loading ...\");\n\t\t\tpDialog1.setIndeterminate(false);\n\t\t\tpDialog1.setCancelable(false);\n\t\t\tpDialog1.show();\n\t\t}",
"@Override\n protected void onStartLoading() {\n super.onStartLoading();\n\n mLoadingIndicator.setVisibility(View.VISIBLE);\n\n forceLoad();\n }",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tProfile.this.infolay.setVisibility(View.INVISIBLE);\n\t\t\t\tProfile.this.otherlay.setVisibility(View.VISIBLE);\n\t\t\t\tpd = ProgressDialog.show(Profile.this, \"dowloading\", \"dowloading,please wait……\");\n\n\t\t\t\t new Thread(runnableloadportf).start();\n\n\t\t\t\tsm.toggle();\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tmpProgress = ProgressDialog.show(mContext,\n\t\t\t\t\t\t\t\"Downloading data\",\n\t\t\t\t\t\t\t\"Please wait for a moment...\");\n\t\t\t\t}",
"@Override\r\n protected void onPostExecute(Void result) {\n mProgressDialog.dismiss();\r\n }",
"@Override\r\n\t\tprotected void onPreExecute() {\r\n\t\t\tsuper.onPreExecute();\r\n\t\t\tpDialog = new ProgressDialog(getActivity());\r\n\t\t\tpDialog.setMessage(\"Loading...\");\r\n\t\t\tpDialog.setIndeterminate(false);\r\n\t\t\tpDialog.setCancelable(false);\r\n\t\t\tpDialog.show();\r\n\t\t}",
"private void showLoading() {\n mRecycleView.setVisibility(View.INVISIBLE);\n /* Finally, show the loading indicator */\n mLoadingIndicator.setVisibility(View.VISIBLE);\n }",
"@Override\r\n\t protected void onPreExecute() {\n\t super.onPreExecute();\r\n\t progressDialog = new ProgressDialog(UDMap.this);\r\n\t progressDialog.setMessage(\"Loading the best way...\");\r\n\t progressDialog.setIndeterminate(true);\r\n\t progressDialog.show();\r\n\t }",
"@Override\n\t\t\t\t\tpublic void onLoadingCancelled(String arg0, View arg1) {\n\n\t\t\t\t\t}",
"public void onLoadingComplete() {\n swipeRefreshing = loading = false;\n autoLoadMore = true;\n\n setRefreshing(false);\n\n if (postsAdapter.getCount() == 0) footer.showMessage(NO_POSTS);\n else footer.clear();\n }",
"@Override\n public void onFailure(@NonNull Exception e) {\n Toast.makeText(getApplicationContext(), e.getMessage(), Toast.LENGTH_SHORT).show();\n pd.dismiss();\n }",
"@Override\n\t\t\t\t protected void onPostExecute(Void result)\n\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\tif (progressDialog != null)\n\t\t\t\t\t\t\t\t\t\t\tprogressDialog.dismiss();\n\t\t\t\t }",
"@Override\n protected void onPreExecute() {\n super.onPreExecute();\n mLoadingIndicator.setVisibility(View.VISIBLE);\n }",
"@Override\n public void onLoadingCancelled(String arg0, View arg1) {\n }",
"@Override\n protected void onPreExecute() {\n super.onPreExecute();\n progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progressDialog.setMessage(\"Please wait. Loading...\");\n progressDialog.setCanceledOnTouchOutside(false);\n progressDialog.show();\n }",
"@Override\n protected void onStopLoading() {\n // The Loader is in a stopped state, so we should attempt to cancel the\n // current load (if there is one).\n cancelLoad();\n }",
"@Override\n\t\tprotected void onPreExecute() \n\t\t{\n\t\t\t\n\t\t\tdialog = new ProgressDialog(AddFoodAdvActivity.this);\n\t\t\tdialog.setMessage(\"Loading...\");\n\t\t\tdialog.show();\n\t\t\tsuper.onPreExecute();\n\t\t}",
"@Override\n\t\tprotected void onPreExecute() {\n\t\t\tmyDialog = ProgressDialog.show\n\t\t\t\t\t(\n\t\t\t\t\t\t\tgetActivity(),\n\t\t\t\t\t\t\t\"Loading...\",\n\t\t\t\t\t\t\t\"Please Wait\",\n\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t\t);\n\t\t}",
"@Override\n\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\tprogressBar.setVisibility(View.GONE);\n\t\t\t\t\t\t\t}",
"@Override\n\t\t\t protected void onPostExecute(Void result)\n\t\t\t {\n\t\t\t\t\t\t\t\t\tif (progressDialog != null)\n\t\t\t\t\t\t\t\t\t\tprogressDialog.dismiss();\n\t\t\t }",
"private void dismissProgressDialog() {\n if (mProgressDialog != null && mProgressDialog.isShowing()) {\n mProgressDialog.dismiss();\n }\n }",
"private void progressStuff() {\n cd = new ConnectionDetector(getActivity());\n parser = new JSONParser();\n progress = new ProgressDialog(getActivity());\n progress.setMessage(getResources().getString(R.string.loading));\n progress.setIndeterminate(false);\n progress.setCancelable(true);\n // progress.show();\n }",
"@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tprogressBar.setVisibility(View.GONE);\n\t\t\t\t\t}",
"private void showLoading() {\n hideNoNetwork();\n mRecipesBinding.fragmentRecipesProgressBar.setVisibility(View.VISIBLE);\n }",
"@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n pDialog = new ProgressDialog(Activity_List.this);\n pDialog.setMessage(\"Loading spots. Please wait...\");\n\n pDialog.setIndeterminate(false);\n pDialog.setCancelable(false);\n pDialog.show();\n }",
"@Override\n\t\tprotected void onPreExecute() {\n\t\t\tsuper.onPreExecute();\n\n\t\t\t((Activity) mContext).runOnUiThread(new Runnable() {\n\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\tmpProgress = ProgressDialog.show(mContext,\n\t\t\t\t\t\t\t\"Downloading data\",\n\t\t\t\t\t\t\t\"Please wait for a moment...\");\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t\n\t\t}",
"public void timeout(){\n // close open loading dialogs\n Fragment dialog = getSupportFragmentManager().findFragmentByTag(\"loading\");\n if (dialog != null) {\n loadingDialog.dismiss();\n }\n timeoutDialog.show(getSupportFragmentManager(), \"timeout\");\n }",
"@Override\n protected void onPreExecute() {\n\n dialog = new ProgressDialog(context);\n dialog.setTitle(\"Loading Contents\");\n dialog.setMessage(\"Doing something interesting ...\");\n dialog.setIndeterminate(true);\n dialog.setCancelable(false);\n dialog.show();\n }",
"public void onUnFinishFetching() {\n\t\t\t\thideLoading();\n\t\t\t\tUiApplication.getUiApplication().invokeLater(new Runnable() {\n\t\t\t\t\t\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\tUiApplication.getUiApplication().pushScreen(new HomeScreen());\n\t\t\t\t\t}\n\t\t\t\t});\t\t\t\t\n\t\t\t}",
"@Override\r\n protected void onPreExecute() {\r\n super.onPreExecute();\r\n this.progressDialog = ProgressDialog.show(SelectFBForDGPSActivity.this, \"\", \"Please wait...Your CMV data is downloading\", false);\r\n this.progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);\r\n this.progressDialog.setCancelable(false);\r\n }",
"@Override\n protected void onPreExecute() {\n String msg = \"Please Wait....\";\n cd.showProgressDialog(msg);\n\n }",
"private void showSpinerProgress() {\n dialog.setMessage(\"Loading\");\n//\n// dialog.setButton(ProgressDialog.BUTTON_POSITIVE, \"YES\", new DialogInterface.OnClickListener() {\n// @Override\n// public void onClick(DialogInterface dialog, int which) {\n//\n// }\n// });\n\n //thiet lap k the huy - co the huy\n dialog.setCancelable(false);\n\n //show dialog\n dialog.show();\n Timer timer = new Timer();\n timer.schedule(new TimerTask() {\n @Override\n public void run() {\n dialog.dismiss();\n }\n }, 20000000);\n }"
] | [
"0.7880525",
"0.7809502",
"0.77320045",
"0.7164138",
"0.7132295",
"0.7132295",
"0.7041559",
"0.70284325",
"0.7024391",
"0.7016442",
"0.7006063",
"0.6963137",
"0.69513506",
"0.69509614",
"0.6942039",
"0.6939181",
"0.69222635",
"0.6907603",
"0.69021255",
"0.69000715",
"0.69000715",
"0.688605",
"0.6884662",
"0.6832684",
"0.68082625",
"0.68006235",
"0.67984223",
"0.67980784",
"0.67980784",
"0.67980784",
"0.67893726",
"0.6747344",
"0.67356104",
"0.672466",
"0.6720784",
"0.67201495",
"0.6719322",
"0.6715623",
"0.67144173",
"0.6706923",
"0.67062414",
"0.66946024",
"0.6691812",
"0.6691094",
"0.6691094",
"0.66785836",
"0.6670079",
"0.66555",
"0.6650366",
"0.6650366",
"0.6650366",
"0.66479754",
"0.66479754",
"0.6645542",
"0.66433203",
"0.6641839",
"0.6641839",
"0.6641839",
"0.6624304",
"0.6617647",
"0.6607736",
"0.66032386",
"0.65994644",
"0.65876967",
"0.6585971",
"0.6585971",
"0.65847725",
"0.65768576",
"0.6570974",
"0.65655726",
"0.6559609",
"0.6554765",
"0.6549117",
"0.6548949",
"0.65388876",
"0.65360224",
"0.65283906",
"0.65264004",
"0.6522209",
"0.65219647",
"0.6520933",
"0.6519627",
"0.651885",
"0.6512287",
"0.6508195",
"0.6507324",
"0.64982086",
"0.6495748",
"0.6493107",
"0.64565784",
"0.64556086",
"0.64498556",
"0.6448895",
"0.64435345",
"0.64417624",
"0.64408016",
"0.6437162",
"0.6431449",
"0.64251024",
"0.6420491",
"0.64186203"
] | 0.0 | -1 |
Loads a car to the Ferry | public void load(Car c,int x,int y){
load.load(c,x,y);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void loadCarListings() {\r\n try {\r\n cars = Reader.readCars(new File(CARLISTINGS_FILE));\r\n } catch (IOException e) {\r\n cars = new Cars();\r\n }\r\n }",
"public static void loadcars() {\n Cars xx = new Cars();\n System.out.println(\"Load cars\");\n listcars.clear();\n try {\n File fileload = new File(\"cars.csv\");\n BufferedReader in = new BufferedReader(new FileReader(fileload));\n String st;\n while((st = in.readLine()) != null) {\n String[] strs = st.split(\"[,//;]\");\n addcar(strs[0], strs[1], strs[2],Integer.parseInt(strs[3]));\n }\n in.close();\n System.out.println(\"cars data restored from cars.csv\");\n } catch (IOException i) {\n i.printStackTrace();\n }\n\n\n }",
"public void loadVehicle(Vehicle vehicle) {\n storage.addVehicle(vehicle);\n }",
"Car readCar(String plateNo) throws CarNotFoundException;",
"public void setCar(Car car) {\n this.car = car;\n }",
"public void setCarro(Carro carro) {\n this.carro = carro;\n }",
"public CarEdition() {\n ELContext context = FacesContext.getCurrentInstance().getELContext();\n app = (CarsaleApplication) FacesContext.getCurrentInstance().getApplication().getELResolver().getValue(context, null, \"carsaleApplication\");\n try {\n this.carId = Integer.valueOf(FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get(\"carId\"));\n this.car = searchCar(this.carId);\n } catch (Exception ex) {\n Logger.getLogger(CarDetail.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"public void setCar() {\n\n\t\tint tries = 0;\n\t\tif(type ==RANDOM)\n\t\t{\n\t\t\tfor (int i = 0; i < noOfCarsGenerated; i++) {\n\t\t\t\tCar c = generateRandomCar(Timer.getClock());\n\t\t\t\twhile (c == null){\n\t\t\t\t\ttries++;\n\t\t\t\t\tSystem.out.println(\"i'm null somehow : \" + tries);\n\t\t\t\t\tc = generateRandomCar(Timer.getClock());\n\t\t\t\t}\n\t\t\t\tSimulator.getStations().get(c.getDestination()).addMovingQueue(c);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\telse if (type == FIXED) {\n\t\t\t\n\t\t\tPoint source=Simulator.geoToCor(latitude, longitude);\n\t\t\tString destination=strategy.chooseDestination(source);\n\n\t\t\tfor (int i = 0; i < noOfCarsGenerated; i++) {\n\t\t\t\tCar c = new Car(latitude, longitude, destination, Timer.getClock(), strategy.setChargingTime(source));\n\t\t\t\tc.saveRoute(c.getCarRoute());\n\t\t\t\tSimulator.getStations().get(c.getDestination()).addMovingQueue(c);\n\t\t\t}\n\t\t}\n\n\t\tcurrentNo += noOfCarsGenerated;\n\n\t\tSimulator.updateCarNolbl(noOfCarsGenerated);\n\n\n\t}",
"@Override\n\tpublic void loadCargo() {\n\n\t}",
"public Car(Integer id, String make, String logoFileName, String makeUrl, String model, Integer year, Integer price, Integer mileage, Integer cityMPG, Integer highwayMPG, String engineType, String driveType) {\n this.id = id;\n this.make = make;\n this.logoFileName = logoFileName;\n this.makeUrl = makeUrl;\n this.model = model;\n this.year = year;\n this.price = price;\n this.mileage = mileage;\n this.cityMPG = cityMPG;\n this.highwayMPG = highwayMPG;\n this.engineType = engineType;\n this.driveType = driveType;\n }",
"public Car(String carname) {\n this.carname = carname;\n }",
"@Spawns(\"car\")\n public Entity spawnCar(SpawnData data) {\n PhysicsComponent physics = new PhysicsComponent();\n physics.setBodyType(BodyType.DYNAMIC);\n return entityBuilder()\n .type(CAR)\n .from(data)\n .viewWithBBox(texture(MainMenu.getSelectedCarAsset() , 70, 140))\n .with(new CollidableComponent(true))\n .with(new IrremovableComponent())\n .build();\n }",
"public void load() {\n }",
"public Car getCarById(Integer id){\n\n return this.carCrudInterface.getById(id);\n\n }",
"public void load() ;",
"public Car(String primaryKey, String name, String dealerKey, int year, Category category,\r\n double price, String displacementCC, int maxPower,\r\n String powerRPM, double torqueFtLb, String torqueRPM, DriveTrain driveTrain,\r\n Aspiration aspiration, double length, double width, double height, double weight,\r\n double maxSpeed, double acceleration, double braking, double cornering, double stability) {\r\n this.primaryKey = primaryKey;\r\n this.name = name;\r\n this.manufacturerKey = dealerKey;\r\n this.year = year;\r\n this.category = category;\r\n this.price = price;\r\n this.displacementCC = displacementCC;\r\n this.maxPower = maxPower;\r\n this.powerRPM = powerRPM;\r\n this.torqueFtLb = torqueFtLb;\r\n this.torqueRPM = torqueRPM;\r\n this.driveTrain = driveTrain;\r\n this.aspiration = aspiration;\r\n this.length = length;\r\n this.width = width;\r\n this.height = height;\r\n this.weight = weight;\r\n this.maxSpeed = maxSpeed;\r\n this.acceleration = acceleration;\r\n this.braking = braking;\r\n this.cornering = cornering;\r\n this.stability = stability;\r\n }",
"public void loadVehicles() throws IOException {\n File veFile = new File(VE_FILE);\n\n //Checks is file created\n if (!veFile.exists()) {\n veFile.createNewFile(); //If not, creates new file\n System.out.print(\"The data file vehicles.txt is not exits. \" +\n \"Creating new data file vehicles.txt... \" +\n \"Done!\");\n this.numberOfVehicle = 0; //New data file with the number of Vehicle is 0\n } else {\n //If file is existed, so loading this data file\n System.out.print(\"The data file vehicles.txt is found. \" +\n \"Data of vehicles is loading...\");\n\n //Loads text file into buffer\n try (BufferedReader br = new BufferedReader(new FileReader(VE_FILE))) {\n String line, contractId, type, licensePlate, chassisId, enginesId;\n\n //Reads number of vehicles\n line = br.readLine();\n if (line == null) return;\n this.numberOfVehicle = Integer.parseInt(line);\n\n for (int i = 0; i < this.numberOfVehicle; i++) {\n //Reads Vehicle's information\n contractId = br.readLine();\n type = br.readLine();\n licensePlate = br.readLine();\n chassisId = br.readLine();\n enginesId = br.readLine();\n\n\n //Create new instance of Vehicle and adds to Vehicle bank\n this.vehicles.add(new Vehicle(Integer.parseInt(contractId), type, licensePlate, chassisId, enginesId));\n }\n }\n System.out.print(\"Done!\");\n }\n }",
"public void displayCar()\n\t{\n\t\tSystem.out.println(\"Wheels of car\t:\t\" + objCar.getWheel());\n\t\tSystem.out.println(\"Speed of car\t:\t\" + objCar.getSpeed());\n\t\tSystem.out.println(\"Passengers of car\t:\t\" + objCar.getCarPassengerNumber());\n\t}",
"public void load();",
"public void load();",
"@SneakyThrows\n private void addCar(ActionEvent event) {\n final Project project = table.getSelectionModel().getSelectedItem();\n if (project == null) {\n NotificationUtil.warningAlert(\"Warning\", \"Select project first\", NotificationUtil.SHORT);\n return;\n }\n final FXMLLoader fxmlLoader = new FXMLLoader();\n fxmlLoader.setLocation(getClass().getResource(\"/entity/EditCarList.fxml\"));\n final Parent parent = fxmlLoader.load();\n EditCarListController editCarListController = fxmlLoader.getController();\n editCarListController.loadCars(project);\n final Stage stage = new Stage();\n stage.setTitle(\"Patriot Defence\");\n Scene value = new Scene(parent);\n value.getStylesheets().add(\"css/main.css\");\n stage.setScene(value);\n stage.initModality(Modality.WINDOW_MODAL);\n Window window = ((Node) event.getSource()).getScene().getWindow();\n stage.initOwner(window);\n stage.show();\n\n stage.setOnHiding(e -> loadProjects());\n }",
"public Car() {\n\t\t\tmake = \"GM\";\n\t\t\tyear = 1900;\n\t\t\tmileage= 0;\n\t\t\tcarCost = 0;\n\t\t}",
"@Override\r\n public void initialize(URL url, ResourceBundle rb) {\r\n // TODO\r\n vehicleType = \"CAR\";\r\n VehicleCtrl vehicleControl = new VehicleCtrl();\r\n ObservableList<String> list = FXCollections.observableArrayList(vehicleControl.getCarType());\r\n VehicleClassCB.getItems().clear();\r\n VehicleClassCB.setItems(list);\r\n }",
"public void locateParkedCar() {\n\t\tthis.generalRequest(LocalRequestType.LOCATE);\n\t}",
"@Override\n public void addCar(Car car) {\n if (inDock) {\n transporter.addCar(car, this);\n } else {\n throw new IllegalStateException(\"The ferry is not in a harbour\");\n }\n }",
"private void load() {\n Uri poiUri = Uri.withAppendedPath(Wheelmap.POIs.CONTENT_URI_POI_ID,\r\n String.valueOf(poiID));\r\n\r\n // Then query for this specific record:\r\n Cursor cur = getActivity().managedQuery(poiUri, null, null, null, null);\r\n\r\n if (cur.getCount() < 1) {\r\n cur.close();\r\n return;\r\n }\r\n\r\n cur.moveToFirst();\r\n\r\n WheelchairState state = POIHelper.getWheelchair(cur);\r\n String name = POIHelper.getName(cur);\r\n String comment = POIHelper.getComment(cur);\r\n int lat = (int) (POIHelper.getLatitude(cur) * 1E6);\r\n int lon = (int) (POIHelper.getLongitude(cur) * 1E6);\r\n int nodeTypeId = POIHelper.getNodeTypeId(cur);\r\n int categoryId = POIHelper.getCategoryId(cur);\r\n\r\n NodeType nodeType = mSupportManager.lookupNodeType(nodeTypeId);\r\n // iconImage.setImageDrawable(nodeType.iconDrawable);\r\n\r\n setWheelchairState(state);\r\n // nameText.setText(name);\r\n\r\n String category = mSupportManager.lookupCategory(categoryId).localizedName;\r\n // categoryText.setText(category);\r\n nodetypeText.setText(nodeType.localizedName);\r\n commentText.setText(comment);\r\n addressText.setText(POIHelper.getAddress(cur));\r\n websiteText.setText(POIHelper.getWebsite(cur));\r\n phoneText.setText(POIHelper.getPhone(cur));\r\n\r\n /*\r\n * POIMapsforgeOverlay overlay = new POIMapsforgeOverlay();\r\n * overlay.setItem(name, comment, nodeType, state, lat, lon);\r\n * mapView.getOverlays().clear(); mapView.getOverlays().add(overlay);\r\n * mapController.setCenter(new GeoPoint(lat, lon));\r\n */\r\n }",
"private void displayCarData() {\n\t\tmHeaderText.setText(mCar.getBrand() + \" \" + mCar.getModel());\n\t\tmBrandText.setText(mCar.getBrand());\n\t\tmModelText.setText(mCar.getModel());\n\t\tmColorText.setText(mCar.getColor());\n\t\tmSeatsText.setText(String.valueOf(mCar.getNSeats()));\n\t\tmPlateText.setText(mCar.getPlate());\n\t\tmFuelText.setText(mCar.getCarFuel().name());\n\t\tmConsumptionText.setText(String.valueOf(mCar.getConsumptionPerKm()));\n\t}",
"public Car() {\n super();\n }",
"public void load() {\n\t}",
"public addcar() {\n initComponents();\n }",
"public Car(){\n\t\t\n\t}",
"public Car() {\r\n super();\r\n }",
"@Override\r\n\tpublic int carOpen() throws Exception{\n\t\tIFTESTDao dao = new IFTESTDao();\r\n\t\treturn dao.openCar();\r\n\t}",
"public abstract void load();",
"public static void carlist() {\n Cars xx = new Cars();\n System.out.println(\"You have \" + String.valueOf(listcars.size())+ \" cars\");\n System.out.println(\"List of all your cars \");\n for (int i = 0; i < listcars.size();i++) {\n xx = listcars.get(i);\n System.out.println(xx.getBrand()+ \" \"+ xx.getModel()+ \" \"+ xx.getReference()+ \" \"+ xx.getYear()+ \" \");\n }\n }",
"public void load() {\n handleLoad(false, false);\n }",
"public Carrier() {\n }",
"public Car () {\n\n Make = \"\";\n Model = \"\";\n Year = 2017;\n Price = 0.00;\n }",
"public Object loadResource(CameraRecord record);",
"@Override\r\n\tpublic void start() {\n\t\tSystem.out.println(\"Car Started\");\r\n\t}",
"public void load(BusIfc bus)\n {\n tenderCargo = (TenderCargo) bus.getCargo();\n }",
"private void initialize() {\n SystemManager.get(this);\n SystemManager.add(new PlayerInputSystem(this, win.getInputHandler()));\n SystemManager.add(new PhysicSystem(this, win.getDimension()));\n SystemManager.add(new RenderSystem(this));\n\n World world = new World(new Vector2D(0.0f, 98.1f));\n theCar = new Car(\"car\");\n\n theCar.setPosition(new Vector2D(win.getWidth() * 0.5f, win.getHeight() * 0.5f))\n .setSize(new Rectangle(50, 20))\n .setVelocity(new Vector2D(0.0f, 0.0f))\n .setResistance(0.90f)\n .setMass(2000.0f)\n .setWorld(world);\n\n add(theCar);\n }",
"public void Enter(Car car) {\n\t\tcurrentCar = car;\n\t\tcar.curVelocity=car.maxVelocity;\n\t\tArrayList <Road> tempList = new ArrayList<Road>();\n\t\tfor(int i=0; i<roads.size(); i++){\n\t\t\tif(roads.get(i).roadClosed){\n\t\t\t\ttempList.add(null);\n\t\t\t\t//System.out.println(\"road closed\");\n\t\t\t\t//System.out.println(roads.get(i).getStart() + \", \" + roads.get(i).getEnd());\n\t\t\t}\n\t\t\telse if(roads.get(i).direction == i){\n\t\t\t\ttempList.add(roads.get(i));\n\t\t\t}\n\t\t\telse{\n\t\t\t\ttempList.add(null);\n\t\t\t}\n\n\t\t}\n\t\tnextDir = currentCar.getNextDirection(tempList);\n\t}",
"@SuppressWarnings(\"unchecked\")\n\tprivate void initialize() {\n\t\tbookCarSavedData = getSharedPreferences(\n\t\t\t\tgetResources().getString(R.string.bookedCarSharedPreference),\n\t\t\t\tMODE_PRIVATE);\n\n\t\tgson = new Gson();\n\n\t\teditor = bookCarSavedData.edit();\n\n\t\tString bookedCar = bookCarSavedData.getString(\"bookedCars\", null);\n\n\t\tif (bookedCar != null) {\n\n\t\t\tType type2 = new TypeToken<ArrayList<BookedCar>>() {\n\t\t\t}.getType();\n\n\t\t\tObject obj = gson.fromJson(bookedCar, type2);\n\n\t\t\tbookedCars = (ArrayList<BookedCar>) obj;\n\n\t\t\tcarList = (ListView) findViewById(R.id.bookedCarList);\n\t\t\tadapter = new BookedCarListAdapter(BookedCarsActivity.this,\n\t\t\t\t\tR.layout.booked_car_list_item, bookedCars);\n\n\t\t\tcarList.setAdapter(adapter);\n\n\t\t}\n\n\t}",
"public boolean load( Conge conge ) ;",
"public Car() {\n }",
"public void add (Car car){\n\t\t}",
"public Car() {\n }",
"public CarResource() {\n }",
"public Car findCarByName(String name){\r\n return repository.findCarByName(name);\r\n }",
"@Override\r\n\tpublic void load() {\n\t}",
"public static void load() {\n }",
"@RequestMapping(value = \"/cars/{id}\", method=RequestMethod.GET)\n\tpublic Car getCar(@PathVariable int id) {\n\t\tCar aCar = _carDao.findById(id);\n\t\t\n\t\treturn aCar;\n\t}",
"void load();",
"void load();",
"@Override\n public void load() {\n }",
"protected void instantiateEJB() throws java.rmi.RemoteException, javax.ejb.FinderException, javax.naming.NamingException {\n if ( ejbRef() != null )\n return;\n\n com.hps.july.persistence.CarKey key = keyFromFields(initKey_car);\n ejbRef = ejbHome().findByPrimaryKey(key);\n }",
"@Override\r\n\tprotected void load() {\n\t\t\r\n\t}",
"public CarShowroom() {\n initialiseShowroom();\n calculateAveragePrice();\n setOldestCar();\n getPriciestCar();\n }",
"private void loadDetails() {\n TextView tvName = (TextView) findViewById(R.id.tvPropertyName);\n TextView tvAddress = (TextView) findViewById(R.id.tvFullAddress);\n TextView tvCategory = (TextView) findViewById(R.id.tvPropCategory);\n TextView tvSize = (TextView) findViewById(R.id.tvRoomSize);\n TextView tvPrice = (TextView) findViewById(R.id.tvPropPrice);\n\n tvName.setText(name);\n tvAddress.setText(address);\n tvCategory.setText(category);\n tvSize.setText(size + \"m2\");\n tvPrice.setText(\"R\" + price + \".00 pm\");\n getImage();\n }",
"private void loadCard(String cardName) {\n // TODO = load more types of card\n Card card = world.loadCard(cardName);\n onLoad(card);\n }",
"public void start() {\r\n\t\tSystem.out.println(\"start the car\");\r\n\t}",
"@Override\n public void load() {\n }",
"public CarExternalizable() {\n System.out.println(\"in carExternalizable\");\n }",
"public void load(BusIfc bus)\n {\n // retrieve cargo from the parent\n super.load(bus);\n saleCargo = (SaleCargoIfc)bus.getCargo();\n }",
"public Car (String color, int wheels, double speed)\n {\n this.color = color;\n this.wheels = wheels;\n this.speed = speed;\n }",
"public Carro getCarro() {\n return carro;\n }",
"public void mount(CarrierEntity carrier);",
"private void findVehicle(RoutingContext routingContext) {\n var vehicleId = routingContext.pathParam(\"id\");\n // Find it in the registry. The Node#withBlockchainData provides\n // the required context with the current, immutable database state.\n var vehicleOpt = node.withBlockchainData(\n (blockchainData) -> service.findVehicle(vehicleId, blockchainData));\n if (vehicleOpt.isPresent()) {\n // Respond with the vehicle details\n var vehicle = vehicleOpt.get();\n routingContext.response()\n .putHeader(\"Content-Type\", \"application/octet-stream\")\n .end(Buffer.buffer(vehicle.toByteArray()));\n } else {\n // Respond that the vehicle with such ID is not found\n routingContext.response()\n .setStatusCode(HTTP_NOT_FOUND)\n .end();\n }\n }",
"public void Car(String ownerName, Image itemImg, float itemPrice) \n\t{\n name = ownerName;\n img = itemImg;\n price = itemPrice;\n\t}",
"@Override\n\tprotected void load() {\n\t\t\n\t}",
"@Override\n\tprotected void load() {\n\t\t\n\t}",
"@Override\n\tprotected void load() {\n\t\t\n\t}",
"@Override\n\tpublic void showCarDialog(View v) {\n\t\tDialogFragment carDialog = CarDialog\n\t\t\t\t.newInstance(new Car()\n\t\t\t\t\t\t.newInstance(uclm.esi.cardroid.data.ice.Car\n\t\t\t\t\t\t\t\t.extractObject(mCar)));\n\t\tcarDialog.show(getSupportFragmentManager(),\n\t\t\t\tCarDialog.class.getSimpleName());\n\t}",
"private static void load(){\n }",
"@Override\r\n\tpublic void load() {\n\r\n\t}",
"public void setCarCode(String carCode)\r\n {\r\n this.carCode = carCode;\r\n }",
"private void saveRaceCar() {\n if(Storage.getSelectedRaceCar() == null){\n RaceCar raceCar = new RaceCar(\n Storage.getNewId(),\n Double.valueOf(cornerWeightFLInput.getText()),\n Double.valueOf(cornerWeightFRInput.getText()),\n Double.valueOf(cornerWeightRLInput.getText()),\n Double.valueOf(cornerWeightRRInput.getText())\n );\n setRaceCarDefaultsToValues(raceCar);\n Storage.addRaceCar(raceCar);\n Storage.setSelectedRaceCar(raceCar);\n }else{\n RaceCar raceCar = Storage.getSelectedRaceCar();\n raceCar.setCornerWeightFL(Double.valueOf(cornerWeightFLInput.getText()));\n raceCar.setCornerWeightFR(Double.valueOf(cornerWeightFRInput.getText()));\n raceCar.setCornerWeightRL(Double.valueOf(cornerWeightRLInput.getText()));\n raceCar.setCornerWeightRR(Double.valueOf(cornerWeightRRInput.getText()));\n setRaceCarDefaultsToValues(raceCar);\n Storage.replaceRaceCar(raceCar);\n Storage.setSelectedRaceCar(raceCar);\n }\n }",
"public String getCarid() {\n return carid;\n }",
"public void load() throws ClassNotFoundException, IOException;",
"@Override\n public void load() throws IOException, ClassNotFoundException {\n \n }",
"@Override\n\tprotected void load() {\n\n\t}",
"@Override\n\tprotected void load() {\n\n\t}",
"@Override\n public void initialize(URL url, ResourceBundle rb) {\n this.rb = rb;\n /*\n * 1. Cargar las opciones de la biblioteca\n * 2. Cargar las playlist del usuario \n * 3. Agregar menu contextual a la lista de listas de reproducción\n */\n\n agregarOpciones();\n listas = obtenerPlaylist(usuario.getCorreo());\n cargarPlaylist(listas);\n addContextMenu(listPlaylist);\n controllerCola = new ModColaController();\n\n drawerCola.setOnDrawerClosed(event -> {\n drawerCola.toBack();\n });\n\n try {\n FXMLLoader loader = new FXMLLoader(getClass().getResource(\"/presentacion/vistas/modCola.fxml\"), rb);\n loader.setController(controllerCola);\n AnchorPane pane = loader.load();\n pane.setStyle(\"-fx-background-color: transparent\");\n drawerCola.setSidePane(pane);\n drawerCola.setStyle(\"-fx-background-color: transparent\");\n } catch (IOException ex) {\n Logger.getLogger(IUReproductorController.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"public void setCarList(List<VehicleVO> carList) {\n this.carList = carList;\n }",
"@Override\r\n\tpublic void initialLoad() throws IOException {\n\t\t\r\n\t}",
"public void loadBook() {\n List<Book> books = new ArrayList<>();\n for (int i = 0; i < 5; i++) {\n Book book = new Book(\"Book-\" + i, \"Test book \" + i);\n books.add(book);\n }\n this.setBooks(books);\n }",
"public void load(BusIfc bus)\n {\n // load financial cargo\n super.load(bus);\n\n // retrieve cargo from the parent\n saleCargo = (SaleCargoIfc)bus.getCargo();\n\n }",
"public void load(Cell cell) {\n // Double-check we're dealing with a Room.\n if(cell.isConnectible()) {\n // Get the data we need from the CellPanel.\n //this.colorChooserButton.setBackground(cellPanel.getBackground());\n this.colorChooserButton.setBackground(cell.getColor());\n // Load the Room.\n Room room = (Room)cell.getEntity();\n loadRoom(room);\n }\n }",
"@Override\n\tpublic Carpo findCar(String id) {\n\t\treturn inList.find(id);\n\t}",
"public void setCarNo(String carNo) {\n this.carNo = carNo;\n }",
"public abstract void load() throws IOException;",
"private void reloadShoppingCarTable() {\n\t\t\r\n\t}",
"public static URL getUrlForAddCar()\r\n {\r\n String strUrl = getBaseURL() +\"account_services/api/1.0/vehicle\";\r\n return str2url( strUrl );\r\n }",
"@Override\n public void onCarsLoaded(List<Car> cars) {\n if (!mCarsView.isActive()) {\n Log.i(\"CARS PRESENTER\", \"CARS VIEW IS INACTIVE\");\n return;\n }\n\n if (showLoadingUI) {\n mCarsView.setLoadingIndicator(false);\n }\n\n if (cars.isEmpty()) {\n mCarsView.showNoCarsPlaceholder();\n } else {\n mCarsView.showCarList(cars);\n }\n }",
"public void load(String name) {\n\tSetupLoader.load(board, name);\n\tgb.init();\n\ttsp.init();\n\tcols = gb.getCols();\n\trows = gb.getRows();\n\n\tssp.setBoardDimensions(cols, rows);\n\tgetPromotionListModel().load(board.getPromotionList());\n\n\tgb.update();\n }",
"public ElectricCar(String mfr, String color, Model model, Vehicle.PowerSource power, \n\t\t double safety, int range, boolean awd, int price, int rch,String batteryType, int VIN)\n{\n\t super(mfr, color, model, Vehicle.PowerSource.ELECTRIC_MOTOR, safety, range, awd, price, VIN);\n\t rechargeTime = rch;\n\t batteryType = \"Lithium\";\n}",
"public Car findCarById(int id) {\r\n return repository.findById(id).orElse(null);\r\n }",
"@PostConstruct\n public void loaddata() throws IOException {\n File file = ResourceUtils.getFile(configProvider.getFilePath());\n Reader in = new FileReader(file.getPath());\n Iterable<CSVRecord> records = CSVFormat.RFC4180.withHeader(\n \"locationid\", \"Applicant\", \"FacilityType\", \"cnn\", \"LocationDescription\", \"Address\", \"blocklot\", \"block\", \"lot\",\n \"permit\", \"Status\", \"FoodItems\", \"X\", \"Y\", \"Latitude\", \"Longitude\", \"Schedule\",\n \"dayshours\", \"NOISent\", \"Approved\", \"Received\", \"PriorPermit\", \"ExpirationDate\",\n \"Location\", \"Fire Prevention Districts\", \"Police Districts\",\n \"Supervisor Districts\", \"Zip Codes\", \"Neighborhoods (old)\"\n ).parse(in);\n\n Iterator<CSVRecord> iterator = records.iterator();\n iterator.next();\n // use our own ids because of how atomic integers work, we can't have a 0 for an id, so can't rely on outside sources.\n int i = 0;\n while (iterator.hasNext()) {\n CSVRecord record = iterator.next();\n FoodTruck truck = new FoodTruck(Float.parseFloat(record.get(\"Latitude\")), Float.parseFloat(record.get(\"Longitude\")),\n record.get(\"Address\"), record.get(\"FoodItems\"), ++i);\n //add food truck to datastore\n truckDataStore.addTruck(truck.getId(), truck);\n\n final Rectangle rect = new Rectangle(truck.getLat(), truck.getLon(),\n truck.getLat(), truck.getLon());\n //add food truck location + id to location data store.\n locationDataStore.getSpatialIndex().add(rect, truck.getId());\n }\n }",
"public void carDetails() {\n\t\t\r\n\t}"
] | [
"0.70054096",
"0.6579211",
"0.65090704",
"0.6258298",
"0.6019164",
"0.5994747",
"0.5905497",
"0.5856855",
"0.5839447",
"0.57950693",
"0.5772358",
"0.56232",
"0.56106156",
"0.56019634",
"0.55992895",
"0.55788887",
"0.5574516",
"0.5564074",
"0.55545354",
"0.55545354",
"0.55429536",
"0.55394465",
"0.55345523",
"0.5527207",
"0.55137414",
"0.55052185",
"0.55029285",
"0.5501887",
"0.550158",
"0.55005956",
"0.5496974",
"0.5496173",
"0.54712975",
"0.54434997",
"0.5438408",
"0.54328537",
"0.54267174",
"0.54220474",
"0.5411861",
"0.54053843",
"0.53987855",
"0.5385516",
"0.53617936",
"0.5351863",
"0.5349198",
"0.5346069",
"0.5345581",
"0.53450376",
"0.5324074",
"0.5320993",
"0.5313119",
"0.5310784",
"0.53095603",
"0.5302987",
"0.5302987",
"0.5297451",
"0.52804697",
"0.5279532",
"0.5276091",
"0.52724594",
"0.5265792",
"0.5264617",
"0.5263201",
"0.5257424",
"0.52534497",
"0.5250408",
"0.5240698",
"0.5235543",
"0.52255774",
"0.5225488",
"0.5219596",
"0.5219596",
"0.5219596",
"0.52148837",
"0.52021575",
"0.51953006",
"0.5186159",
"0.518591",
"0.5167706",
"0.515999",
"0.51590115",
"0.51540214",
"0.51540214",
"0.51514614",
"0.51506656",
"0.51480246",
"0.51397604",
"0.513268",
"0.5130173",
"0.5125002",
"0.51237977",
"0.5123776",
"0.51232696",
"0.5122259",
"0.51178974",
"0.51176053",
"0.51157385",
"0.51145864",
"0.51130074",
"0.5111005"
] | 0.68462306 | 1 |
Unloads a car from the Ferry FIFO | public void unload(){
load.unloadFirst();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void btnUnparkActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUnparkActionPerformed\n if(CbCarList.getSelectedItem() == null){\n alertWindow.output(\"There are no cars to unpark.\");\n } else { \n Car thisCar = (Car) CbCarList.getSelectedItem();\n unparkCar(thisCar);\n inTerminalGUI.getParkingLotCarList().remove(CbCarList.getSelectedItem());\n CbCarList.removeItem(CbCarList.getSelectedItem());\n }\n }",
"void removeRocket(RocketDTO rocket);",
"private final void unparkCar(Car car){\n inTerminalGUI.unparkCar(car);\n }",
"public void remove(Car car){\n\t\t}",
"public void remove(RWDCar car) {\n game.removePlayer(car);\n }",
"@Override\n public Car removeCar() {\n Car car = null;\n if (inDock) {\n car = transporter.removeCar(true, this);\n }\n return car;\n }",
"@Override\r\n\tpublic int removeCar(int serial) throws DataAccessException {\n\t\treturn 0;\r\n\t}",
"void removeFlight(Flight flight);",
"public void unregisterCar(Car car, Lane registeredLane) {\n if (!waitingCarsForLaneCorrespondences.containsKey(registeredLane)) {\n throw new NullPointerException(\"Trying to unregister from a lane that is not connected\");\n } else if (!waitingCarsForLaneCorrespondences.get(registeredLane).contains(car)) {\n throw new NullPointerException(\"Trying to unregister a car that wasn't registered\");\n } else {\n waitingCarsForLaneCorrespondences.get(registeredLane).remove(car);\n priorityQueue.remove(car);\n }\n }",
"private void removeYourCar(Car user) {\r\n\r\n cars.removeCar(user);\r\n checkCarIsListed(user);\r\n }",
"public void refill(Car car){\n this.gasAmount -= car.capacity;\n System.out.println(gasAmount);\n }",
"public void removeCar(Car usedCar) {\n boolean wasRemoved = cars.remove(usedCar);\n // subtracts usedCar value to adjust totalValue if car removed\n if (wasRemoved) {\n totalValue -= usedCar.getPrice();\n }\n else {\n System.out.println(\"Car was not in lot.\");\n }\n }",
"public static void removecar(String ref) {\n Cars xx = new Cars();\n System.out.println(\"remove car\");\n String target = ref.toUpperCase();\n int gotit = 0;\n for (int i = 0; i<listcars.size();i++) {\n xx = listcars.get(i);\n String record = xx.getReference().toUpperCase();\n if(record.equals(target)) {\n System.out.println(\"car found !\");\n //test si loc en cour\n listcars.remove(i);\n System.out.println(\"car is successfully deleted ! \");\n gotit = 1;\n }\n }\n\n }",
"public void unScheduleItem(IItem item, BankFusionEnvironment env) {\n removeItem(item);\n }",
"void delistResource(ExoResource xares) throws RollbackException, SystemException;",
"public Vehicle unloadLastVehicle() {\n return storage.removeVehicleBack();\n }",
"public void unregisterWithMasterServer() {\n //register the shipper in the master database\n Message addressMsg = new Message();\n Message unregisterMsg = new Message();\n\n //create a new register message to tell master server that this carrier\n //is now active\n unregisterMsg.setMessageType(MessageTags.UnregisterTag);\n unregisterMsg.addArgument(MessageTags.AgentTypeTag, CarrierMessage);\n\n //create a message containing the address of this carrier for use by the\n //master server\n addressMsg.setMessageType(InetAddressTag);\n\n addressMsg.addArgument(MessageTags.IPAddressTag, carrierIP);\n addressMsg.addArgument(MessageTags.PortNumberTag,\n Integer.toString(carrierPort));\n unregisterMsg.addArgument(addressMsg);\n\n //the message is to be sent to the master server\n // read message from open socket\n // parse message and return port no.\n try {\n logWriter.writeLog(\"Unregistering carrier\");\n new ThreadedClient(unregisterMsg, HermesGlobals.masterServerIP,\n this.myMasterPort);\n } catch (Exception ex) {\n System.err.print(\"Carrier unable to unregister: \" + ex);\n logWriter.writeLog(\"Carrier unable to unregister: \" + ex);\n }\n\n jbRegister.setEnabled(true);\n }",
"public void unmountObb(\n String rawPath, boolean force, IObbActionListener token, int nonce)\n throws RemoteException {\n Parcel _data = Parcel.obtain();\n Parcel _reply = Parcel.obtain();\n try {\n _data.writeInterfaceToken(DESCRIPTOR);\n _data.writeString(rawPath);\n _data.writeInt((force ? 1 : 0));\n _data.writeStrongBinder((token != null ? token.asBinder() : null));\n _data.writeInt(nonce);\n mRemote.transact(Stub.TRANSACTION_unmountObb, _data, _reply, 0);\n _reply.readException();\n } finally {\n _reply.recycle();\n _data.recycle();\n }\n }",
"public void remove(Car c){\n\t\tthis.cars.remove(c);\n\t}",
"public void removeCar(View v) {\n\t\tQueryListener carRemoved = new QueryListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onError() {\n\t\t\t\tToast.makeText(CarDetailsActivity.this, R.string.updateError,\n\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onDataChange(double data, boolean saved) {\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onDataChange(boolean data, boolean saved) {\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onDataChange(ObjectPrx data, boolean saved) {\n\t\t\t\tif (saved) {\n\t\t\t\t\tUserTypPrx user = _sessionController.getMyUser();\n\t\t\t\t\tList<CarTypPrx> userCars = user.getUserCars();\n\t\t\t\t\tfor (int n = 0; n < userCars.size(); n++)\n\t\t\t\t\t\tif (userCars.get(n).getPlate().equals(mCar.getPlate()))\n\t\t\t\t\t\t\tuserCars.remove(n);\n\t\t\t\t\tuser.setUserCars(userCars);\n\t\t\t\t\tToast.makeText(CarDetailsActivity.this,\n\t\t\t\t\t\t\tR.string.dataUpdated, Toast.LENGTH_SHORT).show();\n\t\t\t\t\tfinish();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onDataChange(QueryModel data, boolean saved) {\n\t\t\t}\n\t\t};\n\t\t_sessionController.removeCarPlateEmail(carRemoved, mCar.getPlate(),\n\t\t\t\t_sessionController.getMyLogin());\n\t}",
"@Override\n public void onArmUnsync(Myo myo, long timestamp) {\n\n }",
"public void removeVehicle() {\n\t\tmVehicles.removeFirst();\n\t}",
"@Override\n public void unstall() {\n registers.get(rdIndex).unstall(id);\n }",
"public void unget() {}",
"public void removePresentCard() {\n storageCards.remove();\n }",
"public void removeRefFromBasket(Reference ref, String basketID){\n Basket b = query.getBasket(basketID);\n Command c = new RemoveRefCommand(ref,b,rep);\n gateway.pushCommand(c);\n // b.deleteRefFromBasket(ref);\n // rep.save(b); //write\n }",
"public void Kill(){\n this.dead.getAndSet(true);\n if(this.registry != null){\n try {\n UnicastRemoteObject.unexportObject(this.registry, true);\n } catch(Exception e){\n System.out.println(\"None reference\");\n }\n }\n }",
"public void unload(BusIfc bus)\n {\n super.unload(bus);\n SellOrderItemCargo cargo = (SellOrderItemCargo) bus.getCargo();\n\n\n cargo.setRegister(processOrderCargo.getRegister());\n\n cargo.setPLUItemID(processOrderCargo.getCurrentExternalOrderItem().getPOSItemId());\n cargo.setPLUItem(processOrderCargo.getCurrentExternalOrderItem().getPLUItem());\n cargo.setTransaction(processOrderCargo.getTransaction());\n cargo.setStoreStatus(processOrderCargo.getStoreStatus());\n cargo.setOperator(processOrderCargo.getOperator());\n cargo.setCustomerInfo(processOrderCargo.getCustomerInfo());\n cargo.setTenderLimits(processOrderCargo.getTenderLimits());\n cargo.setItemList(processOrderCargo.getCurrentExternalOrderItem().getPLUItems());\n cargo.setSalesAssociate(processOrderCargo.getSalesAssociate());\n cargo.setExternalOrder(processOrderCargo.getExternalOrder());\n cargo.setExternalOrderItem(processOrderCargo.getCurrentExternalOrderItem());\n cargo.setPasswordRequired(processOrderCargo.isPasswordRequired());\n }",
"public void remove(Vehicle vehicle) {\n\t\tvehicles.remove(vehicle);\n\n\t}",
"public void unmountObb(String rawPath, boolean force, IObbActionListener token, int nonce)\n throws RemoteException;",
"@Override\n public UntagResourceResult untagResource(UntagResourceRequest request) {\n request = beforeClientExecution(request);\n return executeUntagResource(request);\n }",
"@Override\n public UntagResourceResult untagResource(UntagResourceRequest request) {\n request = beforeClientExecution(request);\n return executeUntagResource(request);\n }",
"@Override\n public UntagResourceResult untagResource(UntagResourceRequest request) {\n request = beforeClientExecution(request);\n return executeUntagResource(request);\n }",
"public void remove(Load load){\n\t\t}",
"void decoller();",
"public void unsetComparesource()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_element(COMPARESOURCE$2, 0);\r\n }\r\n }",
"public void remove(String ID) {\n\t\tif (load.size() == 0)\n\t\t\tSystem.out.println(\"\tERROR: Boxcar is empty\");\n\t\telse {\n\t\t\t\n\t\t\t//searches load for correct id\n\t\t\tfor (int i = 0; i < load.size(); i++) {\n\t\t\t\t\n\t\t\t\tif (load.get(i).getID().equals(ID)) {\n\t\t\t\t\t\n\t\t\t\t\tload.remove(i);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"\tERROR: Invalid item id, item not found\");\n\t\t}\n\t}",
"UntagResourceResult untagResource(UntagResourceRequest untagResourceRequest);",
"@Override\n\tpublic ResultMessage deleteCar(String id) {\n\t\treturn inList.delete(id);\n\t}",
"public void Unsubscribe(Integer busLineID, final ConfigurationActivity configurationActivity) { //unsubscribe antoistoixi gia ena buslineid\n subscribedLists.remove(busLineID);\n Client client = subscribedThreads.get(busLineID);\n\n Message message = MapsActivity.mainHandler.obtainMessage();\n message.what = 6;\n message.obj = busLineID;\n MapsActivity.mainHandler.sendMessage(message);\n\n configurationActivity.runOnUiThread(new Runnable() {\n @Override\n public void run() {\n configurationActivity.updateGUI();\n }\n });\n\n Socket socket = subscribedSockets.get(busLineID);\n try {\n socket.close();\n } catch (IOException e) {\n }\n }",
"public void cancelFlight(){\n \n Flight flightObject = FlightRepository.getFlight(this.number);\n if (flightObject == null){\n System.out.println(\"Please select a valid flight number\");\n }\n flightObject.removePassengerSeat(this.PassengerID);\n }",
"public void unload() {\n releasePressureToReturn();\n releasePressureToShooter();\n latch(false);\n// reloaded = false;\n }",
"public void ejectTicket(){if(this.inProgress()){this.currentTicket=null;}}",
"public void removeClockFromStock(Clock removedClock);",
"public void eliminarReceiver(Long id){\r\n persistence.remove(id);\r\n }",
"void unsubscribe();",
"@Override\r\n public void delete(Vehicle vehicle) {\n }",
"public void removeVehicle () {\n\t\t\n\t\tfor(int i = 0; i <= vehicles.size(); i++) {\n\t\t\t\n\t\t\tif(vehicles.get(i) instanceof Car) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse if(vehicles.get(i) instanceof Motorcycle) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse if(vehicles.get(i) instanceof Bus) {\n\t\t\t\tvehicles.remove(i); \n\t\t\t}\n\t\t\t\n\t\t}\n\t}",
"void deletById(Integer id);",
"private void deletarLivro(Livro livro){\n //deletar livro\n myBooksDb.daoLivro().deletar(livro);\n\n //remover livro da lista\n remove(livro);\n }",
"public void unload(BusIfc bus)\n {\n super.unload(bus);\n SerializedItemCargo cargo = (SerializedItemCargo)bus.getCargo();\n RetailTransactionIfc transaction = saleCargo.getTransaction();\n lineItem = saleCargo.getLineItem();\n cargo.setTransaction(transaction);\n cargo.setCustomer(transaction.getCustomer());\n cargo.setRegister(saleCargo.getRegister());\n\n if (!lineItem.isKitHeader())\n {\n cargo.setLineItems(new SaleReturnLineItemIfc[] {lineItem});\n }\n else\n {\n cargo.setLineItems(\n ((KitHeaderLineItemIfc)lineItem).getKitComponentLineItemArray());\n cargo.setKitHeader(true);\n }\n\n //Adding SearchCriteriaIfc to the SerializedItem Cargo\n String geoCode = null;\n if(saleCargo.getStoreStatus() != null &&\n saleCargo.getStoreStatus().getStore() != null)\n {\n geoCode = saleCargo.getStoreStatus().getStore().getGeoCode();\n }\n cargo.setInquiry(LocaleMap.getLocale(LocaleConstantsIfc.USER_INTERFACE), saleCargo.getPLUItemID(), \"\", \"\", geoCode);\n\n\n }",
"public boolean removeVehicle(){\r\n veh = null;\r\n return true;\r\n }",
"public void mo37873b() {\n if (C13262e.this.f34200n.onRequest(this.f34217f, this.f34218g)) {\n try {\n C13262e.this.f34208v.mo38156a(this.f34217f, C13256a.CANCEL);\n synchronized (C13262e.this) {\n C13262e.this.f34210x.remove(Integer.valueOf(this.f34217f));\n }\n } catch (IOException unused) {\n }\n }\n }",
"java.util.concurrent.Future<UntagResourceResult> untagResourceAsync(UntagResourceRequest untagResourceRequest);",
"java.util.concurrent.Future<UntagResourceResult> untagResourceAsync(UntagResourceRequest untagResourceRequest);",
"java.util.concurrent.Future<UntagResourceResult> untagResourceAsync(UntagResourceRequest untagResourceRequest);",
"public void dequeue() {\r\n saf.remove(0);\r\n }",
"public void vacateGarage() {\n\t\tvehicles.clear(); \n\t}",
"void unsetRaceList();",
"public void flightDisappear();",
"public void removeDriver(){\n\t\tunitSpaceAvailable += getFirstDriver().getVehicle().getUnitSize();\n\t\tqueue.remove(0);\n\t}",
"public void remove() {\n int size = itinerary.size();\n if (size != 1) {\n \n // Removes last Flight in this Itinerary.\n Flight removedFlight = this.itinerary.remove(size - 1);\n \n // Gets the new last Flight in this Itinerary.\n Flight flight = this.itinerary.get(size - 2);\n \n // Updates all the relevant fields in this Itinerary.\n this.price -= removedFlight.getCost();\n this.arrivalDateTime = flight.getArrivalDateTime();\n this.destination = flight.getDestination();\n this.travelTime = arrivalDateTime.timeDiff(departDateTime);\n this.places.remove(size);\n }\n }",
"void dissociate(RTMPConnection rtmpConn);",
"@Override\n\t\tpublic void unregisterResource(FlexoResource<?> resource, InJarResourceImpl serializationArtefact) {\n\t\t\tunregisterResource(resource);\n\t\t}",
"private void releaseAirfield() {\n\t\tlandedAirfield.setOccupied(false);\n\t}",
"private void removeCard() {\n\t\tint sic_idHolder; // declares sic_idHolder\n\t\t\n\t\tSystem.out.println(\"Please enter the SIC ID number you'd like to remove:\");\n\t\tsic_idHolder = scan.nextInt(); // prompts user to input sic_idHolder\n\t\tscan.nextLine();\n\t\t\n\t\tinventoryObject.removeStockIndexCard(sic_idHolder); //calls removeStockIndexCard from InventoryManagement\n\t\tgetUserInfo();\n\t}",
"public abstract void remove(UIReader reader);",
"public abstract void unregister();",
"public abstract void remove(BEAN bean);",
"public void removeOrder(){\n foods.clear();\n price = 0;\n }",
"public void removeFromSilkBag() {\r\n silkBag.remove(0);\r\n }",
"public void unloadItems() {\n if (dishwasherState == State.ON) {\n throw new InvalidStateException(\"The washing cycle hasn't been run yet\");\n } else if (dishwasherState == State.RUNNING) {\n throw new InvalidStateException(\"Please wait until washing cycle is finished\");\n }\n items = 0;\n dishwasherState = State.ON;\n System.out.println(\"The dishwasher is ready to go\");\n }",
"void deletar(Long id);",
"@Override\r\n\tpublic int deleteCar(int serial) throws DataAccessException {\n\t\treturn 0;\r\n\t}",
"public void remove() {\r\n setRemovable(true);\r\n }",
"public boolean pull() {\n\t\ttry {\n\t\t\tTransaction t = null;\n\t\t\tString fileName = storagePath + \"/pull\";\n\t\t\tFile f = new File(fileName);\n\t\t\ttry {\n\t\t\t\tboolean flag = true;\n\t\t\t\tif (f.exists()) {\n\t\t\t\t\tbyte[] buffer = \"PULL\".getBytes();\n\t\t\t\t\toos.writeObject(buffer);\n\t\t\t\t\t// System.out.println(\"PULL packet sent!!!\");\n\t\t\t\t\tObjectInputStream fin = new ObjectInputStream(\n\t\t\t\t\t\t\tnew FileInputStream(f));\n\t\t\t\t\tt = (Transaction) fin.readObject();\n\t\t\t\t\tfin.close();\n\t\t\t\t\tboolean result = f.delete();\n\t\t\t\t\t// System.out.println(\"Delete event : \" + result);\n\t\t\t\t\tBundle b = new Bundle();\n\t\t\t\t\tb.userId = userId;\n\t\t\t\t\tb.transactionId = -1;\n\t\t\t\t\tb.bundleType = b.RETRANS;\n\t\t\t\t\tb.noOfBundles = 1;\n\t\t\t\t\tb.bundleNumber = -1;\n\t\t\t\t\tString s = Integer.toString(t.transactionId) + \"\\n\"\n\t\t\t\t\t\t\t+ Integer.toString((t.bundleNo + 1));\n\t\t\t\t\tbyte[] bb = s.getBytes();\n\t\t\t\t\tint size = bb.length;\n\t\t\t\t\tb.bundleSize = bb.length;\n\t\t\t\t\tb.data = new byte[size];\n\t\t\t\t\tfor (int j = 0; j < size; j++) {\n\t\t\t\t\t\tb.data[j] = bb[j];\n\t\t\t\t\t}\n\t\t\t\t\t// System.out.println(\"Sent retrans : \" + b.transactionId\n\t\t\t\t\t// + \" \" + b.noOfBundles + \" \" + b.bundleNumber + \" \"\n\t\t\t\t\t// + b.bundleType + \" \" + new String(b.data));\n\t\t\t\t\toos.writeObject(b.getBytes());\n\t\t\t\t\toos.flush();\n\t\t\t\t\t// System.out.println(\"RETRANS bundle sent\");\n\t\t\t\t\tflag = true;\n\t\t\t\t\twhile (flag) {\n\t\t\t\t\t\t// System.out.print(\"Going to read\");\n\t\t\t\t\t\tbuffer = (byte[]) ois.readObject();\n\t\t\t\t\t\t// System.out.println(\"Read\");\n\t\t\t\t\t\tb = new Bundle();\n\t\t\t\t\t\tb.parse(buffer);\n\t\t\t\t\t\t// System.out.println(\"Parsed\");\n\t\t\t\t\t\tif (b.bundleType == b.STOP)\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tif (!newdata)\n\t\t\t\t\t\t\tnewdata = true;\n\t\t\t\t\t\tt.addBundle(b);\n\t\t\t\t\t\tif (b.bundleNumber == (b.noOfBundles - 1)) {\n\t\t\t\t\t\t\tcommit(t);\n\t\t\t\t\t\t\tflag = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tBundle ackb = new Bundle();\n\t\t\t\t\t\tackb.createACK(b);\n\t\t\t\t\t\t// System.out.println(ackb.transactionId + \" \"\n\t\t\t\t\t\t// + ackb.noOfBundles + \" \" + ackb.bundleNumber\n\t\t\t\t\t\t// + \" \" + ackb.bundleType);\n\t\t\t\t\t\toos.writeObject(ackb.getBytes());\n\t\t\t\t\t\toos.flush();\n\t\t\t\t\t\t// System.out.println(\"Written!!!\");\n\t\t\t\t\t}\n\t\t\t\t\tupdate();\n\t\t\t\t}\n\t\t\t\tbyte[] buffer = \"PULL\".getBytes();\n\t\t\t\toos.writeObject(buffer);\n\t\t\t\t// System.out.println(\"PULL packet sent!!!\");\n\t\t\t\tBundle b = new Bundle();\n\t\t\t\tb.userId = userId;\n\t\t\t\tb.transactionId = -1;\n\t\t\t\tb.bundleType = b.START;\n\t\t\t\tb.noOfBundles = 1;\n\t\t\t\tb.bundleNumber = -1;\n\t\t\t\tb.bundleSize = 0;\n\t\t\t\tb.data = null;\n\t\t\t\toos.writeObject(b.getBytes());\n\t\t\t\toos.flush();\n\t\t\t\t// System.out.println(\"START bundle sent\");\n\t\t\t\tflag = true;\n\t\t\t\t// System.out.println(\"Waiting to receive\");\n\t\t\t\tdo {\n\t\t\t\t\t// System.out.print(\"Going to read\");\n\t\t\t\t\tbuffer = (byte[]) ois.readObject();\n\t\t\t\t\t// System.out.println(\"Read\");\n\t\t\t\t\tb = new Bundle();\n\t\t\t\t\tb.parse(buffer);\n\t\t\t\t\t// System.out.println(\"Parsed\");\n\t\t\t\t\tif (b.bundleType == b.STOP)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tif (!newdata)\n\t\t\t\t\t\tnewdata = true;\n\t\t\t\t\tif (b.bundleNumber == 0) {\n\t\t\t\t\t\tt = new Transaction(b.transactionId, b.noOfBundles);\n\t\t\t\t\t}\n\t\t\t\t\tt.addBundle(b);\n\t\t\t\t\tif (b.bundleNumber == (b.noOfBundles - 1)) {\n\t\t\t\t\t\tcommit(t);\n\t\t\t\t\t}\n\t\t\t\t\tBundle ackb = new Bundle();\n\t\t\t\t\tackb.createACK(b);\n\t\t\t\t\t// System.out.println(\"Sent ack : \" + ackb.transactionId +\n\t\t\t\t\t// \" \"\n\t\t\t\t\t// + ackb.noOfBundles + \" \" + ackb.bundleNumber + \" \"\n\t\t\t\t\t// + ackb.bundleType);\n\t\t\t\t\toos.writeObject(ackb.getBytes());\n\t\t\t\t\toos.flush();\n\t\t\t\t} while (flag);\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\tif (t != null && t.bundleNo != (t.noOfBundles - 1)) {\n\t\t\t\t\t// System.out.println(\"Writing broken transaction!!!\");\n\t\t\t\t\tf.createNewFile();\n\t\t\t\t\tObjectOutputStream fout = new ObjectOutputStream(\n\t\t\t\t\t\t\tnew FileOutputStream(f));\n\t\t\t\t\tfout.writeObject(t);\n\t\t\t\t\tfout.close();\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\ttry {\n\t\t\t\tsleep(100);\n\t\t\t} catch (InterruptedException e1) {\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"void unsaveCurrentStation();",
"public void undispatchURL(String url);",
"public void unload(BusIfc bus)\n {\n // unload financial cargo\n super.unload(bus);\n\n // retrieve cargo from the child\n SaleCargoIfc cargo = (SaleCargoIfc)bus.getCargo();\n cargo.setAccessFunctionID(saleCargo.getAccessFunctionID());\n cargo.setPasswordRequired(saleCargo.isPasswordRequired());\n cargo.setCustomerInfo(saleCargo.getCustomerInfo());\n cargo.setEmployee(saleCargo.getEmployee());\n cargo.setLineItem(saleCargo.getLineItem());\n cargo.setOperator(saleCargo.getOperator());\n cargo.setPLUItem(saleCargo.getPLUItem());\n cargo.setIndices(saleCargo.getIndices());\n cargo.setSalesAssociate(saleCargo.getEmployee());\n cargo.setTransaction(saleCargo.getTransaction());\n cargo.setCanSkipCustomerPrompt(saleCargo.getCanSkipCustomerPrompt());\n\n SaleReturnTransactionIfc[] originalTxns = saleCargo.getOriginalReturnTransactions();\n if (originalTxns != null)\n {\n for (int i = 0; i < originalTxns.length; i++)\n {\n cargo.addOriginalReturnTransaction(originalTxns[i]);\n }\n }\n\n // Record the timeout status in the cargo, so called services will know\n if(cargo instanceof TimedCargoIfc && saleCargo instanceof TimedCargoIfc)\n {\n ((TimedCargoIfc)cargo).setTimeout(((TimedCargoIfc)saleCargo).isTimeout()); \n }\n }",
"@RequestMapping(value = \"/{branch}/stackRoom/{book}\", method = RequestMethod.DELETE)\n public String removeBookFromStock(@PathVariable String branch, @PathVariable String book) {\n branchBookService.removeBook(branch, book);\n return \"Success\";\n }",
"protected void unregisterSingleDownloadController(final SingleDownloadController con) {\r\n try {\r\n DownloadLink link = con.getDownloadLink();\r\n synchronized (this.downloadControllers) {\r\n if (this.downloadControllers.remove(con) == false) { throw new WTFException(\"SingleDownloadController not registed!\"); }\r\n }\r\n synchronized (activeDownloadsbyHost) {\r\n String host = link.getHost();\r\n /* decrease active counter for this hoster */\r\n java.util.List<SingleDownloadController> active = this.activeDownloadsbyHost.get(host);\r\n if (active == null) { throw new WTFException(\"no SingleDownloadController available for this host\"); }\r\n active.remove(con);\r\n if (active.size() == 0) {\r\n this.activeDownloadsbyHost.remove(host);\r\n }\r\n }\r\n synchronized (downloadControlHistory) {\r\n /* update downloadControlHistory */\r\n if (FilePackage.isDefaultFilePackage(link.getFilePackage()) || DownloadController.getInstance() != link.getFilePackage().getControlledBy()) {\r\n /*\r\n * link is no longer controlled by DownloadController, so we can remove the history\r\n */\r\n downloadControlHistory.remove(link);\r\n return;\r\n }\r\n DownloadControlHistory history = downloadControlHistory.get(link);\r\n if (history == null) { throw new WTFException(\"no history\"); }\r\n DownloadControlHistoryItem info = history.accountUsageHistory.get(con.getAccount());\r\n if (info == null) { throw new WTFException(\"no historyitem\"); }\r\n info.timeStamp = System.currentTimeMillis();\r\n info.round = link.getLinkStatus().getRetryCount();\r\n }\r\n } finally {\r\n synchronized (WATCHDOGWAITLOOP) {\r\n WATCHDOGWAITLOOP.incrementAndGet();\r\n WATCHDOGWAITLOOP.notifyAll();\r\n }\r\n }\r\n }",
"public void pull();",
"public void RemoveCardFromComputer(int value){\n handComputer.remove(value);\n }",
"public Unmount() {\r\n }",
"@Override\n\tpublic void unLock() {\n\t\t\n\t}",
"public void deletar(Integer id) {\n\t\t\n\t}",
"void unsubscribe(){}",
"Object remove();",
"void unpublish() {\n pendingOps.decrementAndGet();\n }",
"public void removeFeeAccrBVOItem(int i)\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(FEEACCRBVOITEM$2, i);\n }\n }",
"private void handleUnbooking() {\n\t\ttry {\n\t\t\tint recNo = table.getSelectedRow();\n\t\t\tif(recNo == -1){\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcontroller.unreserveRoom(recNo);\n\t\t\t\n\t\t\tupdateTable(nameSearchBar.getText(), locationSearchBar.getText());\n\t\t} catch (BookingServiceException bse) {\n\t\t\tJOptionPane.showMessageDialog(mainPanel,\n\t\t\t\t\t\"Record has not been booked!\");\n\t\t} catch (ServiceUnavailableException sue) {\n\t\t\tJOptionPane.showMessageDialog(null, sue.getMessage());\n\t\t\tSystem.exit(0);\n\t\t}\n\t\t\n\t}",
"public RemoteLibrary removeLibrary(String path);",
"void deleteVehicle(String vehicleID);",
"void minecraftChunkUnloaded() {\n\t\tthis.lastUnloadingTime = System.currentTimeMillis();\n\t}",
"public void unloaded(){\n\t\tloaded=false;\n\t}",
"public void removeWire(IPWire pres);",
"public void unload(BusIfc bus)\n {\n CaptureCustomerInfoCargo cargo = (CaptureCustomerInfoCargo) bus.getCargo();\n cargo.setTenderType(TenderLineItemConstantsIfc.TENDER_TYPE_STORE_CREDIT);\n cargo.setCustomer(tenderCargo.getCustomer());\n HashMap tenderAttributes = tenderCargo.getTenderAttributes();\n cargo.setBalanceDue(tenderCargo.parseAmount((String) tenderAttributes.get(TenderConstants.AMOUNT)));\n cargo.setTransaction((TransactionIfc)tenderCargo.getCurrentTransactionADO().toLegacy());\n }",
"public void remove()\r\n {\r\n if(bookCount>0)\r\n {\r\n bookCount-=1;\r\n }\r\n }",
"public void unsubscribeToCovRequest() {\n try {\n DeviceService.localDevice.send(bacnetDevice, new SubscribeCOVRequest(new UnsignedInteger(1), getObjectIdentifier(), null, null)).get();\n LOG.info(\"Unsubscription @: '\" + getObjectIdentifier() + \"' on: \" + bacnetDevice.getObjectIdentifier());\n } catch (BACnetException e) {\n LOG.warn(\"Can't unsubscribe : '\" + getObjectIdentifier() + \"' on: \" + bacnetDevice.getObjectIdentifier());\n }\n\n }",
"public void removeRef(String name, int type) throws RemoteException\r\n\t{\r\n\t\tSyncRecord rec;\r\n\t\ttry {\r\n\t\t\trec = findObject(name,type);\r\n\t\t} catch (NotFoundException e) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\trec.count--;\r\n\t\t// destroy object if it no longer exists\r\n\t\tif (rec.count<=0)\r\n\t\t{\r\n\t\t\tdestroyObject(rec);\r\n\t\t}\r\n\t}"
] | [
"0.6115237",
"0.5994611",
"0.59937245",
"0.59741724",
"0.58184385",
"0.5809943",
"0.57852864",
"0.57673424",
"0.57471",
"0.56747156",
"0.56673586",
"0.56222796",
"0.5573672",
"0.5573334",
"0.5551977",
"0.5550091",
"0.5518593",
"0.5502914",
"0.5467924",
"0.54580134",
"0.5423949",
"0.5404364",
"0.54025567",
"0.539651",
"0.53933614",
"0.53849095",
"0.5361237",
"0.53605825",
"0.5353739",
"0.53101695",
"0.52911717",
"0.52911717",
"0.52911717",
"0.52866787",
"0.528211",
"0.527418",
"0.5261969",
"0.525073",
"0.52426946",
"0.5202598",
"0.52020013",
"0.5186224",
"0.51759666",
"0.5173471",
"0.5168354",
"0.5139107",
"0.5138739",
"0.51313645",
"0.51303357",
"0.51269937",
"0.5124342",
"0.51120764",
"0.51084685",
"0.5107662",
"0.5107662",
"0.5107662",
"0.5095388",
"0.5073868",
"0.5071894",
"0.50700015",
"0.50664943",
"0.50587916",
"0.5050211",
"0.5047696",
"0.50475717",
"0.50444853",
"0.50329137",
"0.5026227",
"0.50229406",
"0.5019764",
"0.5019411",
"0.5017222",
"0.5013063",
"0.50084877",
"0.50077236",
"0.500687",
"0.50062245",
"0.50027853",
"0.4994476",
"0.49931964",
"0.49914634",
"0.4988803",
"0.4985955",
"0.49851075",
"0.49755785",
"0.4972227",
"0.49662274",
"0.49658749",
"0.49652982",
"0.4964392",
"0.49615243",
"0.49552706",
"0.49549994",
"0.4952122",
"0.49499807",
"0.49474785",
"0.4940113",
"0.492414",
"0.49220788",
"0.49198747"
] | 0.53429323 | 29 |
Moves the car transporter and updates the coordinates of the cars inside | public void move(){
super.move();
load.updateCoordinates(this.x,this.y);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void moveEast(){\n\t\tcar.setXLocation(currentX + 1);\n\t\tcurrentX += 1;\n\t}",
"public void move() {\n float diffX = cDestination.getX() - getCenterX();\n float diffY = cDestination.getY() - getCenterY();\n\n float newX = cPosition.getX() + cSpeed * Math.signum(diffX);\n float newY = cPosition.getY() + cSpeed * Math.signum(diffY);\n\n cPosition.setX(newX);\n cPosition.setY(newY);\n }",
"@Override\n public Status move(){\n\n if(onNode.getNextNode(this)==null){\n return Status.NOT_EMPTY_CAR;\n }\n List<Train> on = onNode.getNextNode(this).getTrains();\n if(!on.isEmpty()) return Status.CRASHED;\n\n Node next = onNode.getNextNode(this);\n prevNode.removeTrain(this);\n next.addTrain(this);\n x=next.getX();\n y=next.getY();\n try {\n ((Station)next).setGetOff();\n }\n catch (Exception e) {}\n \n return nextCar.move();\n }",
"private void move() {\n\t\t\tangle += Math.PI/24;\n\t\n\t\t\tcow.locX = Math.sin(angle) * 2.5 + player.getLocation().getX();\n\t\t\tcow.locZ = Math.cos(angle) * 2.5 + player.getLocation().getZ();\n\t\t\t\n\t\t\tLocation loc = new Location(player.getWorld(), cow.locX, player.getLocation().getY() + 1.5, cow.locZ);\n\t\t\tloc.setDirection(player.getLocation().subtract(loc).toVector()); //Look at the player\n\t\t\t\n\t\t\tPacketHandler.teleportFakeEntity(player, cow.getId(), loc);\n\t\t}",
"public void move() {\n\n if (_currentFloor == Floor.FIRST) {\n _directionOfTravel = DirectionOfTravel.UP;\n }\n if (_currentFloor == Floor.SEVENTH) {\n _directionOfTravel = DirectionOfTravel.DOWN;\n }\n\n\n if (_directionOfTravel == DirectionOfTravel.UP) {\n _currentFloor = _currentFloor.nextFloorUp();\n } else if (_directionOfTravel == DirectionOfTravel.DOWN) {\n _currentFloor = _currentFloor.nextFloorDown();\n }\n\n if(_currentFloor.hasDestinationRequests()){\n stop();\n } \n\n }",
"public void move() {\n\n\tGrid<Actor> gr = getGrid();\n\tif (gr == null) {\n\n\t return;\n\t}\n\n\tLocation loc = getLocation();\n\tif (gr.isValid(next)) {\n\n\t setDirection(loc.getDirectionToward(next));\n\t moveTo(next);\n\n\t int counter = dirCounter.get(getDirection());\n\t dirCounter.put(getDirection(), ++counter);\n\n\t if (!crossLocation.isEmpty()) {\n\t\t\n\t\t//reset the node of previously occupied location\n\t\tArrayList<Location> lastNode = crossLocation.pop();\n\t\tlastNode.add(next);\n\t\tcrossLocation.push(lastNode);\t\n\t\t\n\t\t//push the node of current location\n\t\tArrayList<Location> currentNode = new ArrayList<Location>();\n\t\tcurrentNode.add(getLocation());\n\t\tcurrentNode.add(loc);\n\n\t\tcrossLocation.push(currentNode);\t\n\t }\n\n\t} else {\n\t removeSelfFromGrid();\n\t}\n\n\tFlower flower = new Flower(getColor());\n\tflower.putSelfInGrid(gr, loc);\n\t\n\tlast = loc;\n\t\t\n }",
"public void move() { \n\t\tSystem.out.println(\"MOVING\");\n\t\tswitch(direction) {\n\t\t\tcase NORTH: {\n\t\t\t\tyloc -= ySpeed;\n\t\t\t}\n\t\t\tcase SOUTH: {\n\t\t\t\tyloc+= xSpeed;\n\t\t\t}\n\t\t\tcase EAST: {\n\t\t\t\txloc+= xSpeed;\n\t\t\t}\n\t\t\tcase WEST: {\n\t\t\t\txloc-= xSpeed;\n\t\t\t}\n\t\t\tcase NORTHEAST: {\n\t\t\t\txloc+=xSpeed;\n\t\t\t\tyloc-=ySpeed;\n\t\t\t}\n\t\t\tcase NORTHWEST: {\n\t\t\t\txloc-=xSpeed;\n\t\t\t\tyloc-=ySpeed;\n\t\t\t}\n\t\t\tcase SOUTHEAST: {\n\t\t\t\txloc+=xSpeed;\n\t\t\t\tyloc+=ySpeed;\n\t\t\t}\n\t\t\tcase SOUTHWEST: {\n\t\t\t\txloc-=xSpeed;\n\t\t\t\tyloc+= ySpeed;\n\t\t\t}\n\t\t}\n\t}",
"protected void moveCar(E_Direction direction) {\n\t\tif(!this.isFinished()) {\n\t\ttry {\n\t\t\tThread.sleep(1000);\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tswitch (direction) {\n\t\tcase DOWN:\n\t\t\tmoveDown();\n\t\t\tsetDirection(E_Direction.DOWN);\n\t\t\tbreak;\n\t\tcase LEFT:\n\t\t\tmoveLeft();\n\t\t\tsetDirection(E_Direction.LEFT);\n\t\t\tbreak;\n\t\tcase RIGHT:\n\t\t\tmoveRight();\n\t\t\tsetDirection(E_Direction.RIGHT);\n\t\t\tbreak;\n\t\tcase UP:\n\t\t\tmoveUp();\n\t\t\tsetDirection(E_Direction.UP);\n\t\t\tbreak;\n\t\t}\n\t\t}\n\t}",
"protected void moveWest(){\n\t\tcar.setXLocation(currentX - 1);\n\t\tcurrentX -= 1;\n\t}",
"public void move() {\n float xpos = thing.getX(), ypos = thing.getY();\n int xdir = 0, ydir = 0;\n if (left) xdir -= SPEED; if (right) xdir += SPEED;\n if (up) ydir -= SPEED; if (down) ydir += SPEED;\n xpos += xdir; ypos += ydir;\n\n VeggieCopter game = thing.getGame();\n int w = game.getWindowWidth(), h = game.getWindowHeight();\n int width = thing.getWidth(), height = thing.getHeight();\n if (xpos < 1) xpos = 1; if (xpos + width >= w) xpos = w - width - 1;\n if (ypos < 1) ypos = 1; if (ypos + height >= h) ypos = h - height - 1;\n thing.setPos(xpos, ypos);\n }",
"private void move() {\n acceleration.accelerate(velocity, position);\r\n }",
"public void move() {\n\t\tGrid<Actor> gr = getGrid();\n\t\tif (gr == null) {\n\t\t\treturn;\n\t\t}\n\t\tLocation loc = getLocation();\n\t\tif (gr.isValid(next)) {\n\t\t\tsetDirection(getLocation().getDirectionToward(next));\n\t\t\tmoveTo(next);\n\t\t} else {\n\t\t\tremoveSelfFromGrid();\n\t\t}\n\t\tFlower flower = new Flower(getColor());\n\t\tflower.putSelfInGrid(gr, loc);\n\t}",
"public void setCar() {\n\n\t\tint tries = 0;\n\t\tif(type ==RANDOM)\n\t\t{\n\t\t\tfor (int i = 0; i < noOfCarsGenerated; i++) {\n\t\t\t\tCar c = generateRandomCar(Timer.getClock());\n\t\t\t\twhile (c == null){\n\t\t\t\t\ttries++;\n\t\t\t\t\tSystem.out.println(\"i'm null somehow : \" + tries);\n\t\t\t\t\tc = generateRandomCar(Timer.getClock());\n\t\t\t\t}\n\t\t\t\tSimulator.getStations().get(c.getDestination()).addMovingQueue(c);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\telse if (type == FIXED) {\n\t\t\t\n\t\t\tPoint source=Simulator.geoToCor(latitude, longitude);\n\t\t\tString destination=strategy.chooseDestination(source);\n\n\t\t\tfor (int i = 0; i < noOfCarsGenerated; i++) {\n\t\t\t\tCar c = new Car(latitude, longitude, destination, Timer.getClock(), strategy.setChargingTime(source));\n\t\t\t\tc.saveRoute(c.getCarRoute());\n\t\t\t\tSimulator.getStations().get(c.getDestination()).addMovingQueue(c);\n\t\t\t}\n\t\t}\n\n\t\tcurrentNo += noOfCarsGenerated;\n\n\t\tSimulator.updateCarNolbl(noOfCarsGenerated);\n\n\n\t}",
"public void move() {\n\t\tthis.position.stepForwad();\n\t\tthis.position.spin();\n\t}",
"public void moveForward(){\n\t\tSystem.out.println(\"Vehicle moved forward\");\n\t}",
"public void move()\n {\n daysSurvived+=1;\n\n energy -= energyLostPerDay;\n\n Random generator = new Random();\n\n //losowo okreslony ruch na podstawie genomu\n int turnIndex = generator.nextInt((int)Math.ceil(Genome.numberOfGenes));\n int turn = genome.getGenome().get(turnIndex);\n\n //wywolujemy metode obrotu - dodaje odpowiednio liczbe do aktualnego kierunku\n direction.turn(turn);\n\n //zmieniamy pozycje zwierzaka przez dodanie odpowiedniego wektora\n position = position.add(direction.move());\n //walidacja pozycji tak, by wychodzac za mape byc na mapie z drugiej strony\n position.validatePosition(map.getWidth(),map.getHeight());\n\n moveOnSimulation();\n\n //jesli po ruchu zwierzaczek nie ma juz energii na kolejny ruch\n if(energy < energyLostPerDay )\n {\n this.animalHungry = true;\n }\n }",
"public void move() {\n Grid<Actor> gr = getGrid();\n if (gr == null) {\n return;\n }\n Location loc = getLocation();\n if (gr.isValid(next)) {\n setDirection(getLocation().getDirectionToward(next));\n moveTo(next);\n } else {\n removeSelfFromGrid();\n }\n Flower flower = new Flower(getColor());\n flower.putSelfInGrid(gr, loc);\n }",
"public void move() {\n if (!canMove) {\n return;\n }\n int moveX = currDirection == EAST ? PACE : currDirection == WEST ? -PACE : 0;\n int moveY = currDirection == NORTH ? PACE : currDirection == SOUTH ? -PACE : 0;\n if (grid == null || grid.isOutside(currX + moveX, currY + moveY)) {\n return;\n }\n currX += moveX;\n currY += moveY;\n }",
"protected void move()\n {\n // Find a location to move to.\n Debug.print(\"Fish \" + toString() + \" attempting to move. \");\n Location nextLoc = nextLocation();\n\n // If the next location is different, move there.\n if ( ! nextLoc.equals(location()) )\n {\n // Move to new location.\n Location oldLoc = location();\n changeLocation(nextLoc);\n\n // Update direction in case fish had to turn to move.\n Direction newDir = environment().getDirection(oldLoc, nextLoc);\n changeDirection(newDir);\n Debug.println(\" Moves to \" + location() + direction());\n }\n else\n Debug.println(\" Does not move.\");\n }",
"private void move() {\n\n if(currentPosition.getX() == -1 && currentPosition.getY() == -1) {\n System.out.println(\"Robot is not placed, yet.\");\n return;\n }\n\n Position.Direction direction = currentPosition.getDirection();\n int newX = -1;\n int newY = -1;\n switch (direction) {\n case EAST:\n newX = currentPosition.getX() + 1;\n newY = currentPosition.getY();\n break;\n case WEST:\n newX = currentPosition.getX() - 1;\n newY = currentPosition.getY();\n break;\n case NORTH:\n newX = currentPosition.getX();\n newY = currentPosition.getY() + 1;\n break;\n case SOUTH:\n newX = currentPosition.getX();\n newY = currentPosition.getY() - 1;\n break;\n }\n\n if(newX < lowerBound.getX() || newY < lowerBound.getY()\n || newX > upperBound.getX() || newY > upperBound.getY()) {\n System.out.println(\"Cannot move to \" + direction);\n return;\n }\n\n currentPosition.setX(newX);\n currentPosition.setY(newY);\n }",
"@Override\n public void move() {\n switch (direction){\n case SOUTH:\n position.setY(position.getY() + currentSpeed);\n break;\n case NORTH:\n position.setY(position.getY() - currentSpeed);\n break;\n case WEST:\n position.setX(position.getX() - currentSpeed);\n break;\n case EAST:\n position.setX(position.getX() + currentSpeed);\n }\n }",
"public void move() {\n\t\tmoveX();\n\t\tmoveY();\n\t}",
"public void move() {\n\t\t\tar.setAhead(10 * fahrtrichtung);\n\n\t\t\t// Wie schnell sich der Roboter drehen soll\n\t\t\tar.setTurnRight(45 * drehrichtung);\n\t\t\tar.execute();\n\t\t\tfarbschema = farbschema * (-1);\n\t\t}",
"@Override\n\tpublic void updatePosition()\n\t{\n\t\tif(!fired && !pathfinding)\n\t\t{\n\t\t\tif(x == destX && y == destY)\n\t\t\t{\n\t\t\t\tfired = true;\n\t\t\t\tvehicle.msgAnimationDestinationReached();\n\t\t\t\tcurrentDirection = MovementDirection.None;\n\t\t\t\t\n\t\t\t\tIntersection nextIntersection = city.getIntersection(next);\n\t\t\t\tIntersection cIntersection = city.getIntersection(current);\n\t\t\t\tif(cIntersection == null)\n\t\t\t\t{\n\t\t\t\t\tif(city.permissions[current.y][current.x].tryAcquire() || true)\n\t\t\t\t\t{\n\t\t\t\t\t\tcity.permissions[current.y][current.x].release();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(nextIntersection == null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(!cIntersection.acquireIntersection())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcIntersection.releaseAll();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcIntersection.releaseIntersection();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(Pathfinder.isCrossWalk(current,city.getWalkingMap(), city.getDrivingMap()))\n\t\t\t\t{\n\t\t\t\t\tList<Gui> guiList = city.crosswalkPermissions.get(current.y).get(current.x);\n\t\t\t\t\tsynchronized(guiList)\n\t\t\t\t\t{\n\t\t\t\t\t\twhile(guiList.contains(this))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tguiList.remove(this);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(allowedToMove || drunk)\n\t\t\t{\n\t\t\t\tswitch(currentDirection)\n\t\t\t\t{\n\t\t\t\t\tcase Right:\n\t\t\t\t\t\tx++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Up:\n\t\t\t\t\t\ty--;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Down:\n\t\t\t\t\t\ty++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Left:\n\t\t\t\t\t\tx--;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(x % CityPanel.GRID_SIZE == 0 && y % CityPanel.GRID_SIZE == 0 && !moves.isEmpty())\n\t\t\t{\t\n\t\t\t\tif(allowedToMove || drunk)\n\t\t\t\t{\n\t\t\t\t\tcurrentDirection = moves.pop();\n\t\t\t\t\n\t\t\t\t\tIntersection nextIntersection = city.getIntersection(next);\n\t\t\t\t\tIntersection cIntersection = city.getIntersection(current);\n\t\t\t\t\t\n\t\t\t\t\tif(current != next)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(cIntersection == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(city.permissions[current.y][current.x].tryAcquire() || true)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcity.permissions[current.y][current.x].release();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(nextIntersection == null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(!cIntersection.acquireIntersection())\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tcIntersection.releaseAll();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcIntersection.releaseIntersection();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//**************************ADDED**************************//\n\t\t\t\t\t\tif(Pathfinder.isCrossWalk(current,city.getWalkingMap(), city.getDrivingMap()))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tList<Gui> guiList = city.crosswalkPermissions.get(current.y).get(current.x);\n\t\t\t\t\t\t\tsynchronized(guiList)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\twhile(guiList.contains(this))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tguiList.remove(this);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//**************************END ADDED**************************//\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tcurrent = next;\n\t\t\t\t\t\n\t\t\t\t\tswitch(currentDirection)\n\t\t\t\t\t{\n\t\t\t\t\tcase Down:next = new Point(current.x,current.y + 1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Left:next = new Point(current.x - 1,current.y);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Right:next = new Point(current.x + 1,current.y);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Up:next = new Point(current.x,current.y - 1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:next = current;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\n\t\t\t\tIntersection nextIntersection = city.getIntersection(next);\n\t\t\t\tIntersection cIntersection = city.getIntersection(current);\n\t\t\t\t\n\t\t\t\tif(nextIntersection == null)\n\t\t\t\t{\n\t\t\t\t\tif(city.permissions[next.y][next.x].tryAcquire())\n\t\t\t\t\t{\n\t\t\t\t\t\tallowedToMove = true;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tallowedToMove = false;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(cIntersection == null)\n\t\t\t\t\t{\n\t\t\t\t\t\t//**************************ADDED**************************//\n\t\t\t\t\t\tList<Gui> guiList = city.crosswalkPermissions.get(next.y).get(next.x);\n\t\t\t\t\t\tsynchronized(guiList)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(Pathfinder.isCrossWalk(next, city.getWalkingMap(), city.getDrivingMap()))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfor(Gui g : guiList)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif(g instanceof PassengerGui)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tallowedToMove = false;\n\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(nextIntersection.acquireIntersection())\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tnextIntersection.acquireAll();\n\t\t\t\t\t\t\t\t\tallowedToMove = true;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tallowedToMove = false;\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tguiList.add(this);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//**************************END ADDED**************************//\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tallowedToMove = true;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(!allowedToMove && drunk)\n\t\t{\n\t\t\tcity.addGui(new ExplosionGui(x,y));\n\t\t\tSystem.out.println(\"DESTROYING\");\n\t\t\tcity.removeGui(this);\n\t\t\tvehicle.stopThread();\n\t\t\tsetPresent(false);\n\t\t\t\n\t\t\tIntersection nextIntersection = city.getIntersection(next);\n\t\t\tIntersection cIntersection = city.getIntersection(current);\n\t\t\t\n\t\t\tif(cIntersection == null)\n\t\t\t{\n\t\t\t\tif(city.permissions[current.y][current.x].tryAcquire() || true)\n\t\t\t\t{\n\t\t\t\t\tcity.permissions[current.y][current.x].release();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(nextIntersection == null)\n\t\t\t\t{\n\t\t\t\t\tif(!cIntersection.acquireIntersection())\n\t\t\t\t\t{\n\t\t\t\t\t\tcIntersection.releaseAll();\n\t\t\t\t\t}\n\t\t\t\t\tcIntersection.releaseIntersection();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"protected void onTick() {\n\t\tif(car.drivingInfo.pathToGet.size() == 0 && car.carData.to == null) {\n\t\t\tcar.state = Car.WAIT_PASSENGER_TO_GO_INSIDE;\n\t\t\tSystem.out.println(\"engaged with from drive\" + car.engagedWithAID.toString());\n\t\t\tcar.addBehaviour(new TakePassenger());\n\t\t\tthis.stop();\n\t\t\treturn;\n\t\t}\n\t\t\t\t\n\t\tif(car.carData.to == null) {\n\t\t\tHouseData nextHouseToGo = car.drivingInfo.pathToGet.remove(0);\n\t\t\tcar.carData.to = nextHouseToGo;\n\t\t}\n\t\t\n\t\tint distanceDone = car.carData.distance;\n\t\tint distanceToDo = (int) SmaUtils.computeDistance(car.carData.from.position, car.carData.to.position);\n\t\t\n\t\t// if the distance left is higher than the distance the car can do in one tick, we increment the distance\n\t\tif(distanceDone+Car.CAR_SPEED < distanceToDo) {\n\t\t\tcar.carData.distance += Car.CAR_SPEED;\n\t\t\treturn;\n\t\t} \n\t\t// else, we put the car on the next house\n\t\telse if(distanceDone <= distanceToDo) {\n\t\t\tcar.carData.from = car.carData.to;\n\t\t\tcar.carData.to = null;\n\t\t\tcar.carData.distance = 0;\n\t\t\treturn;\n\t\t}\n\t}",
"public void move()\n {\n double angle = Math.toRadians( getRotation() );\n int x = (int) Math.round(getX() + Math.cos(angle) * WALKING_SPEED);\n int y = (int) Math.round(getY() + Math.sin(angle) * WALKING_SPEED);\n setLocation(x, y);\n }",
"public void move() {\n\t\tif (type.equals(\"Fast\")) {\n\t\t\tspeed = 2;\n\t\t}else if (type.equals(\"Slow\")){\n\t\t\tspeed = 4;\n\t\t}\n\t\t\n\t\tif (rand.nextInt(speed) == 1){\n\t\t\tif (currentLocation.x - ChristopherColumbusLocation.x < 0) {\n\t\t\t\tif (currentLocation.x + 1 < oceanMap.getDimensions()) {\n\t\t\t\t\tcurrentLocation.x++;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (currentLocation.x != 0) {\t\t\t\t\n\t\t\t\t\tcurrentLocation.x--;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (currentLocation.y - ChristopherColumbusLocation.y < 0) {\n\t\t\t\tif (currentLocation.y + 1 < oceanMap.getDimensions()) {\n\t\t\t\t\tcurrentLocation.y++;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (currentLocation.y != 0) {\n\t\t\t\t\tcurrentLocation.y--;\n\t\t\t\t}\n\t\t\t} \n\t\t}\n\t}",
"public void move()\n {\n x = x + unitVector.getValue(1)*speed;\n y = y + unitVector.getValue(2)*speed;\n }",
"void moveVehicles() {\n for (int i = roads.size() - 1; i >= 0; i--) {\n roads.get(i).moveVehicles();\n checkTurns(i);\n\n\n }\n\n }",
"public synchronized void follow(Vehicle vehicle){\n \n distance = distance - (float)((float)vehicle.getCurrentSpeed()*1000f/3600f)/100f;\n \n //System.out.println(\"Distance to drive: \" + distance);\n if (distance <= 0){\n \n Settings.messageLog.AddMessage(\"Reached end of path\");\n //System.out.println(\"weg.size() == \" + weg.size());\n try{\n vehicle.setPosition(weg.get(weg.size()-1));\n }\n catch(Exception e){vehicle.setPosition(new Vector3f(10.3f, 5.5f, 156.2f));}\n vehicle.stopDriving();\n if (destinationPlatform == null && destinationParkingSpot == null){}\n else if (destinationParkingSpot == null){\n //motionpath from waypoint to platform\n //platform sign in\n vehicle.setCurrentPlatform(destinationPlatform);\n \n } //meldt aan voor platform nieuwe route\n else {\n \n //motionpath from waypoint to parkingspot\n if (destinationPlatform == null)\n {\n try\n {\n this.destinationParkingSpot.ParkVehicle(vehicle);\n vehicle.setPosition(this.destinationParkingSpot.getPosition());\n Settings.messageLog.AddMessage(\"Park vehicle\");\n }\n catch(Exception e)\n {\n \n ErrorLog.logMsg(e.getMessage());\n }\n \n }\n \n //hier kraan geparkeerd ... ga unload\n try\n {\n this.destinationParkingSpot.ParkVehicle(vehicle);\n vehicle.setPosition(this.destinationParkingSpot.getPosition());\n }\n catch(InvalidVehicleException ie)\n {\n System.out.println(ie.getMessage());\n \n }\n\n }\n \n }\n }",
"public void move() {\n\t\tGrid<Actor> gr = getGrid();\n\t\tif (gr == null) {\n\t\t\treturn;\n\t\t}\n\t\tLocation loc = getLocation();\n\t\tLocation next = loc.getAdjacentLocation(getDirection());\n\t\t\n\t\tLocation next2 = next.getAdjacentLocation(getDirection());\n\t\tif (gr.isValid(next2)) {\n\t\t\tmoveTo(next2);\n\t\t} else {\n\t\t\tremoveSelfFromGrid();\n\t\t}\n\t}",
"protected void carTrack(AutoCar car, double[] speed) {\n // carPos[0] += speed[0];\n // carPos[1] += speed[1];\n\n if(car.xpos >= 98.2 || car.xpos <= 1.8 || car.ypos >= 98.2 || car.ypos <= 1.8)\n {\n car.rotateBy(180, 0, 0, 1);\n speed[0] = -speed[0];\n speed[1] = -speed[1];\n }\n }",
"@Override\n\tpublic void update(float delta) {\n\t\tHashMap<Coordinate, MapTile> currentView = getView();\n\t\tcheckStateChange();\n\t\tfor(Coordinate i : currentView.keySet()) {\n\t\t\t\n\t\t\t//Building up wholeMap with data from currentView\n\t\t\tif(i.x >= 0 && i.y >= 0 && i.x < World.MAP_WIDTH && i.y < World.MAP_HEIGHT ) {\n\t\t\t\twholeMap.put(i, currentView.get(i));\n\t\t\t}\n\t\n\t\t}\n//\t\tif(getSpeed() > CAR_SPEED/2f){\n//\t\t\tapplyBrake();\n//\t\t}\n\n//\t\tif(checkWallAhead(getOrientation(), currentView)){\n//\t\t\tisReversing = true;\n//\t\t}\n//\t\tif(checkRightWall(getOrientation(), currentView)){\n//\t\t\tisTurningLeft = true;\n//\t\t}\n//\t\tif(checkLeftWall(getOrientation(), currentView)){\n//\t\t\tisTurningRight = true;\n//\t\t}\n\n\n\n\t\tdebugPrint(\"STATES: A: \" + isAccelerating +\" Rv: \"+ isReversing +\n\t\t\" L: \"+ isTurningLeft + \" R: \"+isTurningRight);\n\n\n\t\t//Handles Steering\n\t\tif(isTurningLeft){\n\t\t\tdebugPrint(\"TRYING TO TURN LEFT\");\n\t\t\tapplySafeLeftTurn(delta);\n\t\t} else if(isTurningRight){\n\t\t\tdebugPrint(\"TRYING TO TURN RIGHT\");\n\t\t\tapplySafeRightTurn(delta);\n\t\t}\n\t\tif(isAccelerating){\n\t\t\tdebugPrint(\"No\");\n\t\t\tapplySafeForwardAcceleration();\n\t\t}\n\n\t\tif(isReversing){\n\t\t\tapplySafeReverseAcceleration();\n//\t\t\tisReversing = false;\n\n\t\t}\n\n\n\n\n\n\t\t//\n\t\tif(hasReachedNextDest) {\n\t\t\tdebugPrint(\"Recalculating Route.\");\n\t\t\tList<Node> result =exploreDijkstras(new Coordinate(carrrr.getPosition()));\n\t\t\tresult.add(new Node(\"1,2\"));\n\t\t\tpathList.add(result);\n\t\t\thasReachedNextDest = false;\n\t\t}\n\n\n\n\n\t\t//Car movement code-----------------------------------------------------------------------------------\n\t\t//If there's a path in the path array to follow\n\t\tif(pathList.size() > 0 || processing) {\n\t\t\tif(processing) {\n\t\t\t\tcheckStateChange();\n\n\t\t\t\t//Identify if target tile is N,S,E or W.\n\t\t\t\ttry {\n\t\t\t\t\tpath.get(counter+1);\n\t\t\t\t}\n\t\t\t\tcatch(Exception e) {\n\t\t\t\t\tdebugPrint(\"Starting new path\");\n\t\t\t\t\tcounter = 0;\n\t\t\t\t\tprocessing = false;\n\t\t\t\t\thasReachedNextDest = true;\n\t\t\t\t}\n\n\n\n\t\t\t\tCoordinate currPos = new Coordinate (getPosition());\n\t\t\t\tCoordinate targetPos = new Coordinate(path.get(counter).getName());\n\n\t\t\t\tif(!coordList.contains(currPos)){\n\t\t\t\t\tdebugPrint(\"Recalculating Route (Not on route).\");\n\t\t\t\t\tList<Node> result =exploreDijkstras(new Coordinate(getPosition()));\n\t\t\t\t\tresult.add(new Node(\"99,99\")); //This is just to make sure something is there.\n\t\t\t\t\tpathList.add(result);\n\t\t\t\t\tprocessing = false;\n\t\t\t\t\tdebugPrint(result);\n\t\t\t\t\tcounter = 0;\n\t\t\t\t}\n\n\n\t\t\t\tWorldSpatial.Direction dir = getDirection(currPos, targetPos);\n\n\t\t\t\tboolean isFacingTarget = false;\n\n\t\t\t\tSystem.out.println(\"-----------------\");\n\t\t\t\tdebugPrint(\"currPos: \"+ currPos);\n\t\t\t\tdebugPrint(\"targetPos: \"+ targetPos);\n\t\t\t\tSystem.out.println(\"-----------------\");\n\n\t\t\t\t// If we are on the target, move on to next.\n\t\t\t\tif(currPos.equals(targetPos)) {\n\t\t\t\t\tcounter++;\n\t\t\t\t\tcurrPos = targetPos;\n\t\t\t\t\ttargetPos = new Coordinate(path.get(counter).getName());\n\n\n\n\t\t\t\t\tif(!isFacingTarget){\n//\t\t\t\t\t\tisTurningSoon = true;\n\t\t\t\t\t\trotateAntiClockwise(delta);\n\n\t\t\t\t\t}\n\t\t\t\t\tdir = getDirection(currPos, targetPos);\n\t\t\t\t\tSystem.out.println(\"dir: \"+ dir);\n\t\t\t\t}\n\t\t\t\telse {\n\n\t\t\t\t\tSystem.out.println(\"dir: \"+ dir + \"|| carFront: \" + getOrientation());\n\t\t\t\t\tisFacingTarget = dir.equals(getOrientation());\n\n\t\t\t\t\tif(dir.equals(oppositeOfOrientation(getOrientation()))){\n\t\t\t\t\t\tisReversing = true;\n\t\t\t\t\t\tisAccelerating = false;\n\t\t\t\t\t}\n\n\t\t\t\t\t//Not on target yet.\n\t\t\t\t\tif(!isFacingTarget && isReversing) {\n\t\t\t\t\t\t//If not moving in Direction of target Coord:\n\t\t\t\t\t\tif(leftOrRight(dir) == null){\n\t\t\t\t\t\t\t//this is bad.\n\t\t\t\t\t\t\tdebugPrint(\"Not left or right?\");\n\t\t\t\t\t\t\tdebugPrint(\"UTURN REQUIRED\");\n\t\t\t\t\t\t\trotateAntiClockwise(delta);\n\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tisReversing = false;\n\t\t\t\t\t\t\tdebugPrint(\"leftOrRight: \" + leftOrRight(dir));\n\t\t\t\t\t\t\tlastTurnDirection = leftOrRight(dir);\n\t\t\t\t\t\t\tint targetDegree = directionToDegree(dir);\n\n\t\t\t\t\t\t\tdebugPrint(\"PEEK: \"+peek(getVelocity(), targetDegree, WorldSpatial.RelativeDirection.RIGHT, delta).getCoordinate().toString());\n\n\t\t\t\t\t\t\tif(peek(getVelocity(), targetDegree, WorldSpatial.RelativeDirection.RIGHT, delta).getCoordinate().equals(currPos)){\n\t\t\t\t\t\t\t\t//isAccelerating = true;\n//\t\t\t\t\t\t\t\tapplyForwardAcceleration();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(lastTurnDirection.equals(WorldSpatial.RelativeDirection.RIGHT)){\n\t\t\t\t\t\t\t\tif(peek(getVelocity(),targetDegree, WorldSpatial.RelativeDirection.RIGHT, delta).getCoordinate().equals(targetPos)){\n\t\t\t\t\t\t\t\t\tdebugPrint(\"RIGHT TURN SAFE\");\n\t\t\t\t\t\t\t\t\tisTurningRight = true;\n\t\t\t\t\t\t\t\t\tisAccelerating = false;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tisTurningRight = false;\n\t\t\t\t\t\t\t\t\tisAccelerating = true;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else{\n\t\t\t\t\t\t\t\tif(peek(getVelocity(),targetDegree, WorldSpatial.RelativeDirection.LEFT, delta).getCoordinate().equals(targetPos)) {\n\t\t\t\t\t\t\t\t\tdebugPrint(\"LEFT TURN SAFE\");\n\n\t\t\t\t\t\t\t\t\tisTurningLeft = true;\n\t\t\t\t\t\t\t\t\tisAccelerating = false;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tisTurningLeft = false;\n\t\t\t\t\t\t\t\t\tisAccelerating = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\treadjust(lastTurnDirection, delta);\n\t\t\t\t\t\t//If moving in right direction,\n\t\t\t\t\t\t//Accelerate if not traveling at max speed\n\t\t\t\t\t\tfloat x = CAR_SPEED;\n\t\t\t\t\t\tif(isTurningSoon) {\n\t\t\t\t\t\t\tx = CAR_SPEED/4f;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(getSpeed() < x){\n\t\t\t\t\t\t\tisTurningSoon = false;\n\t\t\t\t\t\t\t//isAccelerating = true;\n//\t\t\t\t\t\t\tapplyForwardAcceleration();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tif(useTestPath){\n\t\t\t\t\tmakeTestPath();\n\t\t\t\t\tpath = testpath;\n\t\t\t\t} else {\n\t\t\t\t\tpath = pathList.poll();\n\t\t\t\t\t//Populate coordList\n\t\t\t\t\tfor(Node n: path){\n\t\t\t\t\t\tcoordList.add(new Coordinate(n.getName()));\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tdebugPrint(path);\n\t\t\t\tprocessing = true; \n\t\t\t\t\n\t\t\t}\n\t\n\t\t\t\n\t\t} else {\n\t\t\tdebugPrint(\"End of path list\");\n\t\t}\n\n\n\n\n\n\n\n/*\t\t// If you are not following a wall initially, find a wall to stick to!\n\t\tif(!isFollowingWall){\n\t\t\tif(getSpeed() < CAR_SPEED){\n\t\t\t\tapplyForwardAcceleration();\n\t\t\t}\n\t\t\t// Turn towards the north\n\t\t\tif(!getOrientation().equals(WorldSpatial.Direction.NORTH)){\n\t\t\t\tlastTurnDirection = WorldSpatial.RelativeDirection.LEFT;\n\t\t\t\tapplyLeftTurn(getOrientation(),delta);\n\t\t\t}\n\t\t\tif(checkNorth(currentView)){\n\t\t\t\t// Turn right until we go back to east!\n\t\t\t\tif(!getOrientation().equals(WorldSpatial.Direction.EAST)){\n\t\t\t\t\tlastTurnDirection = WorldSpatial.RelativeDirection.RIGHT;\n\t\t\t\t\tapplyRightTurn(getOrientation(),delta);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tisFollowingWall = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Once the car is already stuck to a wall, apply the following logic\n\t\telse{\n\n\t\t\t// Readjust the car if it is misaligned.\n\t\t\treadjust(lastTurnDirection,delta);\n\n\t\t\tif(isTurningRight){\n\t\t\t\tapplyRightTurn(getOrientation(),delta);\n\t\t\t}\n\t\t\telse if(isTurningLeft){\n\t\t\t\t// Apply the left turn if you are not currently near a wall.\n\t\t\t\tif(!checkFollowingWall(getOrientation(),currentView)){\n\t\t\t\t\tapplyLeftTurn(getOrientation(),delta);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tisTurningLeft = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Try to determine whether or not the car is next to a wall.\n\t\t\telse if(checkFollowingWall(getOrientation(),currentView)){\n\t\t\t\t// Maintain some velocity\n\t\t\t\tif(getSpeed() < CAR_SPEED){\n\t\t\t\t\tapplyForwardAcceleration();\n\t\t\t\t}\n\t\t\t\t// If there is wall ahead, turn right!\n\t\t\t\tif(checkWallAhead(getOrientation(),currentView)){\n\t\t\t\t\tlastTurnDirection = WorldSpatial.RelativeDirection.RIGHT;\n\t\t\t\t\tisTurningRight = true;\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t// This indicates that I can do a left turn if I am not turning right\n\t\t\telse{\n\t\t\t\tlastTurnDirection = WorldSpatial.RelativeDirection.LEFT;\n\t\t\t\tisTurningLeft = true;\n\t\t\t}\n\t\t}\n\n\t\t*/\n\n\t}",
"private void carPosition(Car car) {\n if (car.getLocation() == 1) {\n AnchorPane.setTopAnchor(car, 180.0);\n AnchorPane.setLeftAnchor(car, 160.0);\n car.setRotate(180);\n } else if (car.getLocation() == 2) {\n AnchorPane.setTopAnchor(car, 180.0);\n AnchorPane.setRightAnchor(car, 110.0);\n car.setRotate(-90);\n } else if (car.getLocation() == 3) {\n AnchorPane.setBottomAnchor(car, 140.0);\n AnchorPane.setRightAnchor(car, 110.0);\n } else {\n AnchorPane.setBottomAnchor(car, 140.0);\n AnchorPane.setLeftAnchor(car, 160.0);\n car.setRotate(90);\n }\n }",
"public void moveTurtle(double distance){ // WORKS\n\t\tSystem.out.println(\"in move\");\n\n\t\tsetTurtleLocToViewTurtleLoc();\n\t\tPoint2D locOrig = myTurtle.getLoc();\n\t\tSystem.out.println(\" in move - setTurtleLocToViewTurtleLoc 1\");\n\t\tsetTurtleLocToViewTurtleLoc();\n\t\tmyTurtle.move(distance);\n\t\tPoint2D locNew = myTurtle.getLoc();\n\t\tthis.moveTurtleImageAndDraw(locOrig, locNew);\n\t\t//System.out.println(\" in move - setTurtleLocToViewTurtleLoc 2\");\n\t\tsetTurtleLocToViewTurtleLoc();\n\n\t\tthis.updateTurtleOnView();\n\t}",
"public void move() {\n this.pposX = this.posX;\n this.pposY = this.posY;\n this.posX = newPosX;\n this.posY = newPosY;\n }",
"private void move() {\n\t\t\tx += Math.PI/12;\n\t\t\thead.locY = intensity * Math.cos(x) + centerY;\n\t\t\thead.yaw = spinYaw(head.yaw, 3f);\n\t\t\t\t\t\n\t\t\tPacketHandler.teleportFakeEntity(player, head.getId(), \n\t\t\t\tnew Location(player.getWorld(), head.locX, head.locY, head.locZ, head.yaw, 0));\n\t\t}",
"void moving() {\n\t\tSystem.out.println(\"Moving the car\");\r\n\t}",
"public void move()\n\t{\n\t\tx = x + frogVelocityX;\n\t}",
"void move() {\n\t\tif (reachedEdge()) {\n\t\t\tvelocityX = velocityX * -1;\n\t\t\ty = y + 50;\n\t\t}\n\t\tif (reachedLeft()) {\n\t\t\tvelocityX = velocityX * -1;\n\t\t\ty = y + 50;\n\t\t}\n\n\t\tx = x + velocityX;\n\t}",
"public void move()\n {\n xPosition = xPosition + xSpeed;\n yPosition = yPosition + ySpeed;\n draw();\n if (xPosition >= rightBound - diameter)\n {\n xSpeed = -(xSpeed);\n\n }\n else\n {\n }\n if (xPosition <= leftBound)\n {\n xSpeed = -(xSpeed);\n\n }\n else\n {\n }\n if (yPosition <= upBound)\n {\n ySpeed = -(ySpeed);\n\n }\n else\n {\n }\n if (yPosition >= lowBound - diameter)\n {\n ySpeed = -(ySpeed);\n\n }\n else \n {\n }\n\n }",
"public void move(TrackerState state) {\n\t\t\n\t\tcurrentPosition[0] = state.devicePos[0];\n\t\tcurrentPosition[1] = state.devicePos[1];\n\t\tcurrentPosition[2] = state.devicePos[2];\n\t\t\n\t\tboolean processMove = false;\n\t\t\n\t\tboolean isWheel = (state.actionType == TrackerState.TYPE_WHEEL);\n\t\tboolean isZoom = (isWheel || state.ctrlModifier);\n\t\t\n\t\tif (isZoom) {\n\t\t\t\n\t\t\tdirection[0] = 0;\n\t\t\tdirection[1] = 0;\n\t\t\t\n\t\t\tif (isWheel) {\n\t\t\t\tdirection[2] = state.wheelClicks * 0.1f;\n\t\t\t\t\n\t\t\t} else if (state.ctrlModifier) {\n\t\t\t\tdirection[2] = (currentPosition[1] - startPosition[1]);\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tdirection[2] = 0;\n\t\t\t}\n\t\t\t\n\t\t\tif (direction[2] != 0) {\n\t\t\t\t\n\t\t\t\tdirection[2] *= 16;\n\t\t\t\t\n\t\t\t\tdata.viewpointTransform.getTransform(startViewMatrix);\n\t\t\t\tstartViewMatrix.get(positionVector);\n\t\t\t\t\n\t\t\t\tinVector.x = startViewMatrix.m02;\n\t\t\t\tinVector.y = startViewMatrix.m12;\n\t\t\t\tinVector.z = startViewMatrix.m22;\n\t\t\t\tinVector.normalize();\n\t\t\t\tinVector.scale(direction[2]);\n\t\t\t\t\n\t\t\t\tpositionVector.add(inVector);\n\t\t\t\t\n\t\t\t\t// stay above the floor\n\t\t\t\tif (positionVector.y > 0) {\n\t\t\t\t\tdestViewMatrix.set(startViewMatrix);\n\t\t\t\t\tdestViewMatrix.setTranslation(positionVector);\n\t\t\t\t\t\n\t\t\t\t\tprocessMove = true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t\n\t\t\tdirection[0] = -(startPosition[0] - currentPosition[0]);\n\t\t\tdirection[1] = -(currentPosition[1] - startPosition[1]);\n\t\t\tdirection[2] = 0;\n\t\t\t\n\t\t\tfloat Y_Rotation = direction[0];\n\t\t\tfloat X_Rotation = direction[1];\n\t\t\t\n\t\t\tif( ( Y_Rotation != 0 ) || ( X_Rotation != 0 ) ) {\n\t\t\t\t\n\t\t\t\tdouble theta_Y = -Y_Rotation * Math.PI;\n\t\t\t\tdouble theta_X = -X_Rotation * Math.PI;\n\t\t\t\t\n\t\t\t\tdata.viewpointTransform.getTransform(startViewMatrix);\n\t\t\t\tstartViewMatrix.get(positionVector);\n\t\t\t\t\n\t\t\t\tpositionVector.x -= centerOfRotation.x;\n\t\t\t\tpositionVector.y -= centerOfRotation.y;\n\t\t\t\tpositionVector.z -= centerOfRotation.z;\n\t\t\t\t\n\t\t\t\tif (theta_Y != 0) {\n\n\t\t\t\t\trot.set(0, 1, 0, (float)theta_Y);\n\t\t\t\t\tmtx.set(rot);\n\t\t\t\t\tmtx.transform(positionVector);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (theta_X != 0) {\n\t\t\t\t\t\n\t\t\t\t\tvec.set(positionVector);\n\t\t\t\t\tvec.normalize();\n\t\t\t\t\tfloat angle = vec.angle(Y_AXIS);\n\t\t\t\t\t\n\t\t\t\t\tif (angle == 0) {\n\t\t\t\t\t\tif (theta_X > 0) {\n\t\t\t\t\t\t\trightVector.x = startViewMatrix.m00;\n\t\t\t\t\t\t\trightVector.y = startViewMatrix.m10;\n\t\t\t\t\t\t\trightVector.z = startViewMatrix.m20;\n\t\t\t\t\t\t\trightVector.normalize();\n\t\t\t\t\t\t\trot.set(rightVector.x, 0, rightVector.z, (float)theta_X);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\trot.set(0, 0, 1, 0);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ((theta_X + angle) < 0) {\n\t\t\t\t\t\t\ttheta_X = -(angle - 0.0001f);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvec.y = 0;\n\t\t\t\t\t\tvec.normalize();\n\t\t\t\t\t\trot.set(vec.z, 0, -vec.x, (float)theta_X);\n\t\t\t\t\t}\n\t\t\t\t\tmtx.set(rot);\n\t\t\t\t\tmtx.transform(positionVector);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tpositionPoint.x = positionVector.x + centerOfRotation.x;\n\t\t\t\tpositionPoint.y = positionVector.y + centerOfRotation.y;\n\t\t\t\tpositionPoint.z = positionVector.z + centerOfRotation.z;\n\t\t\t\t\n\t\t\t\t// don't go below the floor\n\t\t\t\tif (positionPoint.y > 0) {\n\t\t\t\t\t\n\t\t\t\t\tmatrixUtils.lookAt(positionPoint, centerOfRotation, Y_AXIS, destViewMatrix);\n\t\t\t\t\tmatrixUtils.inverse(destViewMatrix, destViewMatrix);\n\t\t\t\t\t\n\t\t\t\t\tprocessMove = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (processMove) {\n\t\t\t\n\t\t\tboolean collisionDetected = \n\t\t\t\tcollisionManager.checkCollision(startViewMatrix, destViewMatrix);\n\t\t\t\n\t\t\tif (!collisionDetected) {\n\t\t\t\tAV3DUtils.toArray(destViewMatrix, array);\n\t\t\t\tChangePropertyTransientCommand cptc = new ChangePropertyTransientCommand(\n\t\t\t\t\tve, \n\t\t\t\t\tEntity.DEFAULT_ENTITY_PROPERTIES, \n\t\t\t\t\tViewpointEntity.VIEW_MATRIX_PROP,\n\t\t\t\t\tarray,\n\t\t\t\t\tnull);\n\t\t\t\tcmdCntl.execute(cptc);\n\t\t\t\tif (statusManager != null) {\n\t\t\t\t\tstatusManager.fireViewMatrixChanged(destViewMatrix);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tstartPosition[0] = currentPosition[0];\n\t\tstartPosition[1] = currentPosition[1];\n\t\tstartPosition[2] = currentPosition[2];\n\t}",
"public void preform_action() {\n\t\tCarPanelState car_panel_state;\n\t\tSensorData sensor_data;\n\n\t\tint actuator_comp_time = 300;\n\t\tint actuator_deadline = 1000;\n\t\tNature actuator_nature = Task.Nature.APERIODIC;\n\t\tint actuator_movement_amount = 80;\n\n\t\tint closest = 100000;\n\n\t\tswitch (this.action) {\n\t\tcase SET_CAR_SPEED:\n\t\t\tSystem.out.println(\"set speed:\\t\" + this.set_point);\n\t\t\tthis.car_panel_controller.set_target_speed(this.set_point);\n\t\t\tbreak;\n\t\tcase MOVE_UP_CAR:\n\t\t\tSystem.out.println(\"Move_UP:\\t\" + this.set_point);\n\t\t\tthis.car_panel_controller.move_up(this.set_point);\n\t\t\tbreak;\n\t\tcase MOVE_DOWN_CAR:\n\t\t\tSystem.out.println(\"Move_DOWN:\\t\" + this.set_point);\n\t\t\tthis.car_panel_controller.move_down(this.set_point);\n\t\t\tbreak;\n\t\tcase READ_CONE_SENSOR:\n\t\t\tcar_panel_state = this.car_panel_controller.car_panel.getState();\n\t\t\tsensor_data = this.car_panel_controller.get_sensor_data();\n\n\t\t\tint move_up = 0;\n\t\t\tint move_down = 0;\n\n\t\t\tSystem.out.println(\"cone sensor:\\t\" + sensor_data.cone_sensor.cones);\n\n\t\t\t// what to do to avoid hitting the cone\n\t\t\t// if the bottom of the car will hit the cone, move up\n\t\t\tfor (Cone cone : sensor_data.cone_sensor.cones) {\n\t\t\t\tif (will_collide(car_panel_state.main_car, cone)) {\n\t\t\t\t\t// check if the top of the cone will hit the car\n\t\t\t\t\tif ((cone.y_pos < car_panel_state.main_car.y_pos + car_panel_state.main_car.height)\n\t\t\t\t\t\t\t&& (cone.y_pos > car_panel_state.main_car.y_pos)) {\n\t\t\t\t\t\t// the bottom of the car will hit, so move up\n\t\t\t\t\t\tmove_down++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// the top of the car will hit, so move down\n\t\t\t\t\t\t// this.processing_controller.add_task(task);\n\t\t\t\t\t\tmove_up++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// set the actuator deadline based on the closest cone\n\t\t\t\tif (cone.origional_x_pos < closest) {\n\t\t\t\t\tclosest = cone.origional_x_pos;\n\n\t\t\t\t\tint distance_from_cone = cone.origional_x_pos - car_panel_state.main_car.total_moved;\n\t\t\t\t\tint speed_by_tick = 1; // car_panel_state.main_car.speed /\n\t\t\t\t\t\t\t\t\t\t\t// CarPanelController.speed_increment;\n\n\t\t\t\t\tactuator_deadline = distance_from_cone / speed_by_tick;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// if we need to move decide what task we need to insert\n\t\t\tif (move_up + move_down > 0) {\n\t\t\t\t// see if more obstacles would be avoided by moving up or down\n\t\t\t\tif (move_down > move_up) {\n\t\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.MOVE_DOWN_CAR, this.processing_controller, this.car_panel_controller,\n\t\t\t\t\t\t\tactuator_movement_amount);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t\t} else {\n\t\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.MOVE_UP_CAR, this.processing_controller, this.car_panel_controller,\n\t\t\t\t\t\t\tactuator_movement_amount);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase READ_OTHER_CAR_SENSOR:\n\t\t\tcar_panel_state = this.car_panel_controller.car_panel.getState();\n\t\t\tsensor_data = this.car_panel_controller.get_sensor_data();\n\n\t\t\tmove_up = 0;\n\t\t\tmove_down = 0;\n\n\t\t\tSystem.out.println(\"car sensor:\\t\" + sensor_data.other_car_sensor.other_cars);\n\n\t\t\t// what to do to avoid hitting the cone\n\t\t\t// if the bottom of the car will hit the cone, move up\n\t\t\tfor (Car car : sensor_data.other_car_sensor.other_cars) {\n\t\t\t\tif (will_collide(car_panel_state.main_car, car)) {\n\t\t\t\t\t// check if the top of the cone will hit the car\n\t\t\t\t\tif ((car.y_pos < car_panel_state.main_car.y_pos + car_panel_state.main_car.height)\n\t\t\t\t\t\t\t&& (car.y_pos > car_panel_state.main_car.y_pos)) {\n\t\t\t\t\t\t// the bottom of the car will hit, so move up\n\t\t\t\t\t\tmove_down++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// the top of the car will hit, so move down\n\t\t\t\t\t\t// this.processing_controller.add_task(task);\n\t\t\t\t\t\tmove_up++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// set the actuator deadline based on the closest cone\n\t\t\t\tif (car.origional_x_pos < closest) {\n\t\t\t\t\tclosest = car.origional_x_pos;\n\n\t\t\t\t\tint distance_from_cone = car.origional_x_pos - car_panel_state.main_car.total_moved;\n\t\t\t\t\tint speed_by_tick = 1; // car_panel_state.main_car.speed /\n\t\t\t\t\t\t\t\t\t\t\t// CarPanelController.speed_increment;\n\n\t\t\t\t\tactuator_deadline = distance_from_cone / speed_by_tick;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// if we need to move decide what task we need to insert\n\t\t\tif (move_up + move_down > 0) {\n\t\t\t\t// see if more obstacles would be avoided by moving up or down\n\t\t\t\tif (move_down > move_up) {\n\t\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.MOVE_DOWN_CAR, this.processing_controller, this.car_panel_controller,\n\t\t\t\t\t\t\tactuator_movement_amount);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t\t} else {\n\t\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.MOVE_UP_CAR, this.processing_controller, this.car_panel_controller,\n\t\t\t\t\t\t\tactuator_movement_amount);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase READ_SPEED_SIGN_SENSOR:\n\t\t\tcar_panel_state = this.car_panel_controller.car_panel.getState();\n\t\t\tsensor_data = this.car_panel_controller.get_sensor_data();\n\n\t\t\tSystem.out.println(\"speed sensor:\\t\" + sensor_data.speed_sign_sensor.signs);\n\n\t\t\t// what to do to avoid hitting the cone\n\t\t\t// if the bottom of the car will hit the cone, move up\n\t\t\tfor (Sign sign : sensor_data.speed_sign_sensor.signs) {\n\t\t\t\t// check the distance to the sign. If the sign is within 300,\n\t\t\t\t// slow down\n\t\t\t\tint main_car_x = car_panel_state.main_car.origional_x_pos + car_panel_state.main_car.total_moved;\n\t\t\t\tif (sign.origional_x_pos - main_car_x < 1000) {\n\t\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.SET_CAR_SPEED, this.processing_controller, this.car_panel_controller,\n\t\t\t\t\t\t\tsign.speed_limit);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t\t}\n\n\t\t\t\t// set the actuator deadline based on the closest cone\n\t\t\t\tif (sign.origional_x_pos < closest) {\n\t\t\t\t\tclosest = sign.origional_x_pos;\n\n\t\t\t\t\tint distance_from_cone = sign.origional_x_pos - car_panel_state.main_car.total_moved;\n\t\t\t\t\tint speed_by_tick = 1; // car_panel_state.main_car.speed /\n\t\t\t\t\t\t\t\t\t\t\t// CarPanelController.speed_increment;\n\n\t\t\t\t\tactuator_deadline = distance_from_cone / speed_by_tick;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase READ_STOP_SIGN_SENSOR:\n\t\t\tcar_panel_state = this.car_panel_controller.car_panel.getState();\n\t\t\tsensor_data = this.car_panel_controller.get_sensor_data();\n\n\t\t\tSystem.out.println(\"stop sensor:\\t\" + sensor_data.stop_sign_sensor.signs);\n\n\t\t\t// what to do to avoid hitting the cone\n\t\t\t// if the bottom of the car will hit the cone, move up\n\t\t\tfor (Sign sign : sensor_data.stop_sign_sensor.signs) {\n\t\t\t\t// check the distance to the sign. If the sign is within 300,\n\t\t\t\t// slow down\n\t\t\t\tint main_car_x = car_panel_state.main_car.origional_x_pos + car_panel_state.main_car.total_moved;\n\t\t\t\tif (sign.origional_x_pos - main_car_x < 500) {\n\t\t\t\t\t// submit a task to stop at the stop sign\n\t\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.SET_CAR_SPEED, this.processing_controller, this.car_panel_controller, 0);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\n\t\t\t\t\t// submit a task to start moving again\n\t\t\t\t\ttask = new Task(actuator_comp_time * 100, 0, actuator_deadline * 100, actuator_nature,\n\t\t\t\t\t\t\tTask.Action.SET_CAR_SPEED, this.processing_controller, this.car_panel_controller, 50);\n\t\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t\t}\n\n\t\t\t\t// set the actuator deadline based on the closest cone\n\t\t\t\tif (sign.origional_x_pos < closest) {\n\t\t\t\t\tclosest = sign.origional_x_pos;\n\n\t\t\t\t\tint distance_from_cone = sign.origional_x_pos - car_panel_state.main_car.total_moved;\n\t\t\t\t\tint speed_by_tick = 1; // car_panel_state.main_car.speed /\n\t\t\t\t\t\t\t\t\t\t\t// CarPanelController.speed_increment;\n\n\t\t\t\t\tactuator_deadline = distance_from_cone / speed_by_tick;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase READ_LANE_SENSOR:\n\t\t\tcar_panel_state = this.car_panel_controller.car_panel.getState();\n\t\t\tsensor_data = this.car_panel_controller.get_sensor_data();\n\n\t\t\tSystem.out.println(\"lane sensor:\\t\" + sensor_data.lane_sensor.within_lane);\n\n\t\t\t// if we aren't within our lane\n\t\t\tif (sensor_data.lane_sensor.within_lane == false) {\n\t\t\t\t// move back to origional y position\n\t\t\t\tint main_car_y_offset = car_panel_state.main_car.origional_y_pos - car_panel_state.main_car.y_pos;\n\t\t\t\t// if car below where it should be\n\n\t\t\t\tTask task = new Task(actuator_comp_time, 0, actuator_deadline, actuator_nature,\n\t\t\t\t\t\tTask.Action.MOVE_DOWN_CAR, this.processing_controller, this.car_panel_controller,\n\t\t\t\t\t\tmain_car_y_offset);\n\t\t\t\tthis.processing_controller.add_task(task);\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\t}",
"public void move(){\n x+=xDirection;\n y+=yDirection;\n }",
"@Override\n\tpublic void move() {\n\t\tSystem.out.println(\"Driving a airplane!\");\n\t}",
"@Override\n public void move(){\n setDirectionSpeed(180, 7);\n this.moveTowardsAPoint(target.getCenterX(), target.getCenterY());\n }",
"@Override\n\tpublic void update() {\n\t\tmove();\n\t\tplace();\n\t}",
"@Override\n public void move() {\n this.point.x += vector.x * getCurrentSpeed();\n this.point.y += vector.y * getCurrentSpeed();\n }",
"public void Enter(Car car) {\n\t\tcurrentCar = car;\n\t\tcar.curVelocity=car.maxVelocity;\n\t\tArrayList <Road> tempList = new ArrayList<Road>();\n\t\tfor(int i=0; i<roads.size(); i++){\n\t\t\tif(roads.get(i).roadClosed){\n\t\t\t\ttempList.add(null);\n\t\t\t\t//System.out.println(\"road closed\");\n\t\t\t\t//System.out.println(roads.get(i).getStart() + \", \" + roads.get(i).getEnd());\n\t\t\t}\n\t\t\telse if(roads.get(i).direction == i){\n\t\t\t\ttempList.add(roads.get(i));\n\t\t\t}\n\t\t\telse{\n\t\t\t\ttempList.add(null);\n\t\t\t}\n\n\t\t}\n\t\tnextDir = currentCar.getNextDirection(tempList);\n\t}",
"protected void myCarTrack(AutoCar car, double outerBox) {\n if(car.xpos >= outerBox || car.xpos <= (100-outerBox) || car.ypos >= outerBox || car.ypos <= (100-outerBox))\n {\n camera.turn(180);\n myCar.rotateBy(180, 0, 0, 1);\n } \n }",
"@Override\r\n public void move() {\r\n Grid<Actor> gr = getGrid();\r\n if (gr == null) {\r\n return;\r\n }\r\n Location loc = getLocation();\r\n if (gr.isValid(next)) {\r\n setDirection(getLocation().getDirectionToward(next));\r\n moveTo(next);\r\n } else {\r\n removeSelfFromGrid();\r\n }\r\n Flower flower = new Flower(getColor());\r\n flower.putSelfInGrid(gr, loc);\r\n }",
"public ParentAI(Car car){\n\t\tthis.car = car;\n\t\tthis.currentX = car.getXLocation();\n\t\tthis.currentY = car.getYLocation();\n\t\tthis.currentTile = car.getTileType();\n\t\tthis.tileRotation = car.getTileRotation();\n\t\t\n\t\tfindValidMoveDirections();\n\t}",
"public void moveRobber(HexLocation loc) {\n\n\t}",
"public void move() {\n\t\t// Override move so we don't move, then get location set by owner.\n\t}",
"public void paradiseMove(){\n if (!getCurrentMainCellCoordinates().equals(new DiscreteCoordinates(11, 9))) {\n move(30);\n }\n }",
"public void move(Camera camera) {\n stormCloud.setPosition(0, camera.getPositionY() - 387 * 2);\n cloudRectangle.setPosition(stormCloud.getX(),stormCloud.getY());\n }",
"public void actionPerformed(ActionEvent event){\n String sourceDirection = sourceText.getText();\n String destDirection = destText.getText();\n\n // If input is invalid, return\n if(!sourceDirection.equals(\"N\") && !sourceDirection.equals(\"E\") && !sourceDirection.equals(\"W\") && !sourceDirection.equals(\"S\")){\n return;\n }\n if(!destDirection.equals(\"N\") && !destDirection.equals(\"E\") && !destDirection.equals(\"W\") && !destDirection.equals(\"S\")){\n return;\n }\n // Clear input fields\n // sourceText.setText(\"\");\n // destText.setText(\"\");\n int currentTime = 0;\n\n // If simulation not running currently\n if(!isClicked) {\n currentTime = Integer.parseInt(arrivalTime.getText());\n if(currentTime < 0) System.out.println(\"Invalid Input! Arrival time should be greater than zero.\");\n // arrivalTime.setText(\"\");\n }\n\n //Initialize new Car object\n Car car = null;\n \n // If simulation has not begun yet\n if(!isClicked){\n // Create a car object and associate traffic light with its travel directions\n if(sourceDirection.equals(\"S\") && destDirection.equals(\"E\")){\n car = new Car(lightSE, sourceDirection, destDirection, currentTime);\n }\n\n else if(sourceDirection.equals(\"W\") && destDirection.equals(\"S\")){\n car = new Car(lightWS, sourceDirection, destDirection, currentTime);\n }\n\n else if(sourceDirection.equals(\"E\") && destDirection.equals(\"W\")){\n car = new Car(lightEW, sourceDirection, destDirection, currentTime);\n }\n\n else{\n car = new Car(null, sourceDirection, destDirection, currentTime);\n car.departureTime = 0;\n }\n // Update array of all cars arrived till now\n Cars.add(car);\n\n }\n // If simulation is running\n else{\n // Create a car object and associate traffic light with its travel directions\n if(sourceDirection.equals(\"S\") && destDirection.equals(\"E\")){\n car = new Car(lightSE, sourceDirection, destDirection, 0);\n }\n\n else if(sourceDirection.equals(\"W\") && destDirection.equals(\"S\")){\n car = new Car(lightWS, sourceDirection, destDirection, 0);\n }\n\n else if(sourceDirection.equals(\"E\") && destDirection.equals(\"W\")){\n car = new Car(lightEW, sourceDirection, destDirection, 0);\n }\n\n else{\n car = new Car(null, sourceDirection, destDirection, 0);\n car.departureTime = 0;\n }\n\n // Acquire lock to ensure synchronization while updating the queue shared by the Main thread and the TimerThread\n lock.lock(); \n try{ \n // Add new car to queue\n new_cars.add(car); \n } \n catch(Exception e){ \n e.printStackTrace(); \n } \n finally{\n // Release lock\n lock.unlock(); \n } \n } \n }",
"public void move() {\n\t\tthis.move(velocity.x, velocity.y);\n\t}",
"public void move() {\n if(Objects.nonNull(this.position)) {\n Position position = this.getPosition();\n Function<Position, Position> move = moveRobotInDirectionMap.get(position.getDirection());\n this.position = move.apply(position);\n }\n }",
"public void move() {\n\tupdateSwapTime();\n\tupdateAttackTime();\n\n\tif (enemyNear) {\n\t if (moved) {\n\t\tstopMove();\n\t\tmoved = false;\n\t }\n\t} else {\n\t if (!moved) {\n\t\tcontinueMove();\n\t\tmoved = true;\n\t }\n\n\t x += dx;\n\t y += dy;\n\n\t if (x < speed) {\n\t\tx = speed;\n\t\tdx = (-1) * dx;\n\t }\n\n\t if (y < speed) {\n\t\ty = speed;\n\t\tdy = (-1) * dy;\n\t }\n\n\t if (x > MapSize.getSIZE().getWidth() - 40) {\n\t\tx = MapSize.getSIZE().getWidth() - 40;\n\t\tdx = (-1) * dx;\n\t }\n\n\t if (y > MapSize.getSIZE().getHeight() - 40) {\n\t\ty = MapSize.getSIZE().getHeight() - 40;\n\t\tdy = (-1) * dy;\n\t }\n\t}\n }",
"public static void movePlayer(Player thisPlayer, int moveFields) {\n if (thisPlayer.getOnField() + moveFields <= FIELD_COUNT) {\n thisPlayer.setOnField(thisPlayer.getOnField() + moveFields);\n } else {\n thisPlayer.setOnField(thisPlayer.getOnField() + moveFields - FIELD_COUNT);\n }\n\n //\"Moves\" the car on the board by removing it in the previous location\n // and then set it to the new location.\n InterfaceController.removeAllCars(thisPlayer.getName());\n InterfaceController.setCar(thisPlayer.getOnField(), thisPlayer.getName());\n\n }",
"public void updatePosition(){\n\t\t//maps the position to the closest \"grid\"\n\t\tif(y-curY>=GameSystem.GRID_SIZE/2){\n\t\t\tcurY=curY+GameSystem.GRID_SIZE;\n\t\t\tyGridNearest++;\n\t\t}\n\t\telse if(curX-x>=GameSystem.GRID_SIZE/2){\n\t\t\tcurX=curX-GameSystem.GRID_SIZE;\n\t\t\txGridNearest--;\n\t\t}\n\t\telse if(x-curX>=GameSystem.GRID_SIZE/2){\n\t\t\tcurX=curX+GameSystem.GRID_SIZE;\n\t\t\txGridNearest++;\n\t\t}\n\t\telse if(curY-y>=GameSystem.GRID_SIZE/2){\n\t\t\tcurY=curY-GameSystem.GRID_SIZE;\n\t\t\tyGridNearest--;\n\t\t}\n\t\t//sets the last completely arrived location grid\n\t\tif(y-yTemp>=GameSystem.GRID_SIZE){\n\t\t\tyTemp=yTemp+GameSystem.GRID_SIZE;\n\t\t\ty=yTemp;\n\t\t\tlastY++;\n\t\t}\n\t\telse if(xTemp-x>=GameSystem.GRID_SIZE){\n\t\t\txTemp=xTemp-GameSystem.GRID_SIZE;\n\t\t\tx=xTemp;\n\t\t\tlastX--;\n\t\t}\n\t\telse if(x-xTemp>=GameSystem.GRID_SIZE){\n\t\t\txTemp=xTemp+GameSystem.GRID_SIZE;\n\t\t\tx=xTemp;\n\t\t\tlastX++;\n\t\t}\n\t\telse if(yTemp-y>=GameSystem.GRID_SIZE){\n\t\t\tyTemp=yTemp-GameSystem.GRID_SIZE;\n\t\t\ty=yTemp;\n\t\t\tlastY--;\n\t\t}\n\t\t//only updates nextX and nextY when the move buttons are being pressed down\n\t\t/*\n\t\tif(movable){\n\t\t\tif(direction.equals(\"right\")){\n\t\t\t\t\tnextX=lastX+1;\n\t\t\t\t\tnextY=lastY;\n\t\t\t}\n\t\t\telse if(direction.equals(\"left\")){\n\t\t\t\tnextX=lastX-1;\n\t\t\t\tnextY=lastY;\n\t\t\t}\n\t\t\telse if(direction.equals(\"up\")){\n\t\t\t\tnextY=lastY-1;\n\t\t\t\tnextX=lastX;\n\t\t\t}\n\t\t\telse if(direction.equals(\"down\")){\n\t\t\t\tnextY=lastY+1;\n\t\t\t\tnextX=lastX;\n\t\t\t}\n\t\t}\n\t\t*/\n\t\t\n\t}",
"public void travelForward (double x, double y){\r\n\r\n\t\t\tdouble xDistance = x - odometer.getX();//the distance the robot has to travel in x to get to its destination from current position.\r\n\t\t\tdouble yDistance = y - odometer.getY();//the distance the robot has to travel in y to get to its destination from current position.\r\n\t\t\tdouble distance = Math.sqrt(xDistance*xDistance + yDistance*yDistance);//the overall distance the robot has to travel from current position.\r\n\t\t\r\n\t\t\tdouble xStart = odometer.getX();\r\n\t\t\tdouble yStart = odometer.getY();\r\n\t\t\t\r\n\t\t\tboolean isTravelling = true;\r\n\t\t\t\r\n\t\t\twhile(isTravelling){\r\n\t\t\t\t\r\n\t\t\t\tleftMotor.setSpeed(FORWARD_SPEED);\r\n\t\t\t\trightMotor.setSpeed(FORWARD_SPEED);\r\n\r\n\t\t\t\tleftMotor.rotate(convertDistance(wheelRadius, distance - distanceTravelled), true);\r\n\t\t\t\trightMotor.rotate(convertDistance(wheelRadius, distance - distanceTravelled), true);\r\n\t\t\t\t\r\n\t\t\t\txTravelled =(odometer.getX() - xStart); //update xTravelled\r\n\t\t\t\tyTravelled =(odometer.getY() - yStart);\t//update yTravelled\r\n\t\t\t\t\r\n\t\t\t\tdistanceTravelled = Math.sqrt(xTravelled*xTravelled +yTravelled*yTravelled); //update the distance travelled\r\n\t\t\t\tif (distanceTravelled >= distance){\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tif(getFilteredData() < 15 ){ // if the robot sees an object on the path\r\n\t\t\t\t\tisTravelling = false; //set to false so we exit the loop \r\n\t\t\t\t}\r\n\t\t\t\tLCD.drawString(\"x \", 0, 5);\r\n\t\t\t\tLCD.drawString(\"x \"+odometer.getX(), 0, 5);\r\n\t\t\t\tLCD.drawString(\"y \", 0, 6);\r\n\t\t\t\tLCD.drawString(\"y \"+odometer.getY(), 0, 6);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tleftMotor.setSpeed(0);\r\n\t\t\trightMotor.setSpeed(0);\r\n\t\t\t\t\r\n\t\t\t}",
"public void move()\n {\n universe.erase(this);\n \n // compute new position\n \n yPosition += ySpeed;\n xPosition += xSpeed;\n\n // check if it has hit the ground\n if(yPosition >= (groundPosition - diameter) && ySpeed > 0) {\n yPosition = groundPosition - diameter;\n ySpeed = -ySpeed; \n }\n // check if top\n if(yPosition <= 0 && ySpeed < 0){\n ySpeed = -ySpeed; \n }\n //check right\n if(xPosition >= (universe.getLength() - diameter) && xSpeed >0){\n xSpeed = -xSpeed;\n }\n //check left\n if(xPosition <= 0 && xSpeed < 0){\n xSpeed = -xSpeed;\n }\n \n // draw again at new position\n universe.draw(this);\n }",
"private void moveMap() {\n //String to display current latitude and longitude\n String msg = latitude + \", \" + longitude;\n //Creating a LatLng Object to store Coordinates\n LatLng latLng = new LatLng(latitude, longitude);\n\n CameraPosition cameraPosition = new CameraPosition.Builder()\n .target(latLng) // Sets the center of the map to location user\n .zoom(15) // Sets the zoom\n .bearing(0) // Sets the orientation of the camera to east\n .tilt(40) // Sets the tilt of the camera to 30 degrees\n .build(); // Creates a CameraPosition from the builder\n mMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));\n\n\n // Add Marker to Map\n MarkerOptions option = new MarkerOptions();\n option.title(\" Current Location\");\n option.snippet(\"....\");\n option.position(latLng);\n option.draggable(true);//Making the marker draggable\n\n Marker currentMarker = mMap.addMarker(option);\n currentMarker.showInfoWindow();\n Toast.makeText(this, msg, Toast.LENGTH_LONG).show();\n\n }",
"public void move(GeoCoordFine geoCoord) throws ARDInstanceException;",
"public void move(){\n\t\t\n\t}",
"public void moveTo(int newX, int newY) {\n xPosition = newX-radius;\n yPosition = newY-radius;\n }",
"private void updateMovement() {\n if (_movementTask == null) {\n return;\n }\n\n if (getOwner().isDead() || _followTarget != null && _followTarget.isDead()) {\n cancelMoveTask2(true);\n return;\n }\n\n // Movement is invalid! Queue a new movement and wait again!\n if (_destinationLocation == null)\n {\n if (_waypoints.peek() != null) {\n _destinationLocation = _waypoints.poll();\n\n if (getOwner().getLocation().getGameSector() != null && getOwner().getLocation().getGameSector().hasActiveNeighbours()) {\n double validatedZ = GeoService.getInstance().validateZ(_destinationLocation.getX(), _destinationLocation.getY(), _destinationLocation.getZ());\n if (validatedZ == Double.MIN_VALUE) {\n _movementTick = System.currentTimeMillis();\n getOwner().getAi().setFindPathCompleted(false);\n cancelMoveTask2(true);\n onMovementComplete();\n return;\n }\n\n if (_destinationLocation != null) {\n _destinationLocation.setZ(validatedZ);\n }\n else {\n _movementTick = System.currentTimeMillis();\n getOwner().getAi().setFindPathCompleted(false);\n cancelMoveTask2(true);\n onMovementComplete();\n return;\n }\n _isSectorActive = true;\n }\n else {\n _isSectorActive = false;\n }\n notifySector(true);\n }\n else\n {\n _movementTick = System.currentTimeMillis();\n getOwner().getAi().setFindPathCompleted(true);\n cancelMoveTask2(true);\n onMovementComplete();\n return;\n }\n }\n\n if (_destinationLocation != null) {\n // Update current character movement, the location.\n float deltaTime = (System.currentTimeMillis() - _movementTick) / 1000.0f;\n float movementSpeed = getOwner().getActionStorage().getMoveSpeed();\n if (getOwner().getActionStorage().getAction().getActionChartActionT().getApplySpeedBuffType().isMove()) {\n movementSpeed *= (getOwner().getGameStats().getMoveSpeedRate().getMoveSpeedRate() + 1_000_000.0f) / 1_000_000.0f;\n }\n\n Location ownerLocation = getOwner().getLocation();\n\n double movementDirectionX = _destinationLocation.getX() - ownerLocation.getX();\n double movementDirectionY = _destinationLocation.getY() - ownerLocation.getY();\n double movementDirectionZ = _destinationLocation.getZ() - ownerLocation.getZ();\n\n double directionLength = Math.sqrt(Math.pow(movementDirectionX, 2) + Math.pow(movementDirectionY, 2) + Math.pow(movementDirectionZ, 2));\n movementDirectionX /= directionLength;\n movementDirectionY /= directionLength;\n movementDirectionZ /= directionLength;\n\n ownerLocation.setXYZ(\n ownerLocation.getX() + movementDirectionX * movementSpeed * deltaTime,\n ownerLocation.getY() + movementDirectionY * movementSpeed * deltaTime,\n ownerLocation.getZ() + movementDirectionZ * movementSpeed * deltaTime\n );\n\n if (_isSectorActive && !_navigationType.isAir()) {\n double validatedZ = GeoService.getInstance().validateZ(ownerLocation.getX(), ownerLocation.getY(), ownerLocation.getZ());\n if (validatedZ == Double.MIN_VALUE) {\n getOwner().getAi().setFindPathCompleted(false);\n cancelMoveTask2(true);\n onMovementComplete();\n return;\n }\n\n ownerLocation.setZ(validatedZ);\n }\n\n if (ownerLocation.isValid() && World.getInstance().getWorldMap().updateLocation(getOwner(), ownerLocation.getX(), ownerLocation.getY())) {\n double distanceToPoint = MathUtils.getDistance(ownerLocation, _destinationLocation) - getOwner().getTemplate().getBodySize();\n notifyVehicleMovement();\n\n if (_followTarget != null) {\n distanceToPoint -= _followTarget.getTemplate().getBodySize();\n\n if (!MathUtils.isInRange(_destinationLocation, _followTarget.getLocation(), 150)) {\n _destinationLocation.setLocation(_followTarget.getLocation());\n notifySector(true);\n } else { // No more waypoint's available. Send movement stop and events.\n if (distanceToPoint < 75 || distanceToPoint < getOwner().getTemplate().getAttackRange() && getOwner().getAi().getBehavior().isChase()) {\n getOwner().getAi().setFindPathCompleted(true);\n cancelMoveTask2(false);\n onMovementComplete();\n }\n }\n } else {\n // Check if we are near another destination, then we will\n // switch to another waypoint instead to continue our journey.\n Location nextWaypoint = _waypoints.peek();\n if (nextWaypoint != null) {\n if (distanceToPoint < 100) {\n _destinationLocation = null;\n }\n } else { // No more waypoint's available. Send movement stop and events.\n if (distanceToPoint < 75 || distanceToPoint < getOwner().getTemplate().getAttackRange() && getOwner().getAi().getBehavior().isChase()) {\n getOwner().getAi().setFindPathCompleted(true);\n cancelMoveTask2(false);\n onMovementComplete();\n }\n }\n }\n } else {\n getOwner().getAi().setFindPathCompleted(false);\n cancelMoveTask2(true);\n onMovementComplete();\n }\n }\n _movementTick = System.currentTimeMillis();\n }",
"public void move() {\n\t\tif (!visible) {\r\n\t\t\thideTurtle();\r\n\t\t}\r\n\t}",
"public void moveByPoint(Point p, CarRect[] cars, boolean fromSolver) {\n\t\tif (!isGhosting) {\n\t\t\trealPoint = this.getLocation();\n\t\t\tisGhosting = true;\n\t\t}\n\t\tint tempX = x;\n\t\tint tempY = y;\n\t\tif (moveCapabilites == 0)\n\t\t\tx = p.x;\n\t\telse if (moveCapabilites == 1)\n\t\t\ty = p.y;\n\t\telse if (Math.abs(realPoint.x - p.x) > Math.abs(realPoint.y - p.y)) {\n\t\t\tx = p.x;\n\t\t\ty = realPoint.y;\n\t\t} else {\n\t\t\tx = realPoint.x;\n\t\t\ty = p.y;\n\t\t}\n\t\tdouble dis = Math.sqrt((tempX - x)*(tempX - x)+(tempY - y)*(tempY - y));\n\t\t\n\t\tif (fromSolver)\n\t\t\tdis = 0;\n\n\t\tfor(CarRect t: cars){\n\t\t\tif ((t != this && this.intersects(t)) || dis > tileDim * 1.5){\n\t\t\t\tx = tempX;\n\t\t\t\ty = tempY;\n\t\t\t}\n\t\t}\n\t\tfor(Rectangle t: borders){\n\t\t\tif ((t != this && this.intersects(t)) || dis > tileDim * 1.5){\n\t\t\t\tx = tempX;\n\t\t\t\ty = tempY;\n\t\t\t}\n\t\t}\n\t}",
"public void moveBomber(){\n\t\t\t\n\t\t\tif (startredtimer) redtimer++;\n\t\t\tif (redtimer > 5) {\n\t\t\t\tredtimer = 0;\n\t\t\t\tstartredtimer = false;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tif (rand.nextInt(21) == 20){ //controls the switching of directions\n\t\t\t\tif (direction == 1) direction = 0;\n\t\t\t\telse if (direction == 0) direction = 1;\n\t\t\t}\n\t\t\tif (direction == 1){ //actually moves the plain\n\t\t\t\tx += 10;\n\t\t\t\tr = true;\n\t\t\t}\n\t\t\telse if (direction == 0){\n\t\t\t\tx -= 10;\n\t\t\t\tr = false;\n\t\t\t}\n\t\t\t\n\t\t\tif (x <= 0) x = 992; //handles the ofscrean plane\n\t\t\telse if ( x >= 992) x = 0;\n\t\t\t\n\t\t\tthis.setBounds(x,y,100,50); //updates the bounds\n\t\t\t\n\t\t}",
"public void Move (double distancia){\n if(isPowerOn) {\n double consumeGas = this.gasConsumption * distancia;\n if (consumeGas > gas) {\n double distance = consumeGas/this.gasConsumption;\n gas = 0;\n this.mileage += distance;\n System.out.println(\"You can continue only \" + distance + \" km more\");\n } else {\n gas -= consumeGas;\n this.mileage += distancia;\n }\n System.out.println(\"you have traveled by car\" + this.mileage + \" km\");\n }\n else\n {\n System.out.println(\"Car is powerOff, it is not possible to move\");\n }\n }",
"void accelerate() {\n isAccelerating = true;\n Bukkit.getScheduler().scheduleSyncRepeatingTask(Cars.getInstance(), new BukkitRunnable() {\n @Override\n public void run() {\n if (!isAccelerating) {\n cancel();\n return;\n } else if (CAR.getAcceleration(DIRECTION.getOpposite()).isAccelerating) {\n // Just stop the car if both cars are accelerating because it means the driver is holding down 's'\n // and 'w' at the same time.\n CAR.stopCompletely();\n return;\n }\n\n Minecart minecart = CAR.getMinecart();\n Vector velocity = minecart.getVelocity();\n velocity.add(/* TODO ACCELERATION direction*/new Vector());\n if (velocity.length() >= minecart.getMaxSpeed()) isAccelerating = false;\n minecart.setDerailedVelocityMod(velocity);\n }\n }, 1, 1);\n }",
"public void redoMove(){\n circleObj.setX(newX);\n circleObj.setY(newY);\n }",
"public void move(){\n\t\tif (currentFloor == TOTALFLOORS) currentDirection = \"DOWN\"; else currentDirection =\"UP\";\t\t//sets inital direction for the elevator.\n\t\tfor (int x = 1; x <= TOTALFLOORS; x++){\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//This loop will move the elevator through each floor. \n\t\t\tif (getTotalPassDestFloor()[currentFloor] >0 || destRequest[currentFloor] == 'Y')this.stop(); \t//Checks for the destined passengers or registered request for the current floor.\n\t\t\tif (currentDirection == \"UP\") currentFloor++; else currentFloor--;\t\t\t\t\t\t\t//Moves the elevator up/down based on the direction\n\t\t}\n\t\tif (currentFloor == 8) currentFloor--;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Adjusts currentfloor value when elevator-\n\t\tif (currentFloor == 0) currentFloor++;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//-is at first or top most floor\n\t}",
"public void move(int distance);",
"public static void changePosition() {\n int direction;\n int speed;\n int newTopX;\n int newTopY;\n\n for (int i = 0; i < numShapes; ++i) {\n direction = moveDirection[i];\n speed = moveSpeed[i];\n newTopX = xTopLeft[i];\n newTopY = yTopLeft[i];\n\n //the switch uses the direction the speed should be applied to in order to find the new positions\n switch (direction) {\n case 0 -> {\n newTopX = newTopX - (speed);\n xTopLeft[i] = newTopX;\n }\n //upper left 135 degrees\n case 1 -> {\n newTopX = newTopX - (speed);\n xTopLeft[i] = newTopX;\n newTopY = newTopY - (speed);\n yTopLeft[i] = newTopY;\n }\n case 2 -> {\n newTopY = newTopY - (speed);\n yTopLeft[i] = newTopY;\n }\n //upper right 45 degrees\n case 3 -> {\n newTopX = newTopX + (speed);\n xTopLeft[i] = newTopX;\n newTopY = newTopY - (speed);\n yTopLeft[i] = newTopY;\n }\n case 4 -> {\n newTopX = newTopX + (speed);\n xTopLeft[i] = newTopX;\n }\n //bottom right 315 degrees\n case 5 -> {\n newTopX = newTopX + (speed);\n xTopLeft[i] = newTopX;\n newTopY = newTopY + (speed);\n yTopLeft[i] = newTopY;\n }\n case 6 -> {\n newTopY = newTopY + (speed);\n yTopLeft[i] = newTopY;\n }\n //bottom left 225 degrees\n case 7 -> {\n newTopX = newTopX - (speed);\n xTopLeft[i] = newTopX;\n newTopY = newTopY + (speed);\n yTopLeft[i] = newTopY;\n }\n }\n }\n }",
"public void moveCar(Car c,Moves choosenMove) {\n\t\tc.makeAcceleration(choosenMove);\t\t\n\t\t\n\t\tAsphalt actual = getAsphalt(c);\n\t\tif(!isAsphaltOnTrack(actual)||actual==null) {\n\t\t\tc.setOnTrack(false);\n\t\t\treturn;\n\t\t}\n\t\t\tAsphalt next = getAsphalt(actual.x+c.getInertia().x,actual.y+c.getInertia().y,this.trk);\t\t\n\t\tif(isAsphaltOnTrack(next)) {\n\t\t\tList<Point> vector = new ArrayList<>(BresenhamAlgorithm.findLine(actual.getLocation(),next.getLocation()));\n\t\t\tvector = getAsphaltArray(vector);\n\t\t\tif(!checkLines(vector)) {\n\t\t\t\tnext.setEmpty();\n\t\t\t\tc.setOnTrack(false);\n\t\t\t\treturn;\n\t\t\t}\t\t\t\t\n\t\t\tVector<Integer> ids = this.matchCheckPoint(vector);\n\t\t\tfor(Integer i:ids) { \n\t\t\t\tc.addCheckPassed(i);\n\t\t\t}\n\t\tif(next.setCar(c)) {}\n\t\telse\n\t\t\tc.setOnTrack(false);\t\t\t\t\n\t\t}\n\t\tactual.setEmpty();\t\t\n\t}",
"public void move()\n {\n move(WALKING_SPEED);\n }",
"public void move()\r\n\t{\r\n\t\tmoveHor(xVel);\r\n\t\tmoveVert(yVel);\r\n\t}",
"public void move() {\n\t\tif(path.size() != 0) {\n\t\t\tCoordinate c = path.get(0);\n\t\t\tint x1 = c.x;\n\t\t\tint y1 = c.y;\n\t\t\t\t\n\t\t\tif(Math.abs(x1 - x) > speed || Math.abs(y1 - y) > speed) {\n\t\t\t\tif(this.x > x1) {\n\t\t\t\t\tvy = 0;\n\t\t\t\t\ttx.translate(-speed, vy);\n\t\t\t\t\tthis.x -= speed;\n\t\t\t\t}\n\t\t\t\n\t\t\t\telse if(this.x < x1) {\n\t\t\t\t\t//this.x += speed;\n\t\t\t\t\tvy = 0;\n\t\t\t\t\ttx.translate(speed, vy);\n\t\t\t\t\tthis.x += speed;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse if(this.y > y1) {\n\t\t\t\t\t//vx = 0;\n\t\t\t\t\ttx.translate(0, -speed);\n\t\t\t\t\tthis.y -= speed;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse if(this.y < y1) {\n\t\t\t\t\t//vx = 0;\n\t\t\t\t\ttx.translate(0, speed);\n\t\t\t\t\tthis.y += speed;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\telse {\n\t\t\t\tpath.remove(0);\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t}",
"@Override\n public void movement() {\n if (isAlive()) {\n //Prüfung ob A oder die linke Pfeiltaste gedrückt ist\n if (Keyboard.isKeyDown(KeyEvent.VK_LEFT) || Keyboard.isKeyDown(KeyEvent.VK_A)) {\n //Änder die X Position um den speed wert nach link (verkleinert sie)\n setPosX(getPosX() - getSpeed());\n //Prüft ob der Spieler den linken Rand des Fensters erreicht hat\n if (getPosX() <= 0) {\n //Setzt die X Position des Spielers an den Rand des Fensters zurück\n setPosX(0);\n }\n }\n //Prüfung ob D oder die rechte Pfeiltaste gedrückt ist\n if (Keyboard.isKeyDown(KeyEvent.VK_RIGHT) || Keyboard.isKeyDown(KeyEvent.VK_D)) {\n //Änder die X Position um den speed wert nach rechts (vergrößert sie)\n setPosX(getPosX() + getSpeed());\n //Prüft ob der Spieler den rechten Rand des Fensters erreicht hat\n if (getPosX() >= Renderer.getWindowSizeX() - getWight() - 7) {\n //Setzt die X Position des Spielers an den Rand des Fensters zurück\n setPosX(Renderer.getWindowSizeX() - getWight() - 7);\n }\n }\n //Aktualsiert die Hitbox\n setBounds();\n }\n }",
"public void move() {\r\n posX += movementX;\r\n posY += movementY;\r\n anchorX += movementX;\r\n anchorY += movementY;\r\n }",
"public void move() {\n\r\n\t}",
"public void move() {\r\n\t\tSystem.out.print(\"This Goose moves forward\");\r\n\t}",
"public void update()\n {\n if (frames_since_update++ < UPDATE_AFTER_FRAMES)\n return;\n frames_since_update = 0;\n\n //For each vehicle in the world, determine which station is the closest.\n Actor[] actors = world.getActors();\n for (Actor actor: actors)\n {\n if (!(actor instanceof Vehicle))\n continue;\n Vehicle vehicle = (Vehicle) actor;\n\n //Iterate over each station until the closest one is found.\n Station closest_station = null;\n float closest_station_distance = Float.MAX_VALUE;\n for (Station station : stations)\n {\n if (station == null)\n continue;\n\n float new_distance = vehicle.distance(station);\n if (new_distance < closest_station_distance)\n {\n closest_station = station;\n closest_station_distance = new_distance;\n }\n }\n\n vehicle.setClosestStation(closest_station);\n }\n }",
"public void Obstaclemove() {\n for (int i = 0; i < getNumberObstacles(); i++) {\n if (ObstacleDeplace.class.isInstance(getObstacle()[i])) {\n getObstacle()[i].setX(getObstacle()[i].getX() - getObstacle()[i].getSpeed());\n\n if (getObstacle()[i].getX() < -200) {\n getObstacle()[i].setX(600);\n getObstacle()[i].setSpeed(randomGenerator.nextFloat());\n }\n }\n setChanged();\n notifyObstacle(i, getObstacle()[i].getX(), getObstacle()[i].getY());\n }\n }",
"public void updateTrifecta() {\n\n\t\taccelX = (xl.getX() - 0) * 9.8 * Math.cos(angleToForward * (Math.PI / 180.0)); //convert from g's\n\t\taccelY = (xl.getY() - 0) * 9.8 * Math.sin(angleToForward * (Math.PI / 180.0));\n\t\taccelZ = (xl.getZ() - 0) * 9.8;\n\t\t\n\t\t//velocity updated by acceleration integral\n\t\tvelX += accelX * dT;\n\t\tvelY += accelY * dT;\n\t\tvelZ += accelZ * dT;\n\t\t\n\t\t//position updated by velocity integral and adjusted for robot rotation\n\t\tposX += velX * dT;\n\t\tposY += velY * dT;\n\t\tposZ += velZ * dT;\n\t}",
"public static void updatePosition() {\n\t\tfor (int i = 0; i < TitanV4.planets.length; i++) { //compute forces between all celestial corpses\n\t\t\tfor(int j=i; j<TitanV4.planets.length; j++){\n\t\t\t\tif (i != j) {\n\t\t\t\t\tdouble upper = TitanV4.G*TitanV4.planets[i].getMass() * TitanV4.planets[j].getMass();\n\t\t\t\t\tdouble lower = TitanV4.planets[i].getPosition().distanceFrom(TitanV4.planets[j].getPosition());\n\t\t\t\t\tdouble gravitation = upper/lower;\n\t\t\t\t\tVector a = new Vector();\n\t\t\t\t\ta = TitanV4.planets[i].getPosition().substract(TitanV4.planets[j].getPosition()).normalize().multiply(-1);\n\n\t\t\t\t\tTitanV4.planets[i].force.add(a.multiply(gravitation));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//compute acceleration vector for each celestial corpse but the sun\n\t\tfor(int i=1; i<TitanV4.planets.length; i++){\n\t\t\tTitanV4.planets[i].acceleration = (TitanV4.planets[i].force.divide(TitanV4.planets[i].getMass()));\n\t\t}\n\n\t\t//calculate change in speed over deltaT\n\t\tfor(int i=1; i<TitanV4.planets.length; i++){\n\t\t\tVector oldVelocity = new Vector(TitanV4.planets[i].velocity);\n\t\t\tTitanV4.planets[i].velocity.add((TitanV4.planets[i].acceleration.multiply(TitanV4.deltaT)));\n\n\t\t\tVector posChange = new Vector();\n\t\t\tposChange = (oldVelocity.add(velocity).divide(2)).multiply(TitanV4.deltaT);\n\t\t\tTitanV4.planets[i].pos.add(posChange);\n\t\t}\n\t}",
"public void updatePosition(Coordinate c) {\n\t\tpointMoveTo.setCoordinate(c);\n\t\tPedSimCity.agents.setGeometryLocation(agentLocation, pointMoveTo);\n\t}",
"public void go_to_switch_position() {\n stop_hold_arm();\n Dispatcher.get_instance().add_job(new JMoveArm(RobotMap.Arm.pot_value_switch, 0.9, 0.7, 0.7, 0.2, 0.8, false, false));\n hold_arm();\n }",
"public void doGoToLocation(Structure structure)\n\t{\n\t\tif(vehicle.currentLocation != null)\n\t\t{\n\t\t\tx = (int)vehicle.currentLocation.getParkingLocation().getX();\n\t\t\ty = (int)vehicle.currentLocation.getParkingLocation().getY();\n\t\t}\n\t\tdestination = structure;\n\t\tdestX = (int)destination.getParkingLocation().getX();\n\t\tdestY = (int)destination.getParkingLocation().getY();\n\t\tfired = false;\n\t\tpresent = true;\n\n\t\tcurrent = new Point(x/CityPanel.GRID_SIZE,y/CityPanel.GRID_SIZE);\n\t\tnext = current;\n\t\t\t\t\n\t\tfindPath();\n\t}",
"public void toggleCamera() {\n\t\tif (map != null && map.getCameraPosition().zoom != MBDefinition.DEFAULT_ZOOM && carLatLng!=null) {\n\t\t\tmap.moveCamera(CameraUpdateFactory.newLatLngZoom(carLatLng, MBDefinition.DEFAULT_ZOOM));\n\t\t} else if (map != null && carMarker != null && pickupMarker != null) {\n\t\t\tLatLngBounds.Builder builder = new LatLngBounds.Builder();\n\n\t\t\tbuilder.include(carMarker.getPosition());\n\t\t\tbuilder.include(pickupMarker.getPosition());\n\n\t\t\tLatLngBounds bounds = builder.build();\n\n\t\t\tint padding = 150; // offset from edges of the map in pixels\n\t\t\tCameraUpdate cu = CameraUpdateFactory.newLatLngBounds(bounds, padding);\n\t\t\tmap.moveCamera(cu);\n\t\t}\n\t}",
"public void move() {\r\n\t\tSystem.out.print(\"This Tiger moves forward\");\r\n\t}",
"private void changeCameraPosition() {\n yPosition = mPerspectiveCamera.position.y;\n if (isMovingUp) {\n yPosition += 0.1;\n if (yPosition > 20)\n isMovingUp = false;\n } else {\n yPosition -= 0.1;\n if (yPosition < 1)\n isMovingUp = true;\n }\n\n mPerspectiveCamera.position.set(xPosition, yPosition, zPosition);\n mPerspectiveCamera.update();\n }",
"public void update() {\n\t\tfinal StarSystem oldLocation = getPlayer().getLocation();\n\t\tfinal StarSystem newLocation = getChart().getSelected();\n\t\tgetPlayer().setLocation(newLocation);\n\t\tgetPlayer().setFuel(-oldLocation.distanceToStarSystem(newLocation));\n\t\tgetChart().setSelected(null);\n\t\tgetChart().repaint();\n\t\tplanetLbl.setText(\"Current Location: \" + player.getLocation().getName()\n\t\t\t\t+ \"....Tech Level: \" + player.getLocation().getTechLevel());\n\n\t}",
"public void frogReposition() {\n\t\tsetY(FrogPositionY);\n\t\tsetX(FrogPositionX);\t\t\n\t\t}",
"@Override\n public void move()\n {\n System.out.println(\"tightrope walking\");\n }",
"private void changeCharacterLocations() {\n if (locationAnimationDirectionSwitch) {\n locationAnimationTicker++;\n } else {\n locationAnimationTicker--;\n }\n\n // While the user's FaceCharacter bobs up, their opponent should bob down.\n heroLocation[1] += locationAnimationTicker;\n antagonistLocation[1] -= locationAnimationTicker;\n\n if (locationAnimationTicker == 5 || locationAnimationTicker == -5) {\n locationAnimationDirectionSwitch = !locationAnimationDirectionSwitch;\n }\n }"
] | [
"0.6792144",
"0.6780712",
"0.66816366",
"0.65882266",
"0.65427804",
"0.6484604",
"0.6461062",
"0.64373904",
"0.64018357",
"0.63233024",
"0.63093305",
"0.63065773",
"0.62749326",
"0.6240763",
"0.6199765",
"0.6199036",
"0.6189752",
"0.61842936",
"0.6173484",
"0.617287",
"0.61700225",
"0.6161691",
"0.61612165",
"0.61593485",
"0.61480415",
"0.6136358",
"0.612304",
"0.61156076",
"0.6113498",
"0.6099844",
"0.6097974",
"0.6084947",
"0.6084501",
"0.60785943",
"0.6078074",
"0.60651386",
"0.60624063",
"0.60603184",
"0.6059805",
"0.6022531",
"0.60199994",
"0.6007223",
"0.6002677",
"0.6002076",
"0.599722",
"0.5980691",
"0.59784895",
"0.5974623",
"0.5967137",
"0.5959285",
"0.59512687",
"0.59512275",
"0.59414095",
"0.5933421",
"0.59325725",
"0.59121233",
"0.5908405",
"0.590762",
"0.5901867",
"0.5889287",
"0.58804613",
"0.5874927",
"0.58679074",
"0.58522433",
"0.5843506",
"0.58387977",
"0.58350873",
"0.583254",
"0.5830838",
"0.5829693",
"0.582585",
"0.58228475",
"0.5815492",
"0.5809052",
"0.580758",
"0.57991713",
"0.5794852",
"0.57671046",
"0.57650447",
"0.5759464",
"0.57590455",
"0.57420623",
"0.5740548",
"0.57391125",
"0.57368547",
"0.5731022",
"0.5730163",
"0.57285184",
"0.5727231",
"0.57266766",
"0.57244766",
"0.5721532",
"0.5717112",
"0.5716846",
"0.5712745",
"0.57121617",
"0.5707807",
"0.57035184",
"0.5701633",
"0.5701275"
] | 0.57235134 | 91 |
TELLER APP CITATION MODIFIES: this EFFECTS: processes user command | protected void processCommand(String command) throws EmptyException {
if (command.equals("a")) {
doAddTask();
} else if (command.equals("r")) {
doRemoveTask();
} else if (command.equals("p")) {
doViewList();
} else if (command.equals("m")) {
//doMarkComplete();
} else if (command.equals("n")) {
doCount();
} else if (command.equals("s")) {
doSave();
} else if (command.equals("c")) {
doClear();
} else {
System.out.println("Selection not valid...");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getUserCommand();",
"public abstract void exec(CommandSender sender, String[] args);",
"public void processUserInput(String input) {\n\t\tString[] request = this.getArguments(input); \n\t\tString command = request[0]; \n\n\t\ttry {\n\t\t\tswitch (command) {\n\t\t\t\tcase TUICommands.START_SESSION:\n\t\t\t\t\tif (!this.sessionActive) {\n\t\t\t\t\t\tthis.showNamedMessage(\"Initiating session with server...\");\n\t\t\t\t\t\twhile (!this.requestSession()) {\n\t\t\t\t\t\t\ttextUI.getBoolean(\"Try again?\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.showNamedMessage(\"Session is already active\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\t\n\n\t\t\t\tcase TUICommands.LIST_FILES: \n\t\t\t\t\tthis.showNamedMessage(\"Requesting list of files...\");\n\t\t\t\t\tif (!this.requestListFiles()) { \n\t\t\t\t\t\tthis.showNamedError(\"Retrieving list of files failed\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase TUICommands.LIST_FILES_LOCAL: \n\t\t\t\t\tthis.showNamedMessage(\"Making list of local files...\");\n\t\t\t\t\tthis.printArrayOfFile(this.getLocalFiles()); \n\t\t\t\t\tbreak;\n\n\t\t\t\tcase TUICommands.DOWNLOAD_SINGLE:\n\t\t\t\t\tFile fileToDownload = this.selectServerFile();\n\t\t\t\t\tif (!this.downloadSingleFile(fileToDownload)) {\n\t\t\t\t\t\tthis.showNamedError(\"Downloading file failed\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase TUICommands.UPLOAD_SINGLE:\n\t\t\t\t\tFile fileToUpload = this.selectLocalFile();\n\t\t\t\t\tif (!this.uploadSingleFile(fileToUpload)) { \n\t\t\t\t\t\tthis.showNamedError(\"Uploading file failed\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase TUICommands.DELETE_SINGLE:\n\t\t\t\t\tFile fileToDelete = this.selectServerFile();\n\t\t\t\t\tif (!this.deleteSingleFile(fileToDelete)) { \n\t\t\t\t\t\tthis.showNamedError(\"Deleting file failed\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase TUICommands.CHECK_INTEGRITY:\n\t\t\t\t\tFile fileToCheck = this.selectLocalFile();\n\t\t\t\t\tif (!this.checkFile(fileToCheck)) { \n\t\t\t\t\t\tthis.showNamedError(\"Checking file failed\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase TUICommands.UPLOAD_MANAGER:\n\t\t\t\t\tif (!this.helperManager(this.uploads)) { \n\t\t\t\t\t\tthis.showNamedError(\"Upload manager failed!\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase TUICommands.DOWNLOAD_MANAGER:\n\t\t\t\t\tif (!this.helperManager(this.downloads)) {\n\t\t\t\t\t\tthis.showNamedError(\"Download manager failed!\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase TUICommands.HELP:\n\t\t\t\t\tthis.textUI.printHelpMenu();\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase TUICommands.EXIT:\n\t\t\t\t\tthis.shutdown();\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\tthis.showNamedError(\"Unknow command received (and ignoring it)\"); \n\t\t\t}\n\t\t\tthis.showNamedMessage(\"... done!\");\n\t\t} catch (IOException | PacketException | UtilDatagramException e) {\n\t\t\tthis.showNamedError(\"Something went wrong: \" + e.getLocalizedMessage());\n\t\t}\n\t}",
"private void commandCheck() {\n\t\t//add user command\n\t\tif(cmd.getText().toLowerCase().equals(\"adduser\")) {\n\t\t\t/*\n\t\t\t * permissions check: if user is an admin, proceed. If not, error with a permission error.\n\t\t\t * There will be more user level commands added in version 2, like changing rename to allow a\n\t\t\t * user to rename themselves, but not any other user. Admins can still rename all users.\n\t\t\t */\n\t\t\tif(type.equals(\"admin\")) {\n\t\t\t\taddUser();\n\t\t\t}\n\t\t\telse {\n\t\t\t\terror(PERMISSIONS);\n\t\t\t}\n\t\t}\n\t\t//delete user command\n\t\telse if(cmd.getText().toLowerCase().equals(\"deluser\")) {\n\t\t\t//permissions check: if user is an admin, proceed. If not, error with a permission error.\n\t\t\tif(type.equals(\"admin\")) {\n\t\t\t\tdelUser();\n\t\t\t}\n\t\t\telse {\n\t\t\t\terror(PERMISSIONS);\n\t\t\t};\n\t\t}\n\t\t//rename user command\n\t\telse if(cmd.getText().toLowerCase().equals(\"rename\")) {\n\t\t\t//permissions check: if user is an admin, allow the user o chose a user to rename.\n\t\t\t//If not, allow the user to rename themselves only.\n\t\t\tif(type.equals(\"admin\")) {\n\t\t\t\trename(ALL);\n\t\t\t}\n\t\t\telse {\n\t\t\t\trename(SELF);\n\t\t\t}\n\t\t}\n\t\t//promote user command\n\t\telse if(cmd.getText().toLowerCase().equals(\"promote\")) {\n\t\t\t//permissions check: if user is an admin, proceed. If not, error with a permission error.\n\t\t\tif(type.equals(\"admin\")) {\n\t\t\t\tpromote();\n\t\t\t}\n\t\t\telse {\n\t\t\t\terror(PERMISSIONS);\n\t\t\t}\n\t\t}\n\t\t//demote user command\n\t\telse if(cmd.getText().toLowerCase().equals(\"demote\")) {\n\t\t\t//permissions check: if user is an admin, proceed. If not, error with a permission error.\n\t\t\tif(type.equals(\"admin\")) {\n\t\t\t\tdemote();\n\t\t\t}\n\t\t\telse {\n\t\t\t\terror(PERMISSIONS);\n\t\t\t}\n\t\t}\n\t\t//the rest of the commands are user level, no permission checking\n\t\telse if(cmd.getText().toLowerCase().equals(\"ccprocess\")) {\n\t\t\tccprocess();\n\t\t}\n\t\telse if(cmd.getText().toLowerCase().equals(\"cprocess\")) {\n\t\t\tcprocess();\n\t\t}\n\t\telse if(cmd.getText().toLowerCase().equals(\"opentill\")) {\n\t\t\topenTill();\n\t\t}\n\t\telse if(cmd.getText().toLowerCase().equals(\"closetill\")) {\n\t\t\tcloseTill();\n\t\t}\n\t\telse if(cmd.getText().toLowerCase().equals(\"opendrawer\")) {\n\t\t\topenDrawer();\n\t\t}\n\t\telse if(cmd.getText().toLowerCase().equals(\"sale\")) {\n\t\t\tsale();\n\t\t}\n\t\t//if the command that was entered does not match any command, return an error.\n\t\telse {\n\t\t\terror(CMD_NOT_FOUND);\n\t\t}\n\t}",
"private void processCommand()\n {\n String vInput = this.aEntryField.getText();\n this.aEntryField.setText(\"\");\n\n this.aEngine.interpretCommand( vInput );\n }",
"public void run() {\n\t\t\t\t\t\tString monkeyCmd = \"\";\n\t\t\t\t\t\t\n\t\t\t\t\t\tmonkeyCmd = \"adb -s \" + deviceId + \" \" + textAreaCmd.getText().toString().trim().substring(3);\n\t\t\t\t\t\tSystem.out.println(monkeyCmd);\n\t\t\t\t\t\t//2.sent command to device and return touch event.\n\t\t\t\t\t\tcmd.makeDirectory(\"report\");\n\t\t\t\t\t\tString filename = \"MONKEY_\" + systime + \".txt\";\n\t\t\t\t\t\tString filepath = cmd.getCurrentDirectory() + \"\\\\report\\\\\" + filename; \n\t\t\t\t\t\tcmd.execCommandAndSave(monkeyCmd, filepath);\n\t\t\t\t\t}",
"protected void mainTask() {\n\t logger.log(1, CLASS, \"-\", \"impl\",\n\t\t \"About to read command\");\n\t try { \n\t\tcommand = (COMMAND)connection.receive();\n\t\tlogger.log(1,CLASS, \"-\", \"impl\",\n\t\t\t \"Received command: \"+(command == null ? \"no-command\" : command.getClass().getName()));\n\t } catch (IOException e) {\n\t\tinitError(\"I/O error while reading command:[\"+e+\"]\",command);\n\t\treturn;\n\t } catch (ClassCastException ce) {\n\t\tinitError(\"Garbled command:[\"+ce+\"]\", command);\n\t\treturn;\n\t } \n\t \n\t // 2. Create a handler.\n\t if (command == null) {\n\t\tinitError(\"No command set\", null);\n\t\treturn;\n\t }\n\n\t if (handlerFactory != null) {\n\t\thandler = handlerFactory.createHandler(connection, command);\n\t\tif (handler == null) {\n\t\t initError(\"Unable to process command [\"+command.getClass().getName()+\"]: No known handler\", command);\n\t\t return;\n\t\t}\n\t \n\t\t// 3. Handle the request - handler may send multiple updates to client over long period\n\t\thandler.handleRequest();\n\t }\t \n\t}",
"public void processUser() {\r\n view.printMessage(View.GEM_POOL + model.getStonePool());\r\n chooseMenuOption(chooseParameters(INTEGER_DELIMITERS, View.INPUT_PARAMETERS, true));\r\n\r\n\r\n }",
"@Override\r\n\tpublic void command() {\n\t\tSystem.out.println(\"CommandAttack Process\");\r\n\t}",
"public abstract void execute(CommandSender sender, String[] args);",
"public abstract byte[] appExecuteUnordered(byte[] command, MessageContext msgCtx);",
"public String userCommand(){\n return scanner.nextLine();\n }",
"private void handleUserEntry(String command) {\r\n //---------------------------------\r\n if(command.startsWith(\"RETURN\") || command.startsWith(\"return\") || command.startsWith(\"Return\")){\r\n clearCommandPromptScreen();\r\n WELCOMESCREEN_INSTANCE.newSession();\r\n }\r\n //---------------------------------\r\n if(command.startsWith(\"EXIT\") || command.startsWith(\"exit\") || command.startsWith(\"Exit\")){\r\n EXITCONFIRM_INSTANCE.newSession();\r\n\r\n }else {\r\n\r\n try {\r\n\r\n if (command.length() > 0) {\r\n\r\n //------------------------------------------\r\n //> VALIDATE USER ENTRY\r\n //------------------------------------------\r\n File foundFile = searchForFile(command);\r\n\r\n if(foundFile != null) {\r\n\r\n\r\n clearCommandPromptScreen();\r\n\r\n //---------------- FUN COLORED COMMAND PROMPT -----------------\r\n if(APP_INSTANCE.isWindows) {\r\n try {\r\n ProcessBuilder builder = new ProcessBuilder(\"cmd.exe\", \"/c\", \"@echo off & color A\");\r\n Process process = builder.inheritIO().start();\r\n } catch (IOException e) {\r\n //> If this fails, its no biggie...\r\n }\r\n }\r\n\r\n System.out.println(\" \");\r\n System.out.println(\" \");\r\n System.out.println(\" \");\r\n System.out.println(\"////////////// (SEARCH RESULT - 'SUCCESS- FILE FOUND IN LOCKED_ME DIRECTORY') ///////////////////\");\r\n System.out.println(\"/// FILE FOUND: (\" + foundFile.getAbsolutePath() + \")\");\r\n System.out.println(\"\\nPRESS <ENTER> TO CONTINUE\");\r\n //---------------------------------\r\n BufferedReader reader = new BufferedReader( new InputStreamReader(System.in));\r\n try {\r\n reader.readLine();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }finally {\r\n clearCommandPromptScreen();\r\n newSession();\r\n }\r\n\r\n }else{\r\n\r\n clearCommandPromptScreen();\r\n\r\n //---------------- FUN COLORED COMMAND PROMPT -----------------\r\n if(APP_INSTANCE.isWindows) {\r\n try {\r\n ProcessBuilder builder = new ProcessBuilder(\"cmd.exe\", \"/c\", \"@echo off & color C\");\r\n Process process = builder.inheritIO().start();\r\n } catch (IOException e) {\r\n //> If this fails, its no biggie...\r\n }\r\n }\r\n\r\n System.out.println(\" \");\r\n System.out.println(\" \");\r\n System.out.println(\" \");\r\n System.out.println(\"//////////// (SEARCH RESULT - 'FILE WAS NOT FOUND' IN LOCKED_ME DIRECTORY') //////////////////\");\r\n System.out.println(\"\\nPRESS <ENTER> TO CONTINUE\");\r\n //---------------------------------\r\n BufferedReader reader = new BufferedReader( new InputStreamReader(System.in));\r\n try {\r\n reader.readLine();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }finally {\r\n clearCommandPromptScreen();\r\n newSession();\r\n }\r\n }\r\n\r\n }else{\r\n //------------------------------------------\r\n //> USERS ENTRY WAS EMPTY\r\n //------------------------------------------\r\n newSession();\r\n }\r\n\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n newSession();\r\n }\r\n }\r\n }",
"public abstract void onCommand(MessageEvent context) throws Exception;",
"public void processCommand(String userInput){\n if (userInput.contains(\" \")){ \n processSingleToken(userInput.split(\" \")); //Splits strings based on \" \" \n }\n \n else{\n List<String> tempStore = new ArrayList<String>();\n tempStore.add(userInput);\n String[] token = tempStore.toArray(new String[tempStore.size()]);\n processSingleToken(token);\n }\n }",
"@Override\n public void run() {\n mHandler.post(new Runnable() {\n\n @Override\n public void run() {\n // display toast\n Toast.makeText(getApplicationContext(), getDateTime(),\n Toast.LENGTH_SHORT).show();\n try {\n Process p = Runtime.getRuntime().exec(SKIP);\n } catch (IOException e) {\n e.printStackTrace();\n }\n //startNewService();\n //ShellExecuter shellExecuter = new ShellExecuter();\n //String output = shellExecuter.Executer(skip);\n //String output = shellExecuter.Executer(\"input keyevent 87\");\n }\n\n });\n }",
"public void run(){\n\t\tinputStreamReader = new InputStreamReader(System.in);\r\n\t\tin = new BufferedReader( inputStreamReader );\r\n\t\t\r\n\t\tSystem.out.println(\"\\n\" + Application.APPLICATION_VENDOR + \" \" + Application.APPLICATION_NAME + \" \" + Application.VERSION_MAJOR + \".\" + Application.VERSION_MINOR + \".\" + Application.VERSION_REVISION + \" (http://ThreatFactor.com)\");\r\n\t\t//System.out.println(\"We are here to help, just go to http://ThreatFactor.com/\");\r\n\t\t\r\n\t\tif( application.getNetworkManager().sslEnabled() )\r\n\t\t{\r\n\t\t\tif( application.getNetworkManager().getServerPort() != 443 )\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"Web server running on: https://127.0.0.1:\" + application.getNetworkManager().getServerPort());\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tSystem.out.println(\"Web server running on: https://127.0.0.1\");\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif( application.getNetworkManager().getServerPort() != 80 )\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"Web server running on: http://127.0.0.1:\" + application.getNetworkManager().getServerPort());\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tSystem.out.println(\"Web server running on: http://127.0.0.1\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"Interactive console, type help for list of commands\");\r\n\t\t\r\n\t\tcontinueExecuting = true;\r\n\t\twhile( continueExecuting ){\r\n\r\n\t\t\tSystem.out.print(\"> \");\r\n\r\n\t\t\ttry{\r\n\t\t\t\t\r\n\t\t\t\tString text = in.readLine();\r\n\t\t\t\t\r\n\t\t\t\tif( continueExecuting && text != null ){\r\n\t\t\t\t\tcontinueExecuting = runCommand( text.trim() );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcatch(AsynchronousCloseException e){\r\n\t\t\t\t//Do nothing, this was likely thrown because the read-line command was interrupted during the shutdown operation\r\n\t\t\t\tcontinueExecuting = false;\r\n\t\t\t}\r\n\t\t\tcatch(Exception e){\r\n\t\t\t\t//Catch the exception and move on, the console listener must not be allowed to exit\r\n\t\t\t\tSystem.err.println(\"Operation Failed: \" + e.getMessage());\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t\t\r\n\t\t\t\t//Stop listening. Otherwise, an exception loop may occur. \r\n\t\t\t\tcontinueExecuting = false;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"@Override\n\tpublic void onCommand(CommandSender sender, String[] args) {\n\t\t\n\t}",
"@Override\n\tpublic void onCommand(CommandSender sender, String[] args) {\n\t\t\n\t}",
"public void start(){\r\n\t\tThread cliThread = new Thread(new Runnable() {\r\n\t\t\tpublic void run() {\r\n\t\t\t\tString line= \"1\";\r\n\t\t\t\twhile(!line.equals(\"exit\")) {\r\n\t\t\t\t\tSystem.out.println(\"\\n\");\r\n\t\t\t\t\tfor(String str: commandsSet.keySet())\r\n\t\t\t\t\t\tSystem.out.println(\"* \" + str);\r\n\t\t\t\t\tSystem.out.println(\"\\nEnter command\");\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tline=in.readLine();\r\n\t\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\tStringBuilder argusb= new StringBuilder();\r\n\t\t\t\t\t\tStringBuilder command=new StringBuilder();\r\n\t\t\t\t\t\tString[] split=line.split(\" \");\r\n\t\t\t\t\t\tint j=0;\r\n\t\t\t\t\t\tfor (int i =0;i<split.length;i++) {\r\n\t\t\t\t\t\t\tif (split[i].startsWith(\"<\")){\r\n\t\t\t\t\t\t\t\tsplit[i] = split[i].replace(\"<\",\"\");\r\n\t\t\t\t\t\t\t\tsplit[i] = split[i].replace(\">\", \"\");\r\n\t\t\t\t\t\t\t\tsplit[i]= split[i].toLowerCase();\r\n\t\t\t\t\t\t\t\targusb.append(split[i]);\r\n\t\t\t\t\t\t\t\targusb.append(\" \");\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\telse {\r\n\t\t\t\t\t\t\t\tcommand.append(\" \");\r\n\t\t\t\t\t\t\t\tcommand.append(split[i]);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcommand.deleteCharAt(0);\r\n\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\tcontroller.handleUserCommand(command.toString(),argusb.toString().split(\" \"));\r\n\t\t\t\t\t\t}catch (Exception e){\r\n\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\targusb=null;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//out.write(\"The Program closed Good Bye\");\r\n\t\t\t{ try {\r\n\t\t\t\tin.close();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tSystem.out.println(\"The In stream can't be close\");\r\n\t\t\t} \r\n\t\t\t\tout.close();\r\n\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\t\t\r\n\t\t\tcliThread.start();\t\r\n\t\t}",
"public abstract boolean commandExecution(CommandSender sender, String label, String[] args);",
"public abstract CommandResponse onCommand(CommandSender sender, String label, String[] args);",
"@Override\n public void execute() {\n this.context.setToken(new Token(context.getLexemeType(), context.getLexemeBuffer().toString()));\n this.context.getLexemeBuffer().setLength(0);\n if (command != null) {\n command.execute();\n }\n }",
"@Override\n\t public void onReceive(Context context, Intent intent) {\n\t Toast.makeText(appContext, intent.getStringExtra(\"cmd_value\"), Toast.LENGTH_SHORT).show();\n\t }",
"private void uTorrent(String[] command) {\n\t\ttry {\n\t\t\tnew ProcessBuilder(Constants.CH_PATH_UTORRENT, \"\").start();\n\t\t\tSystem.out.println(\"Launching uTorrent application.\");\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"private static Object command(String userCommandLine[]) {\n\t\tint size = userCommandLine.length;\n\n\t\tswitch(userCommandLine[0].trim().toUpperCase()) {\n\n\t\t/*\n\t\t * INFORMATION\n\t\t *\n\t\t * Add executecommand on each case\n\t\t * but if it dosn't yet implemented\n\t\t * comment the command allow to user\n\t\t * on the variable string[] commands\n\t\t *\n\t\t */\n\t\t\n\t\t/* ************************************\n\t\t * standard commands\n\t\t *************************************/\n\t\tcase \"QUIT\": return ExecuteCommand.exit();\n\t\tcase \"EXIT\": return ExecuteCommand.exit();\n\t\tcase \"HELP\": help( (size > 1) ? userCommandLine[1].trim() : \"\"); break;\n\t\tcase \"VAR\": ExecuteCommand.showVar(); break;\n\t\tcase \"DEL\" : ExecuteCommand.delVar(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\tcase \"RENAME\": ExecuteCommand.renameVar(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\tcase \"STARTSPARK\": ExecuteCommand.startSpark(); break;\n\t\tcase \"STOPSPARK\": ExecuteCommand.stopSpark(); break;\n\t\t\n\t\t/* ************************************\n\t\t * database\n\t\t *************************************/ \n\t\t\n\t\t/* open database(name: String, filesystem: FileSystem, conf: Config) */\n\t\tcase \"OPEN\" : ExecuteCommand.openDB(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* close database */\n\t\tcase \"CLOSE\" : ExecuteCommand.closeDB(); break;\n\t\t/* restart database */\n\t\tcase \"RESTART\" : ExecuteCommand.restartDB(); break;\n\t\t/* show list of TimeSeries */\n\t\tcase \"SHOW\" : ExecuteCommand.showTS(); break;\n\t\t/* drop a timeSeries */\n\t\tcase \"DROP\" : ExecuteCommand.dropTS(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* exist a timeSeries with name ... */\n\t\tcase \"EXIST\" : ExecuteCommand.existTS(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* get a timeSeries */\n\t\tcase \"GET\" : ExecuteCommand.getTS(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* create a timeSeries */\n\t\tcase \"CREATE\" : ExecuteCommand.createTS2DB(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t\n\t\t\n\t\t/* ************************************\n\t\t * Time Series\n\t\t *************************************/\n\t\t\n\t\t/* create the timeSerie schema */\n\t\tcase \"CREATE_SCHEMA\" : ExecuteCommand.createSchema(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* show the schema of the timeSerie */\n\t\tcase \"SHOW_SCHEMA\" : ExecuteCommand.showSchema(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* get the schema of the timeSerie*/\n\t\tcase \"GET_SCHEMA\" : ExecuteCommand.getSchema(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* insert data at a certain file */\n\t\tcase \"INSERT\" : ExecuteCommand.insertDataFromFile(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* select timeSerie Range from timeStart to timeEnd */\n\t\tcase \"SELECT_RANGE\": break;\n\t\t/* select a column of a timeserie */\n\t\tcase \"SELECT\": ExecuteCommand.selectColumn(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* find max value of timeSerie */\n\t\tcase \"MAX_VALUE\" : ExecuteCommand.maxValue(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* find min value of timeSerie */\n\t\tcase \"MIN_VALUE\" : ExecuteCommand.minValue(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* print first five values */\n\t\tcase \"PRINT\" : ExecuteCommand.printHead(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t\t\t\n\t\t\n\t\t/* ************************************\n\t\t * Transformations\n\t\t *************************************/\n\t\t\n\t\t/* power transformation of timeSerie: square root */\n\t\tcase \"SQRT_TRANSFORM\" : break;\n\t\t/* power transformation of timeSerie: logarithm */\n\t\tcase \"LOG_TRANSFORM\" : break;\n\t\t/* average of timeSerie */\n\t\tcase \"MEAN\" : break;\n\t\t/* shifting timeSerie with coefficient */\n\t\tcase \"SHIFT\" : break;\n\t\t/* scaling timeSerie with coefficient */\n\t\tcase \"SCALE\" : break;\n\t\t/* standard deviation of timeSeries */\n\t\tcase \"STD_DEVIATION\" : break;\n\t\t/* normalize the TimeSerie */\n\t\tcase \"NORMALIZE\" : break;\n\t\t/* search the first time occurs */\n\t\tcase \"SEARCH\" : break;\n\t\t/* moving average */\n\t\tcase \"MOVING_AVERAGE\" : break;\n\t\t/* DFT of timeSerie */\n\t\tcase \"DFT\" : break;\n\t\t/* DTW of 2 timeSerie (similarity between two timeseries) */\n\t\tcase \"DTW\" : break;\n\t\t\n\t\t/* ************************************\n\t\t * Compression \n\t\t *************************************/\n\n\t\t/* compress a timeserie */\n\t\tcase \"COMPRESSION\" : ExecuteCommand.compression(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* decompress a timeserie */\n\t\tcase \"DECOMPRESSION\" : break;\n\n\t\t/* ************************************\n\t\t * indexing \n\t\t *************************************/\n\t\t\n\t\t/* create index for many ts */\n\t\tcase \"CREATE_INDEX\" : ExecuteCommand.createIndex(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* return neighbors of a ts from the create index */\n\t\tcase \"NEIGHBORS\" : break;\n\t\t/* ************************************\n\t\t * clustering \n\t\t *************************************/\n\t\t\n\t\t/* ************************************\n\t\t * Application \n\t\t *************************************/\n\t\tcase \"CREATE_DNA\" : break;\n\t\tcase \"DNA_SIMILARITY\" : ExecuteCommand.dnApplication(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t\n\t\t\t\t\n\t\tdefault: System.out.println(\"oups it may have a code error\");\n\t\t}\n\n\t\treturn true;\n\t}",
"public static void main( String args[] )\r\n {\r\n try\r\n {\r\n LateralUDPSender lur = new LateralUDPSender( new LateralCacheAttributes() );\r\n\r\n // process user input till done\r\n boolean notDone = true;\r\n String message = null;\r\n // wait to dispose\r\n BufferedReader br = new BufferedReader( new InputStreamReader( System.in ) );\r\n\r\n while ( notDone )\r\n {\r\n System.out.println( \"enter mesage:\" );\r\n message = br.readLine();\r\n CacheElement ce = new CacheElement( \"test\", \"test\", message );\r\n LateralElementDescriptor led = new LateralElementDescriptor( ce );\r\n lur.send( led );\r\n }\r\n }\r\n catch ( Exception e )\r\n {\r\n System.out.println( e.toString() );\r\n }\r\n }",
"@Override\n public CommandResult execute(String userInput) throws DukeException {\n Command c;\n if (EditorManager.isActive()) {\n logger.log(Level.INFO, \"editing...\");\n c = EditorManager.edit(userInput);\n } else {\n try {\n c = Parser.parseComplexCommand(userInput);\n conversationManager.clearContext();\n } catch (ChronologyAfterPresentException | ChronologyBeforePresentException\n | ChronologyInconsistentException | ApiException e) {\n throw e;\n } catch (ParseException e) {\n c = getCommandFromConversationManager(userInput);\n }\n }\n return (CommandResult) c.execute(model);\n }",
"@FXML\n\tpublic void onProcessCommand() {\n\t\tString command = prompt.getText().trim();\n\t\tif (!command.isEmpty()) {\n\t\t\t// Print what the user entered to the screen\n\t\t\tscreen.appendText(\"> \" + command + \"\\n\");\n\t\t\tswitch (command) {\n\t\t\t\tcase \"clear\":\n\t\t\t\t\tscreen.clear();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t// Print the output of the commandName\n\t\t\t\t\tscreen.appendText(commandDispatch.processCommand(command) + \"\\n\");\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// Clear the prompt - ready for new input\n\t\t\tprompt.clear();\n\t\t}\n\t}",
"void processGUIInput(String cmd){\n try{\n debugWriter.write(cmd);\n debugWriter.flush();\n //}\n }catch(IOException e){\n //Eat it\n e.printStackTrace();\n //throw new InvalidInteractionsException();\n }\n }",
"@Override\n public void dealWithCommand(MessageReceivedEvent event) {\n List<String> contentSplit = new ArrayList<>(Arrays.asList(event.getMessage().getContentStripped().split(\" \")));\n\n // remove the command part of the message\n contentSplit.remove(0);\n boolean isXpDesired = DetermineArguments.determineIsXpDesired(contentSplit);\n boolean isCollection = DetermineArguments.determineIsCollection(contentSplit);\n long timeToSpend = DetermineArguments.determineTimeToSpend(contentSplit, event.getTextChannel());\n int classLevel = DetermineArguments.determineClassLevel(contentSplit, event.getTextChannel());\n long amountDesired = DetermineArguments.determineAmountDesired(contentSplit, event.getTextChannel());\n\n // be done if something bad was found\n if (timeToSpend == -2 || classLevel == -2 || amountDesired == -2)\n return;\n\n if (contentSplit.isEmpty()) {\n // user did not specify what player they want\n event.getChannel().sendMessage(\"Specify what player you want to analyze.\").queue();\n return;\n }\n String username = contentSplit.get(0);\n WynncraftPlayer player = GetPlayerStats.get(username);\n if (player == null) {\n event.getChannel().sendMessage(\"Either the api is down, or '\" + username + \"' is not a player.\").queue();\n return;\n }\n\n // tell the user we're working on the answer\n event.getMessage().addReaction(\"\\uD83D\\uDEE0\").queue();\n\n List<String> classNames = new ArrayList<>();\n for (WynncraftClass playerClass : player.classes) {\n classNames.add(playerClass.name);\n }\n ChoiceArguments choiceArguments = new ChoiceArguments(\n isXpDesired, isCollection, timeToSpend, amountDesired, classLevel, classNames, player, true);\n\n\n long xpDesiredGivenPerc = 0;\n long emeraldDesiredGivenPerc = 0;\n for (WynncraftClass wynncraftClass : player.classes)\n for (Quest quest : wynncraftClass.questsNotCompleted) {\n if (quest.levelMinimum <= (classLevel == -1 ? wynncraftClass.combatLevel : classLevel)) {\n xpDesiredGivenPerc += quest.xp;\n emeraldDesiredGivenPerc += quest.emerald;\n }\n }\n xpDesiredGivenPerc *= GetAnswers.DEFAULT_PERCENTAGE_AMOUNT;\n emeraldDesiredGivenPerc *= GetAnswers.DEFAULT_PERCENTAGE_AMOUNT;\n\n FinalQuestOptionsAll finalQuestOptionsAll = GetAnswers.getAllFullAnswers(player, choiceArguments);\n String spreadsheetId = SheetsWrite.writeSheet(finalQuestOptionsAll, event.getAuthor().getIdLong(), player.name, true);\n if (spreadsheetId == null) return;\n new QuestRecommendationMessagePlayer(spreadsheetId, finalQuestOptionsAll, event.getChannel(), choiceArguments, xpDesiredGivenPerc, emeraldDesiredGivenPerc);\n\n event.getMessage().removeReaction(\"\\uD83D\\uDEE0\", DiscordBot.client.getSelfUser()).queue();\n }",
"@Override\r\n public void onMessage(MessageEvent message) {\r\n String newMessage = message.getMessage();\r\n String response;\r\n\r\n //split the message on spaces to identify the command\r\n String[] messageArray = newMessage.split(\" \");\r\n \r\n switch (messageArray[0]) {\r\n case \"!command\":\r\n if (message.getChannel().getOps().contains(message.getUser())) {\r\n if (messageArray.length == 2) {\r\n if (messageArray[1].equals(\"off\")) {\r\n commandsActive = false;\r\n } \r\n if (messageArray[1].equals(\"on\")) {\r\n commandsActive = true;\r\n }\r\n }\r\n }\r\n break;\r\n //command to make a custom command for the bot\r\n case \"!addcom\":\r\n if (commandsActive) {\r\n if (message.getChannel().getOps().contains(message.getUser())) {\r\n response = addCom(messageArray, message.getChannel().getName());\r\n message.getChannel().send().message(response);\r\n } \r\n else {\r\n message.respond(\"You are not allowed to add commands.\");\r\n }\r\n }\r\n break;\r\n case \"!commands\":\r\n if (commandsActive) {\r\n if (messageArray.length ==1) {\r\n ArrayList<String> commands = manager.getCommands(message.getChannel().getName());\r\n String commandList = \"The custom commands available to everyone for this channel are: \";\r\n while (!commands.isEmpty()) {\r\n commandList += commands.remove(0) + \", \";\r\n }\r\n message.getChannel().send().message(commandList);\r\n }\r\n }\r\n break;\r\n //command to delete a custom command from the bot\r\n case \"!delcom\":\r\n if (commandsActive) {\r\n if (message.getChannel().getOps().contains(message.getUser())) {\r\n response = delCom(messageArray[1], message.getChannel().getName());\r\n message.getChannel().send().message(response);\r\n } \r\n else {\r\n message.respond(\"You are not allowed to remove commands.\");\r\n }\r\n }\r\n break;\r\n //command to edit a custom command the bot has\r\n case \"!editcom\":\r\n if (commandsActive) {\r\n if (message.getChannel().getOps().contains(message.getUser())) {\r\n response = editCom(messageArray, message.getChannel().getName());\r\n message.getChannel().send().message(response);\r\n } \r\n else {\r\n message.respond(\"You are not allowed to edit commands.\");\r\n }\r\n }\r\n break;\r\n\r\n //default message handling for custom commands\r\n default:\r\n if (commandsActive) {\r\n if (message.getMessage().startsWith(\"!\") && !messageArray[0].equals(\"!permit\")&& !messageArray[0].equals(\"!spam\")) {\r\n customCommands(message);\r\n }\r\n }\r\n break;\r\n }\r\n }",
"void transactTo_execCommand(int code, String transactName, ComponentName who, int userId) {\n Parcel _data = Parcel.obtain();\n Parcel _reply = Parcel.obtain();\n try {\n IBinder binder = ServiceManager.getService(\"device_policy\");\n if (binder != null) {\n if (HWFLOW) {\n Log.i(TAG, \"Transact: \" + transactName + \" to device policy manager service.\");\n }\n _data.writeInterfaceToken(ConstantValue.DESCRIPTOR);\n if (who != null) {\n _data.writeInt(1);\n who.writeToParcel(_data, 0);\n } else {\n _data.writeInt(0);\n }\n _data.writeInt(userId);\n binder.transact(code, _data, _reply, 0);\n _reply.readException();\n }\n _reply.recycle();\n _data.recycle();\n } catch (RemoteException localRemoteException) {\n Log.e(TAG, \"transactTo \" + transactName + \" failed: \" + localRemoteException.getMessage());\n } catch (Throwable th) {\n _reply.recycle();\n _data.recycle();\n }\n }",
"public void handleCommand() {\n\t\tif (Client.isLoggedIn() == false)\n\t\t\treturn;\n\t\t\n\t\tClientUser user = Client.getUserByName(argument);\n\t\tif (user == Client.getThisUser()) {\n\t\t\tSystem.err.println(\"Trying to remove this user? This should never happen!\");\n\t\t}\n\t\tif (user != null) {\n\t\t\tClient.removeUser(user);\n\t\t\tClient.getMainWindow().getMainChatPanel().displayInfo(user.getName() + \" has logged off!\");\n\t\t} else {\n\t\t\tSystem.err.println(\"cquit used with a non-exisitng username!\");\n\t\t}\n\t}",
"public static void ocultar() {\n\t\t\ttry{\n\t\t\t //REQUIRES ROOT\n\t\t\t Build.VERSION_CODES vc = new Build.VERSION_CODES();\n\t\t\t Build.VERSION vr = new Build.VERSION();\n\t\t\t String ProcID = \"79\"; //HONEYCOMB AND OLDER\n\t\t\t \n\t\t\t //v.RELEASE //4.0.3\n\t\t\t if(vr.SDK_INT >= vc.ICE_CREAM_SANDWICH){\n\t\t\t ProcID = \"42\"; //ICS AND NEWER\n\t\t\t }\t\t\t \n\t\t\t \n\t\t\t //REQUIRES ROOT\n\t\t\t Process proc = Runtime.getRuntime().exec(new String[]{\"su\",\"-c\",\"service call activity \"+ ProcID +\" s16 com.android.systemui\"}); //WAS 79\n\t\t\t proc.waitFor();\n\t\t\t \n\t\t\t}catch(Exception ex){\n\t\t\t //Toast.makeText(getApplicationContext(), ex.getMessage(), Toast.LENGTH_LONG).show();\n\t\t\t}\n\t\t}",
"public int onCommand(java.lang.String r6) {\n /*\n r5 = this;\n java.io.PrintWriter r0 = r5.getOutPrintWriter()\n r1 = -1\n if (r6 == 0) goto L_0x0009\n r2 = r6\n goto L_0x000b\n L_0x0009:\n java.lang.String r2 = \"\"\n L_0x000b:\n int r3 = r2.hashCode() // Catch:{ Exception -> 0x00dd }\n switch(r3) {\n case -1894245460: goto L_0x008b;\n case -1845752298: goto L_0x0081;\n case -1687551032: goto L_0x0077;\n case -1367724422: goto L_0x006d;\n case -1313911455: goto L_0x0062;\n case 113291: goto L_0x0057;\n case 55361425: goto L_0x004c;\n case 200896764: goto L_0x0040;\n case 703160488: goto L_0x0036;\n case 1749711139: goto L_0x002c;\n case 1791471818: goto L_0x0020;\n case 1854493850: goto L_0x0014;\n default: goto L_0x0012;\n } // Catch:{ Exception -> 0x00dd }\n L_0x0012:\n goto L_0x0097\n L_0x0014:\n java.lang.String r3 = \"monitor-battery\"\n boolean r2 = r2.equals(r3) // Catch:{ Exception -> 0x00dd }\n if (r2 == 0) goto L_0x0012\n r2 = 3\n goto L_0x0098\n L_0x0020:\n java.lang.String r3 = \"get-job-state\"\n boolean r2 = r2.equals(r3) // Catch:{ Exception -> 0x00dd }\n if (r2 == 0) goto L_0x0012\n r2 = 9\n goto L_0x0098\n L_0x002c:\n java.lang.String r3 = \"get-battery-not-low\"\n boolean r2 = r2.equals(r3) // Catch:{ Exception -> 0x00dd }\n if (r2 == 0) goto L_0x0012\n r2 = 6\n goto L_0x0098\n L_0x0036:\n java.lang.String r3 = \"get-battery-seq\"\n boolean r2 = r2.equals(r3) // Catch:{ Exception -> 0x00dd }\n if (r2 == 0) goto L_0x0012\n r2 = 4\n goto L_0x0098\n L_0x0040:\n java.lang.String r3 = \"heartbeat\"\n boolean r2 = r2.equals(r3) // Catch:{ Exception -> 0x00dd }\n if (r2 == 0) goto L_0x0012\n r2 = 10\n goto L_0x0098\n L_0x004c:\n java.lang.String r3 = \"get-storage-not-low\"\n boolean r2 = r2.equals(r3) // Catch:{ Exception -> 0x00dd }\n if (r2 == 0) goto L_0x0012\n r2 = 8\n goto L_0x0098\n L_0x0057:\n java.lang.String r3 = \"run\"\n boolean r2 = r2.equals(r3) // Catch:{ Exception -> 0x00dd }\n if (r2 == 0) goto L_0x0012\n r2 = 0\n goto L_0x0098\n L_0x0062:\n java.lang.String r3 = \"timeout\"\n boolean r2 = r2.equals(r3) // Catch:{ Exception -> 0x00dd }\n if (r2 == 0) goto L_0x0012\n r2 = 1\n goto L_0x0098\n L_0x006d:\n java.lang.String r3 = \"cancel\"\n boolean r2 = r2.equals(r3) // Catch:{ Exception -> 0x00dd }\n if (r2 == 0) goto L_0x0012\n r2 = 2\n goto L_0x0098\n L_0x0077:\n java.lang.String r3 = \"get-battery-charging\"\n boolean r2 = r2.equals(r3) // Catch:{ Exception -> 0x00dd }\n if (r2 == 0) goto L_0x0012\n r2 = 5\n goto L_0x0098\n L_0x0081:\n java.lang.String r3 = \"get-storage-seq\"\n boolean r2 = r2.equals(r3) // Catch:{ Exception -> 0x00dd }\n if (r2 == 0) goto L_0x0012\n r2 = 7\n goto L_0x0098\n L_0x008b:\n java.lang.String r3 = \"trigger-dock-state\"\n boolean r2 = r2.equals(r3) // Catch:{ Exception -> 0x00dd }\n if (r2 == 0) goto L_0x0012\n r2 = 11\n goto L_0x0098\n L_0x0097:\n r2 = r1\n L_0x0098:\n switch(r2) {\n case 0: goto L_0x00d7;\n case 1: goto L_0x00d2;\n case 2: goto L_0x00cd;\n case 3: goto L_0x00c8;\n case 4: goto L_0x00c3;\n case 5: goto L_0x00be;\n case 6: goto L_0x00b9;\n case 7: goto L_0x00b4;\n case 8: goto L_0x00af;\n case 9: goto L_0x00aa;\n case 10: goto L_0x00a5;\n case 11: goto L_0x00a0;\n default: goto L_0x009b;\n } // Catch:{ Exception -> 0x00dd }\n L_0x009b:\n int r1 = r5.handleDefaultCommands(r6) // Catch:{ Exception -> 0x00dd }\n goto L_0x00dc\n L_0x00a0:\n int r1 = r5.triggerDockState(r0) // Catch:{ Exception -> 0x00dd }\n return r1\n L_0x00a5:\n int r1 = r5.doHeartbeat(r0) // Catch:{ Exception -> 0x00dd }\n return r1\n L_0x00aa:\n int r1 = r5.getJobState(r0) // Catch:{ Exception -> 0x00dd }\n return r1\n L_0x00af:\n int r1 = r5.getStorageNotLow(r0) // Catch:{ Exception -> 0x00dd }\n return r1\n L_0x00b4:\n int r1 = r5.getStorageSeq(r0) // Catch:{ Exception -> 0x00dd }\n return r1\n L_0x00b9:\n int r1 = r5.getBatteryNotLow(r0) // Catch:{ Exception -> 0x00dd }\n return r1\n L_0x00be:\n int r1 = r5.getBatteryCharging(r0) // Catch:{ Exception -> 0x00dd }\n return r1\n L_0x00c3:\n int r1 = r5.getBatterySeq(r0) // Catch:{ Exception -> 0x00dd }\n return r1\n L_0x00c8:\n int r1 = r5.monitorBattery(r0) // Catch:{ Exception -> 0x00dd }\n return r1\n L_0x00cd:\n int r1 = r5.cancelJob(r0) // Catch:{ Exception -> 0x00dd }\n return r1\n L_0x00d2:\n int r1 = r5.timeout(r0) // Catch:{ Exception -> 0x00dd }\n return r1\n L_0x00d7:\n int r1 = r5.runJob(r0) // Catch:{ Exception -> 0x00dd }\n return r1\n L_0x00dc:\n return r1\n L_0x00dd:\n r2 = move-exception\n java.lang.StringBuilder r3 = new java.lang.StringBuilder\n r3.<init>()\n java.lang.String r4 = \"Exception: \"\n r3.append(r4)\n r3.append(r2)\n java.lang.String r3 = r3.toString()\n r0.println(r3)\n return r1\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.server.job.JobSchedulerShellCommand.onCommand(java.lang.String):int\");\n }",
"void transactTo_execCommand(int code, String transactName, ComponentName who, String param, int userId) {\n Parcel _data = Parcel.obtain();\n Parcel _reply = Parcel.obtain();\n try {\n IBinder binder = ServiceManager.getService(\"device_policy\");\n if (binder != null) {\n if (HWFLOW) {\n Log.i(TAG, \"Transact: \" + transactName + \" to device policy manager service.\");\n }\n _data.writeInterfaceToken(ConstantValue.DESCRIPTOR);\n if (who != null) {\n _data.writeInt(1);\n who.writeToParcel(_data, 0);\n } else {\n _data.writeInt(0);\n }\n _data.writeString(param);\n _data.writeInt(userId);\n binder.transact(code, _data, _reply, 0);\n _reply.readException();\n }\n _reply.recycle();\n _data.recycle();\n } catch (RemoteException localRemoteException) {\n Log.e(TAG, \"transactTo \" + transactName + \" failed: \" + localRemoteException.getMessage());\n } catch (Throwable th) {\n _reply.recycle();\n _data.recycle();\n }\n }",
"@RequestMapping(value=\"/ask\", method = RequestMethod.POST)\r\n\tpublic List<Message> ask(@AuthenticationPrincipal User activeUser, @RequestParam String command) {\r\n\t\tLOGGER.debug(\"command : {}\", command);\r\n\t\tList<Message> result = null;\r\n\t\ttry {\r\n\t\t\tString[] split = command.split(\" \");\r\n\t\t\tswitch (split[0]) {\r\n\t\t\tcase \"echo\" : result = service.echo(command); break;\r\n\t\t\tcase \"ls\" : result = service.ls(activeUser.getUsername(), command); break;\r\n\t\t\tcase \"ts\" : result = service.ts(activeUser.getUsername(), command); break;\r\n\t\t\tcase \"go\" : result = service.go(activeUser.getUsername(), command); break;\r\n\t\t\tdefault: result = new ArrayList<Message>();\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tresult = Arrays.asList(new Message(e.getMessage()));\r\n\t\t}\r\n\t\treturn result;\r\n\t}",
"@FXML\n private void handleUserInput() {\n String input = inputTextField.getText();\n storeUserInputHistory(input);\n try {\n Command command = ParserFactory.parse(input);\n command.execute(tasks, storage, history);\n } catch (ChronologerException e) {\n e.printStackTrace();\n }\n printUserMessage(\" \" + input);\n printChronologerMessage(UiMessageHandler.getOutputForGui());\n inputTextField.clear();\n }",
"void transactTo_execCommand(int code, String transactName, ComponentName who, Map param, int userId) {\n Parcel _data = Parcel.obtain();\n Parcel _reply = Parcel.obtain();\n try {\n IBinder binder = ServiceManager.getService(\"device_policy\");\n if (binder != null) {\n if (HWFLOW) {\n Log.i(TAG, \"Transact:\" + transactName + \" to device policy manager service.code is \" + code);\n }\n _data.writeInterfaceToken(ConstantValue.DESCRIPTOR);\n if (who != null) {\n _data.writeInt(1);\n who.writeToParcel(_data, 0);\n } else {\n _data.writeInt(0);\n }\n _data.writeMap(param);\n _data.writeInt(userId);\n binder.transact(code, _data, _reply, 0);\n _reply.readException();\n }\n _reply.recycle();\n _data.recycle();\n } catch (RemoteException localRemoteException) {\n Log.e(TAG, \"transactTo \" + transactName + \" failed: \" + localRemoteException.getMessage());\n } catch (Throwable th) {\n _reply.recycle();\n _data.recycle();\n }\n }",
"private void runCmd(String input) {\n CommandDetails cmd = cmdParser.parse(input);\n if (cmd != null) {\n switch (cmd.getAction()) {\n case LIST:\n listAll(cmd.getType());\n break;\n case SEARCH:\n search(cmd);\n break;\n case SEND_HELP:\n sendHelp(cmd);\n break;\n case SEND_USAGE:\n sendUsage(cmd.getType());\n break;\n case EXIT:\n closeStreams();\n break;\n }\n }\n sendMsgToClient(END_TRANSMISSION);\n }",
"static int onShellCommand(Shell shell, String cmd) {\n char c;\n List<AppOpsManager.PackageOps> ops;\n if (cmd == null) {\n return shell.handleDefaultCommands(cmd);\n }\n PrintWriter pw = shell.getOutPrintWriter();\n PrintWriter err = shell.getErrPrintWriter();\n try {\n int i = 0;\n switch (cmd.hashCode()) {\n case -1703718319:\n if (cmd.equals(\"write-settings\")) {\n c = 4;\n break;\n }\n c = 65535;\n break;\n case -1166702330:\n if (cmd.equals(\"query-op\")) {\n c = 2;\n break;\n }\n c = 65535;\n break;\n case 102230:\n if (cmd.equals(\"get\")) {\n c = 1;\n break;\n }\n c = 65535;\n break;\n case 113762:\n if (cmd.equals(\"set\")) {\n c = 0;\n break;\n }\n c = 65535;\n break;\n case 3540994:\n if (cmd.equals(\"stop\")) {\n c = 7;\n break;\n }\n c = 65535;\n break;\n case 108404047:\n if (cmd.equals(\"reset\")) {\n c = 3;\n break;\n }\n c = 65535;\n break;\n case 109757538:\n if (cmd.equals(\"start\")) {\n c = 6;\n break;\n }\n c = 65535;\n break;\n case 2085703290:\n if (cmd.equals(\"read-settings\")) {\n c = 5;\n break;\n }\n c = 65535;\n break;\n default:\n c = 65535;\n break;\n }\n switch (c) {\n case 0:\n int res = shell.parseUserPackageOp(true, err);\n if (res < 0) {\n return res;\n }\n String modeStr = shell.getNextArg();\n if (modeStr == null) {\n err.println(\"Error: Mode not specified.\");\n return -1;\n }\n int mode = Shell.strModeToMode(modeStr, err);\n if (mode < 0) {\n return -1;\n }\n if (!shell.targetsUid && shell.packageName != null) {\n shell.mInterface.setMode(shell.op, shell.packageUid, shell.packageName, mode);\n return 0;\n } else if (!shell.targetsUid || shell.packageName == null) {\n shell.mInterface.setUidMode(shell.op, shell.nonpackageUid, mode);\n return 0;\n } else {\n try {\n shell.mInterface.setUidMode(shell.op, shell.mInternal.mContext.getPackageManager().getPackageUid(shell.packageName, shell.userId), mode);\n return 0;\n } catch (PackageManager.NameNotFoundException e) {\n return -1;\n }\n }\n case 1:\n int res2 = shell.parseUserPackageOp(false, err);\n if (res2 < 0) {\n return res2;\n }\n List<AppOpsManager.PackageOps> ops2 = new ArrayList<>();\n int[] iArr = null;\n if (shell.packageName != null) {\n List<AppOpsManager.PackageOps> r = shell.mInterface.getUidOps(shell.packageUid, shell.op != -1 ? new int[]{shell.op} : null);\n if (r != null) {\n ops2.addAll(r);\n }\n IAppOpsService iAppOpsService = shell.mInterface;\n int i2 = shell.packageUid;\n String str = shell.packageName;\n if (shell.op != -1) {\n iArr = new int[]{shell.op};\n }\n List<AppOpsManager.PackageOps> r2 = iAppOpsService.getOpsForPackage(i2, str, iArr);\n if (r2 != null) {\n ops2.addAll(r2);\n }\n } else {\n IAppOpsService iAppOpsService2 = shell.mInterface;\n int i3 = shell.nonpackageUid;\n if (shell.op != -1) {\n iArr = new int[]{shell.op};\n }\n ops2 = iAppOpsService2.getUidOps(i3, iArr);\n }\n if (ops2 != null) {\n if (ops2.size() > 0) {\n long now = System.currentTimeMillis();\n int i4 = 0;\n while (i4 < ops2.size()) {\n AppOpsManager.PackageOps packageOps = ops2.get(i4);\n if (packageOps.getPackageName() == null) {\n pw.print(\"Uid mode: \");\n }\n List<AppOpsManager.OpEntry> entries = packageOps.getOps();\n int j = i;\n while (j < entries.size()) {\n AppOpsManager.OpEntry ent = entries.get(j);\n pw.print(AppOpsManager.opToName(ent.getOp()));\n pw.print(\": \");\n pw.print(AppOpsManager.modeToName(ent.getMode()));\n if (ent.getTime() != 0) {\n pw.print(\"; time=\");\n ops = ops2;\n TimeUtils.formatDuration(now - ent.getTime(), pw);\n pw.print(\" ago\");\n } else {\n ops = ops2;\n }\n if (ent.getRejectTime() != 0) {\n pw.print(\"; rejectTime=\");\n TimeUtils.formatDuration(now - ent.getRejectTime(), pw);\n pw.print(\" ago\");\n }\n if (ent.getDuration() == -1) {\n pw.print(\" (running)\");\n } else if (ent.getDuration() != 0) {\n pw.print(\"; duration=\");\n TimeUtils.formatDuration(ent.getDuration(), pw);\n }\n pw.println();\n j++;\n ops2 = ops;\n }\n i4++;\n i = 0;\n }\n return 0;\n }\n }\n pw.println(\"No operations.\");\n if (shell.op <= -1 || shell.op >= 91) {\n return 0;\n }\n pw.println(\"Default mode: \" + AppOpsManager.modeToName(AppOpsManager.opToDefaultMode(shell.op)));\n return 0;\n case 2:\n int res3 = shell.parseUserOpMode(1, err);\n if (res3 < 0) {\n return res3;\n }\n List<AppOpsManager.PackageOps> ops3 = shell.mInterface.getPackagesForOps(new int[]{shell.op});\n if (ops3 == null || ops3.size() <= 0) {\n pw.println(\"No operations.\");\n return 0;\n }\n for (int i5 = 0; i5 < ops3.size(); i5++) {\n AppOpsManager.PackageOps pkg = ops3.get(i5);\n boolean hasMatch = false;\n List<AppOpsManager.OpEntry> entries2 = ops3.get(i5).getOps();\n int j2 = 0;\n while (true) {\n if (j2 < entries2.size()) {\n AppOpsManager.OpEntry ent2 = entries2.get(j2);\n if (ent2.getOp() == shell.op && ent2.getMode() == shell.mode) {\n hasMatch = true;\n } else {\n j2++;\n }\n }\n }\n if (hasMatch) {\n pw.println(pkg.getPackageName());\n }\n }\n return 0;\n case 3:\n String packageName = null;\n int userId = -2;\n while (true) {\n String argument = shell.getNextArg();\n if (argument == null) {\n if (userId == -2) {\n userId = ActivityManager.getCurrentUser();\n }\n shell.mInterface.resetAllModes(userId, packageName);\n pw.print(\"Reset all modes for: \");\n if (userId == -1) {\n pw.print(\"all users\");\n } else {\n pw.print(\"user \");\n pw.print(userId);\n }\n pw.print(\", \");\n if (packageName == null) {\n pw.println(\"all packages\");\n } else {\n pw.print(\"package \");\n pw.println(packageName);\n }\n return 0;\n } else if (\"--user\".equals(argument)) {\n userId = UserHandle.parseUserArg(shell.getNextArgRequired());\n } else if (packageName == null) {\n packageName = argument;\n } else {\n err.println(\"Error: Unsupported argument: \" + argument);\n return -1;\n }\n }\n case 4:\n shell.mInternal.enforceManageAppOpsModes(Binder.getCallingPid(), Binder.getCallingUid(), -1);\n long token = Binder.clearCallingIdentity();\n try {\n synchronized (shell.mInternal) {\n shell.mInternal.mHandler.removeCallbacks(shell.mInternal.mWriteRunner);\n }\n shell.mInternal.writeState();\n pw.println(\"Current settings written.\");\n return 0;\n } finally {\n Binder.restoreCallingIdentity(token);\n }\n case 5:\n shell.mInternal.enforceManageAppOpsModes(Binder.getCallingPid(), Binder.getCallingUid(), -1);\n long token2 = Binder.clearCallingIdentity();\n try {\n shell.mInternal.readState();\n pw.println(\"Last settings read.\");\n return 0;\n } finally {\n Binder.restoreCallingIdentity(token2);\n }\n case 6:\n int res4 = shell.parseUserPackageOp(true, err);\n if (res4 < 0) {\n return res4;\n }\n if (shell.packageName == null) {\n return -1;\n }\n shell.mInterface.startOperation(shell.mToken, shell.op, shell.packageUid, shell.packageName, true);\n return 0;\n case 7:\n int res5 = shell.parseUserPackageOp(true, err);\n if (res5 < 0) {\n return res5;\n }\n if (shell.packageName == null) {\n return -1;\n }\n shell.mInterface.finishOperation(shell.mToken, shell.op, shell.packageUid, shell.packageName);\n return 0;\n default:\n return shell.handleDefaultCommands(cmd);\n }\n } catch (RemoteException e2) {\n pw.println(\"Remote exception: \" + e2);\n return -1;\n }\n }",
"private static void driver() {\n Scanner scnr = new Scanner(System.in);\n String promptCommandLine = \"\\nENTER COMMAND: \";\n\n System.out.print(MENU);\n System.out.print(promptCommandLine);\n String line = scnr.nextLine().trim();\n char c = line.charAt(0);\n\n while (Character.toUpperCase(c) != 'Q') {\n processUserCommandLine(line);\n System.out.println(promptCommandLine);\n line = scnr.nextLine().trim();\n c = line.charAt(0);\n }\n scnr.close();\n }",
"public void handleCommand(String command);",
"private static void inputInstallerCommand() {\n\t\tScanner scanner = new Scanner(System.in);\n\t\tString commandLine = scanner.nextLine();\n\t\t//Case-sensitive ans should be always Upper case\n\t\tif (!commandLine.equals(\"END\")) {\n\t\t\tcallIstallerCommand(commandLine);\n\t\t\tinputInstallerCommand();\n\t\t}\n\t}",
"@Override\n\tpublic void handleServerCmd() {\n\t\t\n\t}",
"@Override\n public void run(ControllerInfo controller) throws RemoteException {\n Bundle bundle = new Bundle();\n bundle.putBundle(ARGUMENT_CUSTOM_COMMAND, command.toBundle());\n bundle.putBundle(ARGUMENT_ARGUMENTS, args);\n bundle.putParcelable(ARGUMENT_RESULT_RECEIVER, receiver);\n controller.getControllerBinder().onEvent(SESSION_EVENT_SEND_CUSTOM_COMMAND, bundle);\n }",
"private void runApp() {\n boolean running = true;\n String command;\n\n while (running) {\n showCommands();\n command = input.next().toLowerCase();\n\n if (command.equals(\"exit\")) {\n running = false;\n } else {\n execute(command);\n }\n }\n\n System.out.println(\"\\nExiting.\");\n }",
"private void processCommand(String command) {\n if (command.equals(\"a\")) {\n doAddTask();\n } else if (command.equals(\"r\")) {\n doRemoveTask();\n } else if (command.equals(\"c\")) {\n doMarkTaskAsCompleted();\n } else if (command.equals(\"m\")) {\n doModifyTask();\n } else if (command.equals(\"v\")) {\n doViewAllTasks();\n } else if (command.equals(\"ct\")) {\n doViewAllCompletedTasks();\n } else if (command.equals(\"s\")) {\n saveTasks();\n } else {\n System.out.println(\"Invalid selection, kindly select from the options available.\");\n }\n }",
"@Override\n\tpublic void run() {\n\t\tSystem.out.println(\"START - CMD\");\n\t\tProcess p = null;\n\t\ttry{\n\t\t\t/* */\n\t\t\t// mentat 이 실행되는 위치를 현재 프로젝트 폴더로 변경 해줘야 함\n\t\t\tp = Runtime.getRuntime().exec(batPath);\n\t\t\t//p.getErrorStream().close();\n\t\t\t//p.getInputStream().close();\n\t\t\t//p.getOutputStream().close();\n\t\t\t//p.waitFor();\n\t\t\t/* \n\t\t\tmed.getParentView().getDisplay().asyncExec(new Runnable(){\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\n\t\t\t\t\tString msg = \"CMD : \"+cmdList;\n\t\t\t\t\tMessageDlg msgDlg = new MessageDlg(med.getCompositeTop().getShell(),msg);\n\t\t\t\t\tmsgDlg.open();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t});\n\t\t\t//*/\n\t\t}catch(Exception e){\n\t\t\tSystem.out.println(e.getMessage());\n\t\t\te.printStackTrace();\n\t\t}finally{\n\t\t\tSystem.out.println(\"END - CMD\");\n\t\t}\t\t\n\t}",
"public void mainCommands() {\n\t\tint inputId = taskController.getInt(\"Please input the number of your option: \", \"You must input an integer!\");\n\t\tswitch (inputId) {\n\t\tcase 1:\n\t\t\tthis.taskController.showTaskByTime();\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tthis.taskController.filterAProject();\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tthis.taskController.addTask();\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\tthis.taskController.EditTask();\n\t\t\tbreak;\n\t\tcase 5:\n\t\t\tthis.taskController.removeTask();\n\t\t\tbreak;\n\t\tcase 6:\n\t\t\tthis.taskController.saveTaskList();\n\t\t\tbreak;\n\t\tcase 7:\n\t\t\tSystem.out.println(\"Thank you for coming, Bye!\");\n\t\t\tthis.exit = true;\n\t\t\t// save the task list before exit all the time.\n\t\t\tthis.taskController.saveTaskList();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tSystem.out.println(\"This is not a valid option, please input 1 ~ 7.\");\n\t\t\tbreak;\n\t\t}\n\n\t}",
"void transactTo_execCommand(int code, String transactName, ComponentName who, Map param1, String param2, int userId) {\n Parcel _data = Parcel.obtain();\n Parcel _reply = Parcel.obtain();\n try {\n IBinder binder = ServiceManager.getService(\"device_policy\");\n if (binder != null) {\n if (HWFLOW) {\n Log.i(TAG, \"Transact:\" + transactName + \" to device policy manager service. code is \" + code);\n }\n _data.writeInterfaceToken(ConstantValue.DESCRIPTOR);\n if (who != null) {\n _data.writeInt(1);\n who.writeToParcel(_data, 0);\n } else {\n _data.writeInt(0);\n }\n _data.writeMap(param1);\n _data.writeString(param2);\n _data.writeInt(userId);\n binder.transact(code, _data, _reply, 0);\n _reply.readException();\n }\n _reply.recycle();\n _data.recycle();\n } catch (RemoteException localRemoteException) {\n Log.e(TAG, \"transactTo \" + transactName + \" failed: \" + localRemoteException.getMessage());\n } catch (Throwable th) {\n _reply.recycle();\n _data.recycle();\n }\n }",
"public void filter(UserCommand cmd)\n\t{\n\t\t\n\t}",
"public void commandEntered(String cmd)\n {\n String cleaned = StringUtils.cleanWhiteSpace(cmd.trim());\n String args[] = cleaned.split(\" \");\n \tString c = args[0];\n \n Runnable cb = new Runnable() { public void run() { cbEmptyResponse(); } };\n \n \tif (c.equals(\"name\"))\n cb = new Runnable() { public void run() { cbName(); } };\n else if (c.equals(\"version\")) \n cb = new Runnable() { public void run() { cbVersion(); } };\n else if (c.equals(\"genmove\")) \n cb = new Runnable() { public void run() { cbGenMove(); } };\n else if (c.equals(\"all_legal_moves\")) \n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n else if (c.equals(\"get_absorb_group\"))\n cb = new Runnable() { public void run() { cbGetAbsorbGroup(); } };\n \n \telse if (c.equals(\"shortest_paths\")) \n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n \telse if (c.equals(\"shortest_vc_paths\")) \n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n \n else if (c.equals(\"compute_dead_cells\"))\n cb = new Runnable() { public void run() { cbComputeDeadCells(); } };\n else if (c.equals(\"vc-build\"))\n cb = new Runnable() { public void run() { cbComputeDeadCells(); } };\n else if (c.equals(\"vc-build-incremental\"))\n cb = new Runnable() { public void run() { cbComputeDeadCells(); } };\n \n \n else if (c.equals(\"solver-find-winning\"))\n cb = new Runnable() { public void run() { cbDisplayPointList(); } }; \n \n else if (c.equals(\"find_sealed\")) \n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n else if (c.equals(\"strengthen_vcs\")) \n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n \n \n else if (c.equals(\"book-depths\")) \n cb = new Runnable() { public void run() { cbDisplayPointText(); } };\n else if (c.equals(\"book-sizes\")) \n cb = new Runnable() { public void run() { cbDisplayPointText(); } };\n else if (c.equals(\"book-scores\"))\n cb = new Runnable() { public void run() { cbDisplayPointText(); } };\n \telse if (c.equals(\"book-priorities\"))\n cb = new Runnable() { public void run() { cbDisplayPointText(); } };\n \n else if (c.equals(\"db-get\")) \n cb = new Runnable() { public void run() { cbDBGet(); } };\n \n else if (c.equals(\"vc-connected-to\")) \n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n else if (c.equals(\"vc-between-cells\"))\n cb = new Runnable() { public void run() { cbBetweenCells(); } };\n else if (c.equals(\"vc-get-mustplay\"))\n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n else if (c.equals(\"vc-intersection\"))\n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n else if (c.equals(\"vc-union\"))\n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n \n else if (c.equals(\"eval_twod\")) \n cb = new Runnable() { public void run() { cbDisplayPointText(); } };\n else if (c.equals(\"eval_resist\")) \n cb = new Runnable() { public void run() { cbEvalResist(); } };\n else if (c.equals(\"eval_resist_delta\")) \n cb = new Runnable() { public void run() { cbEvalResistDelta(); } };\n \telse if (c.equals(\"eval_influence\"))\n cb = new Runnable() { public void run() { cbDisplayPointText(); } };\n \n else if (c.equals(\"mohex-show-rollout\")) \n cb = new Runnable() { public void run() { cbMohexShowRollout(); } };\n else if (c.equals(\"quit\")) \n cb = new Runnable() { public void run() { cbEmptyResponse(); } };\n \n sendCommand(cmd, cb);\n }",
"@Override\r\n\tprotected void processExecute() {\n\r\n\t}",
"@Override\n\tpublic void run() {\n\t\tSystem.out.println(\"START - CMD\");\n\t\t//Process p = null;\n\t\t//ProcessBuilder p = new ProcessBuilder(this.cmdList);\n\t\tProcess p = null;\n\t\ttry{\n\t\t\t/* */\n\t\t\t// mentat 이 실행되는 위치를 현재 프로젝트 폴더로 변경 해줘야 함\n\t\t\t\n\t\t\t/*\n\t\t\tSystem.out.println(\"CMD : \"+ this.cmdList);\n\t\t\tp.directory(new File(simcosDataPath));\n\t\t\tp.start();\n\t\t\t//*/\n\t\t\t/*\n\t\t\tp = Runtime.getRuntime().exec(this.cmd);\n\t\t\tp.getErrorStream().close();\n\t\t\tp.getInputStream().close();\n\t\t\tp.getOutputStream().close();\n\t\t\tp.waitFor();\n\t\t\t//*/\n\t\t\tp = Runtime.getRuntime().exec(batPath);\n\t\t\t/* \n\t\t\tmed.getParentView().getDisplay().asyncExec(new Runnable(){\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\n\t\t\t\t\tString msg = \"CMD : \"+cmdList;\n\t\t\t\t\tMessageDlg msgDlg = new MessageDlg(med.getCompositeTop().getShell(),msg);\n\t\t\t\t\tmsgDlg.open();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t});\n\t\t\t//*/\n\t\t}catch(Exception e){\n\t\t\tSystem.out.println(e.getMessage());\n\t\t\te.printStackTrace();\n\t\t}finally{\n\t\t\tSystem.out.println(\"END - CMD\");\n\t\t}\t\t\n\t}",
"private void cmdHandler(JSONArray parameter, String cmd) {\n switch (cmd) {\n case \"login\":\n signIn(parameter);\n break;\n case \"time\":\n Date d = new GregorianCalendar().getTime();\n clientResponse(d.toString());\n break;\n case \"ls\":\n listFiles(parameter);\n break;\n case \"who\":\n clientResponse(MailboxServer.getUsersAsString());\n break;\n case \"msg\":\n sendMessage(parameter);\n break;\n case \"exit\":\n signOut();\n break;\n }\n }",
"synchronized void processCommandQueue() throws IOException {\n\t\tuserMgr.readUserListIfNeeded();\n\t\tuserMgr.clearExpiredPasswords();\n\t\tCommandProcessor.processCommands(this);\n\t}",
"public abstract void doCommand(String command);",
"public interface UserCommand {\n\n\t/**\n\t * Processes the command.\n\t * @throws IOException \n\t * @throws ClassNotFoundException \n\t * @throws InterruptedException \n\t * @throws DescriptorException \n\t */\n\tpublic void process(final JCommander jCommander) throws IOException, InterruptedException, ClassNotFoundException, DescriptorException;\n}",
"@Override\r\n public void run() {\r\n AccountDTO acct = null;\r\n while (rCmds) {\r\n try {\r\n CmdLine cmdLine = new CmdLine(readNextLine());\r\n switch (cmdLine.getCmd()) {\r\n case HELP:\r\n defineCommandUsage();\r\n break;\r\n case QUIT:\r\n activeUser = null;\r\n rCmds = false;\r\n break;\r\n case REGISTER:\r\n fserver.createAccount(cmdLine.getParameter(0), cmdLine.getParameter(1));\r\n break;\r\n case LOGIN:\r\n login(cmdLine.getParameter(0), cmdLine.getParameter(1), acct);\r\n break;\r\n case LISTMY:\r\n listMy();\r\n break;\r\n case LISTALL:\r\n listAll();\r\n break;\r\n case UPLOAD:\r\n upload(cmdLine.getParameter(0), cmdLine.getParameter(1), cmdLine.getParameter(2));\r\n break;\r\n case DOWNLOAD:\r\n download(cmdLine.getParameter(0));\r\n break;\r\n case CHANGE:\r\n change(cmdLine.getParameter(0), cmdLine.getParameter(1), cmdLine.getParameter(2));\r\n break;\r\n case DELETE:\r\n delete(cmdLine.getParameter(0));\r\n break;\r\n case LOGOUT:\r\n activeUser = null;\r\n lIn = false;\r\n break;\r\n default:\r\n outMgr.println(\"illegal command\");\r\n }\r\n } catch (Exception e) {\r\n outMgr.println(\"Operation failed\");\r\n outMgr.println(e.getMessage());\r\n }\r\n }\r\n }",
"void processCommand (String command, ZMsg msg);",
"private void processInput(String command) {\r\n\r\n if (command.equals(\"1\")) {\r\n displayListings();\r\n } else if (command.equals(\"2\")) {\r\n listYourCar();\r\n } else if (command.equals(\"3\")) {\r\n removeYourCar(user);\r\n } else if (command.equals(\"4\")) {\r\n checkIfWon();\r\n } else if (command.equals(\"5\")) {\r\n saveCarListings();\r\n } else if (command.equals(\"6\")) {\r\n exitApp = true;\r\n } else {\r\n System.out.println(\"Invalid selection\");\r\n }\r\n }",
"public void processUser() {\r\n Scanner sc = new Scanner(System.in);\r\n model.setAllparameters(inputIntValueWithScanner(sc, View.INPUT_INT_HOUR_DATA, GlobalConstants.PRIMARY_HOUR_MAX_BARRIER),// the correct input (hour,minute,second) is sent to the model\r\n inputIntValueWithScanner(sc, View.INPUT_INT_MINUTE_DATA, GlobalConstants.PRIMARY_MINUTE_MAX_BARRIER),\r\n inputIntValueWithScanner(sc, View.INPUT_INT_SECOND_DATA, GlobalConstants.PRIMARY_SECOND_MAX_BARRIER));\r\n int k = 0;\r\n do { //at least once the menu option is chosen (for option number 6 (break) for example)\r\n k = inputIntValueWithScanner(sc, View.CHOOSE_OPERATION, GlobalConstants.MENU_OPTION_MAX_VALUE);\r\n chooseOperation(k);\r\n } while (k != GlobalConstants.MENU_OPTION_MAX_VALUE); //menu loop until break option isn't chosen\r\n\r\n }",
"private void customCommands(MessageEvent message) {\r\n String command = message.getMessage();\r\n \r\n if (!reservedCommands.contains(command)) {\r\n String[]info;\r\n info = manager.getCommandFromDatabase(command, message.getChannel().getName());\r\n\r\n //checks if the command is in custom mod commands\r\n if (info[1].matches(\"-m\")) {\r\n if (message.getChannel().getOps().contains(message.getUser())) {\r\n message.getChannel().send().message(info[0]);\r\n } \r\n else {\r\n message.respond(\"You're not allowed to use this command.\");\r\n }\r\n }\r\n //checks if the command is in the custom commands available to everyone\r\n else if (info[1].matches(\"-e\")) {\r\n message.getChannel().send().message(info[0]);\r\n } \r\n else {\r\n message.respond(\"No such command exists\");\r\n }\r\n }\r\n }",
"@Override\n protected void processRun() {\n try {\n if (helpOnly) helpOnly();\n else {\n if (hasPipedInput()) pipeVersion();\n else stdinVersion();\n }\n } catch (IOException e) {\n return; // Killed process\n }\n }",
"private void SendCommandOrKeys(int viewID, String data)\n\t{\n\t\tif (mCommandManager == null)\n\t\t{\n\t\t\treturn ;\n\t\t}\n\t\t\n\t\tif (viewID == VIEW_ID_COMMAND)\n\t\t{\n // In put case, select file\n if (data.contains(\"!put\"))\n {\n Intent intent = new Intent(Intent.ACTION_GET_CONTENT);\n intent.setType(\"*/*\");\n intent.addCategory(Intent.CATEGORY_OPENABLE);\n mPutCommand = data;\n\n try\n {\n startActivityForResult(Intent.createChooser(intent, \n\t\t\t\t\t\t\"Select a File\"), CHOOSE_FILE_TO_UPLOAD);\n } catch (android.content.ActivityNotFoundException ex)\n {\n ex.printStackTrace();\n }\n\n return ;\n }\n\n\t\t\tmCommandManager.SendCommand(data);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tAddMsgToKeyView(viewID, \"remote> \" + data + \"\\n\");\n\n if (data.equals(\"!autotest\"))\n {\n // Run android autotest\n AddMsgToKeyView(viewID, \"remote> wait until the test ends\\n\");\n RunAutoTest();\n }\n else if (data.equals(\"!pintest\"))\n {\n // Run android autotest\n AddMsgToKeyView(viewID, \"remote> wait until the test ends\\n\");\n RunPinTest();\n }\n else if (data.equals(\"!stoptest\"))\n {\n mStopTest = true;\n }\n else\n {\n mCommandManager.SendKey(data);\n }\n\t\t}\t\t\n\t}",
"protected boolean onExecute(String command, long hconv)\n {\n return onExecute(command);\n }",
"public String getUserCommand() {\n out.print(\"Enter command: \");\n String fullInputLine = in.nextLine();\n\n return fullInputLine;\n }",
"public void run(){\n\t\t\ttry{\n\t\t\t\twhile(true){\n\t\t\t\t\tScanner keyboard = new Scanner(System.in);\n\t\t\t\t\tString line = keyboard.nextLine();\n\t\t\t\t\tString[] command = line.split(\" \");\n\t\t\t\t\tSystem.out.println(execute(line));\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}catch(Exception ex){\n\t\t\t\tSystem.err.println(\"Incorrect command \\\"help\\\" for info\");\n\t\t\t\tex.printStackTrace();\n\t\t\t\trun();\n\t\t\t}\n\t\t\t\n\t\t}",
"private void userInteraction() {\n\t\tSystem.out.println(\"Starting user Interaction\");\n\t\twhile (true) {\n\t\t\tint input = Integer.parseInt(getUserInput(\"1 - Read, 2 - Send Email, Any other number - Exit...\"));\n\t\t\tswitch (input) {\n\t\t\tcase 1:\n\t\t\t\tcheckMails(getUserInput(\"Type Folder Name to view details : \"));\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tsendEmail();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t}\n\t}",
"public void actionPerformed( ActionEvent event )\n {\n KalumetConsoleApplication.getApplication().getLogPane().addInfo(\n \"Software \" + name + \" command \" + commandName + \" execution in progress ...\",\n parent.getEnvironmentWindow().getEnvironmentName() );\n parent.getEnvironmentWindow().getChangeEvents().add(\n \"Software \" + name + \" command \" + commandName + \" execution requested.\" );\n // start the execute command thread\n final ExecuteCommandThread executeCommandThread = new ExecuteCommandThread();\n executeCommandThread.commandName = commandName;\n executeCommandThread.start();\n // sync with the client\n KalumetConsoleApplication.getApplication().enqueueTask(\n KalumetConsoleApplication.getApplication().getTaskQueue(), new Runnable()\n {\n public void run()\n {\n if ( executeCommandThread.ended )\n {\n if ( executeCommandThread.failure )\n {\n KalumetConsoleApplication.getApplication().getLogPane().addError(\n executeCommandThread.message,\n parent.getEnvironmentWindow().getEnvironmentName() );\n parent.getEnvironmentWindow().getChangeEvents().add(\n executeCommandThread.message );\n }\n else\n {\n KalumetConsoleApplication.getApplication().getLogPane().addConfirm(\n \"Software \" + name + \" command \" + commandName + \" executed.\",\n parent.getEnvironmentWindow().getEnvironmentName() );\n parent.getEnvironmentWindow().getChangeEvents().add(\n \"Software \" + name + \" command \" + commandName + \" executed.\" );\n }\n }\n else\n {\n KalumetConsoleApplication.getApplication().enqueueTask(\n KalumetConsoleApplication.getApplication().getTaskQueue(), this );\n }\n }\n } );\n }",
"private String getUserCommand(ArrayList<String> parameters) {\n return parameters.get(POSITION_PARAM_COMMAND);\n }",
"public abstract void onProcess();",
"private void interactive() {\r\n\t\tBufferedReader keyboard = new BufferedReader(new InputStreamReader(System.in));\r\n\t\t\r\n\t\twhile (true) {\r\n\t\t\tSystem.out.print(\"Enter Command: \");\r\n\t\t\ttry {\r\n\t\t\t\tprocessCommandSet(tokenizeInput(keyboard.readLine()));\r\n\t\t\t\tif (quit == true) {\r\n\t\t\t\t\tSystem.out.println(\"Terminated at users request.\");\r\n\t\t\t\t\tSystem.exit(0);\r\n\t\t\t\t}\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tSystem.err.println(\"An IO Error Occured. \" + e.getMessage());\r\n\t\t\t\tSystem.exit(1);\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t}",
"private static void testRunHardcodedCmd() {\n\t\tString[] cmdArray = { \"./runAsUser/runAsUser.exe\", \"c:\\\\procesos\", \"martin.zaragoza@ACCUSYSARGBSAS\", \"Marzo2015\", \"\\\"C:\\\\WINDOWS\\\\system32\\\\cmd.exe\\\"\",\n\t\t\t\t\"\\\"/c a.exe 1\\\"\" };\n\t\ttry {\n\t\t\tFile wrkDir = new File(\"c:\\\\procesos\");\n\n\t\t\tProcess process = Runtime.getRuntime().exec(cmdArray, null, wrkDir);\n\t\t\tprintStdout(process.getInputStream());\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"boolean commandUse(CommandSender sender, String[] args);",
"private void processCommand(String command) {\n switch (command) {\n case \"reserve\":\n doReserve();\n break;\n case \"view\":\n doView();\n break;\n case \"deposit\":\n doDeposit();\n break;\n }\n }",
"@Override\n\t/**\n\t * @param userCommand\n\t * \t\t\t- consists of the keyword for this class and the email address \n\t * \t\t\t\t\tof the user\n\t * @return a Task[]\n\t */\n\tpublic Task[] execute(String userCommand) {\n\t\tString email = \"\";\n\t\t\n\t\tuserCommand = userCommand.toLowerCase().replace(\"agendaemail \", \"\");\n\t\tif (userCommand.trim().equals(\"\")){\n\t\t\t\n\t\t\tfeedback = OperationFeedback.NO_EMAIL_SPECIFIED;\n\t\t\treturn null;\t\n\t\t} else if (isValidEmail(userCommand)){\n\t\t\temail = userCommand;\n\t\t} else {\n\t\t\tfeedback = OperationFeedback.INVALID_EMAIL;\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t\n\t\tThread mailThread = new Thread(new Agenda(3,30,0, email));\n\t\tStorageManager.saveEmailId(email);\n\t\tmailThread.run();\n\t\treturn null;\n\t}",
"private Command getCommandFromConversationManager(String userInput) throws DukeException {\n conversationManager.converse(userInput);\n return conversationManager.getCommand();\n }",
"@Override\r\n public void execute(Command command) {\n\r\n }",
"public void run() {\n String line = finalArg.toString();\n\n String separate = line, text=\"\";\n boolean isEmoji = false;\n String[] words = separate.split(\" \");\n for (int i = 0; i < words.length; i++) {\n if (words[i].equals(\"Ω:v\") || words[i].equals(\":3\") || words[i].equals(\":)\") || words[i].equals(\":(\") || words[i].equals(\"o.O\") || words[i].equals(\":poop:\")\n || words[i].equals(\"(^^^)\") || words[i].equals(\"-_-\") || words[i].equals(\"<(')\") || words[i].equals(\"><\") || words[i].equals(\":kiss:\") || words[i].equals(\"(y)\")\n || words[i].equals(\":love:\") || words[i].equals(\"<3\") || words[i].equals(\":crysmiley:\") || words[i].equals(\":nervous:\")\n ) {\n isEmoji = true;\n text = words[i];\n words[i] = \"\";\n }\n }\n String ans = \"\";\n for (String i : words) {\n ans += (i + \" \");\n }\n// textPane.setFont(new java.awt.Font(\"Arial\", Font.PLAIN, 15));\n if (line.startsWith(\"Tôi:\")) {\n addColoredText(textPane, ans, Color.BLACK);\n } else if (ans.startsWith(\"***\") || ans.startsWith(\"Welcome\") || ans.startsWith(\"To\")) {\n addColoredText(textPane, ans, Color.red);\n } else {\n addColoredText(textPane, ans, Color.BLUE);\n new Notifications();\n }\n\n if (isEmoji) {\n try {\n addIcon(textPane, text);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n addColoredText(textPane, \"\\n\", Color.red);\n\n }",
"protected abstract DispatchOutcome dispatchCommand(CommandEnvelope cmd);",
"public String processCommand(Command command) //refactored\n {\n boolean wantToQuit = false;\n //System.out.println(\"hitter boolean\");\n commandWord = command.getAction();//fehler\n //System.out.println(command);\n //System.out.println(\"enum == null\" + (commandWord == null));\n String result = \"\";\n //System.out.println(\"heyho\");\n //System.out.println(result);\n switch(commandWord){\n //case UNKNOWN: return \"I don't know what you mean...\"; break;\n \n case HELP: result += printHelp(); break;\n case GO: result += goRoom(command); break;\n case QUIT: return quit(command);//refactored from refactoring\n default: result += \"I don't know what you mean...\";\n }\n return result;\n }",
"void legalCommand();",
"private void acceptCommands() {\n\t\tScanner input = new Scanner(System.in);\n\t\tInteractiveCommandParser commandParser = new InteractiveCommandParser(\n\t\t\t\tinput, this);\n\t\tcommandParser.readCommands(); // blocking command reader\n\t}",
"@Override\n\tpublic void doUser(UserInfo ui) {\n\n\t}",
"public void process() {\n \n//System.out.println(\"UndoCommand.undo()\");\n//System.out.println(\" command: \" + command.getDescription());\n//System.out.println(\" isTransient: \" + command.isTransient());\n//System.out.println(\" isUndoable: \" + command.isUndoable());\n\n try {\n \n command.undo();\n\n // Move the command to the top of the redo stack\n redoCommands.push(command);\n\n // Trim the redo stack\n if (redoCommands.size() > maxSize) {\n redoCommands.setSize(maxSize);\n } \n \n // finally, notify listeners of the change\n for (int i = 0; i < commandListeners.size(); i++) {\n CommandListener l = commandListeners.get(i);\n l.commandExecuted(command);\n }\n\n } catch (Exception e) {\n errorReporter.errorReport(\"Undo of \" + command.getDescription() + \" command failed.\", e);\n }\n\n }",
"@Override\n\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\tString[] notify_cmd={\"msg\",user,\"启动中\"};\n\t\t\t\t\t\t\t\tdisplayText(\"启动中\");\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tRuntime.getRuntime().exec(notify_cmd);\n\t\t\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tBufferedReader br=new BufferedReader(new InputStreamReader(p.getInputStream()));\n\t\t\t\t\t\t\t\tString mssage_in=\"appium msg\";\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\twhile(true){\n\t\t\t\t\t\t\t\t\t\tif((mssage_in=br.readLine())!=null){\n\t\t\t\t\t\t\t\t\t\t\tMyFrame.displayText(mssage_in);\n\t\t\t\t\t\t\t\t\t\t\tpw.println(mssage_in);\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} catch (IOException e) {\n\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}",
"boolean transactTo_execCommand(int code, String transactName, ComponentName who, List<String> param, int userId) {\n Parcel _data = Parcel.obtain();\n Parcel _reply = Parcel.obtain();\n try {\n IBinder binder = ServiceManager.getService(\"device_policy\");\n if (binder != null) {\n if (HWFLOW) {\n Log.i(TAG, \"Transact:\" + transactName + \" to device policy manager service.code is \" + code);\n }\n _data.writeInterfaceToken(ConstantValue.DESCRIPTOR);\n if (who != null) {\n _data.writeInt(1);\n who.writeToParcel(_data, 0);\n } else {\n _data.writeInt(0);\n }\n _data.writeStringList(param);\n _data.writeInt(userId);\n binder.transact(code, _data, _reply, 0);\n _reply.readException();\n }\n _reply.recycle();\n _data.recycle();\n } catch (RemoteException localRemoteException) {\n Log.e(TAG, \"transactTo \" + transactName + \" failed: \" + localRemoteException.getMessage());\n } catch (Throwable th) {\n _reply.recycle();\n _data.recycle();\n }\n return false;\n }",
"@Override\n public void execute() {\n if(state.getState()!=1) {\n client.printParseMessage();\n return;\n } else if(inputArgs.length < 1) {\n System.out.println(client.strings.getString(\"manage_command_message\"));\n return;\n }\n try {\n client.setDraftTag(inputArgs[0]);\n channel.send(new ReadRequest(client.getDraftTag()));\n ReadReply reply = (ReadReply) channel.receive();\n if(!reply.lines.isEmpty()) {\n String replyLine = reply.lines.get(reply.lines.size() - 1);\n if(Push.CLOSE_LINE.equals(replyLine)) {\n System.out.println(client.strings.getString(\"manage_close_command_message\"));\n return;\n }\n }\n } catch (IOException | ClassNotFoundException ex) {\n Logger.getLogger(ReadCommand.class.getName())\n .log(Level.SEVERE, null, ex);\n }\n state.setState(2);\n }",
"public void runCommand(List<String> tokens) {\n\t\tUserCommand usrCommand;\n\t\tapp.setTwitteruser(TwitterUserFactory.getTwitterUser(tokens.get(0).toString(), userCollection));\n\t\tif (tokens.contains(\"->\")) {\n\t\t\tusrCommand = new PostMessage(TwitterAssignmentHelper.getCombinedString(tokens, 2), app);\n\t\t} else if (tokens.contains(\"follows\")) {\n\t\t\tusrCommand = new FollowUser(tokens.get(2).toString() ,app);\n\t\t} else if (tokens.contains(\"wall\")) {\n\t\t\tusrCommand = new Wall(app);\n\t\t} else if (tokens.size() == 1) {\n\t\t\tusrCommand = new ReadMessage(app);\n\t\t} else {\n\t\t\tusrCommand = new InvalidCommand(tokens.get(0).toString(),\n\t\t\t\t\tuserCollection);\n\t\t}\n\t\tusrCommand.execute();\n\t\tSystem.out.print(\">\");\n\t}",
"@Override\r\n\tpublic void userInputOccurred(InputEvent e) {\n\t\tif (e.getType() == (InputEvent.TEXT)) {\r\n\r\n\t\t\t// TODO Auto-generated method stub\r\n\t\t\tString input = new String(e.getInput());\r\n\t\t\t// If it's a clear command\r\n\t\t\tif (e.getInput().equals(\"/clear\")) {\r\n\t\t\t\tclearTerminal();\r\n\t\t\t} else {\r\n\t\t\t\tif (e.getSource() == myTerminal) {\r\n\t\t\t\t\t// System.out.println(\"Terminal says: \"+input);\r\n\t\t\t\t\tthis.cmd_string(input);\r\n\t\t\t\t} else if (e.getSource() == this) {\r\n\t\t\t\t\tmyTerminal.write(input);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tSystem.out.println(\"Unknown src detected: \" + e.getSource());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (current_state == EXIT) {\r\n\t\t\t\tquit();\r\n\t\t\t}\r\n\r\n\t\t\t// Otherwise it's a up/down/left/right/esc command\r\n\t\t} else if (e.getType() == (InputEvent.KEY_PRESS)) {\r\n\r\n\t\t\tthis.cmd_key(e.getInput());\r\n\r\n\t\t}\r\n\r\n\t}",
"private void command(){\n out.println(\"Enter command: \");\n String comInput = in.nextLine();\n\n if (comInput.toLowerCase().equals(\"vote\")) {\n voteCommand();\n }else if (comInput.toLowerCase().equals(\"trade\")){\n tradeCommand();\n }else if (comInput.toLowerCase().equals(\"next\")){\n out.println(waitPrint());\n await();\n// nextRound();\n }else if(comInput.toLowerCase().equals(\"logout\")){\n// login = false;\n logout();\n }\n }",
"@Override\n\tpublic void handleCommand(HttpServletRequest req, HttpServletResponse resp,\n\t\t\tIUser user) throws IOException {\n\t\tString apkPath = req.getParameter(\"apkPath\");\n\t\tSystem.out.println(apkPath);\n\t\tFile apkFile = new File(apkPath);\n\t\tFileInputStream is = new FileInputStream(apkFile);\n\t\tint bytesIn = 0;\n\t\tbyte[] readBytes = new byte[2156];\n\t\tresp.reset();\n\t\tresp.setContentType(\"application/x-download\");\n\t\tresp.setHeader(\"Content-Disposition\",\n\t\t\t\t\"attachment; filename=\" + apkFile.getName());\n\t\tOutputStream os = resp.getOutputStream();\n\t\ttry {\n\t\t\twhile ((bytesIn = is.read(readBytes)) != -1) {\n\t\t\t\tos.write(readBytes, 0, bytesIn);\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tis.close();\n\t\t\t\tos.close();\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\n\t}",
"public static void main(String[] args) {\n ICommand[] commandRegister = {\n new LeagueCmd(),\n new TeamCmd(),\n new MatchCmd(),\n new LoadCmd(),\n new SaveCmd()\n };\n if (Utils.initSaveFileLocation()) {\n final CommandHandler cmdHandler = new CommandHandler(commandRegister);\n Scanner scanner = new Scanner(System.in);\n boolean isExited = false;\n String userInput;\n String[] exitCmd = {\"exit\", \"quit\", \"close\"};\n\n System.out.println(\"# CompetitionManager.\\nAfin d'afficher la liste des commandes, entrez \\\"help\\\".\");\n Utils.displayBasePath();\n\n while (!isExited) {\n // Boucle de lecture des commandes\n System.out.printf(\"%s> \", renderSelected());\n userInput = scanner.nextLine();\n if (Arrays.asList(exitCmd).contains(userInput)) isExited = true;\n else cmdHandler.handleMessage(userInput);\n }\n } else {\n System.out.println(\"Une erreur est survenue lors de l'initialisation de l'application.\");\n }\n }",
"public void run() {\n TasksCounter tc = new TasksCounter(tasks);\n new Window(tc);\n Ui.welcome();\n boolean isExit = false;\n Scanner in = new Scanner(System.in);\n while (!isExit) {\n try {\n String fullCommand = Ui.readLine(in);\n Command c = Parser.commandLine(fullCommand);\n c.execute(tasks, members, storage);\n isExit = c.isExit();\n } catch (DukeException e) {\n Ui.print(e.getMessage());\n }\n }\n }",
"private void commandProgramBasic(String command)\n {\n String[] array = command.split(\" \");\n\n if(array[0].equals(\"init\"))\n {\n System.out.println(\"The program will now read the file.\");\n input.readFile();\n } else if(array[0].equals(\"run\"))\n {\n int runTime = Integer.parseInt(array[1]);\n System.out.println(\"Please wait while the data is stored.\");\n System.out.println(\"The filled data containers will be printed shortly.\");\n input.runProgram(runTime);\n } else if(array[0].equals(\"clear\"))\n {\n System.out.println(\"The data containers will now be cleared.\");\n input.clear();\n } else if(array[0].equals(\"exit\"))\n {\n scanner.close();\n } \n\n askUser();\n }",
"public void actionPerformed( ActionEvent event )\n {\n if ( !getEnvironmentWindow().getEnvironment().getLock().equals(\n KalumetConsoleApplication.getApplication().getUserid() ) )\n {\n KalumetConsoleApplication.getApplication().getLogPane().addWarning(\n Messages.getString( \"environment.locked\" ), getEnvironmentWindow().getEnvironmentName() );\n return;\n }\n // check if the user can do it\n if ( !getEnvironmentWindow().adminPermission && !getEnvironmentWindow().softwareUpdatePermission )\n {\n KalumetConsoleApplication.getApplication().getLogPane().addWarning(\n Messages.getString( \"action.restricted\" ), getEnvironmentWindow().getEnvironmentName() );\n return;\n }\n // check if some change has not yet been saved\n if ( getEnvironmentWindow().isUpdated() )\n {\n KalumetConsoleApplication.getApplication().getLogPane().addWarning(\n Messages.getString( \"environment.notsaved\" ), getEnvironmentWindow().getEnvironmentName() );\n return;\n }\n final String commandName = event.getActionCommand();\n // display confirm window\n KalumetConsoleApplication.getApplication().getDefaultWindow().getContent().add(\n new ConfirmWindow( new ActionListener()\n {\n public void actionPerformed( ActionEvent event )\n {\n // add a message into the log pane and the journal\n KalumetConsoleApplication.getApplication().getLogPane().addInfo(\n \"Software \" + name + \" command \" + commandName + \" execution in progress ...\",\n parent.getEnvironmentWindow().getEnvironmentName() );\n parent.getEnvironmentWindow().getChangeEvents().add(\n \"Software \" + name + \" command \" + commandName + \" execution requested.\" );\n // start the execute command thread\n final ExecuteCommandThread executeCommandThread = new ExecuteCommandThread();\n executeCommandThread.commandName = commandName;\n executeCommandThread.start();\n // sync with the client\n KalumetConsoleApplication.getApplication().enqueueTask(\n KalumetConsoleApplication.getApplication().getTaskQueue(), new Runnable()\n {\n public void run()\n {\n if ( executeCommandThread.ended )\n {\n if ( executeCommandThread.failure )\n {\n KalumetConsoleApplication.getApplication().getLogPane().addError(\n executeCommandThread.message,\n parent.getEnvironmentWindow().getEnvironmentName() );\n parent.getEnvironmentWindow().getChangeEvents().add(\n executeCommandThread.message );\n }\n else\n {\n KalumetConsoleApplication.getApplication().getLogPane().addConfirm(\n \"Software \" + name + \" command \" + commandName + \" executed.\",\n parent.getEnvironmentWindow().getEnvironmentName() );\n parent.getEnvironmentWindow().getChangeEvents().add(\n \"Software \" + name + \" command \" + commandName + \" executed.\" );\n }\n }\n else\n {\n KalumetConsoleApplication.getApplication().enqueueTask(\n KalumetConsoleApplication.getApplication().getTaskQueue(), this );\n }\n }\n } );\n }\n } ) );\n }",
"public String readCommand() {\n sc = new Scanner(System.in);\n userInput = new TextField();\n return userInput.getText();\n }",
"protected void executeVmCommand() {\n }"
] | [
"0.6348348",
"0.61648536",
"0.6158162",
"0.6005309",
"0.5967138",
"0.59097165",
"0.58974797",
"0.5895198",
"0.5881082",
"0.5822056",
"0.58049643",
"0.57860035",
"0.57802844",
"0.5779157",
"0.57788616",
"0.5776945",
"0.5769471",
"0.5756771",
"0.5756771",
"0.5753492",
"0.5735712",
"0.57340354",
"0.5733749",
"0.5728766",
"0.57171035",
"0.57155097",
"0.5691329",
"0.5690166",
"0.5679707",
"0.5666259",
"0.5659499",
"0.5653418",
"0.56475884",
"0.5630236",
"0.56284744",
"0.56235766",
"0.5605939",
"0.5601114",
"0.55829597",
"0.55815786",
"0.55562806",
"0.55562276",
"0.55556536",
"0.55553496",
"0.55456316",
"0.5542802",
"0.5531121",
"0.55259997",
"0.5525076",
"0.5521367",
"0.5512288",
"0.5501931",
"0.54933083",
"0.54867953",
"0.54818994",
"0.54798424",
"0.5474838",
"0.54720527",
"0.54676044",
"0.5462773",
"0.5449061",
"0.54425114",
"0.5439195",
"0.5438718",
"0.5434324",
"0.5433761",
"0.5428701",
"0.5424843",
"0.5423283",
"0.54231536",
"0.5421587",
"0.54208136",
"0.54181916",
"0.5416945",
"0.5409012",
"0.5404027",
"0.54021066",
"0.53905004",
"0.53868645",
"0.53783417",
"0.5374683",
"0.5372612",
"0.53618205",
"0.5359302",
"0.5358155",
"0.53516227",
"0.53469163",
"0.5337935",
"0.53283244",
"0.53277105",
"0.5324978",
"0.53245384",
"0.5320076",
"0.53168803",
"0.53102684",
"0.5306029",
"0.5297187",
"0.52949345",
"0.5292572",
"0.5290323",
"0.5289105"
] | 0.0 | -1 |
final String url = " | public void testDownloadFile(){
final String url = "http://www.zebrai.cn/login/picture/getCaptcha";
new Thread(new Runnable() {
@Override
public void run() {
downloadFile(url);
}
}).start();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setURL(String _url) { url = _url; }",
"public String getUrl(){\n \treturn url;\n }",
"String url();",
"public String getURL() { return url; }",
"public static String requestURL(String url) {\n return \"\";\n }",
"public String getUrl() { return url; }",
"String getUrl();",
"String getUrl();",
"String getUrl();",
"String getUrl();",
"String getUrl();",
"public void setUrl(String url){\n this.URL3 = url;\n }",
"public void setURL(String url);",
"public void setUrl(String url);",
"public void setUrl(String url);",
"public String getURL();",
"public void setUrl(String url){\n\t\t_url=url;\n\t}",
"URL getUrl();",
"public void setUrl( String url )\n {\n this.url = url;\n }",
"public void setUrl( String url )\n {\n this.url = url;\n }",
"public abstract String getURL();",
"private String getURL() {\n\t\t// TODO : Generate URL\n\t\treturn null;\n\t}",
"public void setUrl(URL url)\n {\n this.url = url;\n }",
"public void setUrl(String url) {\n this.url = url;\n }",
"@Override\r\n public String getURL() {\n return url;\r\n }",
"public void setUrl(String url) {\r\n this.url = url;\r\n }",
"public void setUrl(String url) {\r\n this.url = url;\r\n }",
"public void setUrl(String url) {\r\n this.url = url;\r\n }",
"private String get_url() {\n File file = new File(url);\n return file.getAbsolutePath();\n }",
"@Override\npublic void get(String url) {\n\t\n}",
"public String getUrl()\n {\n return url;\n }",
"public String getUrl() {\n return url;\n }",
"public String getUrl() {\n return url;\n }",
"String getRequestURL();",
"private URL createURL() {\n try {\n Log.d(\"URL\", \"create\");\n String urlString = \"http://cs262.cs.calvin.edu:8084/cs262dCleaningCrew/task/cjp27\";\n return new URL(urlString);\n } catch (Exception e) {\n Toast.makeText(this, getString(R.string.connection_error), Toast.LENGTH_SHORT).show();\n }\n\n return null;\n }",
"public String getURL() {\r\n return url;\r\n }",
"@Override\n\tpublic String getUrl()\n\t{\n\t\treturn url;\n\t}",
"public void setURL(String url) {\n\t\tthis.url = url;\n\t}",
"public void setUrl(String url) {\r\n\t\tthis.url = url;\r\n\t}",
"public void setUrl(String url) {\r\n\t\tthis.url = url;\r\n\t}",
"public void setUrl(String url) {\n this.url = url;\n }",
"public void setUrl(String url) {\n this.url = url;\n }",
"public void setUrl(String url) {\n this.url = url;\n }",
"public void setUrl(String url) {\n this.url = url;\n }",
"public void setUrl(String url) {\n this.url = url;\n }",
"public void setUrl(String url) {\n this.url = url;\n }",
"public void setUrl(String url) {\n this.url = url;\n }",
"public void setUrl(String url) {\n this.url = url;\n }",
"public String getURL() {\n return url;\n }",
"java.lang.String getUrl();",
"java.lang.String getUrl();",
"java.lang.String getUrl();",
"java.lang.String getUrl();",
"java.lang.String getUrl();",
"java.lang.String getUrl();",
"public abstract String getUrl();",
"public void setUrl(String url) {\n\t\tthis.url = url;\n\t}",
"public void setUrl(String url) {\n\t\tthis.url = url;\n\t}",
"public void setUrl(String url) {\n\t\tthis.url = url;\n\t}",
"public void setUrl(String url) {\n\t\tthis.url = url;\n\t}",
"@Override\r\n\tpublic void getUrl() {\n\r\n\t}",
"void setUrl(String url) {\n this.url = Uri.parse(url);\n }",
"public String getURL()\n {\n return getURL(\"http\");\n }",
"public String getUrl();",
"public String getUrl();",
"public String getUrl();",
"public String getUrl();",
"public void setUrl(String url) {\n this.url = url;\n }",
"public HttpUrl url() {\n return url;\n }",
"public String getUrl() {\r\n return url;\r\n }",
"public String getUrl() {\r\n return url;\r\n }",
"public String getUrl() {\r\n return url;\r\n }",
"public String getUrl() {\r\n return url;\r\n }",
"public String getUrl() {\r\n return url;\r\n }",
"public String getUrl() {\r\n return url;\r\n }",
"public String getUrl() {\r\n return url;\r\n }",
"public String url() {\n return this.url;\n }",
"public String getUrl(){\n return urlsText;\n }",
"public java.lang.String getUrl () {\r\n\t\treturn url;\r\n\t}",
"public void set_url(String url) throws Exception{\n\t\tthis.url = url;\n\t}",
"public void setUrl(String url)\n {\n this.url = url;\n }",
"public String getUrl() {\n return url;\n }",
"public String getUrl() {\n return url;\n }",
"public String getUrl() {\n return url;\n }",
"public String getUrl() {\n return url;\n }",
"public String getUrl() {\n return url;\n }",
"public String getUrl() {\n return url;\n }",
"public String getUrl() {\n return url;\n }",
"public String getUrl() {\n return url;\n }",
"public String getUrl() {\n return url;\n }",
"public String getUrl() {\n return url;\n }",
"public String getUrl() {\n return url;\n }",
"public String getUrl() {\n return url;\n }",
"public String getUrl() {\n return url;\n }",
"public String getUrl() {\n return url;\n }",
"public String getUrl() {\n return url;\n }",
"public String getUrl() {\n return url;\n }",
"public String getUrl() {\n return url;\n }",
"public String getUrl() {\n return url;\n }",
"public String getUrl() {\n return url;\n }",
"public String getUrl() {\n return url;\n }"
] | [
"0.7592618",
"0.7419734",
"0.7299806",
"0.72449607",
"0.71795434",
"0.71670926",
"0.71468365",
"0.71468365",
"0.71468365",
"0.71468365",
"0.71468365",
"0.711114",
"0.708377",
"0.7069438",
"0.7069438",
"0.706317",
"0.7049802",
"0.69977576",
"0.69534224",
"0.69534224",
"0.69226503",
"0.6869822",
"0.68669933",
"0.6857997",
"0.6812906",
"0.6809674",
"0.6809674",
"0.6809674",
"0.6805741",
"0.67971224",
"0.67913866",
"0.677352",
"0.677352",
"0.67708653",
"0.67699635",
"0.6763539",
"0.6748336",
"0.6738586",
"0.6733473",
"0.6733473",
"0.6731832",
"0.6731832",
"0.6731832",
"0.6731832",
"0.6731832",
"0.6731832",
"0.6731832",
"0.6731832",
"0.6722523",
"0.672047",
"0.672047",
"0.672047",
"0.672047",
"0.672047",
"0.672047",
"0.66996956",
"0.6687738",
"0.6687738",
"0.6687738",
"0.6687738",
"0.66752684",
"0.6663886",
"0.66567117",
"0.66458917",
"0.66458917",
"0.66458917",
"0.66458917",
"0.6631587",
"0.66082627",
"0.66009045",
"0.66009045",
"0.66009045",
"0.66009045",
"0.66009045",
"0.66009045",
"0.66009045",
"0.65817946",
"0.6581149",
"0.657782",
"0.6571237",
"0.6565388",
"0.6557176",
"0.6557176",
"0.6557176",
"0.6557176",
"0.6557176",
"0.6557176",
"0.6557176",
"0.6557176",
"0.6557176",
"0.6557176",
"0.6557176",
"0.6557176",
"0.6557176",
"0.6557176",
"0.6557176",
"0.6557176",
"0.6557176",
"0.6557176",
"0.6557176",
"0.6557176"
] | 0.0 | -1 |
final String url = " | public void testDownloadAndShowImage(){
final String url = "https://ict.image.alimmdn.com/banma_h5/zebrai/zebra_login_bg.png";
new Thread(new Runnable() {
@Override
public void run() {
String hash = DownImageUtils.downloadImage(url);
final String fileName = DownImageUtils.getImagePath(hash);
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
//YmImageUtil.showImageInView(getContext(), fileName);
showImage(fileName);
}
});
}
}).start();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setURL(String _url) { url = _url; }",
"public String getUrl(){\n \treturn url;\n }",
"String url();",
"public String getURL() { return url; }",
"public static String requestURL(String url) {\n return \"\";\n }",
"public String getUrl() { return url; }",
"String getUrl();",
"String getUrl();",
"String getUrl();",
"String getUrl();",
"String getUrl();",
"public void setUrl(String url){\n this.URL3 = url;\n }",
"public void setURL(String url);",
"public void setUrl(String url);",
"public void setUrl(String url);",
"public String getURL();",
"public void setUrl(String url){\n\t\t_url=url;\n\t}",
"URL getUrl();",
"public void setUrl( String url )\n {\n this.url = url;\n }",
"public void setUrl( String url )\n {\n this.url = url;\n }",
"public abstract String getURL();",
"private String getURL() {\n\t\t// TODO : Generate URL\n\t\treturn null;\n\t}",
"public void setUrl(URL url)\n {\n this.url = url;\n }",
"public void setUrl(String url) {\n this.url = url;\n }",
"@Override\r\n public String getURL() {\n return url;\r\n }",
"public void setUrl(String url) {\r\n this.url = url;\r\n }",
"public void setUrl(String url) {\r\n this.url = url;\r\n }",
"public void setUrl(String url) {\r\n this.url = url;\r\n }",
"private String get_url() {\n File file = new File(url);\n return file.getAbsolutePath();\n }",
"@Override\npublic void get(String url) {\n\t\n}",
"public String getUrl()\n {\n return url;\n }",
"public String getUrl() {\n return url;\n }",
"public String getUrl() {\n return url;\n }",
"String getRequestURL();",
"private URL createURL() {\n try {\n Log.d(\"URL\", \"create\");\n String urlString = \"http://cs262.cs.calvin.edu:8084/cs262dCleaningCrew/task/cjp27\";\n return new URL(urlString);\n } catch (Exception e) {\n Toast.makeText(this, getString(R.string.connection_error), Toast.LENGTH_SHORT).show();\n }\n\n return null;\n }",
"public String getURL() {\r\n return url;\r\n }",
"@Override\n\tpublic String getUrl()\n\t{\n\t\treturn url;\n\t}",
"public void setURL(String url) {\n\t\tthis.url = url;\n\t}",
"public void setUrl(String url) {\r\n\t\tthis.url = url;\r\n\t}",
"public void setUrl(String url) {\r\n\t\tthis.url = url;\r\n\t}",
"public void setUrl(String url) {\n this.url = url;\n }",
"public void setUrl(String url) {\n this.url = url;\n }",
"public void setUrl(String url) {\n this.url = url;\n }",
"public void setUrl(String url) {\n this.url = url;\n }",
"public void setUrl(String url) {\n this.url = url;\n }",
"public void setUrl(String url) {\n this.url = url;\n }",
"public void setUrl(String url) {\n this.url = url;\n }",
"public void setUrl(String url) {\n this.url = url;\n }",
"public String getURL() {\n return url;\n }",
"java.lang.String getUrl();",
"java.lang.String getUrl();",
"java.lang.String getUrl();",
"java.lang.String getUrl();",
"java.lang.String getUrl();",
"java.lang.String getUrl();",
"public abstract String getUrl();",
"public void setUrl(String url) {\n\t\tthis.url = url;\n\t}",
"public void setUrl(String url) {\n\t\tthis.url = url;\n\t}",
"public void setUrl(String url) {\n\t\tthis.url = url;\n\t}",
"public void setUrl(String url) {\n\t\tthis.url = url;\n\t}",
"@Override\r\n\tpublic void getUrl() {\n\r\n\t}",
"void setUrl(String url) {\n this.url = Uri.parse(url);\n }",
"public String getURL()\n {\n return getURL(\"http\");\n }",
"public String getUrl();",
"public String getUrl();",
"public String getUrl();",
"public String getUrl();",
"public void setUrl(String url) {\n this.url = url;\n }",
"public HttpUrl url() {\n return url;\n }",
"public String getUrl() {\r\n return url;\r\n }",
"public String getUrl() {\r\n return url;\r\n }",
"public String getUrl() {\r\n return url;\r\n }",
"public String getUrl() {\r\n return url;\r\n }",
"public String getUrl() {\r\n return url;\r\n }",
"public String getUrl() {\r\n return url;\r\n }",
"public String getUrl() {\r\n return url;\r\n }",
"public String url() {\n return this.url;\n }",
"public String getUrl(){\n return urlsText;\n }",
"public java.lang.String getUrl () {\r\n\t\treturn url;\r\n\t}",
"public void set_url(String url) throws Exception{\n\t\tthis.url = url;\n\t}",
"public void setUrl(String url)\n {\n this.url = url;\n }",
"public String getUrl() {\n return url;\n }",
"public String getUrl() {\n return url;\n }",
"public String getUrl() {\n return url;\n }",
"public String getUrl() {\n return url;\n }",
"public String getUrl() {\n return url;\n }",
"public String getUrl() {\n return url;\n }",
"public String getUrl() {\n return url;\n }",
"public String getUrl() {\n return url;\n }",
"public String getUrl() {\n return url;\n }",
"public String getUrl() {\n return url;\n }",
"public String getUrl() {\n return url;\n }",
"public String getUrl() {\n return url;\n }",
"public String getUrl() {\n return url;\n }",
"public String getUrl() {\n return url;\n }",
"public String getUrl() {\n return url;\n }",
"public String getUrl() {\n return url;\n }",
"public String getUrl() {\n return url;\n }",
"public String getUrl() {\n return url;\n }",
"public String getUrl() {\n return url;\n }",
"public String getUrl() {\n return url;\n }"
] | [
"0.7591977",
"0.7419793",
"0.7299509",
"0.7244194",
"0.7179829",
"0.7166426",
"0.7146126",
"0.7146126",
"0.7146126",
"0.7146126",
"0.7146126",
"0.7110335",
"0.7083264",
"0.7069149",
"0.7069149",
"0.70626956",
"0.7049564",
"0.6997195",
"0.69531",
"0.69531",
"0.6921981",
"0.6869161",
"0.6866898",
"0.6857759",
"0.6812328",
"0.6809377",
"0.6809377",
"0.6809377",
"0.6805543",
"0.6797637",
"0.6791159",
"0.6773072",
"0.6773072",
"0.6771019",
"0.6770165",
"0.67631733",
"0.6747386",
"0.67378545",
"0.673291",
"0.673291",
"0.67316246",
"0.67316246",
"0.67316246",
"0.67316246",
"0.67316246",
"0.67316246",
"0.67316246",
"0.67316246",
"0.6722362",
"0.6719507",
"0.6719507",
"0.6719507",
"0.6719507",
"0.6719507",
"0.6719507",
"0.6699288",
"0.66872865",
"0.66872865",
"0.66872865",
"0.66872865",
"0.66751033",
"0.6664016",
"0.6655456",
"0.66453063",
"0.66453063",
"0.66453063",
"0.66453063",
"0.6631476",
"0.66082066",
"0.6600456",
"0.6600456",
"0.6600456",
"0.6600456",
"0.6600456",
"0.6600456",
"0.6600456",
"0.65813357",
"0.6580693",
"0.65770674",
"0.65709823",
"0.6565073",
"0.6556879",
"0.6556879",
"0.6556879",
"0.6556879",
"0.6556879",
"0.6556879",
"0.6556879",
"0.6556879",
"0.6556879",
"0.6556879",
"0.6556879",
"0.6556879",
"0.6556879",
"0.6556879",
"0.6556879",
"0.6556879",
"0.6556879",
"0.6556879",
"0.6556879",
"0.6556879"
] | 0.0 | -1 |
Day 25: FourDimensional Adventure The reindeer's symptoms are getting worse, and neither you nor the whitebearded man have a solution. At least the reindeer has a warm place to rest: a small bed near where you're sitting. As you reach down, the reindeer looks up at you, accidentally bumping a button on your wristmounted device with its nose in the process a button labeled "help". "Hello, and welcome to the Time Travel Support Hotline! If you are lost in time and space, press 1. If you are trapped in a time paradox, press 2. If you need help caring for a sick reindeer, press 3. If you" Beep. A few seconds later, you hear a new voice. "Hello; please state the nature of your reindeer." You try to describe the situation. "Just a moment, I think I can remotely run a diagnostic scan." A beam of light projects from the device and sweeps over the reindeer a few times. "Okay, it looks like your reindeer is very low on magical energy; it should fully recover if we can fix that. Let me check your timeline for a source.... Got one. There's actually a powerful source of magical energy about 1000 years forward from you, and at roughly your position, too! It looks like... hot chocolate? Anyway, you should be able to travel there to pick some up; just don't forget a mug! Is there anything else I can help you with today?" You explain that your device isn't capable of going forward in time. "I... see. That's tricky. Well, according to this information, your device should have the necessary hardware to open a small portal and send some hot chocolate back to you. You'll need a list of fixed points in spacetime; I'm transmitting it to you now." "You just need to align your device to the constellations of fixed points so that it can lock on to the destination and open the portal. Let me look up how much hot chocolate that breed of reindeer needs." "It says here that your particular reindeer is this can't be right, it says there's only one like that in the universe! But THAT means that you're" You disconnect the call. The list of fixed points in spacetime (your puzzle input) is a set of fourdimensional coordinates. To align your device, acquire the hot chocolate, and save the reindeer, you just need to find the number of constellations of points in the list. Two points are in the same constellation if their manhattan distance apart is no more than 3 or if they can form a chain of points, each a manhattan distance no more than 3 from the last, between the two of them. (That is, if a point is close enough to a constellation, it "joins" that constellation.) For example: 0,0,0,0 3,0,0,0 0,3,0,0 0,0,3,0 0,0,0,3 0,0,0,6 9,0,0,0 12,0,0,0 In the above list, the first six points form a single constellation: 0,0,0,0 is exactly distance 3 from the next four, and the point at 0,0,0,6 is connected to the others by being 3 away from 0,0,0,3, which is already in the constellation. The bottom two points, 9,0,0,0 and 12,0,0,0 are in a separate constellation because no point is close enough to connect them to the first constellation. So, in the above list, the number of constellations is 2. (If a point at 6,0,0,0 were present, it would connect 3,0,0,0 and 9,0,0,0, merging all of the points into a single giant constellation instead.) In this example, the number of constellations is 4: 1,2,2,0 0,0,2,2 0,0,0,2 1,2,0,0 2,2,2,2 3,0,2,1 1,3,2,2 1,0,1,0 0,2,1,2 3,0,0,0 In this one, it's 3: 1,1,0,1 2,0,1,0 3,2,1,0 0,0,3,1 0,0,1,1 2,3,2,0 2,2,0,0 2,2,0,1 1,1,0,1 3,2,0,2 Finally, in this one, it's 8: 1,1,1,2 2,2,0,1 0,2,1,3 2,3,2,1 0,2,3,2 1,1,1,2 0,2,1,0 2,2,3,1 1,2,2,0 1,2,0,2 The portly man nervously strokes his white beard. It's time to get that hot chocolate. How many constellations are formed by the fixed points in spacetime? | @Override
public Integer part1() {
init(getLines());
distribute(stars, constellations);
return constellations.size();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void setupAdventure() {\n\t\tArrayList<Ship> availableShips = new ArrayList<Ship>();\n\t\tavailableShips = game.getAvailableShips();\n\t\tint selectedDays = 0;\n\t\tboolean stateAskPlayingDays = false;\n\t\twhile (stateAskPlayingDays == false) {\n\t\t\tSystem.out.println(\"How many days you want your adventure last (Choose between 20 and 50 days)? \");\n\t\t\ttry {\n\t\t\t\tint number = scanner.nextInt();\n\t\t\t\tif (number >= 20 && number <= 50) {\n\t\t\t\t\tstateAskPlayingDays = true;\n\t\t\t\t\tselectedDays = number;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.println(\"You should choose between 20 and 50 days\");\n\t\t\t\t}\n\t\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.out.println(INPUT_REQUIREMENTS);\n\t\t\t\tscanner.nextLine();\n\t\t\t}\n\t\t}\n\t\t\n\t\tboolean stateChoosenShip = false;\n\t\twhile (stateChoosenShip == false) \n\t\t{\n\t\t\tSystem.out.println(\"Choose your ship!\");\n\t\t\tprintAvailableShips(availableShips);\n\t\t\ttry {\n\t\t\t\tint choosenShip = scanner.nextInt();\n\t\t\t\tif (choosenShip <= availableShips.size() && choosenShip > 0) {\n\t\t\t\t\tstateChoosenShip = true;\n\t\t\t\t\tShip selectedShip = availableShips.get(choosenShip - 1);\n\t\t\t\t\tgame.startAdventure(selectedDays, selectedShip);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.println(\"You should choose ship from available ships!\");\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.out.println(INPUT_REQUIREMENTS);\n\t\t\t\tscanner.nextLine();\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"private void notWorthy(final Player player) {\n\t\tplayer.getInterfaceManager().closeChatBoxInterface();\n\t\tplayer.lock(15);\n\t\tplayer.setNextFaceWorldTile(new WorldTile(3084, 3483, 0));\n\t\tWorldTasksManager.schedule(new WorldTask() {\n\t\t\tint phase = 0;\n\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tfinal int[] randomNPC = { 6935, 3283, 4344, 6966 };\n\t\t\t\tswitch (phase) {\n\t\t\t\tcase 0:\n\t\t\t\t\tplayer.setNextAnimation(new Animation(857));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tplayer.setNextAnimation(new Animation(915));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tplayer.setNextAnimation(new Animation(857));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tplayer.setNextGraphics(new Graphics(86));\n\t\t\t\t\tplayer.getGlobalPlayerUpdater().transformIntoNPC(randomNPC[Utils.random(randomNPC.length - 1)]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tplayer.setNextForceTalk(new ForceTalk(\".... what in Helwyr is going on..!?\"));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\tplayer.setNextGraphics(new Graphics(86));\n\t\t\t\t\tplayer.getGlobalPlayerUpdater().transformIntoNPC(-1);\n\t\t\t\t\tplayer.setNextAnimation(new Animation(10070));\n\t\t\t\t\t//player.setNextForceMovement(new ForceMovement(new WorldTile(3084, 3485, 0), 0, 2));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t\t\t\t//player.setNextWorldTile(new WorldTile(3084, 3485, 0)); TODO find out why force movement doesn't work <.>\n\t\t\t\t\tNPC guard = World.findNPC(5941);\n\t\t\t\t\tsendNPCDialogue(4405, GOOFY_LAUGH, \"Looks like Dahmaroc had a sense of humour!\");\n\t\t \t // player.faceEntity(guard);\n\t\t \t // guard.faceEntity(player);\n\t\t\t\t\tplayer.unlock();\n\t\t\t\t\tstage = 99;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tphase++;\n\t\t\t}\n\t\t}, 0, 2);\n\t}",
"private void m27468d() {\n switch (this.f25258E) {\n case 1:\n this.f25270Q = this.f25294i.left;\n break;\n case 2:\n this.f25270Q = this.f25294i.right;\n break;\n default:\n this.f25270Q = this.f25268O;\n break;\n }\n this.f25271R = (int) (((float) this.f25269P) - ((this.f25288c.ascent() + this.f25288c.descent()) / 2.0f));\n }",
"static void door2challenge_straightpath() {\n System.out.println(\"Oh Look! There is a creature charging directly at you\");\n System.out.println(\"Brace Yourself \" + username + \"!!!\");\n enter = next.nextLine();\n player_fights();\n //after you defeat the monster...\n System.out.println(\"Now there is another straight path up ahead take that path now.\");\n enter = next.nextLine();\n System.out.println(\"Do you hear anything? Well, I don't. It must be safe for here...Shall we continue?\");\n answer = responses.nextLine();\n System.out.println(\"WHA HA HA HA!!! VRMMMM!\");\n enter = next.nextLine();\n System.out.println(\"You don't have much time...Hurry up and take the path!\");\n enter = next.nextLine();\n System.out.println(\"Now there are two diverging paths. One leading you straight ahead and the other one \");\n System.out.println(\"curving to the right\");\n System.out.println(\"Which path would you like to take straight or right?\");\n answer = responses.nextLine();\n if(answer.contains(\"straight\")) {\n System.out.println(\"AHHHH!!! The creatures trapped you... \" + username + \"!\");\n System.out.println(username + \" fell into the creatures grasp and was thrown into the molten rocks to burn.\");\n backtocheckpoint1_version2();\n }else if(answer.contains(\"left\")) {\n System.out.println(\"It appears to be safe\");\n enter = next.nextLine();\n System.out.println(\"Let's sit for awhile and relax.\");\n System.out.println(\"GET THAT \" + username + \"!\");\n System.out.println(\"That kid is going to be killed when I come there!\");\n //Here is a brief statement of the main antagonist of the game...More will be revealed as \n //the player advances in the game.\n enter = next.nextLine();\n System.out.println(\"'Who's voice is that'/ Could that voice be the voice you heard as you gain your magic? \");\n enter = next.nextLine(); \n //this hints to the later interaction between the witch and the player\n System.out.println(\"No time to sit...Hurry and move\");\n enter = next.nextLine();\n door2_linkedpath();\n /*this is the path that links both branches the straight and the right branch that the\n player took in the beginning of the challenge.*/\n }\n \n \n }",
"public void setupGame() {\n\t\t// Re-spawn the appropriate number of sheep\n\t\tint numSheep = 31;\n\t\t\n\t\tif (!SheepPhysicsState.PRODUCTION) {\n\t\t\tnumSheep = 1;\n\t\t}\n\t\t\n\t\t// It takes half the sheep to win.\n\t\t_scoreToWin = numSheep / 2;\n\t\tp(\"It takes \" + _scoreToWin + \" sheep to win.\");\n\t\t\n\t\t_hasBeenWon = false;\n\t\t\n\t\t// Non-infrastructural entities.\n\t\t//////////////////////////\n\t\t\n\t\t// Don't create this stuff if I'm replaying.\n\t\tint mod = 1;\n\t\tfor (int i = 0; i < numSheep; i++) {\n\t\t\t//int x = _generator.nextInt(40) - 20;\n\t\t\t//int z = _generator.nextInt(80) - 40;\n\t\t\tmod *= -1;\n\t\t\tint x = i/2 * mod;\n\t\t\tint z = 0;\n\n\t\t\tSheep s = new Sheep(\"sheep-\" + i + \"[\" + _sheepID + \"]\", x, 2, z);\n\t\t\t\n\t\t\tif (!SheepPhysicsState.PRODUCTION) {\n\t\t\t\ts.setBehaviorActive(false);\n\t\t\t}\n\t\t\t\n\t\t\t_sheepID++;\n\t\t}\n\t\t\n\t\t// Add a wubble for testing.\n\t\tif (!_isJimboSpawned && !SheepPhysicsState.PRODUCTION) {\n\t\t\tSystem.out.println(\"Adding Jimbo.\");\n\t\t\t_isJimboSpawned = true;\n\t\t\taddWubble(\"Jimbo\", (short)100, (Integer)1);\n\t\t\taddSidekick(\"Jimbo\");\n\t\t\t//addWubble(\"Bimbo\", (short)101, (Integer)0);\n\t\t}\n\t\t\n\t\t//////////////////////////\n\n\t\t// Add some wrenches in the appropriate spots.\n\t\tnew Wrench(\"blueWrench1\", -8, 5, -20);\n\t\tnew Wrench(\"blueWrench2\", 8, 5, -20);\n\t\tnew Wrench(\"redWrench1\", -8, 5, 20);\n\t\tnew Wrench(\"redWrench2\", 8, 5, 20);\n\t\t\n\t\t// Save the start of the me.\n\t\t_gameStart = System.currentTimeMillis();\n\t\tSystem.out.println(\"Started game at \" + _gameStart);\n\t\t\n\t\t// Make some predicates.\n\t\t//Predicate p = new Predicate(\"baseClassPred\");\n\t\t//GoPred g = new GoPred(\"derivedGoClass\", 1);\n\t\t\n\t\t//new PowerUp(\"PowerUpS\", -1, PowerUpInfo.PowerUpType.SPEEDY, new Vector3f(0, 0.4f, 0));\n\t\t//new PowerUp(\"PowerUpE\", -1, PowerUpInfo.PowerUpType.EATER, new Vector3f(2, 0.4f, 0));\n\t\t//new PowerUp(\"PowerUpS\", -1, PowerUpInfo.PowerUpType.STICKY, new Vector3f(2, 0.4f, 2));\n\t}",
"private void goAdventure() {\n\n\t\tint experience = playern.getExp();\n\t\tint random = randomHelper.randomten();\n\n\t\t/**\n\t\t * Random part that starts with 10% occurance when user chooses goAdventuring()\n\t\t */\n\t\tif (random == 0) {\n\t\t\tSystem.out.println(\"You see nothing but unicorns running in the swaying grass..\");\n\t\t\tSystem.out.println(\"[press enter to continue]\");\n\t\t\tsc.nextLine();\n\t\t}\n\n\t\t/**\n\t\t * Chooses storyboard and battle depending on experience level\n\t\t */\n\t\tif (experience >= 40) {\n\t\t\tStoryboardTwo.leveltwo();\n\t\t\tbattleSpider();\n\t\t}else {\n\t\t\tStoryboard.intro();\n\t\t\tbattleVampire();\n\t\t}\n\t\t}",
"private void eliminateDay() {\r\n\tdayElimTimer.cancel();\r\n\tdayElimTimer.purge();\r\n\r\n\t// playerIDs.remove(playerOnTrialID);\r\n\tplayers.remove(playerOnTrialID);\r\n\r\n\tif (mafia.contains(playerOnTrialID)) {\r\n\t int index = mafia.indexOf(playerOnTrialID);\r\n\t mafia.remove(index);\r\n\r\n\t} else {\r\n\t int index = innocentIDs.indexOf(playerOnTrialID);\r\n\t innocentIDs.remove(index);\r\n\t}\r\n\r\n\tserver.setPlayerMuted(playerOnTrialID, true);\r\n\r\n\tserver.publicMessage(server.getUsername(playerOnTrialID) + \" has been eliminated\");\r\n\r\n\tplayerOnTrialID = null;\r\n\telimDay.clear();\r\n\tsave.clear();\r\n\telimDayVoteInProgress = false;\r\n\r\n\tcheckWin();\r\n }",
"public final void dyE() {\n AppMethodBeat.i(29674);\n com.tencent.mm.blink.b.HQ().o(new Runnable() {\n public final void run() {\n AppMethodBeat.i(29666);\n w.this.ynU = true;\n al.af(w.this.ynV);\n al.n(w.this.ynV, 300);\n AppMethodBeat.o(29666);\n }\n });\n AppMethodBeat.o(29674);\n }",
"private double lookingforFoodPhase(double time) {\n\n\t\t// Determine preferred kitchen to get meal.\n\t\tif (kitchen == null) {\n\t\t\tkitchen = getKitchenWithMeal(person);\n\n\t\t\tif (kitchen == null) {\n\t\t\t\t// If no kitchen found, look for preserved food.\n//\t\t\t\tlogger.info(person + \" couldn't find a kitchen with cooked meals and will look for preserved food.\");\n\t\t\t\tsetPhase(EAT_PRESERVED_FOOD);\n\t\t\t}\n\t\t}\n\t\n\t\tif (kitchen != null) {\n\t\t\t// Walk to kitchen.\n\t\t\twalkToActivitySpotInBuilding(kitchen.getBuilding(), FunctionType.DINING, true);\n\t\t\t\n\t\t\t// Pick up a meal at kitchen if one is available.\n\t\t\tcookedMeal = kitchen.chooseAMeal(person);\n\t\t\tif (cookedMeal != null) {\n\t\t\t\tsetDescription(Msg.getString(\"Task.description.eatDrink.cooked.pickingUp.detail\", cookedMeal.getName())); //$NON-NLS-1$\n\t\t\t\tLogConsolidated.log(Level.INFO, 0, sourceName,\n\t\t\t\t\t\t\"[\" + person.getLocationTag().getLocale() + \"] \" + person\n\t\t\t\t\t\t\t\t+ \" picked up a cooked meal '\" + cookedMeal.getName() \n\t\t\t\t\t\t\t\t+ \"' to eat in \" + person.getLocationTag().getImmediateLocation() + \".\");\n\t\t\t\tsetPhase(EAT_MEAL);\n\t\t\t}\n\t\t\telse {\n//\t\t\t\tlogger.info(person + \" couldn't find any cooked meals in this kitchen and will look for preserved food.\");\n\t\t\t\t// If no kitchen found, look for preserved food.\n\t\t\t\tsetPhase(EAT_PRESERVED_FOOD);\n\t\t\t}\n\t\t}\n\n\t\treturn time *.9;\n\t}",
"public static void main(String[] args) {\n\t\tint birdsOnABranch = 4;\n\t\tint birdsThatFlyAway = 1;\n\t\tint birdsRemaining = birdsOnABranch - birdsThatFlyAway;\n\n /* Exercise 2\n 2. There are 6 birds and 3 nests. How many more birds are there than\n nests?\n */\n\t\t// ### EXAMPLE:\n\t\tint numberOfBirds = 6;\n\t\tint numberOfNests = 3;\n\t\tint numberOfExtraBirds = numberOfBirds - numberOfNests;\n\n /* Exercise 3\n 3. 3 raccoons are playing in the woods. 2 go home to eat dinner. How\n many raccoons are left in the woods?\n */\n\t\tint racoonsInWoods = 3;\n\t\tint racoonsEatingDinner = 2;\n\t\tint racoonsLeft = racoonsInWoods - racoonsEatingDinner;\n\n\n /* Exercise 4\n 4. There are 5 flowers and 3 bees. How many less bees than flowers?\n */\n\t\tint flowers = 5;\n\t\tint bees = 3;\n\t\tint flowersLeft = flowers - bees;\n\n\n /* Exercise 5\n 5. 1 lonely pigeon was eating breadcrumbs. Another pigeon came to eat\n breadcrumbs, too. How many pigeons are eating breadcrumbs now?\n */\n\t\tint lonelyPigeon = 1;\n\t\tint hungryPigeon = 1;\n\t\tint eatingPigeons = lonelyPigeon + hungryPigeon;\n\n\n /* Exercise 6\n 6. 3 owls were sitting on the fence. 2 more owls joined them. How many\n owls are on the fence now?\n */\n\t\tint owlsOnFence = 3;\n\t\tint friendlyOwls = 2;\n\t\tint totalOwlsOnFence = owlsOnFence + friendlyOwls;\n\n\n /* Exercise 7\n 7. 2 beavers were working on their home. 1 went for a swim. How many\n beavers are still working on their home?\n */\n\t\tint beaversWorking = 2;\n\t\tint beaversSwimming = 1;\n\t\tint beaversStillWorking = beaversWorking - beaversSwimming;\n\n\n /* Exercise 8\n 8. 2 toucans are sitting on a tree limb. 1 more toucan joins them. How\n many toucans in all?\n */\n\t\tint toucansOnTree = 2;\n\t\tint toucansJoiningTree = 1;\n\t\tint totalToucansOnTree = toucansOnTree + toucansJoiningTree;\n\n\n /* Exercise 9\n 9. There are 4 squirrels in a tree with 2 nuts. How many more squirrels\n are there than nuts?\n */\n\t\tint squirrelsInTree = 4;\n\t\tint nutsInTree = 2;\n\t\tint squirrelsWithoutNuts = squirrelsInTree - nutsInTree;\n\n\n /* Exercise 10\n 10. Mrs. Hilt found a quarter, 1 dime, and 2 nickels. How much money did\n she find?\n */\n\t\tdouble quarter = 0.25;\n\t\tdouble dime =0.10;\n\t\tdouble nickel = 2 * 0.05;\n\t\tdouble totalMoney = quarter + dime + nickel;\n\n\n /* Exercise 11\n 11. Mrs. Hilt's favorite first grade classes are baking muffins. Mrs. Brier's\n class bakes 18 muffins, Mrs. MacAdams's class bakes 20 muffins, and\n Mrs. Flannery's class bakes 17 muffins. How many muffins does first\n grade bake in all?\n */\n\t\tint mrsBrierClass = 18;\n\t\tint mrsFlanneryClass = 17;\n\t\tint mrsMacAdamClass = 20;\n\t\tint totalMuffins = mrsBrierClass + mrsMacAdamClass + mrsFlanneryClass;\n\n\n /* Exercise 12\n 12. Mrs. Hilt bought a yoyo for 24 cents and a whistle for 14 cents. How\n much did she spend in all for the two toys?\n */\n\t\tdouble yoyoCost = 0.24;\n\t\tdouble whistleCost = 0.14;\n\t\tdouble moneySpent = yoyoCost + whistleCost;\n\n\n /* Exercise 13\n 13. Mrs. Hilt made 5 Rice Krispie Treats. She used 8 large marshmallows\n and 10 mini marshmallows.How many marshmallows did she use\n altogether?\n */\n\t\tint largeMarshmallow = 8;\n\t\tint miniMarshmallow = 10;\n\t\tint totalMarshmallow = largeMarshmallow + miniMarshmallow;\n\n\n /* Exercise 14\n 14. At Mrs. Hilt's house, there was 29 inches of snow, and Brecknock\n Elementary School received 17 inches of snow. How much more snow\n did Mrs. Hilt's house have?\n */\n\t\tint hiltHouseSnow = 29;\n\t\tint brecknockElementarySnow = 17;\n\t\tint differenceInSnow = hiltHouseSnow - brecknockElementarySnow;\n\n\n /* Exercise 15\n 15. Mrs. Hilt has $10. She spends $3 on a toy truck and $2 on a pencil\n case. How much money does she have left?\n */\n\t\tdouble hiltWallet = 10.0;\n\t\tdouble toyTruckCost = 3.0;\n\t\tdouble pencilCaseCost = 2.0;\n\t\tdouble walletBalance = hiltWallet - toyTruckCost - pencilCaseCost;\n\n\n\n /* Exercise 16\n 16. Josh had 16 marbles in his collection. He lost 7 marbles. How many\n marbles does he have now?\n */\n\t\tint totalMarbles = 16;\n\t\tint marblesLost = 7;\n\t\tint marblesLeft = totalMarbles - marblesLost;\n\n\n /* Exercise 17\n 17. Megan has 19 seashells. How many more seashells does she need to\n find to have 25 seashells in her collection?\n */\n\t\tint desiredSeashellCount = 25;\n\t\tint currentSeashellCount = 19;\n\t\tint seashellsNeededCount = desiredSeashellCount - currentSeashellCount;\n\n\n /* Exercise 18\n 18. Brad has 17 balloons. 8 balloons are red and the rest are green. How\n many green balloons does Brad have?\n */\n\t\tint totalBalloons = 17;\n\t\tint redBalloons = 8;\n\t\tint greenBalloons = totalBalloons - redBalloons;\n\n\n /* Exercise 19\n 19. There are 38 books on the shelf. Marta put 10 more books on the shelf.\n How many books are on the shelf now?\n */\n\t\tint booksOnShelf = 38;\n\t\tint booksAdded = 10;\n\t\tint currentBooksOnShelf = booksOnShelf + booksAdded;\n\n\n /* Exercise 20\n 20. A bee has 6 legs. How many legs do 8 bees have?\n */\n\t\tint beeLegCount = 6;\n\t\tint numberOfBees = 8;\n\t\tint totalNumberOfLegs = beeLegCount * numberOfBees;\n\n\n /* Exercise 21\n 21. Mrs. Hilt bought an ice cream cone for 99 cents. How much would 2 ice\n cream cones cost?\n */\n\t\tdouble iceCreamCost = 0.99;\n\t\tint numberOfConesPurchased = 2;\n\t\tdouble totalCostOfIceCream= iceCreamCost * numberOfConesPurchased;\n\n\n /* Exercise 22\n 22. Mrs. Hilt wants to make a border around her garden. She needs 125\n rocks to complete the border. She has 64 rocks. How many more rocks\n does she need to complete the border?\n */\n\t\tint totalRocks = 125;\n\t\tint rocksOnHand = 64;\n\t\tint rocksNeededToComplete = totalRocks - rocksOnHand;\n\n\n /* Exercise 23\n 23. Mrs. Hilt had 38 marbles. She lost 15 of them. How many marbles does\n she have left?\n */\n\t\tint hiltTotalMarbles = 38;\n\t\tint hiltMarblesLost = 15;\n\t\tint hiltMarblesLeft = hiltTotalMarbles - hiltMarblesLost;\n\n\n /* Exercise 24\n 24. Mrs. Hilt and her sister drove to a concert 78 miles away. They drove 32\n miles and then stopped for gas. How many miles did they have left to drive?\n */\n\t\tint concertDistance = 78;\n\t\tint tripStop = 32;\n\t\tint distanceLeft = concertDistance - tripStop;\n\n\n /* Exercise 25\n 25. Mrs. Hilt spent 1 hour and 30 minutes shoveling snow on Saturday\n morning and 45 minutes shoveling snow on Saturday afternoon. How\n much total time (in minutes) did she spend shoveling snow?\n */\n\t\tint saturdayMorningShoveling = (1*60) + 30;\n\t\tint saturdayEveningShoveling = 45;\n\t\tint totalTimeShoveling = saturdayEveningShoveling + saturdayMorningShoveling;\n\n\n /* Exercise 26\n 26. Mrs. Hilt bought 6 hot dogs. Each hot dog cost 50 cents. How much\n money did she pay for all of the hot dogs?\n */\n\t\tdouble hotDogCost = 0.50;\n\t\tint hotDogCount = 6;\n\t\tdouble hotDogMoneySpent = hotDogCount * hotDogCost;\n\n\n\n /* Exercise 27\n 27. Mrs. Hilt has 50 cents. A pencil costs 7 cents. How many pencils can\n she buy with the money she has?\n */\n\t\tdouble hiltMoney = 0.50;\n\t\tdouble pencilCost = 0.07;\n\t\tint pencilsThatCanBeBought = (int) (hiltMoney / pencilCost);\n\n\n /* Exercise 28\n 28. Mrs. Hilt saw 33 butterflies. Some of the butterflies were red and others\n were orange. If 20 of the butterflies were orange, how many of them\n were red?\n */\n\t\tint butterFliesSeen = 33;\n\t\tint orangeButterflies = 20;\n\t\tint redButterflies = butterFliesSeen - orangeButterflies;\n\n\n /* Exercise 29\n 29. Kate gave the clerk $1.00. Her candy cost 54 cents. How much change\n should Kate get back?\n */\n\t\tdouble kateMoneyGiven = 1.00;\n\t\tdouble kateCandyCost = 0.54;\n\t\tdouble kateChange = kateMoneyGiven - kateCandyCost;\n\n\n /* Exercise 30\n 30. Mark has 13 trees in his backyard. If he plants 12 more, how many trees\n will he have?\n */\n\t\tint markTreesInYard = 13;\n\t\tint markPlantsTrees = 12;\n\t\tint markTotalTrees = markPlantsTrees + markTreesInYard;\n\n\n /* Exercise 31\n 31. Joy will see her grandma in two days. How many hours until she sees\n her?\n */\n\t\tint joyDaysToGrandma = 2;\n\t\tint hoursInADay = 24;\n\t\tint hoursToSeeGrandma = joyDaysToGrandma * hoursInADay;\n\n\n /* Exercise 32\n 32. Kim has 4 cousins. She wants to give each one 5 pieces of gum. How\n much gum will she need?\n */\n\t\tint kimCousins = 4;\n\t\tint kimGumDonation = 5;\n\t\tint neededGumCount = kimGumDonation * kimCousins;\n\n\n /* Exercise 33\n 33. Dan has $3.00. He bought a candy bar for $1.00. How much money is\n left?\n */\n\t\tdouble danWallet = 3.00;\n\t\tdouble candyCost = 1.00;\n\t\tdouble danMoneyLeft = danWallet - candyCost;\n\n /* Exercise 34\n 34. 5 boats are in the lake. Each boat has 3 people. How many people are\n on boats in the lake?\n */\n\t\tint boatsOnTheLake = 5;\n\t\tint peopleInEachBoats = 3;\n\t\tint peopleOnWater = boatsOnTheLake * peopleInEachBoats;\n\n\n /* Exercise 35\n 35. Ellen had 380 legos, but she lost 57 of them. How many legos does she\n have now?\n */\n\t\tint totalLegos = 380;\n\t\tint legosLost = 57;\n\t\tint leftsLeft= totalLegos - legosLost;\n\n\n /* Exercise 36\n 36. Arthur baked 35 muffins. How many more muffins does Arthur have to\n bake to have 83 muffins?\n */\n\t\tint wantsToBake = 83;\n\t\tint bakedMuffins = 35;\n\t\tint leftToBake = wantsToBake - bakedMuffins;\n\n\n /* Exercise 37\n 37. Willy has 1400 crayons. Lucy has 290 crayons. How many more\n crayons does Willy have then Lucy?\n */\n\t\tint willyCrayons = 1400;\n\t\tint lucyCrayons = 290;\n\t\tint differenceInCrayons = willyCrayons - lucyCrayons;\n\n\n /* Exercise 38\n 38. There are 10 stickers on a page. If you have 22 pages of stickers, how\n many stickers do you have?\n */\n\t\tint stickersPerPage = 10;\n\t\tint pagesOfStickers = 22;\n\t\tint totalStickers = stickersPerPage * pagesOfStickers;\n\n\n /* Exercise 39\n 39. There are 96 cupcakes for 8 children to share. How much will each\n person get if they share the cupcakes equally?\n */\n\t\tdouble totalCupcakes = 96;\n\t\tdouble numberOfChildren = 8;\n\t\tdouble cupcakesPerChild = totalCupcakes / numberOfChildren;\n\n\n /* Exercise 40\n 40. She made 47 gingerbread cookies which she will distribute equally in\n tiny glass jars. If each jar is to contain six cookies each, how many\n cookies will not be placed in a jar?\n */\n\t\tint totalCookies = 47;\n\t\tint cookiesInEachJar = 6;\n\t\tint leftoverCookies = totalCookies % cookiesInEachJar;\n\n\n /* Exercise 41\n 41. She also prepared 59 croissants which she plans to give to her 8\n neighbors. If each neighbor received and equal number of croissants,\n how many will be left with Marian?\n */\n\t\tint totalCroissants = 59;\n\t\tint croissantsToNeighbors = 8;\n\t\tint leftOverCroissants = totalCroissants % croissantsToNeighbors;\n\n\n\n /* Exercise 42\n 42. Marian also baked oatmeal cookies for her classmates. If she can\n place 12 cookies on a tray at a time, how many trays will she need to\n prepare 276 oatmeal cookies at a time?\n */\n\t\tint cookiesAtATime = 276;\n\t\tint cookiesPerTray = 12;\n\t\tint traysNeeded = cookiesAtATime / cookiesPerTray;\n\n\n /* Exercise 43\n 43. Marian’s friends were coming over that afternoon so she made 480\n bite-sized pretzels. If one serving is equal to 12 pretzels, how many\n servings of bite-sized pretzels was Marian able to prepare?\n */\n\t\tint pretzelsMade = 480;\n\t\tint oneServing = 12;\n\t\tint servingsPrepared = pretzelsMade / oneServing;\n\n\n /* Exercise 44\n 44. Lastly, she baked 53 lemon cupcakes for the children living in the city\n orphanage. If two lemon cupcakes were left at home, how many\n boxes with 3 lemon cupcakes each were given away?\n */\n\t\tint totalCupcakesForChildren = 53;\n\t\tint cupcakesPerBox = 3;\n\t\tint cupcakeBoxesGiven = totalCupcakesForChildren / cupcakesPerBox;\n\n\n\n /* Exercise 45\n 45. Susie's mom prepared 74 carrot sticks for breakfast. If the carrots\n were served equally to 12 people, how many carrot sticks were left\n uneaten?\n */\n\t\tint preparedSticks = 74;\n\t\tint sticksPerPerson = 12;\n\t\tint sticksLeft = preparedSticks % sticksPerPerson;\n\n\n /* Exercise 46\n 46. Susie and her sister gathered all 98 of their teddy bears and placed\n them on the shelves in their bedroom. If every shelf can carry a\n maximum of 7 teddy bears, how many shelves will be filled?\n */\n\t\tint totalTeddyBears = 98;\n\t\tint bearsPerShelf = 7;\n\t\tint shelfsNeeded = totalTeddyBears / bearsPerShelf;\n\n\n /* Exercise 47\n 47. Susie’s mother collected all family pictures and wanted to place all of\n them in an album. If an album can contain 20 pictures, how many\n albums will she need if there are 480 pictures?\n */\n\t\tint totalPictures = 480;\n\t\tint picsPerAlbum = 20;\n\t\tint numberOfAlbums = totalPictures / picsPerAlbum;\n\n\n /* Exercise 48\n 48. Joe, Susie’s brother, collected all 94 trading cards scattered in his\n room and placed them in boxes. If a full box can hold a maximum of 8\n cards, how many boxes were filled and how many cards are there in\n the unfilled box?\n */\n\t\tint totalCards = 94;\n\t\tint boxCanHold = 8;\n\t\tint boxesFilled = totalCards / boxCanHold;\n\t\tint cardsInUnfilledBox = totalCards % boxCanHold;\n\n\n /* Exercise 49\n 49. Susie’s father repaired the bookshelves in the reading room. If he has\n 210 books to be distributed equally on the 10 shelves he repaired,\n how many books will each shelf contain?\n */\n\t\tint totalBooks = 210;\n\t\tint shelves = 10;\n\t\tint booksPerShelve = totalBooks / shelves;\n\n\n /* Exercise 50\n 50. Cristina baked 17 croissants. If she planned to serve this equally to\n her seven guests, how many will each have?\n */\n\t\tdouble cristinaTotalCroissants = 17;\n\t\tdouble guests = 7;\n\t\tdouble croissantsPerGuest = cristinaTotalCroissants / guests;\n\n\n\t /* Exercise 51\n\t 51. Bill and Jill are house painters. Bill can paint a 12 x 14 room in 2.15 hours, while Jill averages\n\t 1.90 hours. How long will it take the two painters working together to paint 5 12 x 14 rooms?\n\t Hint: Calculate the hourly rate for each painter, combine them, and then divide the total walls in feet by the combined hourly rate of the painters.\n\t */\n\t\tdouble billHourlyRate = (12 * 14) / 2.15;\n\t\tdouble jillHourlyRate = (12 * 14) / 1.90;\n\t\tdouble timeToPaintBigRoom = (5 * 12 * 14) / (jillHourlyRate + billHourlyRate);\n\n\n\n\t /* Exercise 52\n\t 52. Create and assign variables to hold a first name, last name, and middle initial. Using concatenation,\n\t\tbuild an additional variable to hold the full name in the order of last name, first name, middle initial. The\n\t\tlast and first names should be separated by a comma followed by a space, and the middle initial must end\n\t\twith a period. Use \"Grace\", \"Hopper, and \"B\" for the first name, last name, and middle initial.\n\t\tExample: \"John\", \"Smith, \"D\" —> \"Smith, John D.\"\n\t */\n\t\tString first_Name = \"Grace\";\n\t\tString last_Name = \"Hopper\";\n\t\tString middle_Initial = \"B\";\n\t\tString full_Name = last_Name + \", \" + first_Name + \" \" + middle_Initial + \".\";\n\n\n\t /* Exercise 53\n\t 53. The distance between New York and Chicago is 800 miles, and the train has already travelled 537 miles.\n\t What percentage of the trip as a whole number has been completed?\n\t */\n\t\tdouble totalDistance = 800;\n\t\tdouble trainTravelled = 537;\n\t\tdouble percentageTravelledFraction = (trainTravelled / totalDistance) * 100;\n\t\tint percentageTravelled = (int)percentageTravelledFraction;\n\n\n\t}",
"void analyze(CaveGen g) {\n caveGenCount += 1; \n\n // count the number of purple flowers\n int num = 0;\n for (Teki t: g.placedTekis) {\n if (t.tekiName.equalsIgnoreCase(\"blackpom\"))\n num += 1;\n }\n if (num > 5) num = 5;\n numPurpleFlowers[num] += 1;\n\n // report about missing treasures\n // print the seed everytime we see a missing treasure\n int minTreasure = 0, actualTreasure = 0;\n for (Item t: g.spawnItem) { minTreasure += t.min; }\n for (Teki t: g.spawnTekiConsolidated) { if (t.itemInside != null) minTreasure += t.min; }\n actualTreasure += g.placedItems.size();\n for (Teki t: g.placedTekis) {\n if (t.itemInside != null)\n actualTreasure += 1;\n }\n int expectedMissingTreasures = 0;\n if (\"CH29 1\".equals(g.specialCaveInfoName + \" \" + g.sublevel))\n expectedMissingTreasures = 1; // This level is always missing a treasure\n boolean missingUnexpectedTreasure = actualTreasure + expectedMissingTreasures < minTreasure;\n if (missingUnexpectedTreasure) {\n println(\"Missing treasure: \" + g.specialCaveInfoName + \" \" + g.sublevel + \" \" + Drawer.seedToString(g.initialSeed));\n missingTreasureCount += 1;\n }\n\n // Good layout finder (story mode)\n if (CaveGen.findGoodLayouts && !CaveGen.challengeMode && !missingUnexpectedTreasure) {\n boolean giveWorstLayoutsInstead = CaveGen.findGoodLayoutsRatio < 0;\n\n ArrayList<Teki> placedTekisWithItems = new ArrayList<Teki>();\n for (Teki t: g.placedTekis) {\n if (t.itemInside != null)\n placedTekisWithItems.add(t);\n }\n\n String ignoreItems = \"g_futa_kyodo,flower_blue,tape_blue,kinoko_doku,flower_red,futa_a_silver,cookie_m_l,chocolate\";\n String findTekis = \"\"; //\"whitepom,blackpom\";\n\n // Compute the waypoints on the shortest paths\n ArrayList<WayPoint> wpOnShortPath = new ArrayList<WayPoint>();\n for (Item t: g.placedItems) { // Treasures\n if (ignoreItems.contains(t.itemName.toLowerCase())) continue;\n WayPoint wp = g.closestWayPoint(t.spawnPoint);\n while (!wp.isStart) {\n if (!wpOnShortPath.contains(wp)) wpOnShortPath.add(wp);\n wp = wp.backWp;\n }\n }\n for (Teki t: placedTekisWithItems) { // Treasures inside enemies\n if (ignoreItems.contains(t.itemInside.toLowerCase())) continue;\n WayPoint wp = g.closestWayPoint(t.spawnPoint);\n while (!wp.isStart) {\n if (!wpOnShortPath.contains(wp)) wpOnShortPath.add(wp);\n wp = wp.backWp;\n }\n }\n for (Teki t: g.placedTekis) { // Other tekis\n if (findTekis.contains(t.tekiName.toLowerCase())) {\n WayPoint wp = g.closestWayPoint(t.spawnPoint);\n while (!wp.isStart) {\n if (!wpOnShortPath.contains(wp)) wpOnShortPath.add(wp);\n wp = wp.backWp;\n }\n }\n }\n /*if (g.placedHole != null) {\n WayPoint wp = g.closestWayPoint(g.placedHole);\n while (!wp.isStart) {\n if (!wpOnShortPath.contains(wp)) wpOnShortPath.add(wp);\n wp = wp.backWp;\n }\n }\n if (g.placedGeyser != null) {\n WayPoint wp = g.closestWayPoint(g.placedGeyser);\n while (!wp.isStart) {\n if (!wpOnShortPath.contains(wp)) wpOnShortPath.add(wp);\n wp = wp.backWp;\n }\n }*/\n\n // add up distance penalty for score\n int score = 0;\n for (WayPoint wp: wpOnShortPath) {\n score += wp.distToStart - wp.backWp.distToStart;\n } \n // add up enemy penalties for score\n for (Teki t: g.placedTekis) {\n WayPoint wp = g.closestWayPoint(t.spawnPoint);\n if (wpOnShortPath.contains(wp)) {\n score += Parser.tekiDifficulty.get(t.tekiName.toLowerCase());\n }\n }\n // add up gate penalties for score\n for (Gate t: g.placedGates) {\n WayPoint wp = g.closestWayPoint(t.spawnPoint);\n if (g.placedHole != null && g.placedHole.mapUnit.type == 0 && g.placedHole.mapUnit.doors.get(0).spawnPoint == t.spawnPoint)\n score += t.life / 3; // covers hole\n // if (g.placedGeyser != null && g.placedGeyser.mapUnit.type == 0 && g.placedGeyser.mapUnit.doors.get(0).spawnPoint == t.spawnPoint)\n // score += t.life / 3; // covers geyser\n if (wpOnShortPath.contains(wp))\n score += t.life / 3; // covers path back to ship\n }\n\n if (giveWorstLayoutsInstead) score *= -1;\n\n // keep a sorted list of the scores\n allScores.add(score);\n\n // only print good ones\n if (CaveGen.indexBeingGenerated > CaveGen.numToGenerate/10 && \n score <= allScores.get((int)(allScores.size()*Math.abs(CaveGen.findGoodLayoutsRatio))) \n || score == allScores.get(0) && CaveGen.indexBeingGenerated > CaveGen.numToGenerate/40) {\n CaveGen.images = true;\n println(\"GoodLayoutScore: \" + Drawer.seedToString(g.initialSeed) + \" -> \" + score);\n }\n else {\n CaveGen.images = false;\n }\n\n }\n\n // good layout finder (challenge mode)\n if (CaveGen.findGoodLayouts && CaveGen.challengeMode) {\n boolean giveWorstLayoutsInstead = CaveGen.findGoodLayoutsRatio < 0;\n\n // compute the number of pokos availible\n int pokosAvailible = 0;\n for (Teki t: g.placedTekis) {\n String name = t.tekiName.toLowerCase();\n if (plantNames.contains(\",\" + name + \",\")) continue;\n if (hazardNames.contains(\",\" + name + \",\")) continue;\n if (name.equalsIgnoreCase(\"egg\"))\n pokosAvailible += 10; // mitites\n else if (!noCarcassNames.contains(\",\" + name + \",\") && !name.contains(\"pom\"))\n pokosAvailible += Parser.pokos.get(t.tekiName.toLowerCase());\n if (t.itemInside != null)\n pokosAvailible += Parser.pokos.get(t.itemInside.toLowerCase());\n }\n for (Item t: g.placedItems)\n pokosAvailible += Parser.pokos.get(t.itemName.toLowerCase());\n\n // compute the number of pikmin*seconds required to complete the level\n float pikminSeconds = 0;\n for (Teki t: g.placedTekis) {\n if (plantNames.contains(\",\" + t.tekiName.toLowerCase() + \",\")) continue;\n if (hazardNames.contains(\",\" + t.tekiName.toLowerCase() + \",\")) continue;\n pikminSeconds += workFunction(g, t.tekiName, t.spawnPoint);\n if (t.itemInside != null)\n pikminSeconds += workFunction(g, t.itemInside, t.spawnPoint);\n }\n for (Item t: g.placedItems) {\n pikminSeconds += workFunction(g, t.itemName, t.spawnPoint);\n }\n pikminSeconds += workFunction(g, \"hole\", g.placedHole);\n pikminSeconds += workFunction(g, \"geyser\", g.placedGeyser);\n // gates??\n // hazards??\n \n int score = -pokosAvailible * 1000 + (int)(pikminSeconds/2);\n if (giveWorstLayoutsInstead) score *= -1;\n\n // keep a sorted list of the scores\n allScores.add(score);\n\n // only print good ones\n if (CaveGen.indexBeingGenerated > CaveGen.numToGenerate/10 && \n score <= allScores.get((int)(allScores.size()*Math.abs(CaveGen.findGoodLayoutsRatio))) \n || score == allScores.get(0) && CaveGen.indexBeingGenerated > CaveGen.numToGenerate/40) {\n CaveGen.images = true;\n println(\"GoodLayoutScore: \" + Drawer.seedToString(g.initialSeed) + \" -> \" + score);\n }\n else {\n CaveGen.images = false;\n }\n }\n }",
"public void duelmode(ScannedRobotEvent e) {\r\n //run predictive_shooter()\r\n if(e.getEnergy() <= 20) {\r\n //shoot things\r\n engage(e);\r\n } runaway(e);\r\n }",
"protected void wander() {\n\t\tfor(int i=3;i>0;){\n\t\t\tfindChest();\n\t\t\tint num = ((int) (Math.random()*100)) % 4;\n\t\t\tswitch (num+1){\n\t\t\t\tcase 1 :\n\t\t\t\t\tif(!(character.xOfFighter-1==game.getXofplayer()&&character.yOfFighter==game.getYofplayer())\n\t\t\t\t\t\t\t&&game.getPlayingmap().npcMove(character.xOfFighter,character.yOfFighter,character.xOfFighter-1,character.yOfFighter)){\n\t\t\t\t\t\tcharacter.xOfFighter = character.xOfFighter-1;\n\t\t\t\t\t\ti--;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2 :\n\t\t\t\t\tif(!(character.xOfFighter==game.getXofplayer()&&character.yOfFighter-1==game.getYofplayer())&&\n\t\t\t\t\t\t\tgame.getPlayingmap().npcMove(character.xOfFighter,character.yOfFighter,character.xOfFighter,character.yOfFighter-1)){\n\t\t\t\t\t\tcharacter.yOfFighter = character.yOfFighter-1;\n\t\t\t\t\t\ti--;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3 :\n\t\t\t\t\tif(!(character.xOfFighter+1==game.getXofplayer()&&character.yOfFighter==game.getYofplayer())&&\n\t\t\t\t\t\t\tgame.getPlayingmap().npcMove(character.xOfFighter,character.yOfFighter,character.xOfFighter+1,character.yOfFighter)){\n\t\t\t\t\t\tcharacter.xOfFighter = character.xOfFighter+1;\n\t\t\t\t\t\ti--;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4 :\n\t\t\t\t\tif(!(character.xOfFighter==game.getXofplayer()&&character.yOfFighter+1==game.getYofplayer())&&\n\t\t\t\t\t\t\tgame.getPlayingmap().npcMove(character.xOfFighter,character.yOfFighter,character.xOfFighter,character.yOfFighter+1)){\n\t\t\t\t\t\tcharacter.yOfFighter = character.yOfFighter+1;\n\t\t\t\t\t\ti--;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tfindChest();\n\t}",
"public TypicalDay() {\n\t\tnbDeliveries = 0;\n\t\twareHouse = -1;\n\t}",
"public void actionsTouches () {\n\t\t//Gestion des deplacements du mineur si demande\n\t\tif (Partie.touche == 'g' || Partie.touche == 'd' || Partie.touche == 'h' || Partie.touche == 'b') deplacements();\n\n\t\t//Affichage du labyrinthe et des instructions, puis attente de consignes clavier.\n\t\tpartie.affichageLabyrinthe();\n\n\t\t//Quitte la partie si demande.\n\t\tif (Partie.touche == 'q') partie.quitter();\n\n\t\t//Trouve et affiche une solution si demande.\n\t\tif (Partie.touche == 's') affichageSolution();\n\n\t\t//Recommence la partie si demande.\n\t\tif (Partie.touche == 'r') {\n\t\t\tgrille.removeAll();\n\t\t\tpartie.initialisation();\n\t\t}\n\n\t\t//Affichage de l'aide si demande\n\t\tif (Partie.touche == 'a') {\n\t\t\tString texteAide = new String();\n\t\t\tswitch(themeJeu) {\n\t\t\tcase 2 : texteAide = \"Le but du jeu est d'aider Link à trouver la sortie du donjon tout en récupérant le(s) coffre(s).\\n Link doit egalement recuperer la Master Sword qui permet de tuer le monstre bloquant le chemin.\\n\\nLink se déplace à l'aide des touches directionnelles.\\nUne solution peut-être affichée en appuyant sur la touche (s).\\nLa touche (r) permet de recommencer, (q) de quitter.\\n\\n Bon jeu !\"; break;\n\t\t\tcase 3 : texteAide = \"Le but du jeu est d'aider Samus à trouver la sortie du vaisseau tout en récupérant le(s) émeraude(s).\\nSamus doit egalement recuperer la bombe qui permet de tuer le metroid qui bloque l'accès à la sortie.\\n\\nSamus se déplace à l'aide des touches directionnelles.\\nUne solution peut-être affichée en appuyant sur la touche (s).\\nLa touche (r) permet de recommencer, (q) de quitter.\\n\\n Bon jeu !\"; break;\n\t\t\tcase 4 : texteAide = \"Le but du jeu est d'aider le pompier à trouver la sortie du batiment tout en sauvant le(s) rescapé(s).\\nLe pompier doit egalement recuperer l'extincteur qui permet d'éteindre le feu qui bloque l'accès à la sortie.\\n\\nLe pompier se déplace à l'aide des touches directionnelles.\\nUne solution peut-être affichée en appuyant sur la touche (s).\\nLa touche (r) permet de recommencer, (q) de quitter.\\n\\n Bon jeu !\"; break;\n\t\t\tcase 5 : texteAide = \"Le but du jeu est d'aider Mario à trouver le drapeau de sortie tout en ramassant le(s) pièce(s).\\nMario doit egalement recuperer l'étoile d'invincibilité qui permet de se débarasser du Goomba qui l'empêche de sortir.\\n\\nMario se déplace à l'aide des touches directionnelles.\\nUne solution peut-être affichée en appuyant sur la touche (s).\\nLa touche (r) permet de recommencer, (q) de quitter.\\n\\n Here we gooo !\"; break;\n\t\t\tdefault : texteAide = \"Le but du jeu est d'aider le mineur à trouver la sortie du labyrinthe tout en extrayant le(s) filon(s).\\nLe mineur doit egalement recuperer la clef qui permet l'ouverture de le porte qui bloque l'accès à la sortie.\\n\\nLe mineur se déplace à l'aide des touches directionnelles.\\nUne solution peut-être affichée en appuyant sur la touche (s).\\nLa touche (r) permet de recommencer, (q) de quitter.\\n\\n Bon jeu !\"; break;\n\t\t\t}\n\t\t\tSystem.out.println(\"\\n============================================ AIDE ========================================\\n\\n\" + texteAide + \"\\n\\n==========================================================================================\\n\");\n\t\t\tJOptionPane.showMessageDialog(null, texteAide, \"Aide\", JOptionPane.QUESTION_MESSAGE);\n\t\t\tPartie.touche = ' ';\n\t\t}\n\n\t\t//Affichage de les infos si demande\n\t\tif (Partie.touche == 'i') {\n\t\t\tSystem.out.println(\"\\n============================================ INFOS =======================================\\n\\nCe jeu a ete developpe par Francois ADAM et Benjamin Rancinangue\\ndans le cadre du projet IPIPIP 2015.\\n\\n==========================================================================================\\n\");\n\t\t\tPartie.touche = ' ';\n\t\t\tJOptionPane.showMessageDialog(null, \"Ce jeu a été développé par François Adam et Benjamin Rancinangue\\ndans le cadre du projet IPIPIP 2015.\", \"Infos\", JOptionPane.INFORMATION_MESSAGE, new ImageIcon(getClass().getResource(\"/images/EMN.png\")));\n\t\t}\n\n\t\t//Nettoyage de l'ecran de console\n\t\tSystem.out.println(\"\\n==========================================================================================\\n\");\n\t}",
"public void recalcDyeStats() {\n dyeINT = 0;\n dyeSTR = 0;\n dyeCON = 0;\n dyeMEN = 0;\n dyeWIT = 0;\n dyeDEX = 0;\n\n for (int i = 0; i < 3; i++) {\n final DyeData dye = dyes[i];\n if (dye == null) {\n continue;\n }\n if (!PlayerUtils.canPlayerWearDye(this, dye)) {\n continue;\n }\n\n dyeINT += dye._int;\n dyeSTR += dye.str;\n dyeMEN += dye.men;\n dyeCON += dye.con;\n dyeWIT += dye.wit;\n dyeDEX += dye.dex;\n }\n\n if (dyeINT > 5) {\n dyeINT = 5;\n }\n if (dyeSTR > 5) {\n dyeSTR = 5;\n }\n if (dyeMEN > 5) {\n dyeMEN = 5;\n }\n if (dyeCON > 5) {\n dyeCON = 5;\n }\n if (dyeWIT > 5) {\n dyeWIT = 5;\n }\n if (dyeDEX > 5) {\n dyeDEX = 5;\n }\n }",
"private void fixDancerPositions() {\n\t\tif (arrangePositionCrowdAuditorium()) return;\n\t\t\n\t\tSystem.out.println(\"*************** only one row stage **************\");\n\t\tint l = 1, r = 5;\n\t\twhile (l < r) {\n\t\t\tint mid = (l + r) >> 1;\n\t\t\tboolean ret = arrangePosition(mid);\n\t\t\tif (ret) r = mid; else l = mid + 1;\n\t\t}\n\t\tboredTime = Math.max(120 - 24 * (l - 1), 12);\n\t\tSystem.out.println(\"*************** numCol: \" + l + \"***************\");\n\t\tif (!arrangePosition(l)) {\n\t\t\tSystem.out.println(\"************** change to crowd auditorium *****************\");\n\t\t\tboredTime = 12;\n\t\t\tarrangePositionCrowdAuditorium();\n\t\t}\n\t}",
"public void diagrafiSintagis() {\n\t\t// Elegxw an yparxoun syntages\n\t\tif(numOfPrescription != 0)\n\t\t{\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(\" STOIXEIA SYNTAGWN\");\n\t\t\t// Emfanizw oles tis syntages \n\t\t\tfor(int j = 0; j < numOfPrescription; j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(\"\\n \" + j + \". STOIXEIA SYNTAGHS: \");\n\t\t\t\tSystem.out.println();\n\t \t \tprescription[j].print();\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t\ttmp_1 = sir.readPositiveInt(\"DWSTE TON ARITHMO THS SYNTAGHS POU THELETAI NA DIAGRAFEI: \");\n\t\t\tSystem.out.println();\n\t\t\t// Elegxos egkyrotitas tou ari8mou pou edwse o xristis\n\t\t\twhile(tmp_1 < 0 || tmp_1 > numOfPrescription)\n\t\t\t{\n\t\t\t\ttmp_1 = sir.readPositiveInt(\"KSANAEISAGETAI ARITHMO SYNTAGHS: \");\n\t\t\t}\n\t\t\t// Metakinw tis epomenes syntages mia 8esi pio aristera\n\t\t\tfor(int k = tmp_1; k < numOfPrescription - 1; k++)\n\t\t\t{\n\t\t\t\tprescription[k] = prescription[k+1]; // Metakinw thn syntagh sti 8esi k+1 pio aristera\n\t\t\t}\n\t\t\tnumOfPrescription--; // Meiwse ton ari8mo twn syntagwn\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.print(\"\\nDEN YPARXOUN DIATHESIMES SYNTAGES PROS DIAGRAFH!\\n\");\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"private void check4voteAndClean()\n\t{\n\t\tif( noBeepersPresent())\n\t\t{\tturnLeft();\n\t\t\tmove();\n\t\t\tpickAll();\n\t\t\tturnAround();\n\t\t\tmove();\n\t\t\tmove();\n\t\t\tpickAll();\n\t\t\tturnAround();\n\t\t\tmove();\n\t\t\tturnRight();\n\t\t}\n\t}",
"@Override\n public Action playTurn(Actions actions, Action lastAction, GameMap map, Display display) {\n\n updateAgilisaurusState(); // update agilisaurus state\n\n if (isPregnant()) {\n pregnantPeriodCount++;\n if (pregnantPeriodCount == 10) {\n // prenant after 10 turns\n this.removeCapability(LifeStage.PREGNANT);\n this.removeCapability(LifeStage.ADULT);\n Egg egg = new Egg(\"Agilisaurus\", true, owner);\n map.locationOf(this).addItem(egg);\n\n pregnantPeriodCount = 0;\n }\n }\n\n if (this.starvationLevel == 20 || this.hitPoints == 0 | this.thirstLevel == 20) {\n this.removeCapability(LiveStatus.LIVE);\n this.addCapability(LiveStatus.DEAD);\n map.locationOf(this).addItem(new Corpse(\"Agilisaurus\"));\n map.removeActor(this);\n }\n\n if (this.foodLevel <= 0) {\n System.out.println(\"Agilisaurus is unwake due to hungry now.\");\n return new DoNothingAction();\n }\n\n Action wander = behaviour.getAction(this, map);\n if (wander != null) {\n return wander;\n } else {\n return new DoNothingAction();\n }\n }",
"private double eatingDessertPhase(double time) {\n\n\t\tdouble remainingTime = 0D;\n\n\t\tdouble eatingTime = time;\n\t\tif ((totalDessertEatingTime + eatingTime) >= dessertEatingDuration) {\n\t\t\teatingTime = dessertEatingDuration - totalDessertEatingTime;\n\t\t}\n\n\t\tif (eatingTime > 0D) {\n\n\t\t\tif (nameOfDessert != null) {\n\t\t\t\t// Eat prepared dessert.\n\t\t\t\tcheckInDescription(PreparingDessert.convertString2AR(nameOfDessert.getName()), true);\n\t\t\t\teatPreparedDessert(eatingTime);\n\n\t\t\t} else {\n\t\t\t\t// Eat unprepared dessert (fruit, soymilk, etc).\n\t\t\t\tboolean enoughDessert = eatUnpreparedDessert(eatingTime);\n\n\t\t\t\tif (enoughDessert) {\n\t\t\t\t\tcheckInDescription(unpreparedDessertAR, false);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tif (cumulativeProportion > nameOfDessert.getDryMass()) {\n\t\t\t\t\t\tendTask();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// If finished eating, end task.\n\t\t\t\t\tif (eatingTime < time) {\n\t\t\t\t\t\tremainingTime = time - eatingTime;\n\t\t\t\t\t}\n\n\t\t\t\t\ttotalEatingTime += eatingTime;\n\n\t\t\t\t\tif (totalEatingTime > getDuration())\n\t\t\t\t\t\tendTask();\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\t// If not enough unprepared dessert available, end task.\n\t\t\t\telse {// if (!enoughDessert) {\n\t\t\t\t\tremainingTime = time;\n\t\t\t\t\t// Need endTask() below to quit EatDrink\n\t\t\t\t\tendTask();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\treturn remainingTime;\n\t}",
"public void explainConjecture(Conjecture conjecture, Theory theory, String timer_num)\n {\n logThis(conjecture.writeConjecture(\"tptp\"), theory);\n for (int i=0; i<explainers.size(); i++)\n {\n Explainer explainer = (Explainer)explainers.elementAt(i);\n explainer.use_entity_letter = use_entity_letter;\n theory.addToTimer(timer_num + \".\" + Integer.toString(i) + \" Trying \" + explainer.name + \" to solve conjecture\");\n\n if (explainer.condition_string.trim().equals(\"\") ||\n reflect.checkCondition(conjecture, explainer.condition_string))\n {\n if (explainer instanceof FileProver)\n {\n FileProver file_prover = (FileProver)explainer;\n boolean is_proved = file_prover.prove(conjecture, theory);\n logThis(explainer.name + \"(\" + explainer.setup_name + \") \" + conjecture.proof_status, theory);\n if (is_proved)\n {\n conjecture.proof_status = \"proved\";\n if (conjecture.is_trivially_true)\n conjecture.explained_by = \"being trivial\";\n else\n conjecture.explained_by = explainer.name + \"(\" + explainer.setup_name + \")\";\n if (!use_all_explainers)\n {\n logThis(\"-----------------\", theory);\n if (store_conjectures)\n storage_handler.handleStorageOf(conjecture);\n return;\n }\n }\n if (!conjecture.counterexamples.isEmpty() || file_prover.disprove(conjecture, theory))\n {\n conjecture.proof_status = \"disproved\";\n logThis(explainer.name + \"(\" + explainer.setup_name + \") \" + conjecture.proof_status, theory);\n conjecture.explained_by = explainer.name + \"(\" + explainer.setup_name + \")\";\n if (!use_all_explainers)\n {\n logThis(\"-----------------\", theory);\n if (store_conjectures)\n storage_handler.handleStorageOf(conjecture);\n return;\n }\n }\n if (conjecture.proof_status.equals(\"sos\") && !use_all_explainers)\n {\n logThis(\"-----------------\", theory);\n if (store_conjectures)\n storage_handler.handleStorageOf(conjecture);\n return;\n }\n }\n if (explainer instanceof DataGenerator)\n {\n DataGenerator data_generator = (DataGenerator)explainer;\n Vector counterexamples = data_generator.counterexamplesFor(conjecture, theory, 1);\n if (!counterexamples.isEmpty())\n {\n conjecture.proof_status = \"disproved\";\n logThis(explainer.name + \"(\" + explainer.setup_name + \") \" + conjecture.proof_status, theory);\n conjecture.counterexamples = counterexamples;\n conjecture.explained_by = explainer.name + \"(\" + explainer.setup_name + \")\";\n if (!use_all_explainers)\n {\n logThis(\"-----------------\", theory);\n if (store_conjectures)\n storage_handler.handleStorageOf(conjecture);\n return;\n }\n }\n }\n if (explainer instanceof Prover && !(explainer instanceof FileProver))\n {\n Prover prover = (Prover)explainers.elementAt(i);\n boolean is_proved = prover.prove(conjecture, theory);\n logThis(explainer.name + \"(\" + explainer.setup_name + \") \" + conjecture.proof_status, theory);\n if (is_proved)\n {\n conjecture.proof_status = \"proved\";\n if (conjecture.is_trivially_true)\n conjecture.explained_by = \"being trivial\";\n else\n conjecture.explained_by = explainer.name + \"(\" + explainer.setup_name + \")\";\n if (!use_all_explainers)\n {\n logThis(\"-----------------\", theory);\n if (store_conjectures)\n storage_handler.handleStorageOf(conjecture);\n return;\n }\n }\n else if (prover.disprove(conjecture, theory)) {\n conjecture.proof_status = \"disproved\";\n this.logThis(explainer.name + \"(\" + explainer.setup_name + \") \" + conjecture.proof_status, theory);\n conjecture.explained_by = explainer.name + \"(\" + explainer.setup_name + \")\";\n if (!this.use_all_explainers) {\n this.logThis(\"-----------------\", theory);\n if (this.store_conjectures) {\n this.storage_handler.handleStorageOf(conjecture);\n }\n return;\n }\n }\n }\n }\n else\n logThis(\"Failed conditions for \" + explainer.name + \"(\" + explainer.setup_name + \")\", theory);\n }\n if (store_conjectures)\n storage_handler.handleStorageOf(conjecture);\n logThis(\"-----------------\", theory);\n }",
"@Override\n\tpublic IMessage onMessage(Message message, MessageContext ctx)\n\t{\n\t\tif (ctx.side.isServer())\n\t\t{\n\t\t\tint eventID = message.eventID;\n\t\t\tEntityPlayer entityplayer = ctx.getServerHandler().playerEntity;\n\t\t\t\n\t\t\tif(eventID == 0){\n \t\t// Note: the following long line of code gets the itemstack in a roundabout way because it needs\n \t\t// to access the tile entity rather than the container to actually get to the items.\n\t \tTileEntityArcaneWorkbench tileentity = ((ContainerArcaneWorkbench)entityplayer.openContainer).tileEntityArcaneWorkbench;\n\t \t\n\t \tItemStack wand = tileentity.getStackInSlot(ContainerArcaneWorkbench.WAND_SLOT);\n\t \tItemStack[] spellBooks = new ItemStack[ContainerArcaneWorkbench.CRYSTAL_SLOT];\n\t \tfor(int i=0; i<spellBooks.length; i++){\n\t \t\tspellBooks[i] = tileentity.getStackInSlot(i);\n\t \t}\n\t \tItemStack crystals = tileentity.getStackInSlot(ContainerArcaneWorkbench.CRYSTAL_SLOT);\n\t \tItemStack upgrade = tileentity.getStackInSlot(ContainerArcaneWorkbench.UPGRADE_SLOT);\n\t \t\n\t \t// Since the workbench now accepts armour as well as wands, this check is needed.\n\t \tif(wand != null && wand.getItem() instanceof ItemWand){\n\t \t\t\n\t \t\t// Upgrades wand if necessary. Damage is copied, preserving remaining durability,\n\t \t\t// and also the entire NBT tag compound.\n \t\t\tif(upgrade != null){\n \t\t\t\t\n \t\t\t\tif(upgrade.getItem() == Wizardry.arcaneTome){\n \t\t\t\t\t\n \t\t\t\t\tItemStack newWand;\n \t\t\t\t\t\n\t \t\t\t\tswitch(EnumTier.values()[upgrade.getItemDamage()]){\n\n\t\t\t\t\t\t\tcase APPRENTICE: \n\t\t\t\t\t\t\t\tif(((ItemWand)wand.getItem()).tier == EnumTier.BASIC){\n\t\t\t\t\t\t\t\t\tnewWand = new ItemStack(WizardryUtilities.getWand(EnumTier.values()[upgrade.getItemDamage()], ((ItemWand)wand.getItem()).element));\n\t\t\t\t\t\t\t\t\tnewWand.stackTagCompound = wand.stackTagCompound;\n\t\t\t\t\t\t\t\t\t// This needs to be done after copying the tag compound so the max damage for the new wand takes storage\n\t\t\t\t\t\t\t\t\t// upgrades into account.\n\t\t\t\t\t\t\t\t\tnewWand.setItemDamage(newWand.getMaxDamage() - (wand.getMaxDamage() - wand.getItemDamage()));\n\t\t\t\t\t\t\t\t\ttileentity.setInventorySlotContents(ContainerArcaneWorkbench.WAND_SLOT, newWand);\n\t\t\t\t\t\t\t\t\ttileentity.setInventorySlotContents(ContainerArcaneWorkbench.UPGRADE_SLOT, null);\n\t\t\t\t\t\t\t\t\tentityplayer.addStat(Wizardry.apprentice, 1);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcase ADVANCED: \n\t\t\t\t\t\t\t\tif(((ItemWand)wand.getItem()).tier == EnumTier.APPRENTICE){\n\t\t\t\t\t\t\t\t\tnewWand = new ItemStack(WizardryUtilities.getWand(EnumTier.values()[upgrade.getItemDamage()], ((ItemWand)wand.getItem()).element));\n\t\t\t\t\t\t\t\t\tnewWand.stackTagCompound = wand.stackTagCompound;\n\t\t\t\t\t\t\t\t\tnewWand.setItemDamage(newWand.getMaxDamage() - (wand.getMaxDamage() - wand.getItemDamage()));\n\t\t\t\t\t\t\t\t\ttileentity.setInventorySlotContents(ContainerArcaneWorkbench.WAND_SLOT, newWand);\n\t\t\t\t\t\t\t\t\ttileentity.setInventorySlotContents(ContainerArcaneWorkbench.UPGRADE_SLOT, null);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcase MASTER:\n\t\t\t\t\t\t\t\tif(((ItemWand)wand.getItem()).tier == EnumTier.ADVANCED){\n\t\t\t\t\t\t\t\t\tnewWand = new ItemStack(WizardryUtilities.getWand(EnumTier.values()[upgrade.getItemDamage()], ((ItemWand)wand.getItem()).element));\n\t\t\t\t\t\t\t\t\tnewWand.stackTagCompound = wand.stackTagCompound;\n\t\t\t\t\t\t\t\t\tnewWand.setItemDamage(newWand.getMaxDamage() - (wand.getMaxDamage() - wand.getItemDamage()));\n\t\t\t\t\t\t\t\t\ttileentity.setInventorySlotContents(ContainerArcaneWorkbench.WAND_SLOT, newWand);\n\t\t\t\t\t\t\t\t\ttileentity.setInventorySlotContents(ContainerArcaneWorkbench.UPGRADE_SLOT, null);\n\t\t\t\t\t\t\t\t\tentityplayer.addStat(Wizardry.master, 1);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tbreak;\n\t \t\t\t\t}\n\t \t\t\t\t\n\t \t\t\t\t// This needs to happen so the charging works on the new wand, not the old one.\n\t \t\t\t\twand = tileentity.getStackInSlot(ContainerArcaneWorkbench.WAND_SLOT);\n \t\t\t\t\n \t\t\t\t}else{\n\n \t\t\t\t\t// Special upgrades\n \t\t\t\t\t\n \t\t\t\t\t// Used to preserve existing mana when upgrading storage rather than creating free mana.\n \t\t\t\t\tint prevMana = wand.getMaxDamage() - wand.getItemDamage();\n \t\t\t\t\t\n \t\t\t\t\tif(WandHelper.getTotalUpgrades(wand) < ((ItemWand)wand.getItem()).tier.upgradeLimit\n \t\t\t\t\t\t\t&& WandHelper.getUpgradeLevel(wand, upgrade.getItem()) < Wizardry.UPGRADE_STACK_LIMIT){\n \t\t\t\t\t\t\n \t\t\t\t\t\tWandHelper.applyUpgrade(wand, upgrade.getItem());\n \t\t\t\t\t\t\n \t\t\t\t\t\t// Special behaviours for specific upgrades\n\t \t\t\t\t\tif(upgrade.getItem() == Wizardry.storageUpgrade){\n\t \t\t\t\t\t\twand.setItemDamage(wand.getMaxDamage() - prevMana);\n\t \t\t\t\t\t}\n\t \t\t\t\t\tif(upgrade.getItem() == Wizardry.attunementUpgrade){\n\t \t\t\t\t\t\t\n\t\t \t\t\t\t\tSpell[] spells = WandHelper.getSpells(wand);\n\t\t \t\t\t\t\tSpell[] newSpells = new Spell[5 + WandHelper.getUpgradeLevel(wand, Wizardry.attunementUpgrade)];\n\t\t \t\t\t\t\t\n\t\t \t\t\t\t\tfor(int i=0; i<newSpells.length; i++){\n\t\t \t\t\t\t\t\t// Prevents both NPEs and AIOOBEs\n\t\t\t \t\t\t\t\tnewSpells[i] = i < spells.length && spells[i] != null ? spells[i] : WizardryRegistry.none;\n\t\t\t \t\t\t\t}\n\t\t \t\t\t\t\t\n\t\t \t\t\t\t\tWandHelper.setSpells(wand, newSpells);\n\t\t \t\t\t\t\t\n\t\t \t\t\t\t\tint[] cooldown = WandHelper.getCooldowns(wand);\n\t\t \t\t\t\t\tint[] newCooldown = new int[5 + WandHelper.getUpgradeLevel(wand, Wizardry.attunementUpgrade)];\n\t\t \t\t\t\t\t\n\t\t \t\t\t\t\tif(cooldown.length > 0){\n\t\t \t\t\t\t\t\tfor(int i=0; i<cooldown.length; i++){\n\t\t\t \t\t\t\t\t\tnewCooldown[i] = cooldown[i];\n\t\t\t \t\t\t\t\t}\n\t\t \t\t\t\t\t}\n\t\t \t\t\t\t\t\n\t\t \t\t\t\t\tWandHelper.setCooldowns(wand, newCooldown);\n\t \t\t\t\t\t}\n \t\t\t\t\t\t\n \t\t\t\t\t\ttileentity.decrStackSize(ContainerArcaneWorkbench.UPGRADE_SLOT, 1);\n \t\t\t\t\t\tentityplayer.addStat(Wizardry.specialUpgrade, 1);\n \t\t\t\t\t\t\n \t\t\t\t\t\tif(WandHelper.getTotalUpgrades(wand) == EnumTier.MASTER.upgradeLimit){\n \t\t\t\t\t\tentityplayer.addStat(Wizardry.maxOutWand, 1);\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\t// Reads NBT spell id array to variable, edits this, then writes it back to NBT.\n \t\t\t// Original spells are preserved; if a slot is left empty the existing spell binding will remain.\n \t\t\t// Accounts for spells which cannot be applied because they are above the wand's tier; these spells\n \t\t\t// will not bind but the existing spell in that slot will remain and other applicable spells will\n \t\t\t// be bound as normal, along with any upgrades and crystals.\n \t\t\tSpell[] spells = WandHelper.getSpells(wand);\n \t\t\tif(spells.length <= 0){\n \t\t\t\t// 5 here because if the spell array doesn't exist, the wand can't possibly have attunement upgrades\n \t\t\t\tspells = new Spell[5];\n \t\t\t}\n \t\t\tfor(int i=0; i<spells.length; i++){\n \t\t\t\tif(spellBooks[i] != null && !(Spell.get(spellBooks[i].getItemDamage()).tier.level > ((ItemWand)wand.getItem()).tier.level)){\n \t\t\t\t\tspells[i] = Spell.get(spellBooks[i].getItemDamage());\n \t\t\t\t}\n \t\t\t}\n \t\t\tWandHelper.setSpells(wand, spells);\n \t\t\t\n \t\t\t// Charges wand by appropriate amount\n \t\t\tif(crystals != null){\n\t \t\t\tint chargeDepleted = wand.getItemDamage();\n\t\t \t\t//System.out.println(\"Charge depleted: \" + chargeDepleted);\n\t\t \t\t//System.out.println(\"Crystals found: \" + crystals.stackSize);\n\t \t\t\tif(crystals.stackSize * Wizardry.MANA_PER_CRYSTAL < chargeDepleted){\n\t \t \t\t//System.out.println(\"charging\");\n\t \t\t\t\twand.setItemDamage(chargeDepleted - crystals.stackSize * Wizardry.MANA_PER_CRYSTAL);\n\t \t\t\t\ttileentity.decrStackSize(ContainerArcaneWorkbench.CRYSTAL_SLOT, crystals.stackSize);\n\t \t\t\t}else if(chargeDepleted != 0){\n\t \t\t\t\t//System.out.println((int)Math.ceil(((double)chargeDepleted)/50));\n\t \t\t\t\ttileentity.decrStackSize(ContainerArcaneWorkbench.CRYSTAL_SLOT, (int)Math.ceil(((double)chargeDepleted)/Wizardry.MANA_PER_CRYSTAL));\n\t \t\t\t\twand.setItemDamage(0);\n\t \t\t\t}\n\t \t\t}\n \t\t\n \t\t// Armour\n\t \t}else if(wand != null && wand.getItem() instanceof ItemWizardArmour){\n\t \t\t// Applies legendary upgrade\n\t \t\tif(upgrade != null && upgrade.getItem() == Wizardry.armourUpgrade){\n\t \t\t\tif(!wand.hasTagCompound()){\n\t \t\t\t\twand.stackTagCompound = new NBTTagCompound();\n\t \t\t\t}\n\t \t\t\tif(!wand.stackTagCompound.hasKey(\"legendary\")){\n\t \t\t\t\twand.stackTagCompound.setBoolean(\"legendary\", true);\n\t \t\t\t\ttileentity.setInventorySlotContents(ContainerArcaneWorkbench.UPGRADE_SLOT, null);\n\t \t\t\tentityplayer.triggerAchievement(Wizardry.legendary);\n\t \t\t\t}\n\t \t\t}\n\t \t\t// Charges armour by appropriate amount\n \t\t\tif(crystals != null){\n\t \t\t\tint chargeDepleted = wand.getItemDamage();\n\t \t\t\tif(crystals.stackSize * Wizardry.MANA_PER_CRYSTAL < chargeDepleted){\n\t \t\t\t\twand.setItemDamage(chargeDepleted - crystals.stackSize * Wizardry.MANA_PER_CRYSTAL);\n\t \t\t\t\ttileentity.decrStackSize(ContainerArcaneWorkbench.CRYSTAL_SLOT, crystals.stackSize);\n\t \t\t\t}else if(chargeDepleted != 0){\n\t \t\t\t\ttileentity.decrStackSize(ContainerArcaneWorkbench.CRYSTAL_SLOT, (int)Math.ceil(((double)chargeDepleted)/Wizardry.MANA_PER_CRYSTAL));\n\t \t\t\t\twand.setItemDamage(0);\n\t \t\t\t}\n\t \t\t}\n \t\t\t\n \t\t// Scrolls\n\t \t}else if(wand != null && wand.getItem() == Wizardry.blankScroll){\n\t \t\t// Spells can only be bound to scrolls if the player has already cast them (prevents casting of master spells without getting a master wand)\n\t \t\t// This restriction does not apply in creative mode\n\t \t\tif(spellBooks[0] != null && (entityplayer.capabilities.isCreativeMode || (ExtendedPlayer.get(entityplayer) != null\n\t \t\t\t\t&& ExtendedPlayer.get(entityplayer).hasSpellBeenDiscovered(Spell.get(spellBooks[0].getItemDamage()))))\n\t \t\t\t\t&& crystals != null && crystals.stackSize * Wizardry.MANA_PER_CRYSTAL > Spell.get(spellBooks[0].getItemDamage()).cost){\n\n \t\t\t\ttileentity.decrStackSize(ContainerArcaneWorkbench.CRYSTAL_SLOT, (int)Math.ceil(((double)Spell.get(spellBooks[0].getItemDamage()).cost)/Wizardry.MANA_PER_CRYSTAL));\n \t\t\t\ttileentity.setInventorySlotContents(ContainerArcaneWorkbench.WAND_SLOT, new ItemStack(Wizardry.scroll, 1, spellBooks[0].getItemDamage()));\n \t\t\t\tspellBooks[0].stackSize--;\n \t\t\t\t}\n\t \t}\n\t \t\n\t //////////////////////////////////////////////////////////////////////////////////////////////\t\n\t \t\n\t }else if(eventID == 1){\n\t \tif(entityplayer.inventory.getCurrentItem() != null &&\n\t \t\t \tentityplayer.inventory.getCurrentItem().getItem() instanceof ItemWand){\n\t \t\t\n\t\t \tItemStack wand = entityplayer.inventory.getCurrentItem();\n\t\t \t\n\t\t \t\t\tif(wand != null) WandHelper.selectNextSpell(wand);\n\t\t \t\t\t\n\t\t \t\t\t// This line fixes the bug with continuous spells casting when they shouldn't be\n\t\t \t\t\tentityplayer.clearItemInUse();\n\t }\n\t \t\n\t //////////////////////////////////////////////////////////////////////////////////////////////\n\t \t\n\t }else if(eventID == 2){\n\t \tif(entityplayer.inventory.getCurrentItem() != null &&\n\t\t \t\t entityplayer.inventory.getCurrentItem().getItem() instanceof ItemWand){\n\t \t\t\n\t\t \tItemStack wand = entityplayer.inventory.getCurrentItem();\n\t\t \t\t\t\n\t\t \tif(wand != null) WandHelper.selectPreviousSpell(wand);\n\n\t\t \t\t\t// This line fixes the bug with continuous spells casting when they shouldn't be\n\t\t \t\t\tentityplayer.clearItemInUse();\n\t \t}\n\t }\n\t\t}\n\n\t\treturn null;\n\t}",
"void updateTotals () {\n\n speed_kts_mph_kmh_ms_info = make_speed_kts_mph_kmh_ms_info(velocity);\n double lift = foil_lift();\n double drag = total_drag();\n \n // This computes location of the center of gravity of the craft\n // (rider, roughly) in relation to the leading edge (aka LE) of the\n // mast (roughly, front bolt of DT). \n //\n // Mtipping is 0.5*eff_strut_span*strut,drag\n //\n // cg_pos: x-axis offset relative to strut bottom LE. \"fore\" is -, \"aft\" is +,\n dash.cg_pos = find_cg_xpos(); \n // cg_pos_board_level: at board level where x=0 at strut's board-side LE.\n // strut tilt correction is required. example:\n // cg_pos=-35cm, xoff_tip=5cm (horue,dmitry) cg_pos_board_level=-30-5=-35\n dash.cg_pos_board_level = dash.cg_pos;\n\n // foilboard AOA correction. when the board is at high angle of\n // attack, the computed offset is only an approximation, rider is more\n // forward *alone the board surface* in reality. for 90 degree strut,\n // it is the hypotenuse where the adjasent is -dash.cg_pos + cos(\n // BOARD_THICKNESS + strut.span)\n if (rider_xpos_tilt_correction) {\n double pitch_rad = Math.toRadians(craft_pitch);\n double hypo = BOARD_THICKNESS + strut.span;\n double deck_rot_adj = - // when AOA is positive, and cg_pos is\n // negative, increses the magnitude\n hypo * Math.sin(pitch_rad);\n\n // board deck offset is hypotenuse; adjasent value is dash.cg_pos plus\n // deck_rot_adjn\n \n // deck_x_offset is the 'hypotenuse' H = A / cos(A)\n double deck_x_offset = (dash.cg_pos + deck_rot_adj) // the 'adjasent'\n / Math.cos(pitch_rad);\n\n // apply correction\n dash.cg_pos_board_level = deck_x_offset;\n }\n\n // cg_pos_board_level: at board level where x=0 at strut's board-side LE.\n // strut tilt correction is required. example for AoA=0:\n // cg_pos=-30cm, xoff_tip=5cm (horue,dmitry) cg_pos_board_level=-30-5=-35\n dash.cg_pos_board_level -= strut.xoff_tip;\n\n \n // rider_countering_x_offset is computed and saved to reflect posture\n // change due to (a) headwind (b) propulsion pull as follows below\n double rider_countering_x_offset = 0;\n\n // (a) Headwind.\n // Two square triangles: rider_offset/height = rider.drag/weight\n if (!in.opts.ignore_air_resistance)\n rider_countering_x_offset += -(rider.drag/rider.weight)* RIDER_CG_HEIGHT;\n\n // (b) Propulsion pull. \n // Rider's force-countering stance is in effect only if the drive force is applied\n // above the board, which implies it goes through rider's body\n if (DRIVING_FORCE_HEIGHT > 0) {\n // drive force, scaled to be considering coming from the rider CG height spot\n double drive_force_scaled = \n (in.opts.ignore_drive_moment)\n ? 0\n : (total_drag() * DRIVING_FORCE_HEIGHT/RIDER_CG_HEIGHT);\n // two square triangles: rider_offset/height = drive_force_scaled/weight\n rider_countering_x_offset += (drive_force_scaled/rider.weight)* RIDER_CG_HEIGHT; // wasFF 0.86;\n }\n rider.force_countering_x_offest = rider_countering_x_offset;\n dash.cg_pos_of_rider = dash.cg_pos_board_level + rider.force_countering_x_offest;\n\n // factored out to dash.loadPanel()\n // if (can_do_gui_updates) {\n // dash.loadPanel();\n // }\n }",
"private double pickingUpDessertPhase(double time) {\n\n\t\t// Determine preferred kitchen to get dessert.\n\t\tif (dessertKitchen == null) {\n\t\t\tdessertKitchen = getKitchenWithDessert(person);\n\n\t\t\tif (dessertKitchen != null) {\n\t\t\t\t// Walk to dessert kitchen.\n\t\t\t\twalkToActivitySpotInBuilding(dessertKitchen.getBuilding(), FunctionType.DINING, true);\n\t\t\t\t\n\t\t\t\t// Pick up a dessert at kitchen if one is available.\n\t\t\t\tnameOfDessert = dessertKitchen.chooseADessert(person);\n\n\t\t\t\tif (nameOfDessert != null) {\n\t\t\t\t\tLogConsolidated.log(Level.FINE, 0, sourceName,\n\t\t\t\t\t\t\t\"[\" + person.getLocationTag().getLocale() + \"] \" + person\n\t\t\t\t\t\t\t\t\t+ \" picked up prepared dessert '\" + nameOfDessert.getName() \n\t\t\t\t\t\t\t\t\t+ \"' to eat/drink in \" + person.getLocationTag().getImmediateLocation() + \".\");\n\t\t\t\t\t\n\t\t\t\t\tsetPhase(EAT_DESSERT);\n\t\t\t\t\treturn time *.85;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t// If no dessert kitchen found, go eat preserved food\n\t\t\t\tsetPhase(EAT_PRESERVED_FOOD);\n\t\t\t\treturn time *.85;\n\t\t\t}\n\t\t}\n\n\t\treturn time *.75;\n\t}",
"public static void main(String[] args) {\n\t\tWatneyRescue wr = new WatneyRescue();\n\n\t\t//A new scanner to read input from the user\n\t\tScanner s = new Scanner(System.in);\n\n\t\t//The user's menu selection; 'd', 'r', 'q' or something else \n\t\tchar inputChoice;\n\n\t\tdo {\n\t\t\tSystem.out.println(\"Do you want 'd' distance mode, 'r' rover mode, or 'q' quit?\");\n\t\t\tinputChoice = s.nextLine().charAt(0);\n\n\t\t\tswitch(inputChoice) {\n\n\t\t\t//Enter distance mode; make the table then compute walking time based on the table\n\t\t\tcase 'd': \n\t\t\t\tSystem.out.println(\"How many meters to Watney?\");\n\t\t\t\tString line = s.nextLine(); \n\t\t\t\tdouble metersToWatney = Double.parseDouble(line.trim());\n\t\t\t\tString table = wr.generateContingency(metersToWatney);\n\t\t\t\tSystem.out.println(table);\n\t\t\t\tSystem.out.println(\"Which row?\");\n\t\t\t\tline = s.nextLine();\n\t\t\t\tint row = Integer.parseInt(line.trim());\n\t\t\t\tSystem.out.println(wr.computeWalkingTime(metersToWatney,table,row));\t\n\t\t\t\tbreak;\n\n\t\t\t//Enter rover mode; receive and translate a series of angles for the rover\n\t\t\tcase 'r':\n\t\t\t\tSystem.out.println(\"What series of angles?\");\n\t\t\t\tString angles = s.nextLine();\n\t\t\t\tSystem.out.println(\"Mission control on earth sends the following message:\\n\");\n\t\t\t\tSystem.out.println(wr.interpretHexadecimal(angles) + \"\\n\");\n\t\t\t\tbreak;\n\n\t\t\t//Quit\n\t\t\tcase'q': \n\t\t\t\tcontinue;\n\n\t\t\t//Ignore anything that isn't 'd', 'r', or 'q'\n\t\t\tdefault: \n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t} while (inputChoice != 'q'); //keep going until we get 'q'\n\n\t\tSystem.out.println(\"Goodbye. May the hexadecimals be with you.\");\n\t\t\n\t\t//Close the scanner to keep eclipse from driving me crazy with its warnings\n\t\ts.close();\n\t}",
"static void Dungeonforgotten() {\n\t\t\n\t\tint[] lvldata;\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"Fate has chosen...\");\n\t\tSystem.out.println(\"|| The Forgotten dungeon ||\");\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"The Forgotten dungeon is an EASY dungeon in which every book you find contains sacred text of a civilization,\\n whose language is long forgotten, but their magical powers have anything but dwindled.\");\n\t\tSystem.out.println(\"By completing this dungeon you will increase your ability to read their language,\\n and thus, understand their arcane arts.\");\n\t\t\n\t\tdungeonsize = (int) (Math.random() * 12) + 5;\n\t\tdungeondiff = 0.6;\n\t\thubcount = (int) (Math.random() * 3) + 1;\t\n\t\tlvldata = LevelGen();\n\t\tfor(int i = 1; i < dungeonsize - 1; i++) {\n\t\t\tEngine.roomaction(lvldata[i]);\n\t\t\t// TODO Forgotten progression\n\t\t}\n\t\tSystem.out.println(\"\tDebug: DungeonForgotten passed\");\n\t}",
"public static void main(String args[]) {\n System.out.println(\"Spacecraft test\");\n\n try {\n // Main objects\n AstroDate astro = new AstroDate(1996, AstroDate.JANUARY, 1);\n TimeElement time = new TimeElement(astro, TimeElement.SCALE.UNIVERSAL_TIME_UT1);\n CityElement city = City.findCity(\"Madrid\");\n ObserverElement observer = ObserverElement.parseCity(city);\n EphemerisElement eph = new EphemerisElement(\n Target.TARGET.JUPITER,\n EphemerisElement.COORDINATES_TYPE.APPARENT,\n EphemerisElement.EQUINOX_OF_DATE,\n EphemerisElement.TOPOCENTRIC,\n EphemerisElement.REDUCTION_METHOD.WILLIAMS_1994,\n EphemerisElement.FRAME.ICRF);\n\n // Show ephemeris for Jupiter\n EphemElement ephem = Ephem.getEphemeris(time, observer, eph, true);\n ConsoleReport.basicEphemReportToConsole(ephem);\n\n // Now for the Galileo spacecraft when it reached Jupiter\n int probe = Spacecraft.searchProbe(\"Galileo-10\");\n eph.targetBody = Target.TARGET.NOT_A_PLANET;\n eph.algorithm = EphemerisElement.ALGORITHM.PROBE;\n eph.orbit = Spacecraft.getProbeElement(probe);\n ephem = Spacecraft.orbitEphemeris(time, observer, eph);\n ConsoleReport.basicEphemReportToConsole(ephem);\n\n double JD = TimeScale.getJD(time, observer, eph, TimeElement.SCALE.UNIVERSAL_TIME_UT1);\n String name = Spacecraft.getName(probe) + \" / \" + Spacecraft.getPhase(probe) + \" / \" +\n Spacecraft.searchProbe(Spacecraft.getFullName(probe));\n System.out.println(\"JD \" + JD + \" / \" + name);\n\n System.out.println(\"Horizons to JPARSEC:\");\n String horizons[];\n /* = new String[] { // Spirit\n \"2452921.500000000 = A.D. 2003-Oct-09 00:00:00.0000 (CT)\",\n \"EC= 1.950613534257460E-01 QR= 1.015241182486214E+00 IN= 2.568563256177712E-01\",\n \"OM= 2.582741114396523E+02 W = 3.576251119367114E+02 Tp= 2452797.843160490971\",\n \"N = 6.958159876484857E-01 MA= 8.604240591231755E+01 TA= 1.081599605263792E+02\",\n \"A = 1.261265298674612E+00 AD= 1.507289414863009E+00 PR= 5.173781666279647E+02\"\n };\n\n horizons = new String[] {\n \"2456018.500000000 = A.D. 2012-Apr-01 00:00:00.0000 (CT)\",\n \"EC= 2.186288185825909E-01 QR= 9.849980637718811E-01 IN= 1.666450728710398E+00\",\n \"OM= 2.427043236295177E+02 W = 1.711208010196681E+02 Tp= 2455883.068369616754\",\n \"N = 6.963652534091054E-01 MA= 9.430988161155695E+01 TA= 1.180906444526340E+02\",\n \"A = 1.260601986862495E+00 AD= 1.536205909953109E+00 PR= 5.169700789026945E+02\"\n };\n */\n\n horizons = new String[] {\n \"2457221.500000000 = A.D. 2015-Jul-18 00:00:00.0000 (CT)\",\n \"EC= 1.396502418164295E+00 QR= 2.239569958804241E+00 IN= 2.423181841903402E+00\",\n \"OM= 2.320104143427997E+02 W = 2.852782283712027E+02 Tp= 2453774.600156403612\",\n \"N = 7.342194488175884E-02 MA= 2.530780903294607E+02 TA= 1.268263097078230E+02\",\n \"A =-5.648313493705464E+00 AD= 6.684586453809735E+91 PR= 1.157407291666667E+95\"\n };\n\n System.out.println(Spacecraft.horizons2JPARSEC(\"New Horizons\", horizons, 0.0, 0.0));\n System.out.println(\"Orbital elements to JPARSEC:\");\n astro = new AstroDate(2008, AstroDate.JANUARY, 1);\n OrbitalElement orbit = OrbitEphem.getOrbitalElements(Target.TARGET.VENUS, astro.jd());\n System.out.println(Spacecraft.orbitalElement2JPARSEC(orbit));\n\n JPARSECException.showWarnings();\n } catch (JPARSECException ve) {\n JPARSECException.showException(ve);\n }\n }",
"public void cheat() {\r\n\t\t\t\tnourriture += population*10;\r\n\t\t\t\tarmee += population/2;\r\n\t\t\t\tpopulation += armee*tailleArmee;\r\n\t\t\t}",
"private static void runHQ() throws GameActionException {\n\t\tif (Clock.getRoundNum() < 3) {\t\t\t\n\t\t\tif (rc.isActive()) {\n\t\t\t\tDirection spawnDir = dir[rand.nextAnd(7)];\n\t\t\t\tif (rc.senseObjectAtLocation(curLoc.add(spawnDir)) == null) {\n\t\t\t\t\trc.spawn(spawnDir);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tif (pastrLocations[0] == null) {\n\t\t\t\tpastrLocations[0] = getBestPastrLocNearMeBasedOnCowGrowthRate();\n\t\t\t\trc.broadcast(0, pastrLocations[0].x * 100 + pastrLocations[0].y);\n\t\t\t}\n\t\t}\n\t\tdouble d = rc.senseCowsAtLocation(new MapLocation(8,11));\n\t\tSystem.out.println(d);\n\t}",
"static void play_redportal () {\n System.out.println(\"Here is the second challenge\");\n System.out.println(\"In this challenge you will have to defeat all the monkeys in 5 different levels.\");\n System.out.println(\"Be careful...Your HP sets the boundaries\");\n enter = next.nextLine();\n System.out.println(\"Alright...3...2...1...Ready- or NOT...GO!!!\");\n enter = next.nextLine();\n System.out.println(\"There is a large open clearance up ahead.\");\n enter = next.nextLine();\n System.out.println(username + \" hears loud monkey sounds from above. BRACE YOURSELF!!!\");\n red_fight();\n //after the player beats the enemy...\n System.out.println(\"Congratulations again... this is gonna be a difficult journey and Kongo can only lead the way.\");\n enter = next.nextLine();\n System.out.println(\"There's three diverging paths that will lead to two different paths...\");\n enter = next.nextLine();\n System.out.println(\"'Take the left path...I can sense the evil witch that way', said Kongo.\");\n enter = next.nextLine();\n System.out.println(username + \" takes the right path\");\n enter= next.nextLine();\n System.out.println(\"FRSSSH...FRSSHHH...WHOSHHH...\");\n enter = next.nextLine();\n System.out.println(\"What's that noice...Let's get closer to check it out.\");\n enter = next.nextLine();\n System.out.println(username + \" and Kongo walked through the big clearance. THEN...\");\n enter = next.nextLine();\n System.out.println(\"OOHHH!!! OOHHHH!!! AAHHH!!! AAHHH!!! - OH NO...\");\n red_fight();\n //after the player beats the enemy\n System.out.println(\"You're on a roll!\");\n enter = next.nextLine();\n System.out.println(\"There is now two diverging paths...\");\n enter = next.nextLine();\n System.out.println(\"'Take the straight path...That's the shortest way outta here...\");\n enter = next.nextLine();\n System.out.println(username + \" takes the straight path and arrives at the opening of a waterfall.\");\n System.out.println(\"However, the water is black instead of a clear/pure water color...\");\n System.out.println(\"YUCK! Separt exclaimed! 'That witch sure doesn't know how to clean up after herself...'\");\n enter = next.nextLine();\n System.out.println(\"He! He! He!\");\n enter = next.nextLine();\n System.out.println(\"Watch yourselves...something is emerging out of the water!\");\n red_fight();\n //after you win\n System.out.println(\"Alright...you got the hang of this now!\");\n enter = next.nextLine();\n System.out.println(\"There is now three diverging paths...\");\n enter = next.nextLine();\n System.out.println(\"Take the left one...I think it isn't a trap.\");\n enter = next.nextLine();\n System.out.println(username + \" takes the left path...\");\n System.out.println(\"Looks like it is safe...Guess we got lucky!\");\n enter = next.nextLine();\n System.out.println(\"Now there are three diverging paths...\");\n enter = next.nextLine();\n System.out.println(\"'Take the straight path', said Separt.\");\n System.out.println(\"That's the only way out. The other two are traps that will just bring you back to the beginning\");\n System.out.println(\"Trust me...\");\n enter = next.nextLine();\n System.out.println(username + \" takes the straight path.\");\n enter = next.nextLine();\n System.out.println(\"There is a large arena up ahead. Let's be prepared...\");\n enter = next.nextLine();\n System.out.println(\"ARRGH!!!\");\n red_fight();\n //after you win\n System.out.println(\"Alright...let's finish this up...\");\n enter = next.nextLine();\n System.out.println(\"Now there is only a straight path ahead...\");\n System.out.println(username + \" takes the straight path and sees a large black portal...\");\n System.out.println(\"That will lead you to the...\");\n enter = next.nextLine();\n System.out.println(\"BOOM! POW! VRRM! ARHGHHGH!\");\n red_fight();\n //after the player beats the enemy\n System.out.println(\"'Gosh...that was rude. Please continue Kongo,'\" + username + \" stated.\");\n enter = next.nextLine();\n System.out.println(\"As I was saying...that is the path that will lead us to the wicked witch that is\");\n System.out.println(\"trying to hunt you down...Don't worry...I got your back...I'll help you in this battle\");\n System.out.println(\"Shall we jump into the portal?\");\n answer = responses.nextLine();\n if(answer.contains(\"n\")) {\n System.out.println(\"We have no more time...the witch send more of her minions to take us on...\");\n enter = next.nextLine();\n System.out.println(username + \" prepares to jump\");\n }else if(answer.contains(\"y\")) {\n System.out.println(\"Alright get ready to jump!!!\");\n }\n bossportal();\n }",
"private void processEvent(Event e) {\n\t\t// adjust timer\n\t\ttime = e.getTime();\n\t\tprintTimer();\n\n\t\t// get related patient and doctor. Start them waiting. Get preferredDoctor\n\t\tPerson p = e.getPatient();\n\t\tp.startWaiting();\n\t\tPerson d = e.getDoctor();\n\t\tif (d != null) {\n\t\t\td.startWaiting();\n\t\t}\n\t\tPerson preferredDoctor = p.getPreferredDoctor();\n\n\t\t// switch on the event type\n\t\tswitch (e.getType()) {\n\t\t\tcase Event.NEW_PATIENT :\n\t\t\t\t// new patient entered ambulance. Add him to incoming waiters\n\t\t\t\t// and check if doctors are waiting\n\t\t\t\tprint(\n\t\t\t\t\t\"New patient: \" + p + \", add to examination-waiting-list\");\n\t\t\t\t_examinationWaiters.addLast(p);\n\t\t\t\tcheckExamination();\n\t\t\t\tbreak;\n\n\t\t\tcase Event.FIRST_EXAMINATION :\n\t\t\t\t// end of 1st examination\n\t\t\t\tprint(\"1st examination end: \" + p + \", \" + d);\n\t\t\t\tif (needXray()) {\n\t\t\t\t\t// if xray needed, add patient to the xray waiters\n\t\t\t\t\t// and check if xray-doctor is waiting\n\t\t\t\t\tprint(\"Xray needed. Add \" + p + \" to xray-waiting-list\");\n\t\t\t\t\tp.setPreferredDoctor(d);\n\t\t\t\t\t_xrayWaiters.addLast(p);\n\t\t\t\t\tcheckXRay();\n\t\t\t\t} else {\n\t\t\t\t\t// if no xray needed, then patient can go home.\n\t\t\t\t\tprint(\"No xray needed. Can go home now: \" + p);\n\t\t\t\t\t_gonePatients.add(p);\n\t\t\t\t}\n\t\t\t\t// check if incoming patients are waiting\n\t\t\t\tcheckExamination();\n\t\t\t\tbreak;\n\n\t\t\tcase Event.XRAY_SHOOTING :\n\t\t\t\t// end of xray-examination. Add Patient to waiters.\n\t\t\t\t// Check if any xray waiters and if doctors are waiting\n\t\t\t\tprint(\"Xray-shooting end: \" + p);\n\t\t\t\tif (_policy == XRAY_FIRST) {\n\t\t\t\t\tprint(\"Add to back-from-xray-waiters: \" + p);\n\t\t\t\t\t_backFromXrayWaiters.addLast(p);\n\t\t\t\t} else {\n\t\t\t\t\tprint(\"Add to examination-waiting-list: \" + p);\n\t\t\t\t\t_examinationWaiters.addLast(p);\n\t\t\t\t}\n\t\t\t\tcheckExamination();\n\t\t\t\tcheckXRay();\n\t\t\t\tbreak;\n\n\t\t\tcase Event.SECOND_EXAMINATION :\n\t\t\t\t// end of second examination. Patient can go home now.\n\t\t\t\t// check if incoming patients are waiting.\n\t\t\t\tprint(\"2nd examination end: \" + p + \", \" + d);\n\t\t\t\tprint(\"Can go home: \" + p);\n\t\t\t\t_gonePatients.add(p);\n\t\t\t\tcheckExamination();\n\t\t\t\tbreak;\n\t\t}\n\t}",
"public static void main(String[] args) {\n Tron.init();\n\n //We'll want to keep track of the turn number to make debugging easier.\n int turnNumber = 0;\n\n // Execute loop forever (or until game ends)\n while (true) {\n //Update turn number:\n turnNumber++;\n\n /* Get an integer map of the field. Each int\n * can either be Tron.Tile.EMPTY, Tron.Tile.ME,\n * Tron.Tile.OPPONENT, Tron.Tile.TAKEN_BY_ME,\n * Tron.Tile.TAKEN_BY_OPPONENT, or Tron.Tile.WALL */\n ArrayList<ArrayList<Tron.Tile>> mList = Tron.getMap();\n int[][] m = new int[mList.size()][mList.get(0).size()];\n for (int i = 0; i < mList.size(); i++) {\n for (int j = 0; j < mList.get(i).size(); j++) {\n m[i][j] = mList.get(i).get(j).ordinal();\n }\n }\n\n //Let's figure out where we are:\n int myLocX = 0, myLocY = 0;\n for(int y = 0; y < 16; y++) {\n for(int x = 0; x < 16; x++) {\n //I want to note that this is a little bit of a disgusting way of doing this comparison, and that you should change it later, but Java makes this uglier than C++\n if(Tron.Tile.values()[m[y][x]] == Tron.Tile.ME) {\n myLocX = x;\n myLocY = y;\n }\n }\n }\n\n //Let's find out which directions are safe to go in:\n boolean [] safe = emptyAdjacentSquares(m, myLocX, myLocY);\n\n //Let's look at the counts of empty squares around the possible squares to go to:\n int [] dirEmptyCount = new int[4];\n for(int a = 0; a < 4; a++) {\n if(safe[a]) {\n //Get the location we would be in if we went in a certain direction (specified by a).\n int[] possibleSquare = getLocation(myLocX, myLocY, a);\n //Make sure that square exists:\n if(possibleSquare[0] != -1 && possibleSquare[1] != -1) {\n //Find the squares around that square:\n boolean [] around = emptyAdjacentSquares(m, possibleSquare[0], possibleSquare[1]);\n //Count the number of empty squares around that square and set it in our array:\n dirEmptyCount[a] = 0;\n for(int b = 0; b < 4; b++) if(around[b]) dirEmptyCount[a]++;\n }\n }\n else dirEmptyCount[a] = 5; //Irrelevant, but we must ensure it's as large as possible because we don't want to go there.\n }\n\n //Log some basic information.\n Tron.log(\"-----------------------------------------------------\\nDebug for turn #\" + turnNumber + \":\\n\");\n for(int a = 0; a < 4; a++) Tron.log(\"Direction \" + stringFromDirection(a) + \" is \" + (safe[a] ? \"safe.\\n\" : \"not safe.\\n\"));\n\n /* Send your move. This can be Tron.Direction.NORTH,\n * Tron.Direction.SOUTH, Tron.Direction.EAST, or\n * Tron.Direction.WEST. */\n int minVal = 1000, minValLoc = 0;\n for(int a = 0; a < 4; a++) {\n if(dirEmptyCount[a] < minVal) {\n minVal = dirEmptyCount[a];\n minValLoc = a;\n }\n }\n Tron.sendMove(Tron.Direction.values()[minValLoc]);\n }\n }",
"private static void checkActions()\n\t{\n\t\tSystem.out.println();\n\t\t\n\t\tif (fighterAction.equals(\"Kick\") && opponentAction.equals(\"Kick\"))\n\t\t{\n\t\t\tannounce(playerOneName,\" smashes shins with \", opponentName);\n\t\t\topponentHurt = true;\n\t\t\tplayerOneHurt = true;\n\t\t}\n\t\n\t\telse if (fighterAction.equals(\"Kick\") && opponentAction.equals(\"Punch\"))\n\t\t{\n\t\t\tannounce(opponentName,\" gives a big uppercut to \", playerOneName);\n\t\t\tplayerOneHurt = true;\n\t\t\tcounterAttack = true;\n\t\t}\n\t\n\t\telse if (fighterAction.equals(\"Kick\") && opponentAction.equals(\"Block\"))\n\t\t{\n\t\t\tannounce(opponentName,\" takes a big kick to the ribs from \", playerOneName);\n\t\t\topponentHurt = true;\n\t\t\tcounterAttack = true;\n\t\t}\n\t\n\t\telse if (fighterAction.equals(\"Punch\") && opponentAction.equals(\"Kick\"))\n\t\t{\n\t\t\tannounce(playerOneName,\" gives a big uppercut to \", opponentName);\n\t\t\topponentHurt = true;\n\t\t\tcounterAttack = true;\n\t\t}\n\t\n\t\telse if (fighterAction.equals(\"Punch\") && opponentAction.equals(\"Punch\"))\n\t\t{\n\t\t\tannounce(playerOneName,\" exchanges quick jabs with \", opponentName);\n\t\t\topponentHurt = true;\n\t\t\tplayerOneHurt = true;\n\t\t}\n\t\n\t\telse if (fighterAction.equals(\"Punch\") && opponentAction.equals(\"Block\"))\n\t\t{\n\t\t\tannounce(opponentName,\" parries the punch and deals big damage to \", playerOneName);\n\t\t\tplayerOneHurt = true;\n\t\t\tcounterAttack = true;\n\t\t}\n\t\n\t\telse if (fighterAction.equals(\"Block\") && opponentAction.equals(\"Kick\"))\n\t\t{\n\t\t\tannounce(playerOneName,\" takes a big kick to the ribs from \", opponentName);\n\t\t\tplayerOneHurt = true;\n\t\t\tcounterAttack = true;\n\t\t}\n\t\n\t\telse if (fighterAction.equals(\"Block\") && opponentAction.equals(\"Punch\"))\n\t\t{\n\t\t\tannounce(playerOneName,\" parries the punch and deals big damage to \", opponentName);\n\t\t\topponentHurt = true;\n\t\t\tcounterAttack = true;\n\t\t}\n\t\n\t\t// Both block\n\t\telse\n\t\t{\n\t\t\tannounce(\"\",\"Both fighters stand still, waiting for the other to make a move!\",\"\");\n\t\t}\n\n\t\tSystem.out.println();\n\t}",
"@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\tswitch(e.getKeyCode()) { \n case KeyEvent.VK_N:\t\t\t\t\t\t\t// N key pressed, switch to night mode \n \tif (day == true) { day = false; } \n \telse { day = true; }\n \tbreak;\n\t\t}\n\n\t\tif(portal.getPortal() && portal2.getPortal()) {\n\t\t\tPoint3D tpFromPos;\n\t\t\tif (person.isFps()) {\n\t\t\t\ttpFromPos = person.getCamera().getPosition();\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttpFromPos = person.getPosition();\n\t\t\t}\n\t\t\t//If hit hits the first cube of the portal\n\t\t\tif (portal.onPortal(person.getCamera().getPosition(), portXTresh, portZTresh) == 1) {\n\t \t\t\t\t\n\t\t\t\tperson.getCamera().setPosition(portal2.getPosition().translate(-1.5f, 0, -1.5f));\n\t \t\t\t\t//person.setTeleportet(true);\n\t \t\t}\n\t \t\telse if (portal.onPortal(person.getCamera().getPosition(), portXTresh, portZTresh) == 2) {\n\t \t\t\tperson.getCamera().setPosition(portal2.getPosition().translate(1.5f, 0, 1.5f));\n\t \t\t}\n\t \t\tif (portal2.onPortal(person.getCamera().getPosition(), portXTresh, portZTresh) == 1) {\n\t \t\t\t\t\n\t \t\t\tperson.getCamera().setPosition(portal.getPosition().translate(-1.5f, 0, -1.5f));\n\t \t\t\t\t//person.setTeleportet(true);\n\t \t\t}\n\t \t\telse if (portal2.onPortal(person.getCamera().getPosition(), portXTresh, portZTresh) == 2) {\n\t \t\t\t\t\n\t \t\t\tperson.getCamera().setPosition(portal.getPosition().translate(1.5f, 0, 1.5f));\n\t \t\t\t\t//person.setTeleportet(true);\n\t \t\t}\n\t\t\t\n\t\t}\n\t}",
"public void familiarTick() {\n\t\tattacked = false;\n\t\tif (summonedFamiliar != null && c.getInstance().summoned != null) {\n\t\t\tif (!c.goodDistance(c.getX(), c.getY(), c.getInstance().summoned.getX(), c.getInstance().summoned.getY(),\n\t\t\t\t\t8)) {\n\t\t\t\tcallOnTeleport();\n\t\t\t}\n\t\t\tif (!c.goodDistance(c.getX(), c.getY(), c.getInstance().summoned.getX(), c.getInstance().summoned.getY(),\n\t\t\t\t\t8)) {\n\t\t\t\tc.getSummoning().callFamiliar();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (c.getInstance().playerIndex != 0\n\t\t\t\t\t&& NPCHandler.npcs[c.getInstance().summoningMonsterId].spawnedBy == c.getId()) {\n\t\t\t\tNPCHandler.npcs[c.getInstance().summoningMonsterId].isAttackingAPerson = true;\n\t\t\t} else if (c.getInstance().playerIndex == 0\n\t\t\t\t\t&& NPCHandler.npcs[c.getInstance().summoningMonsterId].spawnedBy == c.getId()) {\n\t\t\t\tNPCHandler.npcs[c.getInstance().summoningMonsterId].isAttackingAPerson = false;\n\t\t\t}\n\t\t\tif (c.getInstance().underAttackBy != 0\n\t\t\t\t\t&& NPCHandler.npcs[c.getInstance().summoningMonsterId].spawnedBy == c.getId()) {\n\t\t\t\tNPCHandler.npcs[c.getInstance().summoningMonsterId].isAttackedByPerson = true;\n\t\t\t} else if (c.getInstance().underAttackBy == 0\n\t\t\t\t\t&& NPCHandler.npcs[c.getInstance().summoningMonsterId].spawnedBy == c.getId()) {\n\t\t\t\tNPCHandler.npcs[c.getInstance().summoningMonsterId].isAttackedByPerson = false;\n\t\t\t}\n\t\t\tif (c.getInstance().npcIndex != 0\n\t\t\t\t\t&& !NPCHandler.npcs[c.getInstance().summoningMonsterId].isAttackingAPerson\n\t\t\t\t\t&& NPCHandler.npcs[c.getInstance().summoningMonsterId].spawnedBy == c.getId()) {\n\t\t\t\tNPCHandler.npcs[c.getInstance().summoningMonsterId].IsAttackingNPC = true;\n\t\t\t\tNPCHandler.npcs[c.getInstance().summoningMonsterId].facePlayer(0);\n\t\t\t} else if (NPCHandler.npcs[c.getInstance().summoningMonsterId].spawnedBy == c.getId()) {\n\t\t\t\tif (NPCHandler.npcs[c.getInstance().summoningMonsterId].IsAttackingNPC == true)\n\t\t\t\t\tcallFamiliar();\n\t\t\t\tNPCHandler.npcs[c.getInstance().summoningMonsterId].IsAttackingNPC = false;\n\t\t\t}\n\t\t\tif (c.getInstance().summoned.killerId != 0 && c.getInstance().summoned.underAttackBy == 0) {\n\t\t\t\tc.getInstance().summoned.killerId = 0;\n\t\t\t\tc.getInstance().summoned.underAttackBy = 0;\n\t\t\t\tc.getSummoning().callFamiliar();\n\t\t\t}\n\t\t\tif (attacked != true) {\n\t\t\t\tif (NPCHandler.npcs[c.getInstance().summoningMonsterId].isAttackedByPerson == true) {\n\t\t\t\t\tattacked = true;\n\t\t\t\t\tPlayer o = PlayerHandler.players[c.getInstance().underAttackBy];\n\t\t\t\t\tif (o != null) {\n\t\t\t\t\t\tif (o.getInstance().inMulti()) {\n\t\t\t\t\t\t\tif (actionTimer == 0) {\n\t\t\t\t\t\t\t\tServer.npcHandler.followPlayer(c.getInstance().summoningMonsterId, o.playerId,\n\t\t\t\t\t\t\t\t\t\tc.playerId);\n\t\t\t\t\t\t\t\tNPCHandler.npcs[c.getInstance().summoningMonsterId].facePlayer(o.playerId);\n\t\t\t\t\t\t\t\tServer.npcHandler.attackPlayer(o, c.getInstance().summoningMonsterId);\n\t\t\t\t\t\t\t\tc.getInstance().summoned.updateRequired = true;\n\t\t\t\t\t\t\t\tNPCHandler.npcs[c.getInstance().summoningMonsterId].index = o.playerId;\n\t\t\t\t\t\t\t\tactionTimer = 7;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tactionTimer--;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (attacked != true) {\n\t\t\t\tif (NPCHandler.npcs[c.getInstance().summoningMonsterId].isAttackingAPerson == true) {\n\t\t\t\t\tattacked = true;\n\t\t\t\t\tPlayer o = PlayerHandler.players[c.getInstance().playerIndex];\n\t\t\t\t\tif (o != null) {\n\t\t\t\t\t\tif (o.getInstance().inMulti()) {\n\t\t\t\t\t\t\tif (actionTimer == 0) {\n\t\t\t\t\t\t\t\tServer.npcHandler.followPlayer(c.getInstance().summoningMonsterId, o.playerId,\n\t\t\t\t\t\t\t\t\t\tc.playerId);\n\t\t\t\t\t\t\t\tNPCHandler.npcs[c.getInstance().summoningMonsterId].facePlayer(o.playerId);\n\t\t\t\t\t\t\t\tServer.npcHandler.attackPlayer(o, c.getInstance().summoningMonsterId);\n\t\t\t\t\t\t\t\tc.getInstance().summoned.updateRequired = true;\n\t\t\t\t\t\t\t\tNPCHandler.npcs[c.getInstance().summoningMonsterId].index = o.playerId;\n\t\t\t\t\t\t\t\tactionTimer = 7;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tactionTimer--;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (attacked != true) {\n\t\t\t\tif (NPCHandler.npcs[c.getInstance().summoningMonsterId].IsAttackingNPC == true) {\n\t\t\t\t\tattacked = true;\n\t\t\t\t\tNPC n = NPCHandler.npcs[c.getInstance().npcIndex];\n\t\t\t\t\tif (n != null) {\n\t\t\t\t\t\t// if(n.inMulti()) {\n\t\t\t\t\t\tNPCHandler.npcs[c.getInstance().summoningMonsterId].IsAttackingNPC = true;\n\t\t\t\t\t\tNPCHandler.npcs[c.getInstance().npcIndex].IsUnderAttackNpc = true;\n\t\t\t\t\t\tNPCHandler.npcs[c.getInstance().npcIndex].randomWalk = false;\n\t\t\t\t\t\t// GameEngine.npcHandler.attackNPC(c.npcIndex,\n\t\t\t\t\t\t// c.getVariables().summoningMonsterId, c);\n\t\t\t\t\t\tServer.npcHandler.NpcVersusNpc(c.getInstance().summoningMonsterId,\n\t\t\t\t\t\t\t\tc.getInstance().npcIndex, c);\n\t\t\t\t\t\t// }\n\t\t\t\t\t} else {\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tspeakTimer++;\n\t\t\tif (speakTimer == 100) {\n\t\t\t\tc.getInstance().summoned.forceChat(summonedFamiliar.speakText);\n\t\t\t\tspeakTimer = 0;\n\t\t\t}\n\t\t\tc.getInstance().specRestoreTimer -= 1;\n\t\t\tint hours = (c.getInstance().specRestoreTimer / 2) / 3600;\n\t\t\tint minutes = ((c.getInstance().specRestoreTimer / 2) - hours * 3600) / 60;\n\t\t\tint seconds = ((c.getInstance().specRestoreTimer / 2) - (hours * 3600 + minutes * 60));\n\n\t\t\tString timer = String.format(\"%02d:%02d\", minutes, seconds);\n\t\t\tc.getPA().sendString(timer, 17021);\n\t\t\tif (c.getInstance().specRestoreTimer == 100) {\n\t\t\t\tc.sendMessage(\"@red@Your familiar will run out in approximately 1 minute.\");\n\t\t\t\tc.sendMessage(\"@red@Warning! Item's stored in familiar will be dropped upon death!\");\n\t\t\t} else if (c.getInstance().specRestoreTimer == 50) {\n\t\t\t\tc.sendMessage(\"@red@Your familiar will run out in approximately 30 seconds.\");\n\t\t\t\tc.sendMessage(\"@red@Warning! Item's stored in familiar will be dropped upon death!\");\n\t\t\t} else if (c.getInstance().specRestoreTimer == 25) {\n\t\t\t\tc.sendMessage(\"@red@Your familiar will run out in approximately 15 seconds.\");\n\t\t\t\tc.sendMessage(\"@blu@ You can renew your familiar with a new pouch by clicking @red@ Renew pouch\");\n\t\t\t\tc.sendMessage(\"@red@Warning! Item's stored in familiar will be dropped upon death!\");\n\t\t\t} else if (c.getInstance().specRestoreTimer <= 0) {\n\t\t\t\tdismissFamiliar(false);\n\t\t\t}\n\t\t\tif (familiarSpecialEnergy != 60) {\n\t\t\t\tspecialRestoreCycle++;\n\t\t\t\tif (specialRestoreCycle == 50) {\n\t\t\t\t\tif (familiarSpecialEnergy != 60) {\n\t\t\t\t\t\tfamiliarSpecialEnergy += 15;\n\t\t\t\t\t\tif (familiarSpecialEnergy >= 60) {\n\t\t\t\t\t\t\tfamiliarSpecialEnergy = 60;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tspecialRestoreCycle = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tspecialTimer--;\n\t\t}\n\t\tif (renewTimer > 0) {\n\t\t\trenewTimer--;\n\t\t\tif (renewTimer == 0 && c.getInstance().summoned == null && summonedFamiliar != null) {\n\t\t\t\tc.getInstance().summoned = Server.npcHandler.summonNPC(c, summonedFamiliar.npcId, c.getX(),\n\t\t\t\t\t\tc.getY() + (summonedFamiliar.large ? 2 : 1), c.heightLevel, 0,\n\t\t\t\t\t\tSummoningData.getSummonHealth(summonedFamiliar.npcId), 1, 1, 1);\n\t\t\t\tcallFamiliar();\n\t\t\t}\n\t\t}\n\t\tif (loginCycle > 0) {\n\t\t\tloginCycle--;\n\t\t\tif (loginCycle == 0 && c.getInstance().summoned == null && summonedFamiliar != null) {\n\t\t\t\tc.getInstance().summoned = Server.npcHandler.summonNPC(c, summonedFamiliar.npcId, c.getX(),\n\t\t\t\t\t\tc.getY() + (summonedFamiliar.large ? 2 : 1), c.heightLevel, 0,\n\t\t\t\t\t\tSummoningData.getSummonHealth(summonedFamiliar.npcId), 1, 1, 1);\n\t\t\t\tcallFamiliar();\n\t\t\t}\n\t\t}\n\t}",
"public void diagrafiFarmakou() {\n\t\t// Elegxw an yparxoun farmaka sto farmakeio\n\t\tif(numOfMedicine != 0)\n\t\t{\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(\" STOIXEIA FARMAKWN\");\n\t\t\t// Emfanizw ola ta famraka tou farmakeiou\n\t\t\tfor(int j = 0; j < numOfMedicine; j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(\"\\n \" + j + \". STOIXEIA FARMAKOU: \");\n\t\t\t\tSystem.out.println();\n\t \t \tmedicine[j].print();\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t\ttmp_1 = sir.readPositiveInt(\"DWSTE TON ARITHMO TOU FARMAKOU POU THELETAI NA DIAGRAFEI: \");\n\t\t\tSystem.out.println();\n\t\t\t// Elegxos egkyrotitas tou ari8mou pou edwse o xristis\n\t\t\twhile(tmp_1 < 0 || tmp_1 > numOfMedicine)\n\t\t\t{\n\t\t\t\ttmp_1 = sir.readPositiveInt(\"KSANAEISAGETAI ARITHMO FARMAKOU: \");\n\t\t\t}\n\t\t\t// Metakinw ta epomena farmaka mia 8esi pio aristera\n\t\t\tfor(int k = tmp_1; k < numOfMedicine - 1; k++)\n\t\t\t{\n\t\t\t\tmedicine[k] = medicine[k+1]; // Metakinw to farmako sti 8esi k+1 pio aristera\n\t\t\t}\n\t\t\tnumOfMedicine--; // Meiwse ton ari8mo twn farmakwn\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.print(\"\\nDEN YPARXOUN DIATHESIMA FARMAKA PROS DIAGRAFH!\\n\");\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"public void move()\n {\n daysSurvived+=1;\n\n energy -= energyLostPerDay;\n\n Random generator = new Random();\n\n //losowo okreslony ruch na podstawie genomu\n int turnIndex = generator.nextInt((int)Math.ceil(Genome.numberOfGenes));\n int turn = genome.getGenome().get(turnIndex);\n\n //wywolujemy metode obrotu - dodaje odpowiednio liczbe do aktualnego kierunku\n direction.turn(turn);\n\n //zmieniamy pozycje zwierzaka przez dodanie odpowiedniego wektora\n position = position.add(direction.move());\n //walidacja pozycji tak, by wychodzac za mape byc na mapie z drugiej strony\n position.validatePosition(map.getWidth(),map.getHeight());\n\n moveOnSimulation();\n\n //jesli po ruchu zwierzaczek nie ma juz energii na kolejny ruch\n if(energy < energyLostPerDay )\n {\n this.animalHungry = true;\n }\n }",
"private boolean eatUnpreparedDessert(double eatingTime) {\n\n\t\tboolean result = true;\n\n\t\t// Determine dessert resource type if not known.\n\t\tif (unpreparedDessertAR == null) {\n\n\t\t\tboolean isThirsty = false;\n\t\t\tif (condition.getThirst() > 50)\n\t\t\t\tisThirsty = true;\n\t\t\t// Determine list of available dessert resources.\n\t\t\tList<AmountResource> availableDessertResources = getAvailableDessertResources(dessertConsumptionRate,\n\t\t\t\t\tisThirsty);\n\t\t\tif (availableDessertResources.size() > 0) {\n\n\t\t\t\t// Randomly choose available dessert resource.\n\t\t\t\tint index = RandomUtil.getRandomInt(availableDessertResources.size() - 1);\n\t\t\t\tunpreparedDessertAR = availableDessertResources.get(index);\n\t\t\t} else {\n\t\t\t\tresult = false;\n\t\t\t}\n\t\t}\n\n\t\t// Consume portion of unprepared dessert resource.\n\t\tif (unpreparedDessertAR != null) {\n\t\t\t\n\t\t\t// Obtain the dry mass of the dessert\n\t\t\tdouble dryMass = PreparingDessert.getDryMass(PreparingDessert.convertAR2String(unpreparedDessertAR));\n\t\t\t// Proportion of dessert being eaten over this time period.\n\t\t\tdouble proportion = person.getEatingSpeed() * eatingTime;\n\n\t\t\tif (cumulativeProportion > dryMass) {\n\t\t\t\tdouble excess = cumulativeProportion - dryMass;\n\t\t\t\tcumulativeProportion = cumulativeProportion - excess;\n\t\t\t\tproportion = proportion - excess;\n\t\t\t}\n\t\t\t\n\t\t\tif (proportion > MIN) {\n\t\t\n\t\t\t\tUnit containerUnit = person.getTopContainerUnit();\n\t\t\t\t\n\t\t\t\tInventory inv = null;\n\t\t\t\t\n\t\t\t\tif (containerUnit != null) {\t\t\t\n\t\t\t\t\tif (containerUnit instanceof MarsSurface) {\n\t\t\t\t\t\t// Get dessert from one's EVA suit\n\t\t\t\t\t\tinv = person.getSuit().getInventory();\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tinv = containerUnit.getInventory();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (inv != null) {\n\t\t\t\t\t// Add to cumulativeProportion\n\t\t\t\t\tcumulativeProportion += proportion;\n\t\t\t\t\t// Take dessert resource from inventory if it is available.\n\t\t\t\t\tboolean hasDessert = Storage.retrieveAnResource(proportion, unpreparedDessertAR, inv, true);\n\t\t\t\t\t\n\t\t\t\t\tif (hasDessert) {\n\t\t\t\t\t\t// Consume water inside the dessert\n\t\t\t\t\t\tconsumeDessertWater(dryMass);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// dessert amount eaten over this period of time.\n\t\t\t\t\t\tdouble hungerRelieved = RATIO * proportion / dessertConsumptionRate;\n\t\t\t\t\n\t\t\t\t\t\t// Consume unpreserved dessert.\n\t\t\t\t\t\treduceHunger(hungerRelieved);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Reduce person's stress after eating an unprepared dessert.\n\t\t\t\t\t\t// This is in addition to normal stress reduction from eating task.\n\t\t\t\t\t\tdouble stressModifier = DESSERT_STRESS_MODIFIER;\n\t\t\t\t\t\tdouble newStress = condition.getStress() + (stressModifier * eatingTime);\n\t\t\t\t\t\tcondition.setStress(newStress);\n\t\t\t\t\n\t\t\t\t\t\t// Add caloric energy from dessert.\n\t\t\t\t\t\tdouble caloricEnergy = proportion / dessertConsumptionRate * PhysicalCondition.FOOD_COMPOSITION_ENERGY_RATIO;\n\t\t\t\t\t\tcondition.addEnergy(caloricEnergy);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Not enough dessert resource available to eat.\n\t\t\t\t\t\tresult = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}",
"private String randomEventSimulator(Player player) {\r\n\t\tdouble eventRoll = rand.nextDouble();\r\n\t\tif (player.hasLowestScore()) {\r\n\t\t\tif (eventRoll <= 0.27) {\r\n\t\t\t\treturn goodEventHelper(player);\r\n\t\t\t} else {\r\n\t\t\t\treturn \"No event happened.\";\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t\r\n\t\t\tint cost = RANDOMEVENTPRICEMODIFIER[data.getRoundNum()];\r\n\t\t\tint playerMoney = player.getMoney();\r\n\t\t\t\r\n\t\t\tif (eventRoll <= 0.154) {\r\n\t\t\t\treturn goodEventHelper(player);\r\n\t\t\t} else if (eventRoll <= 0.193) {\t\r\n\t\t\t\tcost *= 4;\r\n\t\t\t\tif (playerMoney < cost) {\r\n\t\t\t\t\tplayer.deductMoney(playerMoney);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tplayer.deductMoney(cost);\r\n\t\t\t\t}\r\n\t\t\t\treturn \"FLYING CAT-BUGS ATE THE ROOF OFF YOUR HOUSE. REPAIRS COST \" + cost + \".\";\r\n\t\t\t} else if (eventRoll <= 0.231) {\r\n\t\t\t\tcost *= 6;\r\n\t\t\t\tif (playerMoney < cost) {\r\n\t\t\t\t\tplayer.deductMoney(playerMoney);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tplayer.deductMoney(cost);\r\n\t\t\t\t}\r\n\t\t\t\treturn \"YOUR SPACE GYPSY INLAWS MADE A MESS OF THE TOWN. IT COST YOU \" + cost \r\n\t\t\t\t\t\t+ \" TO CLEAN IT UP.\";\r\n\t\t\t} else if (eventRoll <= 0.27) {\r\n\t\t\t\tint playerFoodAmount = player.getResourceAmount(ResourceType.FOOD);\r\n\t\t\t\tplayer.removeResources(ResourceType.FOOD, playerFoodAmount/2);\r\n\t\t\t\treturn \"MISCHIEVOUS UGA STUDENTS BROKE INTO YOUR STORAGE SHED AND STOLE HALF YOUR \"\r\n\t\t\t\t\t\t+ \"FOOD.\";\r\n\t\t\t} else {\r\n\t\t\t\treturn \"No event happened.\";\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"private void clearExits()\n {\n promenade.removeExit(\"up\", ossuary);\n \n ossuary.removeExit(\"down\", promenade);\n ossuary.removeExit(\"left\", forest);\n ossuary.removeExit(\"straight\", crypt);\n \n \n \n tower.removeExit(\"straight\", ramparts);\n tower.removeExit(\"down\", forest);\n \n ramparts.removeExit(\"down\", bridge);\n ramparts.removeExit(\"straight\", castle);\n \n \n prison.removeExit(\"up\", promenade);\n prison.removeExit(\"down\", sewers);\n prison.removeExit(\"straight\", deathRoom2);\n \n sewers.removeExit(\"down\", depths);\n sewers.removeExit(\"left\", deathRoom1);\n \n depths.removeExit(\"up\", sewers);\n depths.removeExit(\"right\", crypt);\n \n crypt.removeExit(\"up\", graveyard);\n crypt.removeExit(\"straight\", deathRoom3);\n crypt.removeExit(\"left\", depths);\n crypt.removeExit(\"back\", ossuary);\n \n graveyard.removeExit(\"straight\", bridge);\n graveyard.removeExit(\"down\", crypt);\n \n bridge.removeExit(\"up\", ramparts);\n bridge.removeExit(\"down\", deathRoom2);\n \n throneRoomEntrance.removeExit(\"straight\", throne);\n \n }",
"public int chooseTimeOfDay(Household hh, Person person, int tourTypeIndex ) {\n Arrays.fill(tcSample, 1);\n Arrays.fill(tcAvailability, true);\n\n setTcAvailability ( person, tcAvailability, tcSample );\n\n\n // count the number of tours in which no time-of-day alternative was available\n int noTOD = 0;\n for (int p=1; p <= tcUEC[tourTypeIndex].getNumberOfAlternatives(); p++) {\n if (tcAvailability[p]) {\n noTOD++;\n break;\n }\n }\n if (noTOD == 0) {\n noTODAvailableIndiv[tourTypeIndex]++;\n tcAvailability[1] = true;\n tcSample[1] = 1;\n tcAvailability[tcUEC[tourTypeIndex].getNumberOfAlternatives()] = true;\n tcSample[tcUEC[tourTypeIndex].getNumberOfAlternatives()] = 1;\n }\n\n\n long markTime = System.currentTimeMillis();\n // calculate the mode choice logsums for TOD choice based on chosen dest and default time periods\n hh.setTODDefaults ( TourType.NON_MANDATORY_CATEGORY, \"EaEa\" );\n tcLogsumEaEa = getMcLogsum ( hh, tourTypeIndex, TourType.NON_MANDATORY_CATEGORY );\n\n hh.setTODDefaults ( TourType.NON_MANDATORY_CATEGORY, \"EaAm\" );\n tcLogsumEaAm = getMcLogsum ( hh, tourTypeIndex, TourType.NON_MANDATORY_CATEGORY );\n\n hh.setTODDefaults ( TourType.NON_MANDATORY_CATEGORY, \"EaMd\" );\n tcLogsumEaMd = getMcLogsum ( hh, tourTypeIndex, TourType.NON_MANDATORY_CATEGORY );\n\n hh.setTODDefaults ( TourType.NON_MANDATORY_CATEGORY, \"EaPm\" );\n tcLogsumEaPm = getMcLogsum ( hh, tourTypeIndex, TourType.NON_MANDATORY_CATEGORY );\n\n hh.setTODDefaults ( TourType.NON_MANDATORY_CATEGORY, \"EaNt\" );\n tcLogsumEaNt = getMcLogsum ( hh, tourTypeIndex, TourType.NON_MANDATORY_CATEGORY );\n\n hh.setTODDefaults ( TourType.NON_MANDATORY_CATEGORY, \"AmAm\" );\n tcLogsumAmAm = getMcLogsum ( hh, tourTypeIndex, TourType.NON_MANDATORY_CATEGORY );\n\n hh.setTODDefaults ( TourType.NON_MANDATORY_CATEGORY, \"AmMd\" );\n tcLogsumAmMd = getMcLogsum ( hh, tourTypeIndex, TourType.NON_MANDATORY_CATEGORY );\n\n hh.setTODDefaults ( TourType.NON_MANDATORY_CATEGORY, \"AmPm\" );\n tcLogsumAmPm = getMcLogsum ( hh, tourTypeIndex, TourType.NON_MANDATORY_CATEGORY );\n\n hh.setTODDefaults ( TourType.NON_MANDATORY_CATEGORY, \"AmNt\" );\n tcLogsumAmNt = getMcLogsum ( hh, tourTypeIndex, TourType.NON_MANDATORY_CATEGORY );\n\n hh.setTODDefaults ( TourType.NON_MANDATORY_CATEGORY, \"MdMd\" );\n tcLogsumMdMd = getMcLogsum ( hh, tourTypeIndex, TourType.NON_MANDATORY_CATEGORY );\n\n hh.setTODDefaults ( TourType.NON_MANDATORY_CATEGORY, \"MdPm\" );\n tcLogsumMdPm = getMcLogsum ( hh, tourTypeIndex, TourType.NON_MANDATORY_CATEGORY );\n\n hh.setTODDefaults ( TourType.NON_MANDATORY_CATEGORY, \"MdNt\" );\n tcLogsumMdNt = getMcLogsum ( hh, tourTypeIndex, TourType.NON_MANDATORY_CATEGORY );\n\n hh.setTODDefaults ( TourType.NON_MANDATORY_CATEGORY, \"PmPm\" );\n tcLogsumPmPm = getMcLogsum ( hh, tourTypeIndex, TourType.NON_MANDATORY_CATEGORY );\n\n hh.setTODDefaults ( TourType.NON_MANDATORY_CATEGORY, \"PmNt\" );\n tcLogsumPmNt = getMcLogsum ( hh, tourTypeIndex, TourType.NON_MANDATORY_CATEGORY );\n\n hh.setTODDefaults ( TourType.NON_MANDATORY_CATEGORY, \"NtNt\" );\n tcLogsumNtNt = getMcLogsum ( hh, tourTypeIndex, TourType.NON_MANDATORY_CATEGORY );\n\n\n\n // assign mode choice logsums to time-of-day choice alternatives, given correspondiong time periods\n TODDataManager.logsumTcEAEA[1] = tcLogsumEaEa;\n TODDataManager.logsumTcEAEA[2] = tcLogsumEaEa;\n TODDataManager.logsumTcEAAM[3] = tcLogsumEaAm;\n TODDataManager.logsumTcEAAM[4] = tcLogsumEaAm;\n TODDataManager.logsumTcEAAM[5] = tcLogsumEaAm;\n TODDataManager.logsumTcEAMD[6] = tcLogsumEaMd;\n TODDataManager.logsumTcEAMD[7] = tcLogsumEaMd;\n TODDataManager.logsumTcEAMD[8] = tcLogsumEaMd;\n TODDataManager.logsumTcEAMD[9] = tcLogsumEaMd;\n TODDataManager.logsumTcEAMD[10] = tcLogsumEaMd;\n TODDataManager.logsumTcEAMD[11] = tcLogsumEaMd;\n TODDataManager.logsumTcEAPM[12] = tcLogsumEaPm;\n TODDataManager.logsumTcEAPM[13] = tcLogsumEaPm;\n TODDataManager.logsumTcEAPM[14] = tcLogsumEaPm;\n TODDataManager.logsumTcEAPM[15] = tcLogsumEaPm;\n TODDataManager.logsumTcEANT[16] = tcLogsumEaNt;\n TODDataManager.logsumTcEANT[17] = tcLogsumEaNt;\n TODDataManager.logsumTcEANT[18] = tcLogsumEaNt;\n TODDataManager.logsumTcEANT[19] = tcLogsumEaNt;\n TODDataManager.logsumTcEAEA[20] = tcLogsumEaEa;\n TODDataManager.logsumTcEAAM[21] = tcLogsumEaAm;\n TODDataManager.logsumTcEAAM[22] = tcLogsumEaAm;\n TODDataManager.logsumTcEAAM[23] = tcLogsumEaAm;\n TODDataManager.logsumTcEAMD[24] = tcLogsumEaMd;\n TODDataManager.logsumTcEAMD[25] = tcLogsumEaMd;\n TODDataManager.logsumTcEAMD[26] = tcLogsumEaMd;\n TODDataManager.logsumTcEAMD[27] = tcLogsumEaMd;\n TODDataManager.logsumTcEAMD[28] = tcLogsumEaMd;\n TODDataManager.logsumTcEAMD[29] = tcLogsumEaMd;\n TODDataManager.logsumTcEAPM[30] = tcLogsumEaPm;\n TODDataManager.logsumTcEAPM[31] = tcLogsumEaPm;\n TODDataManager.logsumTcEAPM[32] = tcLogsumEaPm;\n TODDataManager.logsumTcEAPM[33] = tcLogsumEaPm;\n TODDataManager.logsumTcEANT[34] = tcLogsumEaNt;\n TODDataManager.logsumTcEANT[35] = tcLogsumEaNt;\n TODDataManager.logsumTcEANT[36] = tcLogsumEaNt;\n TODDataManager.logsumTcEANT[37] = tcLogsumEaNt;\n TODDataManager.logsumTcAMAM[38] = tcLogsumEaAm;\n TODDataManager.logsumTcAMAM[39] = tcLogsumEaAm;\n TODDataManager.logsumTcAMAM[40] = tcLogsumEaAm;\n TODDataManager.logsumTcAMMD[41] = tcLogsumAmMd;\n TODDataManager.logsumTcAMMD[42] = tcLogsumAmMd;\n TODDataManager.logsumTcAMMD[43] = tcLogsumAmMd;\n TODDataManager.logsumTcAMMD[44] = tcLogsumAmMd;\n TODDataManager.logsumTcAMMD[45] = tcLogsumAmMd;\n TODDataManager.logsumTcAMMD[46] = tcLogsumAmMd;\n TODDataManager.logsumTcAMPM[47] = tcLogsumAmPm;\n TODDataManager.logsumTcAMPM[48] = tcLogsumAmPm;\n TODDataManager.logsumTcAMPM[49] = tcLogsumAmPm;\n TODDataManager.logsumTcAMPM[50] = tcLogsumAmPm;\n TODDataManager.logsumTcAMNT[51] = tcLogsumAmNt;\n TODDataManager.logsumTcAMNT[52] = tcLogsumAmNt;\n TODDataManager.logsumTcAMNT[53] = tcLogsumAmNt;\n TODDataManager.logsumTcAMNT[54] = tcLogsumAmNt;\n TODDataManager.logsumTcAMAM[55] = tcLogsumAmAm;\n TODDataManager.logsumTcAMAM[56] = tcLogsumAmAm;\n TODDataManager.logsumTcAMMD[57] = tcLogsumAmMd;\n TODDataManager.logsumTcAMMD[58] = tcLogsumAmMd;\n TODDataManager.logsumTcAMMD[59] = tcLogsumAmMd;\n TODDataManager.logsumTcAMMD[60] = tcLogsumAmMd;\n TODDataManager.logsumTcAMMD[61] = tcLogsumAmMd;\n TODDataManager.logsumTcAMMD[62] = tcLogsumAmMd;\n TODDataManager.logsumTcAMPM[63] = tcLogsumAmPm;\n TODDataManager.logsumTcAMPM[64] = tcLogsumAmPm;\n TODDataManager.logsumTcAMPM[65] = tcLogsumAmPm;\n TODDataManager.logsumTcAMPM[66] = tcLogsumAmPm;\n TODDataManager.logsumTcAMNT[67] = tcLogsumAmNt;\n TODDataManager.logsumTcAMNT[68] = tcLogsumAmNt;\n TODDataManager.logsumTcAMNT[69] = tcLogsumAmNt;\n TODDataManager.logsumTcAMNT[70] = tcLogsumAmNt;\n TODDataManager.logsumTcAMAM[71] = tcLogsumAmAm;\n TODDataManager.logsumTcAMMD[72] = tcLogsumAmMd;\n TODDataManager.logsumTcAMMD[73] = tcLogsumAmMd;\n TODDataManager.logsumTcAMMD[74] = tcLogsumAmMd;\n TODDataManager.logsumTcAMMD[75] = tcLogsumAmMd;\n TODDataManager.logsumTcAMMD[76] = tcLogsumAmMd;\n TODDataManager.logsumTcAMMD[77] = tcLogsumAmMd;\n TODDataManager.logsumTcAMPM[78] = tcLogsumAmPm;\n TODDataManager.logsumTcAMPM[79] = tcLogsumAmPm;\n TODDataManager.logsumTcAMPM[80] = tcLogsumAmPm;\n TODDataManager.logsumTcAMPM[81] = tcLogsumAmPm;\n TODDataManager.logsumTcAMNT[82] = tcLogsumAmNt;\n TODDataManager.logsumTcAMNT[83] = tcLogsumAmNt;\n TODDataManager.logsumTcAMNT[84] = tcLogsumAmNt;\n TODDataManager.logsumTcAMNT[85] = tcLogsumAmNt;\n TODDataManager.logsumTcMDMD[86] = tcLogsumMdMd;\n TODDataManager.logsumTcMDMD[87] = tcLogsumMdMd;\n TODDataManager.logsumTcMDMD[88] = tcLogsumMdMd;\n TODDataManager.logsumTcMDMD[89] = tcLogsumMdMd;\n TODDataManager.logsumTcMDMD[90] = tcLogsumMdMd;\n TODDataManager.logsumTcMDMD[91] = tcLogsumMdMd;\n TODDataManager.logsumTcMDPM[92] = tcLogsumMdPm;\n TODDataManager.logsumTcMDPM[93] = tcLogsumMdPm;\n TODDataManager.logsumTcMDPM[94] = tcLogsumMdPm;\n TODDataManager.logsumTcMDPM[95] = tcLogsumMdPm;\n TODDataManager.logsumTcMDNT[96] = tcLogsumMdNt;\n TODDataManager.logsumTcMDNT[97] = tcLogsumMdNt;\n TODDataManager.logsumTcMDNT[98] = tcLogsumMdNt;\n TODDataManager.logsumTcMDNT[99] = tcLogsumMdNt;\n TODDataManager.logsumTcMDMD[100] = tcLogsumMdMd;\n TODDataManager.logsumTcMDMD[101] = tcLogsumMdMd;\n TODDataManager.logsumTcMDMD[102] = tcLogsumMdMd;\n TODDataManager.logsumTcMDMD[103] = tcLogsumMdMd;\n TODDataManager.logsumTcMDMD[104] = tcLogsumMdMd;\n TODDataManager.logsumTcMDPM[105] = tcLogsumMdPm;\n TODDataManager.logsumTcMDPM[106] = tcLogsumMdPm;\n TODDataManager.logsumTcMDPM[107] = tcLogsumMdPm;\n TODDataManager.logsumTcMDPM[108] = tcLogsumMdPm;\n TODDataManager.logsumTcMDNT[109] = tcLogsumMdNt;\n TODDataManager.logsumTcMDNT[110] = tcLogsumMdNt;\n TODDataManager.logsumTcMDNT[111] = tcLogsumMdNt;\n TODDataManager.logsumTcMDNT[112] = tcLogsumMdNt;\n TODDataManager.logsumTcMDMD[113] = tcLogsumMdMd;\n TODDataManager.logsumTcMDMD[114] = tcLogsumMdMd;\n TODDataManager.logsumTcMDMD[115] = tcLogsumMdMd;\n TODDataManager.logsumTcMDMD[116] = tcLogsumMdMd;\n TODDataManager.logsumTcMDPM[117] = tcLogsumMdPm;\n TODDataManager.logsumTcMDPM[118] = tcLogsumMdPm;\n TODDataManager.logsumTcMDPM[119] = tcLogsumMdPm;\n TODDataManager.logsumTcMDPM[120] = tcLogsumMdPm;\n TODDataManager.logsumTcMDNT[121] = tcLogsumMdNt;\n TODDataManager.logsumTcMDNT[122] = tcLogsumMdNt;\n TODDataManager.logsumTcMDNT[123] = tcLogsumMdNt;\n TODDataManager.logsumTcMDNT[124] = tcLogsumMdNt;\n TODDataManager.logsumTcMDMD[125] = tcLogsumMdMd;\n TODDataManager.logsumTcMDMD[126] = tcLogsumMdMd;\n TODDataManager.logsumTcMDMD[127] = tcLogsumMdMd;\n TODDataManager.logsumTcMDPM[128] = tcLogsumMdPm;\n TODDataManager.logsumTcMDPM[129] = tcLogsumMdPm;\n TODDataManager.logsumTcMDPM[130] = tcLogsumMdPm;\n TODDataManager.logsumTcMDPM[131] = tcLogsumMdPm;\n TODDataManager.logsumTcMDNT[132] = tcLogsumMdNt;\n TODDataManager.logsumTcMDNT[133] = tcLogsumMdNt;\n TODDataManager.logsumTcMDNT[134] = tcLogsumMdNt;\n TODDataManager.logsumTcMDNT[135] = tcLogsumMdNt;\n TODDataManager.logsumTcMDMD[136] = tcLogsumMdMd;\n TODDataManager.logsumTcMDMD[137] = tcLogsumMdMd;\n TODDataManager.logsumTcMDPM[138] = tcLogsumMdPm;\n TODDataManager.logsumTcMDPM[139] = tcLogsumMdPm;\n TODDataManager.logsumTcMDPM[140] = tcLogsumMdPm;\n TODDataManager.logsumTcMDPM[141] = tcLogsumMdPm;\n TODDataManager.logsumTcMDNT[142] = tcLogsumMdNt;\n TODDataManager.logsumTcMDNT[143] = tcLogsumMdNt;\n TODDataManager.logsumTcMDNT[144] = tcLogsumMdNt;\n TODDataManager.logsumTcMDNT[145] = tcLogsumMdNt;\n TODDataManager.logsumTcMDMD[146] = tcLogsumMdMd;\n TODDataManager.logsumTcMDPM[147] = tcLogsumMdPm;\n TODDataManager.logsumTcMDPM[148] = tcLogsumMdPm;\n TODDataManager.logsumTcMDPM[149] = tcLogsumMdPm;\n TODDataManager.logsumTcMDPM[150] = tcLogsumMdPm;\n TODDataManager.logsumTcMDNT[151] = tcLogsumMdNt;\n TODDataManager.logsumTcMDNT[152] = tcLogsumMdNt;\n TODDataManager.logsumTcMDNT[153] = tcLogsumMdNt;\n TODDataManager.logsumTcMDNT[154] = tcLogsumMdNt;\n TODDataManager.logsumTcPMPM[155] = tcLogsumPmPm;\n TODDataManager.logsumTcPMPM[156] = tcLogsumPmPm;\n TODDataManager.logsumTcPMPM[157] = tcLogsumPmPm;\n TODDataManager.logsumTcPMPM[158] = tcLogsumPmPm;\n TODDataManager.logsumTcPMNT[159] = tcLogsumPmNt;\n TODDataManager.logsumTcPMNT[160] = tcLogsumPmNt;\n TODDataManager.logsumTcPMNT[161] = tcLogsumPmNt;\n TODDataManager.logsumTcPMNT[162] = tcLogsumPmNt;\n TODDataManager.logsumTcPMPM[163] = tcLogsumPmPm;\n TODDataManager.logsumTcPMPM[164] = tcLogsumPmPm;\n TODDataManager.logsumTcPMPM[165] = tcLogsumPmPm;\n TODDataManager.logsumTcPMNT[166] = tcLogsumPmNt;\n TODDataManager.logsumTcPMNT[167] = tcLogsumPmNt;\n TODDataManager.logsumTcPMNT[168] = tcLogsumPmNt;\n TODDataManager.logsumTcPMNT[169] = tcLogsumPmNt;\n TODDataManager.logsumTcPMPM[170] = tcLogsumPmPm;\n TODDataManager.logsumTcPMPM[171] = tcLogsumPmPm;\n TODDataManager.logsumTcPMNT[172] = tcLogsumPmNt;\n TODDataManager.logsumTcPMNT[173] = tcLogsumPmNt;\n TODDataManager.logsumTcPMNT[174] = tcLogsumPmNt;\n TODDataManager.logsumTcPMNT[175] = tcLogsumPmNt;\n TODDataManager.logsumTcPMPM[176] = tcLogsumPmPm;\n TODDataManager.logsumTcPMNT[177] = tcLogsumPmNt;\n TODDataManager.logsumTcPMNT[178] = tcLogsumPmNt;\n TODDataManager.logsumTcPMNT[179] = tcLogsumPmNt;\n TODDataManager.logsumTcPMNT[180] = tcLogsumPmNt;\n TODDataManager.logsumTcNTNT[181] = tcLogsumNtNt;\n TODDataManager.logsumTcNTNT[182] = tcLogsumNtNt;\n TODDataManager.logsumTcNTNT[183] = tcLogsumNtNt;\n TODDataManager.logsumTcNTNT[184] = tcLogsumNtNt;\n TODDataManager.logsumTcNTNT[185] = tcLogsumNtNt;\n TODDataManager.logsumTcNTNT[186] = tcLogsumNtNt;\n TODDataManager.logsumTcNTNT[187] = tcLogsumNtNt;\n TODDataManager.logsumTcNTNT[188] = tcLogsumNtNt;\n TODDataManager.logsumTcNTNT[189] = tcLogsumNtNt;\n TODDataManager.logsumTcNTNT[190] = tcLogsumNtNt;\n tcLogsumTime += (System.currentTimeMillis()-markTime);\n\n // compute time-of-day choice proportions and choose alternative\n markTime = System.currentTimeMillis();\n tc[tourTypeIndex].updateLogitModel ( hh, tcAvailability, tcSample );\n\n int chosenTODAlt;\n try {\n chosenTODAlt = tc[tourTypeIndex].getChoiceResult();\n }\n catch (ModelException e) {\n chosenTODAlt = SeededRandom.getRandom() < 0.5 ? 1 : 190;\n }\n tcTime += (System.currentTimeMillis()-markTime);\n return chosenTODAlt;\n }",
"private void aimlessScout() {\n\t\ttargetFlower = null;\n\t\t// if bee is sufficiently far from flower, look for other flowers\n\t\tif((clock.time - tempTime) > 0.15) {\n\t\t\tstate = \"SCOUTING\";\n\t\t}\n\t\t// otherwise keep flying\n\t\telse{\n\t\t\tcurrentAngle += RandomHelper.nextDoubleFromTo(-Math.PI/8, Math.PI/8);\n\t\t\tspace.moveByVector(this, 4, currentAngle,0);\n\t\t\tNdPoint myPoint = space.getLocation(this);\n\t\t\tgrid.moveTo(this, (int) myPoint.getX(), (int) myPoint.getY());\n\t\t\t//energy -= exhaustionRate;\n\t\t\tfood -= highMetabolicRate;\n\t\t}\n\t}",
"static void door2challenge_rightpath() {\n System.out.println(\"You met a creature...\");\n System.out.println(\"Get ready to RIP!!!\");\n player_fights();\n //after you beat the creature...\n System.out.println(\"You killed it!!! \" + username + \"You are on a roll!\");\n enter = next.nextLine();\n System.out.println(\"There is a straight path ahead take the path and continue to survive long enough to escape the creatures\");\n System.out.println(\"grasp...\");\n enter = next.nextLine();\n //when you take that straight path...\n System.out.println(\"It looks safe here... Shall we continue?\");\n answer = responses.nextLine();\n //Choice doesn't matter...you still have to continue\n System.out.println(\"No time to think \" + username + \" the creatures are behind you...run\");\n enter = next.nextLine();\n System.out.println(\"There are two diverging paths. Do you want to take the left or the right path?\");\n answer = next.nextLine();\n if(answer.contains(\"left\")) {\n System.out.println(\"You met a creature!\");\n System.out.println(username + \", prepare yourself...\");\n enter = next.nextLine();\n player_fights();\n //after you beat the monster you will go into another method which is a linked path...\n System.out.println(\"Congratulations you beat the monster\"); {\n door2_linkedpath(); //this is the linked path with the straight path branch.\n }\n }else if (answer.contains(\"right\")) {\n System.out.println(\"OH NO!!!\" + username + \" fell into the hole with razor sharp knives \");\n backtocheckpoint1_version2();\n \n }else{ //in case if the player mistypes the code, they will be punished by getting dragged back to an earlier checkpoint\n System.out.println(username +\" Please retype your response correctly. \");\n System.out.println(\"There is no horse playing at a time like this... \");\n System.out.println(\"The monsters dragged you back...Luckily you escaped\");\n enter = next.nextLine();\n System.out.println(\"Looks like you're back to the place where you just made your decision of taking the right path\");\n door2challenge_rightpath(); \n }\n \n \n }",
"public void eisagwgiSintagis() {\n\t\t//Elegw ean mporei na eisaxthei suntagi\n\t\tif(numOfMedicine != 0 && numOfDoctors != 0 && numOfPatient != 0 && numOfPrescription < 1000) \n\t\t{\n\t\t\ttmp_1 = numOfPrescription + 1;\n\t\t\t// Emfanizw to synolo twn giatrwn pou yparxoun sto farmakeio\n\t\t\tfor(i = 0; i < numOfDoctors; i++)\n\t\t\t{\n\t\t\t\tSystem.out.println();\n\t\t\t\tSystem.out.println(i + \". STOIXEIA IATROU: \");\n\t \t \tdoctor[i].print();\n\t \t \tSystem.out.println();\n\t\t\t}\n\t\t\t// O xristis epilegei ton ari8mo pou antistoixei ston giatro pou egrapse thn syntagh\n\t\t\ttmp_1 = sir.readPositiveInt(\"EPILEKSTE TON GIATRO POU EGGRAPSE THN SYNTAGH: \"); \n\t\t\t// Elegxw an o yparxei o giatros pou edwse o xristis\n\t\t\twhile(tmp_1 < 0 || tmp_1 > numOfDoctors - 1)\n\t \t {\n\t\t\t\ttmp_1 = sir.readPositiveInt(\"DEN YPARXEI GIATROS ME TO NOUMERO POU PLIKTROLOGISATE! PARAKALW KSANADWSTE ARITHMO: \");\n\t\t\t\tSystem.out.println();\n\t \t }\n\t\t\t\n\t\t\ti = numOfPrescription + 1;\n\t\t\t// Emfanizw to synolo twn asthenwn pou yparxoun sto farmakeio\n\t\t\tfor(i = 0; i < numOfPatient; i++)\n\t\t {\n\t\t\t\tSystem.out.println();\n\t\t\t\tSystem.out.println(i + \". STOIXEIA ASTHENOUS: \");\n\t patient[i].print();\n\t System.out.println();\n\t\t }\n\t\t\t// O xristis epilegei ton ari8mo pou antistoixei ston as8enh gia ton opoio proorizetai i syntagh\n\t\t\ti = sir.readPositiveInt(\"EPILEKSTE TON ASTHENH GIA TON OPOIO PROORIZETAI H SYNTAGH: \"); \n\t\t\t// Elegxw an o yparxei o as8enhs pou edwse o xristis\n\t\t\twhile(i < 0 || i > numOfPatient - 1)\n\t \t {\n\t\t\t\ti = sir.readPositiveInt(\"DEN YPARXEI ASTHENHS ME TO NOUMERO POU PLIKTROLOGISATE! PARAKALW KSANADWSTE ARITHMO: \");\n\t\t\t\tSystem.out.println();\n\t \t }\n\t\t\t\n\t\t\t// O xristis eisagei tn synoliko ar8mo farmakwn pou 8a exei h syntagh\n\t\t\tSystem.out.println();\n\t\t\ttmp_2= sir.readPositiveInt(\"EISAGETAI TON ARITHMO TWN FARMAKWN POU EPITHUMEITAI NA EXEI H SYNTAGH(1-6): \");\n\t\t\t// Elegxw an o ari8mos twn farmakwn pou edwse o xristis einai egkyros\n\t\t\twhile(tmp_2 < 0 || tmp_2 > 6)\n\t \t {\n\t\t\t\ttmp_2 = sir.readPositiveInt(\"PARAKALW KSANAEISAGETAI SYNOLIKO ARITHMO FARMAKWN(1-6): \");\n\t\t\t\tSystem.out.println();\n\t \t }\n\t\t\t// Apo8ikeuw tis times ston constructor Syntagi\n\t\t\tprescription[numOfPrescription] = new Syntagi(doctor[tmp_1], patient[i], sir.readDate(\"\\nEISAGETAI THN HMEROMHNIA EGGRAFHS THS SYNTAGHS: \"), tmp_2);\n\t\t\t\n\t\t\tprescription[numOfPrescription].dimiourgiaPinakaFarmakwn(); // Kalw tin methodo auti gia na dimiourgisw ton pinaka me ton arithmo twn farmakwn pou mou edwse o xrhsths\n\t\t\t\n\t\t\t// Emfanizw to synolo twn farmakwn\n\t\t\tfor(i = 0; i < numOfMedicine; i++)\n\t\t\t{\n\t\t\t\tSystem.out.println();\n\t\t\t\tSystem.out.println(i + \". STOIXEIA FARMAKOU: \");\n\t\t\t\tmedicine[i].print();\n\t\t\t}\n\t\t\t\n\t\t\tfor(i = 0; i < tmp_2; i++)\n \t \t{\n\t\t\t\ta = i + 1; \n\t\t\t\t// An h syntagh apoteleitai apo perissotera tou enos farmaka tote...\n\t\t\t\tif(tmp_2 != 1)\n \t \t \t{\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t\ttmp_1 = sir.readPositiveInt(\"ARITHMOS \" + a + \"ou FARMAKOU: \");\n\t\t\t\t\ttmp_3 = sir.readPositiveInt(\"POSOTHTA \" + a + \"ou FARMAKOU: \");\n \t \t \tSystem.out.println();\n \t \t \t}\n\t\t\t\t// An h syntagh apoteleitai apo ena farmako tote...\n\t\t\t\telse\n \t \t \t{\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t\ttmp_1 = sir.readPositiveInt(\"ARITHMOS FARMAKOU: \");\n\t\t\t\t\ttmp_3 = sir.readPositiveInt(\"POSOTHTA FARMAKOU: \");\n \t \t\t \tSystem.out.println();\n \t \t \t}\n \t \t \t// Elegxw an o ari8mos pou edwse o xristis einai egkyros\n\t\t\t\twhile(tmp_1 < 0 || tmp_1 > numOfMedicine - 1)\n \t \t \t{\n \t \t \t\ttmp_1 = sir.readPositiveInt(\"EISAGATAI LATHOS DEDOMENA!DWSTE KSANA TIMH: \");\n \t \t\t \tSystem.out.println();\n \t \t \t}\n \t \t \t\n\t\t\t\tprescription[numOfPrescription].gemismaPinakaFarmakwn(i, medicine[tmp_1], tmp_3); // Kalw tin methodo auti gia na gemisw ton pinaka twn farmakwn pou dimiourgisa proigoumenws\n \t \t}\n\t\t\tnumOfPrescription++;\n\t\t}\n\t\t// Elegxw pote den mporei na eisaxthei syntagh\n\t\telse\n\t\t{\n\t\t\t// An oi syntages pou exoun eisaxthei xeperasan to epitrepto orio\n\t\t\tif(numOfPrescription >= 1000)\n \t\t \t{\n \t\t\t\tSystem.out.print(\"DEN MPOREITAI NA EISAGETAI ALLES SYNTAGES!EXEI KALIFTHEI O MEGISTOS ARITHMOS TOUS\");\n \t\t\t\tSystem.out.println();\n \t\t \t}\n\t\t\t// An den yparxoun iatroi, astheneis kai farmaka sto farmakeio\n\t\t\telse if(numOfDoctors == 0 && numOfPatient == 0 && numOfMedicine == 0)\n \t\t \t{\n \t\t\t\tSystem.out.print(\"DEN YPARXOUN DIATHESIMOI GIATROI, ASTHENEIS KAI FARMAKA WSTE NA OLOKLIRWTHEI H EISAGWGH SYNTAGHS!PARAKALW EISAGETAI GIATROUS, ASTHENEIS KAI FARMAKA!\");\n \t\t\t\tSystem.out.println();\n \t\t \t}\n\t\t\t// An den yparxoun iatroi kai astheneis\n\t\t\telse if(numOfDoctors == 0 && numOfPatient == 0)\n \t \t{\n\t\t\t\tSystem.out.print(\"DEN YPARXOUN DIATHESIMOI GIATROI KAI ASTHENEIS GIA NA OLOKLHRWTHEI H EISAGWGH SYNTAGHS!PARAKALW EISAGETAI GIATROUS KAI ASTHENEIS!\");\n \t \t \tSystem.out.println();\n \t \t}\n\t\t\t// An den yparxoun iatroi kai farmaka\n\t\t\telse if(numOfDoctors == 0 && numOfMedicine == 0)\n \t \t{\n\t\t\t\tSystem.out.print(\"DEN YPARXOUN DIATHESIMOI GIATROI KAI FARMAKA GIA NA OLOKLHRWTHEI H EISAGWGH SYNTAGHS!PARAKALW EISAGETAI GIATROUS KAI FARMAKA!\");\n \t \t \tSystem.out.println();\n \t \t}\n\t\t\t// An den yparxoun astheneis kai farmaka\n\t\t\telse if(numOfPatient == 0 && numOfMedicine == 0)\n \t \t{\n\t\t\t\tSystem.out.print(\"DEN YPARXOUN DIATHESIMOI ASTHENEIS KAI FARMAKA GIA NA OLOKLHRWTHEI H EISAGWGH SYNTAGHS!PARAKALW EISAGETAI ASTHENEIS KAI FARMAKA!\");\n \t \t \tSystem.out.println();\n \t \t}\n\t\t\t// An den yparxoun iatroi\n\t\t\telse if (numOfDoctors == 0)\n \t\t \t{\n \t\t\t\tSystem.out.print(\"DEN YPARXOUN DIATHESIMOI GIATROI GIA NA OLOKLHRWTHEI H EISAGWGH SYNTAGHS!PARAKALW EISAGETAI GIATROUS!\");\n \t\t\t\tSystem.out.println();\n \t\t \t}\n \t\t \t// An den yparxoun astheneis\n\t\t\telse\n \t\t \t{\n \t\t\t\tSystem.out.print(\"DEN YPARXOUN DIATHESIMOI ASTHENEIS GIA NA OLOKLHRWTHEI H EISAGWGH SYNTAGHS!PARAKALW EISAGETAI ASTHENEIS!\");\n \t\t\t\tSystem.out.println();\n \t\t \t}\n\t\t}\n\t}",
"public void start4()\n\t{\n\t\tSystem.out.println();\n\t\tplugboard.clear();\n\t\taddPlug('Q', 'F');\n\t\t\n\t\tTurnoverRotor turnoverRotor1 = new TurnoverRotor(\"I\", 23);\n\t\tTurnoverRotor turnoverRotor2 = new TurnoverRotor(\"II\", 11);\n\t\tTurnoverRotor turnoverRotor3 = new TurnoverRotor(\"III\", 7);\n\t\t\n\t\tturnoverRotor1.setNextRotor(turnoverRotor2);\n\t\tturnoverRotor2.setNextRotor(turnoverRotor3);\n\t\tturnoverRotor3.setNextRotor(null);\n\t\t\n\t\taddRotor(turnoverRotor1, 0);\n\t\taddRotor(turnoverRotor2, 1);\n\t\taddRotor(turnoverRotor3, 2);\n\t\t\n\t\treflector = new Reflector(\"ReflectorI\");\n\t\taddReflector(reflector);\n\t\t\n\t\tString encodedMessage = \"OJVAYFGUOFIVOTAYRNIWJYQWMXUEJGXYGIFT\";\n\t\t\n\t\t//loops through each character from the string and decodes it\n\t\tfor (char character: encodedMessage.toCharArray())\n\t\t{\n\t\t\tcharacter = encodeLetter(character);\n\t\t\tSystem.out.print(character);\n\t\t}\n\t}",
"private void dayLoop(Player p){\r\n\t\t//Loop for every day.\r\n\t\tSystem.out.println(\"*******************\");\r\n\t\tSystem.out.println(\"It is now \" + p.getName() + \"'s turn on this day.\");\r\n\t\twhile(p.getActions() > 0){\r\n\t\t\tSystem.out.println(\"Choose what you're going to do with the day.\");\r\n\t\t\tSystem.out.println(p.getName() + \" has \" + p.getActions() + \" actions left for the day.\");\r\n\t\t\tSystem.out.println(\"1. Play with a pet.\");\r\n\t\t\tSystem.out.println(\"2. Feed a pet.\");\r\n\t\t\tSystem.out.println(\"3. Go to the store.\");\r\n\t\t\tSystem.out.println(\"4. Print out pet status.\");\r\n\t\t\tSystem.out.println(\"5. End the day early.\");\r\n\t\t\tint selected = getNumber(1,5);\r\n\t\t\tswitch(selected){\r\n\t\t\t//Playing with a pet.\r\n\t\t\tcase 1:\r\n\t\t\t\tplay(p);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\t//Feeding a pet.\r\n\t\t\tcase 2:\r\n\t\t\t\tfeed(p);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\t//Code for the store.\r\n\t\t\tcase 3:\r\n\t\t\t\tstoreTrip(p);\r\n\t\t\t\tbreak;\r\n\t\t\t\t//Print Pet Status\r\n\t\t\tcase 4:\r\n\t\t\t\tfor(Pet pet : p.getPets()){\r\n\t\t\t\t\tSystem.out.println(pet.printStatus());\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\t//Print Player inventory.\r\n\t\t\tcase 5:\r\n\t\t\t\tp.printInventory();\r\n\t\t\t\t//Finish the day early.\r\n\t\t\tcase 6:\r\n\t\t\t\tp.setActions(0);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tSystem.out.println(\"Fatal Error.\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tendDay(p);\r\n\t}",
"private String goodEventHelper(Player player) {\r\n\t\tdouble goodEventRoll = rand.nextDouble();\r\n\t\tif (goodEventRoll <= 0.25) {\r\n\t\t\tplayer.addResources(ResourceType.FOOD, 3);\r\n\t\t\tplayer.addResources(ResourceType.ENERGY, 2);\r\n\t\t\treturn \"YOU JUST RECEIVED A PACKAGE FROM THE GT ALUMNI CONTAINING 3 FOOD AND 2 \"\r\n\t\t\t\t\t+ \"ENERGY UNITS.\";\r\n\t\t}\r\n\t\tif (goodEventRoll <= 0.5) {\r\n\t\t\tplayer.addResources(ResourceType.SMITHORE, 2);\r\n\t\t\treturn \"A WANDERING TECH STUDENT REPAID YOUR HOSPITALITY BY LEAVING TWO BARS OF \"\r\n\t\t\t\t\t+ \"ORE.\";\r\n\t\t}\r\n\t\t\r\n\t\tint price = RANDOMEVENTPRICEMODIFIER[data.getRoundNum()];\r\n\t\tif (goodEventRoll <= 0.75) {\r\n\t\t\tprice *= 8;\r\n\t\t\tplayer.addMoney(price);\r\n\t\t\treturn \"THE MUSEUM BOUGHT YOUR ANTIQUE PERSONAL COMPUTER FOR \" + price +\".\";\r\n\t\t} else {\r\n\t\t\tprice *= 2;\r\n\t\t\tplayer.addMoney(price);\r\n\t\t\treturn \"YOU FOUND A DEAD MOOSE RAT AND SOLD THE HIDE FOR \" + price + \".\";\r\n\t\t}\r\n\t}",
"private void showFacts() {\n\t\tSystem.out.println(\"=============================\");\n\t\tSystem.out.println(\"Your lose! Try harder and better luck next time.\");\n\t}",
"private void busquets() {\n\t\ttry {\n\t\t\tThread.sleep(5000); // espera, para dar tempo de ver as mensagens iniciais\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tint xInit = -25;\n\t\tint yInit = -10;\n\t\tplayerDeafaultPosition = new Vector2D(xInit*selfPerception.getSide().value(), yInit *selfPerception.getSide().value());\n\t\t\n\t\twhile (commander.isActive()) {\n\t\t\tupdatePerceptions(); // deixar aqui, no começo do loop, para ler o resultado do 'move'\n\t\t\tswitch (matchPerception.getState()) {\n\t\t\tcase BEFORE_KICK_OFF:\n\t\t\t\tcommander.doMoveBlocking(xInit, yInit);\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase PLAY_ON:\n\t\t\t\tstate = State.ATTACKING;\n\t\t\t\texecuteStateMachine();\n\t\t\t\tbreak;\n\t\t\tcase KICK_OFF_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase KICK_OFF_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\t//if(closer)\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CORNER_KICK_LEFT: // escanteio time esquerdo\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CORNER_KICK_RIGHT: // escanteio time direito\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase KICK_IN_LEFT: // lateral time esquerdo\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\tcase KICK_IN_RIGHT: // lateal time direito\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_LEFT: // Tiro livre time esquerdo\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_RIGHT: // Tiro Livre time direito\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_FAULT_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_FAULT_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase GOAL_KICK_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase GOAL_KICK_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase AFTER_GOAL_LEFT:\n\t\t\t\tcommander.doMoveBlocking(xInit, yInit);\t\n\t\t\t\tbreak;\n\t\t\tcase AFTER_GOAL_RIGHT:\n\t\t\t\tcommander.doMoveBlocking(xInit, yInit);\t\n\t\t\t\tbreak;\n\t\t\tcase INDIRECT_FREE_KICK_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase INDIRECT_FREE_KICK_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}",
"@Test\n public void bestowWithFusedSpell() {\n addCard(Zone.BATTLEFIELD, playerA, \"Mountain\", 2);\n /**\n * Cyclops of One-Eyed Pass {2}{R}{R} Creature - Cyclops 5/2\n */\n addCard(Zone.BATTLEFIELD, playerA, \"Cyclops of One-Eyed Pass\");\n\n /**\n * Nyxborn Rollicker {R} Enchantment Creature - Satyr 1/1 Bestow {1}{R}\n * (If you cast this card for its bestow cost, it's an Aura spell with\n * enchant creature. It becomes a creature again if it's not attached to\n * a creature.) Enchanted creature gets +1/+1.\n */\n addCard(Zone.HAND, playerA, \"Nyxborn Rollicker\");\n\n addCard(Zone.BATTLEFIELD, playerB, \"Swamp\", 3);\n addCard(Zone.BATTLEFIELD, playerB, \"Island\", 2);\n\n // Instant\n // Far {1}{U} Return target creature to its owner's hand.\n // Away {2}{B} Target player sacrifices a creature.\n // Fuse (You may cast one or both halves of this card from your hand.)\n addCard(Zone.HAND, playerB, \"Far // Away\");\n\n castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, \"Nyxborn Rollicker using bestow\", \"Cyclops of One-Eyed Pass\");\n\n castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, \"fused Far // Away\");\n addTarget(playerB, \"Cyclops of One-Eyed Pass\"); // Far\n addTarget(playerB, playerA); // Away\n addTarget(playerA, \"Nyxborn Rollicker\");\n\n setStrictChooseMode(true);\n setStopAt(1, PhaseStep.END_TURN);\n execute();\n\n assertHandCount(playerA, \"Cyclops of One-Eyed Pass\", 1);\n assertHandCount(playerB, 0);\n\n assertGraveyardCount(playerB, \"Far // Away\", 1);\n\n assertPermanentCount(playerA, \"Nyxborn Rollicker\", 0);\n assertGraveyardCount(playerA, \"Nyxborn Rollicker\", 1);\n\n }",
"private static void playHuman(int dimension, int numMines) {\n\t\tBoard board = new Board(dimension, numMines);\n\t\twhile (!board.checkSolved()) {\n\t\t\tint xPos = getValueConsole(\"What X position should be digged?\", dimension - 1);\n\t\t\tint yPos = getValueConsole(\"What Y position should be digged?\", dimension - 1);\n\n\t\t\t// most uncover location and then check if it is dangerous\n\t\t\tboard.uncoverLocation(xPos, yPos);\n\n\t\t\tif (board.isDangerous(xPos, yPos)) {\n\t\t\t\tSystem.out.println(\"Boom! You have exploded\");\n\t\t\t\tSystem.out.println(board.stringFail());\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tSystem.out.println(board);\n\t\t}\n\t\tSystem.out.println(\"Congratulations! you have won the game!\");\n\t}",
"private void eatPreparedDessert(double eatingTime) {\n\t\t// Obtain the dry mass of the dessert\n\t\tdouble dryMass = nameOfDessert.getDryMass();\n\t\t// Proportion of dessert being eaten over this time period.\n\t\tdouble proportion = person.getEatingSpeed() * eatingTime;\n\n\t\tif (cumulativeProportion > dryMass) {\n\t\t\tdouble excess = cumulativeProportion - dryMass;\n\t\t\tcumulativeProportion = cumulativeProportion - excess;\n\t\t\tproportion = proportion - excess;\n\t\t}\n\t\t\n\t\tif (proportion > MIN) {\n\t\t\n\t\t\t// Dessert amount eaten over this period of time.\n\t//\t\tdouble dessertAmount = dessertConsumptionRate * dessertProportion;\n\t\t\tUnit containerUnit = person.getTopContainerUnit();\n\t\t\t\n\t\t\tif (containerUnit != null) {\n\t\t\t\tInventory inv = containerUnit.getInventory();\n\t\t\t\t\n\t\t\t\t// Take dessert resource from inventory if it is available.\n\t\t\t\tboolean hasDessert = false;\n\t\t\t\tif (inv != null) {\n\t\t\t\t\t// Add to cumulativeProportion\n\t\t\t\t\tcumulativeProportion += proportion;\n\t\t\t\t\t\n\t\t\t\t\thasDessert = Storage.retrieveAnResource(proportion, nameOfDessert.getName(), inv, true);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (hasDessert) {\n\t\t\t\t\t// Consume water\n\t\t\t\t\tconsumeDessertWater(dryMass);\n\t\t\t\t\t\n\t\t\t\t\t// dessert amount eaten over this period of time.\n\t\t\t\t\tdouble hungerRelieved = RATIO * proportion / dryMass;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t// Consume unpreserved dessert.\n//\t\t\t\t\tlogger.info(person + \" ate \" + nameOfDessert.getName()\n//\t\t\t\t\t\t\t+ \" hungerRelieved : \" + hungerRelieved);\n\t\t\t\t\treduceHunger(hungerRelieved);\n\t\t\t\t\t\n\t\t\t\t\t// Reduce person's stress after eating a prepared dessert.\n\t\t\t\t\t// This is in addition to normal stress reduction from eating task.\n\t\t\t\t\tdouble stressModifier = DESSERT_STRESS_MODIFIER * (nameOfDessert.getQuality() + 1D);\n\t\t\t\t\tdouble newStress = condition.getStress() + (stressModifier * eatingTime);\n\t\t\t\t\tcondition.setStress(newStress);\n\t\t\t\n\t\t\t\t\t// Add caloric energy from dessert.\n\t\t\t\t\tdouble caloricEnergy = proportion / dryMass * PhysicalCondition.FOOD_COMPOSITION_ENERGY_RATIO;\n\t\t\t\t\tcondition.addEnergy(caloricEnergy);\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t// Not enough dessert resource available to eat.\n\t//\t\t\t\tresult = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"private double eatingMealPhase(double time) {\n\t\tdouble remainingTime = 0D;\n\t\tdouble eatingTime = time;\n\t\t\n\t\tif ((totalEatingTime + eatingTime) >= eatingDuration) {\n\t\t\teatingTime = eatingDuration - totalEatingTime;\n\t\t}\n\n\t\tif (!person.isInVehicle()) {\n\t\n\t\t\tif (eatingTime > 0D) {\n\t\n\t\t\t\tif (cookedMeal != null) {\n\t\t\t\t\t// Set descriptoin for eating cooked meal.\n\t\t\t\t\tsetDescription(Msg.getString(\"Task.description.eatDrink.cooked.eating.detail\", cookedMeal.getName())); //$NON-NLS-1$\n\t\t\t\t\t// Eat cooked meal.\n\t\t\t\t\teatCookedMeal(eatingTime);\n\t\t\t\t\t\n\t\t\t\t\tif (cumulativeProportion > cookedMeal.getDryMass()) {\n\t\t\t\t\t\tendTask();\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t// If finished eating, change to dessert phase.\n\t\t\t\t\tif (eatingTime < time) {\n//\t\t\t\t\t\tsetPhase(PICK_UP_DESSERT);// EATING_DESSERT);\n\t\t\t\t\t\tremainingTime = time - eatingTime;\n\t\t\t\t\t}\n\n\t\t\t\t\ttotalEatingTime += eatingTime;\n\n\t\t\t\t\tif (totalEatingTime > getDuration())\n\t\t\t\t\t\tendTask();\n\t\t\t\t\t\n\t\t\t\t\tconsumeWater(false);\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t// Eat preserved food if available\n\t\t\t\t\tboolean enoughFood = eatPreservedFood(eatingTime);\n\t\n\t\t\t\t\t// If not enough preserved food available, change to dessert phase.\n\t\t\t\t\tif (!enoughFood) {\n\t\t\t\t\t\tsetPhase(PICK_UP_DESSERT);\n\t\t\t\t\t\tremainingTime = time * .75;\n\t\t\t\t\t\treturn remainingTime;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// Report eating preserved food.\n\t\t\t\t\t\tsetDescription(Msg.getString(\"Task.description.eatDrink.preserved\")); //$NON-NLS-1$\n\n\t\t\t\t\t\tremainingTime = time * .75;\n\t\t\t\t\t\treturn remainingTime;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn remainingTime;\n\t}",
"public void diagrafiAstheni() {\n\t\tif(numOfPatient != 0)\n\t\t{\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(\" STOIXEIA ASTHENWN\");\n\t\t\t// Emfanizw olous tous astheneis\n\t\t\tfor(int j = 0; j < numOfPatient; j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(\"\\n \" + j + \". STOIXEIA ASTHENOUS: \");\n\t\t\t\tSystem.out.println();\n\t \t \tpatient[j].print();\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t\ttmp_1 = sir.readPositiveInt(\"DWSTE TON ARITHMO TOU ASTHENH POU THELETAI NA DIAGRAFEI: \");\n\t\t\tSystem.out.println();\n\t\t\t// Elegxos egkyrotitas tou ari8mou pou edwse o xristis\n\t\t\twhile(tmp_1 < 0 || tmp_1 > numOfPatient)\n\t\t\t{\n\t\t\t\ttmp_1 = sir.readPositiveInt(\"KSANAEISAGETAI ARITHMO ASTHENOUS: \");\n\t\t\t}\n\t\t\t// Metakinw tous epomenous astheneis mia 8esi pio aristera\n\t\t\tfor(int k = tmp_1; k < numOfPatient - 1; k++)\n\t\t\t{\n\t\t\t\tpatient[k] = patient[k+1]; // Metakinw ton astheni sti 8esi k+1 pio aristera\n\t\t\t}\n\t\t\tnumOfPatient--; // Meiwse ton ari8mo twn asthenwn\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.print(\"\\nDEN YPARXOUN DIATHESIMOI ASTHENEIS PROS DIAGRAFH!\\n\");\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"public void Instructions ()\n {\n\tSystem.out.println (\"\\nA WILD TANGELA APPEARS!!!\");\n\tSystem.out.println (\" _____ ____\");\n\tSystem.out.println (\" ,\\\"' `. ,-\\\"' `\\\". ,.\");\n\tSystem.out.println (\" . ,---. |,' _... . | `.\");\n\tSystem.out.println (\" _.---'`'\\\"-._ | / .'.---`. ' ' |\");\n\tSystem.out.println (\" ,' `| /...-._____ | |`\\\".' |\");\n\tSystem.out.println (\" / _,---+-. ,' `-. || ' `..-.._\");\n\tSystem.out.println (\" . ,`._ `.`,'. _... \\\\` . `. `. `-.\");\n\tSystem.out.println (\" |_,.-...`---\\\"'| ,`.| .\\\"` \\\\`.`. `. \\\\ \\\\\");\n\tSystem.out.println (\" , ,' | | | | \\\\ \\\\ `.`._ `. \\\\`. .\");\n\tSystem.out.println (\"| \\\\ ' __......-\\\"| | | |`._\\\\ '. `\\\"-`. . . \\\\,\\\"'-._\");\n\tSystem.out.println (\"| `\\\"'| .\\\"' ___ | | ' `-...\\\\...|_`.._ | |..:-' `.\");\n\tSystem.out.println (\" `-..-| . .\\\" _`+.,' | `._ `-.,' | ,+\\\"|`. |\");\n\tSystem.out.println (\" ,' ,| | ,' ,\\\"' __,' `'\\\"\\\"\\\"\\\"'`-. . ,'...-' | | | |\");\n\tSystem.out.println (\". / ` | | . ,-'\\\"' ____ `. |-'-.| | ',' `'\");\n\tSystem.out.println (\"| | \\\\ | | | .' ,-'\\\"\\\"'-. ,'\\\" `. | |. | |__ ,.\");\n\tSystem.out.println (\"' `. `| ' | | .' \\\\ . | | `.`. ' . `\\\"-.' |\");\n\tSystem.out.println (\" \\\\ |\\\\`-..| .`.| | () | | () ' `._ ,.' \\\\ `---' ,\");\n\tSystem.out.println (\" `| `--\\\" | | ' ' ' . .' | |.____,' \\\\\");\n\tSystem.out.println (\" `. ,' ' `. _,' `. ___.'_..,' | | | `. .\");\n\tSystem.out.println (\" `-...-' .' _... `---\\\" _....._ _.'\\\" `..'| | | | |\");\n\tSystem.out.println (\" ,' _.\\\" ,' | .-' ___ `' _.. `/| |`.| | '\");\n\tSystem.out.println (\" ' ,'/ / _,.' ,' .-' `\\\". \\\\,' `. | . ` . ' /\");\n\tSystem.out.println (\" . ,` ' .' ' |/ / ____/ \\\\ . ,-\\\"'| '-.`.__,',' ,'\");\n\tSystem.out.println (\" | | | || |`-..\\\"/ /`.'\\\" / . |' _,' /. `. .\\\"' .'`..__,.\");\n\tSystem.out.println (\" ` `.|_..' `._ / / `._ / /| | ,'/ / \\\\ \\\\ ,\\\"._ _,'\");\n\tSystem.out.println (\" ,`. \\\\ `-._/ `. `-.,' | |. / ,' /. \\\\' __`--\\\"\");\n\tSystem.out.println (\" | |-..,.\\\"| `-._ `. `, \\\", '-j . ,',`. `\\\"' '\");\n\tSystem.out.println (\" | | `. `-../ `-. `.' `\\\"+-..' .' | |_,'.\\\" | | `._, '\");\n\tSystem.out.println (\" ' `-._ `._.' / `. | _,' |\\\"'|`-..| | | | | `\\\"\\\"\");\n\tSystem.out.println (\" `._ `\\\"' _.|__.-| |\\\" `---| '. | '.,' `.'\");\n\tSystem.out.println (\" `-.....-\\\"' |___, ' `. \\\\`+-`. `.\");\n\tSystem.out.println (\" .' ' / / \\\"'/ `\\\"--'-._\");\n\tSystem.out.println (\" _,: ,' `-\\\". . `._\");\n\tSystem.out.println (\" ,-' `\\\" | | `.\");\n\tSystem.out.println (\" ,' | ' `.\");\n\tSystem.out.println (\" / _,' `._ |\");\n\tSystem.out.println (\" | _,\\\" `-..__ _,'\");\n\tSystem.out.println (\" `. __..-' `\\\"\\\"\\\"`\\\"''\");\n\tSystem.out.println (\" `-----\\\"' mh\");\n\tspeed (45, 500, \"\\nIt challenges you to a drawing game, it seems you'll have to accept!\");\n\tspeed (45, 500, \"\\n\");\n\tspeed (45, 500, \"\\nThe goal of the drawing game is to be the first to draw the art in the correct order. \\nIn our game, we will draw a Stick Figure! \\nTo be able to draw a body part, you need to roll the correct number at the correct time. \");\n\tspeed (45, 500, \"\\n\");\n\tspeed (45, 500, \"\\nBody = 1\");\n\tspeed (45, 500, \"\\nHead = 2\");\n\tspeed (45, 500, \"\\nLeft Leg = 3\");\n\tspeed (45, 500, \"\\nRight Leg = 4\");\n\tspeed (45, 500, \"\\nLeft Arm = 5\");\n\tspeed (45, 500, \"\\nRight Arm= 6\");\n\n\tspeed (45, 500, \"\\nYou must roll the number's 1 through 6 in order \\nIf you don't roll what you're looking for, the turn passes on to your opponent\");\n\tspeed (45, 500, \"\\n\");\n }",
"private void handleStandardGameplay(float deltaTime) {\n\t\t// Decrease time to next revived enemy\n\t\tmSpawnTime--;\n\n\t\t// Accumulate time elapsed while playing\n\t\tmRoundTimeElapsed += deltaTime;\n\n\t\t/**\n\t\t * Input Handling\n\t\t * When the screen is touched, kill touched attackers\n\t\t */\n\t\tif(Gdx.input.justTouched()) {\n\t\t\t// Grab the touch position, saved as a Vector3\n\t\t\tmLastTouch.set(Gdx.input.getX(), Gdx.input.getY(), 0);\n\t\t\tmCamera.unproject(mLastTouch); // Translates to game world coordinates\n\n\t\t\t// Find the first attacker located at the touch position, if any\n\t\t\tint indexOfAttacker = getFirstAttackerAt(mLastTouch.x, mLastTouch.y);\n\t\t\t// If the index is greater than negative one, kill the attacker and add points\n\t\t\tif(indexOfAttacker > -1){\n\t\t\t\tmAttackers[indexOfAttacker].kill();\n\t\t\t\tmLivingAttackerCount--;\n\t\t\t\tmMonsterHouseSpawn--;\n\t\t\t\tmRoundScore += 100f;\n\t\t\t\tif(indexOfAttacker > ATTACKER_HALF_SIZE - 1)\n\t\t\t\t\tmRoundScore += 150f; // 150 Bonus points for killing a knight\n\t\t\t}\n\t\t}\n\n\t\t// Spawns a new enemy once the respawn timer hits less than 0\n\t\tif(mSpawnTime <0) {\n\t\t\t// Revive an attacker\n\t\t\treviveAttacker();\n\n\t\t\t// Randomly select a new respawn timer within min and max bounds\n\t\t\tmSpawnTime = mRandom.nextInt(mSpawnTimeMax - mSpawnTimeMin + 1) + mSpawnTimeMin;\n\t\t}\n\n\t\t//spawns a row of enemy units if player is doing well\n\t\tif(mMonsterHouseSpawn <0) {\n\t\t\tint monsterHouseRush = 3;\n\t\t\twhile(monsterHouseRush > 0) {\n\t\t\t\tfor (float i = 0; i < 5f; i++) {\n\t\t\t\t\treviveAttacker();\n\t\t\t\t}\n\t\t\t\tmonsterHouseRush--;\n\t\t\t}\n\t\t\tmMonsterHouseSpawn = 10;\n\t\t}\n\n\t\t// Loop through the array of attackers and update each (dead attackers' update does nothing)\n\t\tfor (int i = 0; i < ATTACKER_ARRAY_SIZE; i++) {\n\t\t\tAttacker a = mAttackers[i];\n\t\t\ta.update(deltaTime);\n\n\t\t\tif(a.getX() > MIN_STOP_X) {\n\t\t\t\t// Play the attacker's \"attack\" animation\n\t\t\t\ta.play(\"attack\", true);\n\t\t\t\t// The attacker stops at the castle and the castle begins losing health\n\t\t\t\ta.setPosition(MIN_STOP_X, a.getY());\n\t\t\t\tmCastleHealth -= a.getHitDamage();\n\t\t\t\t// Only bother checking castle damage stage here - only when damage is being dealt\n\t\t\t\tfloat percentDamage = (mCastleMaxHealth - mCastleHealth) / mCastleMaxHealth;\n\t\t\t\tif(percentDamage < 0.5f) {\n\t\t\t\t\tmCastleDamageStage = 0;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tmCastleDamageStage = 1;\n\t\t\t\t}\n\t\t\t\tif(percentDamage > 0.15f) {\n\t\t\t\t\tmCastleDamageStage = 2;\n\t\t\t\t}\n\t\t\t\tif(percentDamage > 0.35f) {\n\t\t\t\t\tmCastleDamageStage = 3;\n\t\t\t\t}\n\t\t\t\tif(percentDamage > 0.65f) {\n\t\t\t\t\tmCastleDamageStage = 4;\n\t\t\t\t}\n\t\t\t\tif(percentDamage > 0.85f) {\n\t\t\t\t\tmCastleDamageStage = 5;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Check if the game is over, where mCastleHealth <= 0\n\t\tif(mCastleHealth <= 0) {\n\t\t\t// The castle has fallen to the attackers\n\t\t\t// Currently, the game will pause and add text that states the game is over\n\t\t\tmCastleHealth = 0f;\n\t\t\tmHealthText = \"Castle Strength: \" + mCastleHealth;\n\t\t\tmGameState = STATE_GAME_OVER;\n\t\t\thideAllButtons();\n\t\t}\n\n\t\t// If the round time is up, end the round and go to a new state\n\t\tif(mRoundTimeElapsed > mRoundMaxTime) {\n\t\t\tmGameState = STATE_ROUND_OVER;\n\t\t\tmTotalScore += mRoundScore;\n\t\t\tmRoundNumber++;\n\t\t\thideAllButtons();\n\t\t}\n\t}",
"public void mo1664e() {\n this.f9849a.f9855f = false;\n if (this.f9849a.f9853d != null) {\n this.f9849a.f9853d.m12499c();\n this.f9849a.f9853d = null;\n }\n if (this.f9849a.f9856g != null) {\n this.f9849a.f9856g.onInterstitialDismissed(this.f9849a);\n }\n }",
"void dailyLife() {\n\t\tString action = inputPrompt.dailyOptions(dailyTime).toLowerCase();\r\n\t\tswitch(action) {\r\n\t\tcase \"exercise\":\tthis.exercise();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\tcase \"study\":\t\tthis.study();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\tcase \"rocket\":\t\tthis.buildRocket();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\tcase \"eat\":\t\t\tthis.eat();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\tcase \"meds\":\t\tthis.getEnergised();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\tcase \"fun\":\t\t\tthis.haveFun();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\tdefault:\t\t\tdailyLife();\r\n\t\t}\t\r\n\t}",
"private final void segmentsFrameEffects() {\n\t\tif (alive) {\n\t\t\tint i;\n\t\t\t// Energy obtained through photosynthesis\n\t\t\tdouble photosynthesis = 0;\n\t\t\t_nChildren = 1;\n\t\t\t_indigo =0;\n\t\t\t_lowmaintenance =0;\n\t\t\tint fertility =0;\n\t\t\tint yellowCounter =0;\n\t\t\tint reproduceearly =0;\n\t\t\tdouble goldenage =0;\n\t\t\t_isfrozen =false;\n\t\t\tboolean trigger =false;\n\t\t\tfor (i=_segments-1; i>=0; i--) {\n\t\t\t\t// Manteniment\n\t\t\t\tswitch (getTypeColor(_segColor[i])) {\n\t\t\t\t// \tMovement\n\t\t\t\tcase CYAN:\n\t\t\t\t\tif (Utils.random.nextInt(100)<8 && useEnergy(Utils.CYAN_ENERGY_CONSUMPTION)) {\n\t\t\t\t\t\tdx=Utils.between(dx+12d*(x2[i]-x1[i])/_mass, -Utils.MAX_VEL, Utils.MAX_VEL);\n\t\t\t\t\t\tdy=Utils.between(dy+12d*(y2[i]-y1[i])/_mass, -Utils.MAX_VEL, Utils.MAX_VEL);\n\t\t\t\t\t\tdtheta=Utils.between(dtheta+Utils.randomSign()*_m[i]*FastMath.PI/_I, -Utils.MAX_ROT, Utils.MAX_ROT);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase TEAL:\n\t\t\t\t\tif (_geneticCode.getPassive()) {\n\t\t\t\t\t\tif (_hasdodged == false) {\n\t\t\t\t\t\t\t_dodge =true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t_lowmaintenance += 0.9 * _m[i];\n\t\t\t\t\t} else \n\t\t\t\t\t if (Utils.random.nextInt(100)<8 && useEnergy(Utils.CYAN_ENERGY_CONSUMPTION)) {\n\t\t\t\t\t\t dx=Utils.between(dx+12d*(x2[i]-x1[i])/_mass, -Utils.MAX_VEL, Utils.MAX_VEL);\n\t\t\t\t\t\t dy=Utils.between(dy+12d*(y2[i]-y1[i])/_mass, -Utils.MAX_VEL, Utils.MAX_VEL);\n\t\t\t\t\t\t dtheta=Utils.between(dtheta+Utils.randomSign()*_m[i]*FastMath.PI/_I, -Utils.MAX_ROT, Utils.MAX_ROT);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t// Photosynthesis\n\t\t\t\tcase SPRING:\n\t\t\t\t\t if (_geneticCode.getClockwise()) {\n\t\t\t\t\t\t dtheta=Utils.between(dtheta+0.1*_m[i]*FastMath.PI/_I, -Utils.MAX_ROT, Utils.MAX_ROT);\n\t\t\t\t\t\t photosynthesis += Utils.SPRING_ENERGY_CONSUMPTION * _mphoto[i];\n\t\t\t\t\t} else {\n\t\t\t\t\t dtheta=Utils.between(dtheta-0.1*_m[i]*FastMath.PI/_I, -Utils.MAX_ROT, Utils.MAX_ROT);\n\t\t\t\t\t photosynthesis += Utils.SPRING_ENERGY_CONSUMPTION * _mphoto[i];\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase LIME:\n\t\t\t\t\tif (trigger == false) {\n\t\t\t\t\t\ttrigger =true;\n\t\t\t\t\t if (_world.fastCheckHit(this) != null) {\n\t\t\t\t\t \t_crowded =true;\n\t\t\t\t\t } else {\n\t\t\t\t\t \t_crowded =false;\n\t\t\t\t\t }\n\t\t\t\t\t}\n\t\t\t\t\tif (_crowded == true) {\n\t\t\t\t\t photosynthesis += Utils.CROWDEDLIME_ENERGY_CONSUMPTION * _mphoto[i];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tphotosynthesis += Utils.LIME_ENERGY_CONSUMPTION * _mphoto[i];\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase JADE:\n\t\t\t\t\t_isjade =true;\n\t\t\t\t\tphotosynthesis += Utils.JADE_ENERGY_CONSUMPTION * _mphoto[i];\n\t\t\t\t\tbreak;\n\t\t\t\tcase GREEN:\n\t\t\t\t\tphotosynthesis += Utils.GREEN_ENERGY_CONSUMPTION * _mphoto[i];\n\t\t\t\t\tbreak;\n\t\t\t\tcase FOREST:\n\t\t\t\t\tphotosynthesis += Utils.FOREST_ENERGY_CONSUMPTION * _mphoto[i];\n\t\t\t\t\tbreak;\n\t\t\t\tcase BARK:\n\t\t\t\t\tphotosynthesis += Utils.BARK_ENERGY_CONSUMPTION * _mphoto[i];\n\t\t\t\t\tbreak;\n\t\t\t\tcase GRASS:\n\t\t\t\t\tphotosynthesis += Utils.GRASS_ENERGY_CONSUMPTION * _mphoto[i];\n\t\t\t\t\tbreak;\n\t\t\t\tcase C4:\n\t\t\t\t\t_lowmaintenance += _m[i];\n\t\t\t\t\tphotosynthesis += Utils.C4_ENERGY_CONSUMPTION * _mphoto[i];\n\t\t\t\t\tbreak;\n\t\t\t\t// is a consumer\n\t\t\t\tcase RED:\n\t\t\t\t\t_isaconsumer =true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase FIRE:\n\t\t\t\t\t_isaconsumer =true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase ORANGE:\n\t\t\t\t\t_isaconsumer =true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase MAROON:\n\t\t\t\t\t_isaconsumer =true;\n\t\t\t\t\t_lowmaintenance += 0.9 * _m[i];\n\t\t\t\t\tbreak;\n\t\t\t\tcase PINK:\n\t\t\t\t\t_isaconsumer =true;\n\t\t\t\t\tif (_isakiller < 2) {\n\t\t\t\t\t\t_lowmaintenance += 0.8 * _m[i];\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase CREAM:\n\t\t\t\t\t_isaconsumer =true;\n\t\t\t\t\tbreak;\n\t\t\t\t// Organisms with yellow segments have more children\n\t\t\t\tcase YELLOW:\n\t\t\t\t\tyellowCounter++;\n\t\t\t\t\tfertility += _m[i];\n\t\t\t\t break;\n\t\t\t\t// Experienced parents have more children\n\t\t\t\tcase SILVER:\n\t\t\t\t\tif (_isaconsumer == false) {\n\t\t\t\t\tfor (int c = 0; c < _segments; c++) {\n\t\t\t\t\t\tswitch (getTypeColor(_segColor[c])) {\n\t\t\t\t\t\tcase DARKGRAY:\n\t\t\t\t\t\tcase GRAY:\n\t\t\t\t\t\tcase LILAC:\n\t\t\t\t\t\tcase SPIKE:\n\t\t\t\t\t\tcase PLAGUE:\n\t\t\t\t\t\tcase CORAL:\n\t\t\t\t\t\t\t_isaconsumer =true;\n\t\t\t\t\t}}}\n\t\t\t\t\t if (_nTotalChildren >= 1 && _nTotalChildren < 5) {\n\t\t\t\t\t\t_nChildren = 2; \n\t\t\t\t\t} else if (_nTotalChildren >= 5 && _nTotalChildren < 14) {\n\t\t\t\t\t\t_nChildren = 3; \n\t\t\t\t\t} else if (_nTotalChildren >= 14 && _nTotalChildren < 30) {\n\t\t\t\t\t\t_nChildren = 4; \n\t\t\t\t\t} else if (_nTotalChildren >= 30 && _nTotalChildren < 55) {\n\t\t\t\t\t\t_nChildren = 5;\n\t\t\t\t\t} else if (_nTotalChildren >= 55 && _nTotalChildren < 91) {\n\t\t\t\t\t _nChildren = 6;\n\t\t\t\t\t} else if (_nTotalChildren >= 91 && _nTotalChildren < 140) {\n\t\t\t\t\t\t_nChildren = 7; \n\t\t\t\t\t} else if (_nTotalChildren >= 140) {\n\t\t\t\t\t\t_nChildren = 8;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t// Auburn always has one real child if infected\n\t\t\t\tcase AUBURN:\n\t\t\t\t\t_isauburn =true;\n\t\t\t\t\t_lowmaintenance += _m[i] - (Utils.AUBURN_ENERGY_CONSUMPTION * _m[i]);\n\t\t\t\t\tif (_infectedGeneticCode != null && _nChildren == 1) {\n\t\t\t\t\t\t_nChildren = 2;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t// Organisms with blond segments reproduce earlier\n\t\t\t\tcase BLOND:\n\t\t\t\t\treproduceearly += 3 + _m[i];\n\t\t\t\t\tbreak;\n\t\t\t\t// Organisms with indigo segments reduce the energy the new born virus receives\n\t\t\t\tcase INDIGO:\n\t\t\t\t\t_indigo += _m[i];\n\t\t\t\t\t_lowmaintenance += 0.8 * _m[i];\n\t\t\t\t\tbreak;\n\t\t\t\t// Plague forces an organism to reproduce the virus\n\t\t\t\tcase PLAGUE:\n\t\t\t\t\t_isplague =true;\n\t\t\t\t\tbreak;\n\t\t\t\t// Coral transforms particles and viruses\n\t\t\t\tcase CORAL:\n\t\t\t\t\t_iscoral =true;\n\t\t\t\t\tbreak;\n\t\t\t\t// Mint immunity against infections\t\n\t\t\t\tcase MINT:\n\t\t\t\t\t_isantiviral =true;\n\t\t\t\t\tif (_infectedGeneticCode != null && Utils.random.nextInt(Utils.IMMUNE_SYSTEM)<=_m[i] && useEnergy(Utils.MINT_ENERGY_CONSUMPTION)) {\n\t\t\t\t\t\t_infectedGeneticCode = null;\n\t\t\t\t\t\tsetColor(Utils.ColorMINT);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t// Healing\n\t\t\t\tcase MAGENTA:\n\t\t\t\t _isregenerative =true;\n\t\t\t\t for (int j = 0; j < _segments; j++) {\n\t\t\t\t if ((_segColor[j] == Utils.ColorLIGHTBROWN) || (_segColor[j] == Utils.ColorGREENBROWN) || (_segColor[j] == Utils.ColorPOISONEDJADE)\n\t\t\t\t\t\t|| (_segColor[j] == Utils.ColorBROKEN) || (_segColor[j] == Utils.ColorLIGHT_BLUE) || (_segColor[j] == Utils.ColorICE)\n\t\t\t\t\t\t|| (_segColor[j] == Utils.ColorDARKJADE) || (_segColor[j] == Utils.ColorDARKFIRE)) {\n\t\t\t\t\tif (Utils.random.nextInt(Utils.HEALING)<=_m[i] && useEnergy(Utils.MAGENTA_ENERGY_CONSUMPTION)) {\n\t\t\t\t\t _segColor[j] = _geneticCode.getGene(j%_geneticCode.getNGenes()).getColor(); \n\t\t\t\t\t}}}\n\t\t\t\t\tbreak;\n\t\t\t\tcase DARKFIRE:\n\t\t\t\t\tif (Utils.random.nextInt(100)<_geneticCode.getSymmetry() && useEnergy(Utils.MAGENTA_ENERGY_CONSUMPTION)) {\n\t\t\t\t\t\t_segColor[i] = _geneticCode.getGene(i%_geneticCode.getNGenes()).getColor(); \n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase DARKJADE:\n\t\t\t\t\t_isjade =true;\n\t\t\t\t\tif (Utils.random.nextInt(Utils.DARKJADE_DELAY * _geneticCode.getSymmetry() * _geneticCode.getSymmetry())<8) {\n\t\t\t\t\t\t_segColor[i] = Utils.ColorJADE; \n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t// Normalize spike\n\t\t\t\tcase SPIKEPOINT:\n\t\t\t\t\t_segColor[i] = Utils.ColorSPIKE;\n\t\t\t\t\tbreak;\n\t\t\t\t// is a killer\n\t\t\t\tcase SPIKE:\n\t\t\t\t\tif (_isenhanced) {\n\t\t\t\t\t\t_isaconsumer =true;\n\t\t\t\t\t}\n\t\t\t\t\tif (_isakiller == 0) {\n\t\t\t\t\t\t_isakiller = 1;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase LILAC:\n\t\t\t\t\tif (_isakiller == 0) {\n\t\t\t\t\t\t_isakiller = 1;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase GRAY:\n\t\t\t\t\tif (_isakiller < 2) {\n\t\t\t\t\t _isakiller = 2;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t// is poisonous\n\t\t\t\tcase VIOLET:\n\t\t\t\t\t_ispoisonous =true;\n\t\t\t\t\tbreak;\n\t\t\t\t// is a freezer\n\t\t\t\tcase SKY:\n\t\t\t\t\t_isafreezer =true;\n\t\t\t\t\tbreak;\n\t\t\t\t// is enhanced\n\t\t\t\tcase DARKGRAY:\n\t\t\t\t\t_isenhanced =true;\n\t\t\t\t\tbreak;\n\t\t\t\t// Energy transfer\n\t\t\t\tcase ROSE:\n\t\t\t\t\t_lowmaintenance += 0.99 * _m[i];\n\t\t\t\t\tif (_transfersenergy == false) {\n\t\t\t\t\t\t_transfersenergy =true;\n\t\t\t\t\t _lengthfriend = _geneticCode.getGene(i%_geneticCode.getNGenes()).getLength();\n\t\t\t\t\t _thetafriend = _geneticCode.getGene(i%_geneticCode.getNGenes()).getTheta();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t// Low maintenance\n\t\t\t\tcase DARK:\n\t\t\t\t\t_lowmaintenance += 0.99 * _m[i];\n\t\t\t\t\tbreak;\n\t\t\t\t// Organisms with gold segments live longer\n\t\t\t\tcase GOLD:\n\t\t\t\t\t_lowmaintenance += 0.9 * _m[i];\n\t\t\t\t\tgoldenage += (_m[i]/Utils.GOLD_DIVISOR);\n\t\t\t\t\t_geneticCode._max_age = Utils.MAX_AGE + ((_geneticCode.getNGenes() * _geneticCode.getSymmetry())/Utils.AGE_DIVISOR) + (int)goldenage;\n\t\t\t\t\tbreak;\n\t\t\t\t// is weakened\n\t\t\t\tcase LIGHTBROWN:\n\t\t\t\tcase GREENBROWN:\n\t\t\t\tcase POISONEDJADE:\n\t\t\t\t\tif (_remember) {\n\t\t\t\t\t\t_isjade =false;\n\t\t\t\t\t\t_isenhanced =false;\n\t\t\t\t\t\t_isantiviral =false;\n\t\t\t\t\t\t_isregenerative =false;\n\t\t\t\t\t\tfor (int c = 0; c < _segments; c++) {\n\t\t\t\t\t\t\tswitch (getTypeColor(_segColor[c])) {\n\t\t\t\t\t\t\tcase JADE:\n\t\t\t\t\t\t\t\t_isjade =true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase DARKJADE:\n\t\t\t\t\t\t\t\t_isjade =true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase DARKGRAY:\n\t\t\t\t\t\t\t\t_isenhanced =true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase MINT:\n\t\t\t\t\t\t\t\t_isantiviral =true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase MAGENTA:\n\t\t\t\t\t\t\t\t_isregenerative =true;\n\t\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 _geneticCode._max_age = Utils.MAX_AGE + ((_geneticCode.getNGenes() * _geneticCode.getSymmetry())/Utils.AGE_DIVISOR) + (int)goldenage;\n\t\t\t\t\t _remember =false;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase LIGHT_BLUE:\n\t\t\t\t\tif (_isafreezer) {\n\t\t\t\t\t\t_isafreezer =false;\n\t\t\t\t\t\tfor (int c = 0; c < _segments; c++) {\n\t\t\t\t\t\t\tswitch (getTypeColor(_segColor[c])) {\n\t\t\t\t\t\t\tcase SKY:\n\t\t\t\t\t\t\t\t_isafreezer =true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase DEEPSKY:\n\t\t\t\t\t\t\t\t_isafreezer =true;\n\t\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}\n\t\t\t\t\tbreak;\n\t\t\t\t// is frozen\n\t\t\t\tcase ICE:\n\t\t\t\t\t_isfrozen =true;\n\t\t\t\t\tif (_isjade) {\n\t\t\t\t\t\t_isjade =false;\n\t\t\t\t\t\tfor (int c = 0; c < _segments; c++) {\n\t\t\t\t\t\t\tswitch (getTypeColor(_segColor[c])) {\n\t\t\t\t\t\t\tcase JADE:\n\t\t\t\t\t\t\t\t_isjade =true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase DARKJADE:\n\t\t\t\t\t\t\t\t_isjade =true;\n\t\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}\n\t\t\t\t\tbreak;\n\t\t\t\tcase DEADBARK:\n\t\t\t\t\t_isfrozen =true;\n\t\t\t\t\tbreak;\n\t\t\t\t// Restore abilities\n\t\t\t\tcase DARKLILAC:\n\t\t\t\t\tif (_isakiller == 0) {\n\t\t\t\t\t\t_isakiller = 1;\n\t\t\t\t\t}\n\t\t\t\t\tif (Utils.random.nextInt(100)<8) {\n\t\t\t\t\t\t_segColor[i] = Utils.ColorLILAC;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase DEEPSKY:\n\t\t\t\t\t_isafreezer =true;\n\t\t\t\t\tif (Utils.random.nextInt(100)<8) {\n\t\t\t\t\t\t_segColor[i] = Utils.ColorSKY;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase DARKOLIVE:\n\t\t\t\t\tif (Utils.random.nextInt(100)<8 && useEnergy(Utils.OLIVE_ENERGY_CONSUMPTION)) {\n\t\t\t\t\t\t_segColor[i] = Utils.ColorOLIVE;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Reset dodging\n\t\t\tif (_hasdodged == true) {\n\t\t\t\t_dodge =false;\n\t\t\t\t_hasdodged =false;\n\t\t\t}\n\t\t\t//Get sun's energy\n\t\t\tif (photosynthesis > 0) {\n\t\t\t\t_isaplant =true;\n\t\t\t _energy += _world.photosynthesis(photosynthesis);\t\t\t\n\t\t\t}\n\t\t\t// Calculate number of children\n\t\t\tif (fertility > 0) {\n\t\t\t\tif (_geneticCode.getSymmetry() != 3) {\n\t\t\t\t _nChildren += (yellowCounter / _geneticCode.getSymmetry()) + (fertility / 23);\n\t\t\t } else {\n\t\t\t \t_nChildren += (yellowCounter / _geneticCode.getSymmetry()) + (fertility / 34);\n\t\t\t }\n\t\t\t}\n\t\t\t// Calculate reproduction energy for blond segments\n\t\t\tif ((reproduceearly > 0) && (_infectedGeneticCode == null)) {\n\t\t\t\tif (_energy > _geneticCode.getReproduceEnergy() - reproduceearly + Utils.YELLOW_ENERGY_CONSUMPTION*(_nChildren-1)) {\n\t\t\t\t\tif ((!_isaplant) && (!_isaconsumer)) {\n\t\t\t\t\t\tif ((_energy >= 10) && (_growthRatio<16) && (useEnergy(Utils.BLOND_ENERGY_CONSUMPTION))) {\n\t\t\t\t\t\t\t_nChildren = 1;\n\t\t\t\t\t _geneticCode._reproduceEnergy = Math.max((40 + 3 * _geneticCode.getNGenes() * _geneticCode.getSymmetry()) - reproduceearly, 10);\n\t\t\t\t\t reproduce();\n\t\t\t\t\t _geneticCode._reproduceEnergy = 40 + 3 * _geneticCode.getNGenes() * _geneticCode.getSymmetry();\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ((_energy >= 30) && (_growthRatio==1) && (_timeToReproduce==0) && (useEnergy(Utils.BLOND_ENERGY_CONSUMPTION))) {\n\t\t\t\t\t\t _geneticCode._reproduceEnergy = Math.max((40 + 3 * _geneticCode.getNGenes() * _geneticCode.getSymmetry()) - reproduceearly, 30);\n\t\t\t\t\t\t reproduce();\n\t\t\t\t\t\t _geneticCode._reproduceEnergy = 40 + 3 * _geneticCode.getNGenes() * _geneticCode.getSymmetry();\t\t\t\t\t\t\t\n\t\t\t\t\t\t} \n\t\t\t\t\t}\n\t\t\t }\n\t\t\t}\n\t\t}\n\t}",
"private final void step4() { switch (b[k])\n\t {\n\t case 'e': if (ends(\"icate\")) { r(\"ic\"); break; }\n\t if (ends(\"ative\")) { r(\"\"); break; }\n\t if (ends(\"alize\")) { r(\"al\"); break; }\n\t break;\n\t case 'i': if (ends(\"iciti\")) { r(\"ic\"); break; }\n\t break;\n\t case 'l': if (ends(\"ical\")) { r(\"ic\"); break; }\n\t if (ends(\"ful\")) { r(\"\"); break; }\n\t break;\n\t case 's': if (ends(\"ness\")) { r(\"\"); break; }\n\t break;\n\t } }",
"private void c3POSpeaks() {\n\t\tint quoteChoice = (int) ( Math.random() * 10+1);\n\t\t\n\t\tswitch (quoteChoice) {\n\t\tcase 1 : this.say(\"C-3PO says: 'Artoo says that the chances of survival \\nare 725 to 1. Actually Artoo has \\nbeen known to make mistakes... from time \\nto time... Oh dear...' \"); break;\n\t\tcase 2 : this.say(\"C-3PO says: 'Excuse me sir, but might I inquire \\nas to what's going on?' \"); break;\n\t\tcase 3 : this.say(\"C-3PO says: 'I have a bad feeling about this.' \"); break; \n\t\tcase 4 : this.say(\"C-3PO says: 'I've had the most peculiar dream.'\"); break;\n\t\tcase 5 : this.say(\"C-3PO says: 'I'm programmed for etiquette, not destruction!'\"); break;\n\t\tcase 6 : this.say(\"C-3PO says: 'Pardon me, sir, could you possibly resist fiddling \\nwith technology that is beyond your comprehension?' \"); break;\n\t\tcase 7 : this.say(\"C-3PO says: 'Well, you'll never get me to go back to that iceberg! \\nI don't care how safe it is now, R2, it gives my motivators the \\nchills just thinking about it. ' \"); break;\n\t\tcase 8 : this.say(\"C-3PO says: 'Hello, I am C-3PO, human cyborg relations. How might I serve you?' \"); break;\n\t\tcase 9 : this.say(\"C-3PO says: 'Hm, it seems no one wants my company tonight. '\"); break;\n\t\tcase 10 : this.say(\"C-3PO says: 'This way looks potentially dangerous.' \"); break;\n\t\t}\n\t}",
"public void mo3723e() {\n if (!this.f1904d.mo3709a()) {\n this.f1901a.mo3741w();\n } else if (this.f1905e.mo3710a().getLevel() == Level.INFECTED) {\n this.f1902b.mo3744b();\n } else {\n this.f1902b.mo3746d();\n }\n }",
"public static void main(String[] args) {\n\n\t\tboolean allergy=true;\n\t\t\n\t\tboolean petAllergy=false;\n\t\tboolean peanatAllergy=true;\n\t\tboolean pollenAllergy=false;\n\t\t\n\t\t\n\t\t\n\tif (allergy) {\n\t\tSystem.out.println(\"Lets do further check\");\n\t\tif (petAllergy) {\n\t\t\tSystem.out.println(\"Please no cats or dogs in the house\");\n\t\t\n\t\t\n\t\t} else if (peanatAllergy){\n\t\t\tSystem.out.println(\"Dont eat peanat butter\");\n\t\t}else if (pollenAllergy) {\n\t\t\tSystem.out.println(\"Dont clean \");}\n\t}else {\n\t\tSystem.out.println(\"You are lucky\");\n\t}\n\t\n\tSystem.out.println(\"-----------Example 2----------\");\n\t\n\t/*\n\t * If todays is friday we will watch movie but would like to check the date\n\t * if date is 13--> watching scary movie\n\t * and if its is not--> i will watch comedy, action\n\t * \n\t * if no Friday --> i am studying\n\t */\n\t\n\tboolean Friday=false;\n\tint date=4;\n\tboolean monday=true;\n\t\n\tif (Friday) {\n\t\tif (date==13) {\n\t\t\tSystem.out.println(\"We will watch a scary movie\");\n\t\t\n\t\t}else {\n\t\t\tSystem.out.println(\"Watch a comedy\");\n\t\t}\n\t\t\n\t\t\n\t}else {\n\t\t\n\t\tif(monday) {\n\t\tSystem.out.println(\"I am not studying,Im working\");\n\t}else {\n\t\tSystem.out.println(\"I have class at Syntax\");\n\t}\n\t}\n\t\n\tSystem.out.println(\"----------Example 3------\");\n\t/*\n\t * check if assignment is completed\n\t * if assignment is complited:\n\t * if score >90--> great job\n\t * if score >80--> good job;\n\t * if score >70--> please study more\n\t */\n\t\n\tboolean assignment=false;\n\tint score=92;\n\t\n\tif (assignment) {\n\t\tif(score>90) {\n\t\t\tSystem.out.println(\"Great job!\");\n\t\t}else if (score>80) {\n\t\t\tSystem.out.println(\"Good job\");\n\t\t}else if (score>70) {\n\t\t\tSystem.out.println(\"Pleaase study more\");\n\t\t}else {\n\t\t\tSystem.out.println(\"Good job for trying,but must study!\");\n\t\t}\n\t\t\n\t\t\n\t}else {\n\t\tSystem.out.println(\"You should always complete all assignments\");\n\t}\n\t\n\t}",
"public final void mo59469qD() {\n AppMethodBeat.m2504i(94717);\n try {\n C45018f c45018f = this.aRr;\n if (c45018f.aQP || !c45018f.isInitialized()) {\n AppMethodBeat.m2505o(94717);\n return;\n }\n if (c45018f.mo72533qo()) {\n c45018f.aQc.mo2535L(c45018f.mo72538qt());\n c45018f.aQo = 0;\n c45018f.aQP = true;\n }\n AppMethodBeat.m2505o(94717);\n } catch (C37227h e) {\n C25533e b = C25533e.m40358b(e, this.index);\n AppMethodBeat.m2505o(94717);\n throw b;\n }\n }",
"private void startFinalRound() {\r\n if(!m_state.isMidGame()) {\r\n throw new RuntimeException(\"startFinalRound() called, but not midgame\");\r\n }\r\n\r\n m_state.setState(State.STARTING_FINAL);\r\n\r\n if(m_survivorCount == 0) {\r\n m_botAction.sendArenaMessage(\"No survivors?! \\\\(o_O)/\", 24);\r\n endGame();\r\n return;\r\n } else if(m_survivorCount == 1) {\r\n for(KimTeam team : m_survivingTeams) {\r\n if(team != null) {\r\n m_botAction.sendArenaMessage(\"Winner by default: \" + team.toString());\r\n break;\r\n }\r\n }\r\n\r\n endGame();\r\n return;\r\n }\r\n\r\n //display survivors\r\n m_botAction.sendArenaMessage(\"-------------------------------------------------------------------------------------------------------\");\r\n printFormattedTeams(m_survivingTeams, 4);\r\n m_botAction.sendArenaMessage(\"-------------------------------------------------------------------------------------------------------\");\r\n m_botAction.sendArenaMessage(\"Welcome to the Final Round!\", 2);\r\n\r\n //pm leavers\r\n for(String name : m_startingLagouts) {\r\n if(name != null) {\r\n m_botAction.sendSmartPrivateMessage(name, \"Final round is starting. You have 15 seconds to return.\");\r\n }\r\n }\r\n\r\n //warp to final safes and ?set spawns\r\n m_botAction.scheduleTask(new TimerTask() {\r\n public void run() {\r\n for(int i = 0; i < 4; i++) {\r\n KimTeam team = m_survivingTeams[i];\r\n\r\n if(team != null) {\r\n for(KimPlayer kp : team) {\r\n kp.resetTime();\r\n\r\n if(m_startingReturns.remove(kp)) {\r\n int retID = m_botAction.getPlayerID(kp.m_name);\r\n\r\n if(retID < 0) {\r\n m_startingLagouts.add(kp.m_lcname);\r\n continue;\r\n } else {\r\n putPlayerInGame(retID, kp, true);\r\n }\r\n }\r\n\r\n m_botAction.warpTo(kp.m_name, m_finalSafeCoords[i << 1], m_finalSafeCoords[(i << 1) + 1]);\r\n }\r\n }\r\n }\r\n\r\n setFinalSpawns();\r\n }\r\n }, DELAY_FINAL_SETUP);\r\n\r\n //countdown lvz object\r\n m_botAction.scheduleTask(new CountdownImage(), DELAY_FINAL_COUNTDOWN);\r\n\r\n //go go go\r\n m_botAction.scheduleTask(new TimerTask() {\r\n public void run() {\r\n synchronized(m_state) {\r\n m_state.setState(State.MIDGAME_FINAL);\r\n m_botAction.sendArenaMessage(\"GO! GO! GO!\", 104);\r\n\r\n for(int i = 0; i < 4; i++) {\r\n KimTeam team = m_survivingTeams[i];\r\n\r\n for(KimPlayer kp : team) {\r\n if(kp != null) {\r\n if(m_startingLagouts.remove(kp.m_lcname)) {\r\n registerLagout(kp);\r\n continue;\r\n }\r\n\r\n if(m_startingReturns.remove(kp)) {\r\n int retID = m_botAction.getPlayerID(kp.m_name);\r\n\r\n if(retID < 0) {\r\n registerLagout(kp);\r\n continue;\r\n } else {\r\n putPlayerInGame(retID, kp, true);\r\n }\r\n } else {\r\n kp.resetTime();\r\n }\r\n\r\n m_botAction.warpTo(kp.m_name, m_finalGoCoords[i << 1], m_finalGoCoords[(i << 1) + 1]);\r\n }\r\n }\r\n }\r\n\r\n m_botAction.shipResetAll();\r\n m_poll = new Poll(m_survivingTeams, m_botAction);\r\n }\r\n }\r\n }, DELAY_FINAL_GOGOGO);\r\n }",
"protected void actionConfirmed()\r\n\t\t{\n\r\n\t\t\tif ( actionSelect.getSelectedItem() == null )\r\n\t\t\t\tDEFAULT_SHELL.executeLine( \"set battleAction=attack\" );\r\n\r\n\t\t\tRunnable request = (Runnable) locationSelect.getSelectedItem();\r\n\t\t\tif ( request == null )\r\n\t\t\t\treturn;\r\n\r\n\t\t\tsetProperty( \"lastAdventure\", request.toString() );\r\n\r\n\t\t\t// If there are conditions in the condition field, be\r\n\t\t\t// sure to process them.\r\n\r\n\t\t\tString conditionList = conditionField.getText().trim();\r\n\t\t\tif ( conditionList.equalsIgnoreCase( \"none\" ) )\r\n\t\t\t\tconditionList = \"\";\r\n\r\n\t\t\tif ( conditionList.length() > 0 )\r\n\t\t\t{\r\n\t\t\t\tDEFAULT_SHELL.executeLine( \"conditions clear\" );\r\n\r\n\t\t\t\tboolean verifyConditions = false;\r\n\t\t\t\tboolean useDisjunction = false;\r\n\t\t\t\tString [] conditions = conditionList.split( \"\\\\s*,\\\\s*\" );\r\n\r\n\t\t\t\tfor ( int i = 0; i < conditions.length; ++i )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( conditions[i].equals( \"check\" ) )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Postpone verification of conditions\r\n\t\t\t\t\t\t// until all other conditions added.\r\n\r\n\t\t\t\t\t\tverifyConditions = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( conditions[i].equals( \"outfit\" ) )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Determine where you're adventuring and use\r\n\t\t\t\t\t\t// that to determine which components make up\r\n\t\t\t\t\t\t// the outfit pulled from that area.\r\n\r\n\t\t\t\t\t\tif ( !(request instanceof KoLAdventure) || !EquipmentDatabase.addOutfitConditions( (KoLAdventure) request ) )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tsetStatusMessage( \"No outfit corresponds to this zone.\" );\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tverifyConditions = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( conditions[i].equals( \"or\" ) || conditions[i].equals( \"and\" ) || conditions[i].startsWith( \"conjunction\" ) || conditions[i].startsWith( \"disjunction\" ) )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tuseDisjunction = conditions[i].equals( \"or\" ) || conditions[i].startsWith( \"disjunction\" );\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif ( !DEFAULT_SHELL.executeConditionsCommand( \"add \" + conditions[i] ) )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tKoLmafia.enableDisplay();\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ( verifyConditions )\r\n\t\t\t\t{\r\n\t\t\t\t\tDEFAULT_SHELL.executeConditionsCommand( \"check\" );\r\n\t\t\t\t\tif ( StaticEntity.getClient().conditions.isEmpty() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tKoLmafia.updateDisplay( \"All conditions already satisfied.\" );\r\n\t\t\t\t\t\tKoLmafia.enableDisplay();\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ( StaticEntity.getClient().conditions.size() > 1 )\r\n\t\t\t\t\tDEFAULT_SHELL.executeConditionsCommand( useDisjunction ? \"mode disjunction\" : \"mode conjunction\" );\r\n\r\n\t\t\t\tconditionField.setText( \"\" );\r\n\t\t\t\tif ( countField.getText().equals( \"\" ) )\r\n\t\t\t\t\tcountField.setText( String.valueOf( KoLCharacter.getAdventuresLeft() ) );\r\n\t\t\t}\r\n\r\n\t\t\t(new RequestThread( request, getValue( countField ) )).start();\r\n\t\t\tcountField.setText( \"\" );\r\n\t\t}",
"@Test\n public void bestowNighthowlerTest() {\n addCard(Zone.BATTLEFIELD, playerA, \"Mountain\", 4);\n // Instant - {2}{R}{R}\n // Chandra's Outrage deals 4 damage to target creature and 2 damage to that creature's controller.\n addCard(Zone.HAND, playerA, \"Chandra's Outrage\");\n\n // Enchantment Creature — Horror\n // 0/0\n // Bestow {2}{B}{B}\n // Nighthowler and enchanted creature each get +X/+X, where X is the number of creature cards in all graveyards.\n addCard(Zone.HAND, playerB, \"Nighthowler\");\n addCard(Zone.BATTLEFIELD, playerB, \"Swamp\", 4);\n // First strike\n // Whenever Alesha, Who Smiles at Death attacks, you may pay {W/B}{W/B}. If you do, return target creature card\n // with power 2 or less from your graveyard to the battlefield tapped and attacking.\n addCard(Zone.BATTLEFIELD, playerB, \"Alesha, Who Smiles at Death\"); // 3/2\n addCard(Zone.GRAVEYARD, playerB, \"Pillarfield Ox\");\n\n castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, \"Nighthowler using bestow\", \"Alesha, Who Smiles at Death\");\n\n // attacks by Alesha and return card on trigger\n attack(2, playerB, \"Alesha, Who Smiles at Death\");\n setChoice(playerB, true); // use trigger\n addTarget(playerB, \"Pillarfield Ox\"); // target card to return\n\n castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerA, \"Chandra's Outrage\", \"Alesha, Who Smiles at Death\");\n\n setStrictChooseMode(true);\n setStopAt(2, PhaseStep.END_TURN);\n execute();\n\n assertLife(playerB, 18); // -2 from Chandra's Outrage\n assertLife(playerA, 16); // -3 from attack Alesha with bestowed Nighthowler\n\n assertGraveyardCount(playerA, \"Chandra's Outrage\", 1);\n assertGraveyardCount(playerB, \"Alesha, Who Smiles at Death\", 1);\n assertPermanentCount(playerB, \"Nighthowler\", 1);\n assertPowerToughness(playerB, \"Nighthowler\", 2, 2);\n Permanent nighthowler = getPermanent(\"Nighthowler\", playerB);\n\n Assert.assertEquals(\"Nighthowler has to be a creature\", true, nighthowler.isCreature(currentGame));\n }",
"@Override\n\tpublic void decide() {\n\t\tif (this.isDead) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(this.age >= this.lifeSpan) {\n\t\t\t// DIE\n\t\t\tthis.environment.removeAgent(this.getPosX(), this.getPosY());\n\t\t\tthis.isDead = true;\n\n\t\t\t// Print if required\n\t\t\tif (this.appConfig.hasTrace()) {\n\t\t\t\tSystem.out.println(\"Agent;Death;Fish;\" + this.getPosX() + \";\" + this.getPosY());\n\t\t\t}\n\t\t\t\n\t\t\treturn;\n\t\t}\n\t\tthis.age++;\n\t\tthis.color = Color.GREEN;\n\t\tboolean canFuck = this.breedTime == 0;\n\n\t\tint[] coordinates = this.chooseCoordinates();\n\n\t\t// fish cannot move or fuck because there is no place to do so\n\t\tif (coordinates == null) {\n\t\t\tthis.breedTime = this.breedTime > 0 ? this.breedTime - 1 : this.breedTime;\n\t\t\treturn;\n\t\t}\n\n\t\tthis.environment.moveAgent(this, coordinates[0], coordinates[1]);\n\n\t\t// Time to fuck-zer\n\t\tif (canFuck) {\n\t\t\tthis.fuck(this.getPosX(), this.getPosY());\n\t\t}\n\t\t// Update breedtime in order to wait the holy fuck time\n\t\telse {\n\t\t\tthis.breedTime = this.breedTime > 0 ? this.breedTime - 1 : this.breedTime;\n\t\t}\n\t\tthis.posX = coordinates[0];\n\t\tthis.posY = coordinates[1];\n\t}",
"static void play_yellowportal () {\n System.out.println(\"Here is challenge 2\");\n System.out.println(\"In this challenge you would have to defeat all 5 levels without being killed...watch\");\n System.out.println(\"out for your HP.\");\n System.out.println(\"3...2...1...Ready-or Not...GO!!!\");\n enter = next.nextLine();\n System.out.println(\"There is a large open clearance up ahead.\");\n enter = next.nextLine();\n System.out.println(username + \" hears loud noices and sees the grass rustling with life...brace yourself\");\n yellow_fight();\n //after the player beats the enemy...\n System.out.println(\"Congratulations... this is gonna be a difficult journey and Separt can only lead the way.\");\n enter = next.nextLine();\n System.out.println(\"There's too diverging paths that will lead to two different paths...\");\n enter = next.nextLine();\n System.out.println(\"'Take the right path...I can sense that evil witch that way', said Separt\");\n enter = next.nextLine();\n System.out.println(username + \" takes the right path\");\n enter= next.nextLine();\n System.out.println(\"RUSTLE...RUSTLE...RUSTLE...\");\n enter = next.nextLine();\n System.out.println(\"What's that noice...Let's get closer to check it out.\");\n enter = next.nextLine();\n System.out.println(username + \" and Separt walks through the big clearance. THEN...\");\n enter = next.nextLine();\n System.out.println(\"BOOOM!!! OH NO!\");\n yellow_fight();\n //after the player beats the enemy\n System.out.println(\"You're on a roll!\");\n enter = next.nextLine();\n System.out.println(\"There is now three diverging paths...\");\n enter = next.nextLine();\n System.out.println(\"'Take the straight path...That's the shortest way outta here...\");\n enter = next.nextLine();\n System.out.println(username + \" takes the straight path and reaches a bridge half filled with animal corpses.\");\n System.out.println(\"YUCK! Separt exclaimed! 'That witch sure has a big appetite...'\");\n enter = next.nextLine();\n System.out.println(\"HA! HA! HA!\");\n enter = next.nextLine();\n System.out.println(\"Watch yourselves...something is coming from under the bridge!\");\n yellow_fight();\n //after you win\n System.out.println(\"Alright...you got the hang of this now!\");\n enter = next.nextLine();\n System.out.println(\"There is now two diverging paths...\");\n enter = next.nextLine();\n System.out.println(\"Take the left one...I think it isn't a trap.\");\n enter = next.nextLine();\n System.out.println(username + \" takes the left path...\");\n System.out.println(\"Looks like it is safe...Guess we got lucky!\");\n enter = next.nextLine();\n System.out.println(\"Now there are three diverging paths...\");\n enter = next.nextLine();\n System.out.println(\"'Take the straight path', said Separt.\");\n System.out.println(\"That's the only way out. The other two are traps that will just bring you back to the beginning\");\n System.out.println(\"Trust me...\");\n enter = next.nextLine();\n System.out.println(username + \" takes the straight path.\");\n enter = next.nextLine();\n System.out.println(\"There is a large arena up ahead. Let's be prepared...\");\n yellow_fight();\n //after you win\n System.out.println(\"Alright...let's finish this up...\");\n enter = next.nextLine();\n System.out.println(\"Now there is only a straight path ahead...\");\n System.out.println(username + \" takes the straight path and sees a large black portal...\");\n System.out.println(\"That will lead you to the...\");\n enter = next.nextLine();\n System.out.println(\"BOOM! FLURP! FOOSH! POW!\");\n yellow_fight();\n //after the player beats the enemy\n System.out.println(\"Gosh...that was rude. Please continue Separt\" + username + \" stated.\");\n enter = next.nextLine();\n System.out.println(\"As I was saying...that is the path that will lead you to the wicked witch that is\");\n System.out.println(\"Trying to hunt you down...Don't worry...I got your back...I'll help you in this battle\");\n System.out.println(\"Shall we jump into the portal?\");\n answer = responses.nextLine();\n if(answer.contains(\"n\")) {\n System.out.println(\"We have no more time...the witch send more of her minions to take us on...\");\n enter = next.nextLine();\n System.out.println(username + \" prepares to jump\");\n }else if(answer.contains(\"y\")) {\n System.out.println(\"Alright get ready to jump!!!\");\n }\n bossportal();\n }",
"private void harvest() {\n\t\t// if VERY far from flower, it must have died. start scouting\n\t\tif(grid.getDistance(grid.getLocation(targetFlower),grid.getLocation(this)) > 200) {\n\t\t\tstate = \"SCOUTING\";\n\t\t}\n\t\t// if crop storage is full, return to hive with information\n\t\telse if(food >= maxCrop) {\n\t\t\tif(targetFlower != null) {\n\t\t\t\tlastFlowerNectar = targetFlower.food;\n\t\t\t}\n\t\t\tstate = \"RETURNING\";\n\t\t}\n\t\t// if daylight is diminishing, return to hive\n\t\telse if(clock.time > (endForagingTime + 1.0)){\n\t\t\tlastFlowerNectar = 0;\n\t\t\tstate = \"RETURNING\";\n\t\t}\n\t\t// if flower loses all nectar, start scouting for new flower\n\t\telse if(targetFlower.food <= 0){\n\t\t\tstate = \"AIMLESSSCOUTING\";\n\t\t\ttempTime = clock.time;\n\t\t}\n\t\t// semi-random decision to scout for new flower if current flower has low food\n\t\telse if(RandomHelper.nextIntFromTo(0,(int)(maxFlowerNectar/4)) > targetFlower.food &&\n\t\t\t\tRandomHelper.nextDoubleFromTo(0,1) < forageNoise){\n\t\t\tstate = \"AIMLESSSCOUTING\";\n\t\t\ttempTime = clock.time;\n\t\t}\n\t\t// otherwise continue harvesting current flower\n\t\telse{\n\t\t\thover(grid.getLocation(targetFlower));\n\t\t\ttargetFlower.food -= foragingRate;\n\t\t\tfood += foragingRate;\n\t\t\tfood -= lowMetabolicRate;\n\t\t}\n\t}",
"private void setExits()\n {\n promenade.setExit(\"up\", ossuary);\n promenade.setExit(\"deep\", depths);\n \n ossuary.setExit(\"down\", promenade);\n ossuary.setExit(\"left\", forest);\n ossuary.setExit(\"straight\", crypt);\n \n forest.setExit(\"right\", ossuary);\n forest.setExit(\"left\", graveyard);\n \n tower.setExit(\"straight\", ramparts);\n tower.setExit(\"down\", forest);\n tower.setExit(\"left\", deathRoom4);\n \n ramparts.setExit(\"down\", bridge);\n ramparts.setExit(\"straight\", castle);\n ramparts.setExit(\"left\", deathRoom4);\n \n prison.setExit(\"up\", promenade);\n prison.setExit(\"down\", sewers);\n prison.setExit(\"straight\", deathRoom2);\n \n \n sewers.setExit(\"down\", depths);\n sewers.setExit(\"left\", deathRoom1);\n \n depths.setExit(\"up\", sewers);\n depths.setExit(\"right\", crypt);\n depths.setExit(\"left\", deathRoom3);\n \n \n crypt.setExit(\"up\", graveyard);\n crypt.setExit(\"straight\", deathRoom3);\n crypt.setExit(\"left\", depths);\n crypt.setExit(\"back\", ossuary);\n \n graveyard.setExit(\"right\", forest);\n graveyard.setExit(\"straight\", bridge);\n graveyard.setExit(\"down\", crypt);\n \n bridge.setExit(\"up\", ramparts);\n bridge.setExit(\"back\", graveyard);\n bridge.setExit(\"down\", deathRoom2);\n \n throneRoomEntrance.setExit(\"straight\", throne);\n \n }",
"public void diagrafiGiatrou() {\n\t\t// Elegxw an yparxoun iatroi sto farmakeio\n\t\tif(numOfDoctors != 0)\n\t\t{\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(\" STOIXEIA IATRWN\");\n\t\t\t// Emfanizw olous tous giatrous\n\t\t\tfor(int j = 0; j < numOfDoctors; j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(\"\\n \" + j + \". STOIXEIA IATROU: \");\n\t\t\t\tSystem.out.println();\n\t \t \tdoctor[j].print();\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t\ttmp_1 = sir.readPositiveInt(\"DWSTE TON ARITHMO TOU IATROU POU THELETAI NA DIAGRAFEI: \");\n\t\t\tSystem.out.println();\n\t\t\t// Elegxos egkyrotitas tou ari8mou pou edwse o xristis\n\t\t\twhile(tmp_1 < 0 || tmp_1 > numOfDoctors)\n\t\t\t{\n\t\t\t\ttmp_1 = sir.readPositiveInt(\"KSANAEISAGETAI ARITHMO IATROU: \");\n\t\t\t}\n\t\t\t// Metakinw tous epomenous giatrous mia 8esi pio aristera\n\t\t\tfor(int k = tmp_1; k < numOfDoctors - 1; k++)\n\t\t\t{\n\t\t\t\tdoctor[k] = doctor[k+1]; // Metakinw ton giatro sti 8esi k+1 pio aristera\n\t\t\t}\n\t\t\tnumOfDoctors--; // Meiwse ton ari8mo twn giatrwn\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.print(\"\\nDEN YPARXOUN DIATHESIMOI GIATROI PROS DIAGRAFH!\\n\");\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"@Test\n\tpublic void riposteShieldTest() {\n\t\tDisplayWithShield();\n\t\t\n\t\tint cardPos = 0;\n\t\tint targetPlayer = 1;\n\t\tint targetDisplaySize = game.getDisplay(targetPlayer).deckSize();\n\t\t/*\n\t\t * test to make sure the target has a maiden as the last played card\n\t\t*/\n\t\tassertTrue(game.getDisplay(1).getCard(targetDisplaySize-1).isMaiden());\n\t\t\n\t\t/*\n\t\t * test to make sure the player's display is still empty\n\t\t */\n\t\tassertTrue(game.getDisplay(0).deckSize() == 0);\n\t\t\n\t\t\n\t\t//assertFalse(game.getDisplay(0).getCard(targetDisplaySize-1).isMaiden());\n\t\t\n\t\t//test the size of discard deck before playing Riposte\n\t\tassertEquals(game.getDiscardDeck().deckSize(), 0);\n\t\t\n\t\tassertEquals(game.getDisplay(targetPlayer).deckSize(), 7);\n\t\t\n\t\t//play Riposte\n\t\tRulesEngine.riposte(game, cardPos, targetPlayer);\n\t\t\n\t\t//test the size of discard deck after playing Riposte\n\t\tassertEquals(game.getDiscardDeck().deckSize(), 0);\n\t\t\n\t\t//Update this variable after a card has been removed from the display\n\t\ttargetDisplaySize = game.getDisplay(targetPlayer).deckSize();\n\t\t\n\t\t/*\n\t\t * test to make sure the target's last played card is still a maiden\n\t\t*/\n\t\tassertTrue(game.getDisplay(targetPlayer).getCard(targetDisplaySize-1).isMaiden());\n\t\t\n\t\t/*\n\t\t * test to make sure the player's display is still empty\n\t\t*/\n\t\tassertTrue(game.getDisplay(0).deckSize() == 0);\n\t}",
"public static void main(String[] args) {\n\n Room woods = new Room(\"Woods\");\n woods.setStory(\"You are a ferocious wolf, hungry, and tired after a long excursion \" +\n \"out in the deep dark woods. You have just heard some rumors that there are three little \" +\n \"pigs who have recently done some construction in the neighborhood…\");\n woods.setDescription(\"These woods are dark and scary.\");\n\n Room house1 = new Room (\"The Straw House\");\n house1.setStory(\"You’ve trekked out of the woods and followed the rocky dirt road until you\" +\n \" find a neighborhood full of questionably constructed straw houses. Your nose twitches \" +\n \"and you realize the one right in front of you contains some tasty bacon named Billy\");\n house1.setDescription(\"This is the site of the straw house.\");\n\n Room house2 = new Room(\"The Stick House\");\n house2.setStory(\"You decide to look for some more food and continue on to the next neighborhood,\" +\n \" filled with stick houses. You sniff the air and know immediately that the house to your left\" +\n \"houses Reginald -- a chunky pig\");\n house2.setDescription(\"Here is the site of a stick house.\");\n house2.setAccessible(false);// must set accessible again after the first pig is eaten\n\n Room house3 = new Room(\"The Brick House\");\n house3.setStory(\"You decide to look for some more food and continue on to the next neighborhood, filled with \" +\n \"brick houses. You sniff the air and have a good feeling about a house up ahead, which is made of bricks \" +\n \"and has a lovely skylight.\");\n house3.setDescription(\"Here is the site of the brick house.\");\n house3.setAccessible(false);// must set accessible again after the second pig is eaten\n\n Room house3Interior = new Room(\"Inside the brick house.\");\n house3Interior.setStory(\"Aha! Here is the delicious pig -- Spike! Your stomach is rumbling . . . \");\n house3Interior.setDescription(\"This is a nice house made for a pig. Above the fireplace is a framed photo eat \" +\n \"of the pig who lives here and his two brothers.\");\n house3Interior.setAccessible(false);// must set accessible again after the window is broken\n\n Room woods2 = new Room(\"More Woods\");\n woods2.setStory(\"You're feeling pretty good now, having gobbled up some pigs and successfully stopped your stomach from growling.\" +\n \"You walk out of the pig neighborhood and back towards the forest. \" +\n \"But you have a feeling that you're not out of the woods yet-- literally. There's a pig cop here, and if you don't get out of here fast, \" +\n \"you might find yourself in trouble again.\");\n woods2.setDescription(\"A dark and ominous forest.\");\n woods2.setAccessible(false); // must set accessible again after the third pig is eaten\n\n Room river = new Room (\"River shore\");\n river.setStory(\"You've run from the pig cop into another section of woods, but there's a wide rushing river in front of you. Surely you won't be able \" +\n \"to cross it without some sort of bridge . . .\");\n river.setDescription(\"A river cuts through the forest, rushing by quickly.\" );\n\n Room home = new Room(\"Home\");\n home.setStory(\"You're home! After a long and harrowing trip through the woods and a neighborhood full of pigs, you've managed to evade the cops\" +\n \"and arrive home. Your family cheers when they see you and you swear to never trek into the woods without some extra provisions\" +\n \"ever again.\" );\n home.setDescription(\"\");\n home.setAccessible(false); //must set accessible again after the river is crossed\n\n //END OF GAME\n //now possible to add another story...\n\n\n //Characters and their related actions\n\n Character owl = new Character(\"Owl\", \"A wise elderly owl who might have some helpful advice\", null);\n owl.setFirstDialogue(\"I'm an owl, hoot hoot.\");\n owl.setGeneralGreeting(\"Hello again. Hoot hoot!\");\n owl.populateDialogueByTopics(\"advice\", \"That straw house over there looks pretty flimsy. Even a slight breeze could knock it down!\" +\n \"Hoot hoot!\");\n owl.populateDialogueByTopics(\"owl things\", \"I eat mice. Hoot hoot!\");\n owl.populateDialogueByTopics(\"the forest\", \"It sure is dark and scary in here. Hoot hoot!\");\n\n Character pig1 = new Character(\"Billy\", \"A fat, delicious-looking pig\", null);\n pig1.setFirstDialogue(\"Hi, I'm Billy, the pig! You're not a wolf, are you?\");\n pig1.setGeneralGreeting(\"It's Billy the pig again!\");\n pig1.populateDialogueByTopics(\"new house\", \"I've just built a new house out of straw! I think it looks great.\");\n// pig1.setIsEatable(true);\n\n Character pig2 = new Character(\"Reginald\", \"A fat, delicious-looking pig\", null);\n pig2.setFirstDialogue(\"Hi, I'm Reginald, the pig! Have you heard from my brothers?\");\n pig2.setGeneralGreeting(\"It's Reginald again. I'm a little worried about my brothers.\");\n pig2.populateDialogueByTopics(\"new house\", \"I just built a house out of sticks. I bet it can withstand anything!\");\n// pig2.setIsEatable(true);\n\n Character pig3 = new Character(\"Spike\", \"A fat, delicious-looking pig\", null);\n pig3.setFirstDialogue(\"What's up? I'm Spike, the pig! Have you seen a wolf around here? I think one is prowling around . . .\");\n pig3.setGeneralGreeting(\"It's Reginald again. You should stay away, there's a wolf on the loose!\");\n pig3.populateDialogueByTopics(\"the wolf\", \"I think my brothers were eaten by a wolf! Thankfully I \" +\n \"have my strong brick house to protect me.\");\n pig3.setIsEatable(true);\n\n Character cop = new Character(\"Officer Pig\", \"A pig cop looking to find the wolf who ate his friends\", null);\n cop.setFirstDialogue(\"I'm Officer Pig. Hey! You look like the wolf who ate my friends!\");\n cop.setGeneralGreeting(\"I'm Officer Pig.\");\n cop.populateDialogueByTopics(\"wolf\", \"A wolf has been terrorizing the neighborhood. And you look quite a lot like a wolf . . .\");\n\n //Items that are spread throughout the game + what can happen to them\n\n Item house1Item = new Item(\"straw house\", \"a flimsy straw house\", null);\n house1Item.setPickUpAble(false);\n Item house2Item = new Item(\"stick house\", \"a slightly sturdier stick house\", null);\n house2Item.setPickUpAble(false);\n Item house3Item = new Item(\"brick house\", \"a strong, well-built brick house\", null);\n house3Item.setPickUpAble(false);\n\n Item leafBlower = new Item(\"leaf blower\", \"a gardening tool that generates a lot of wind\", null);\n Item brick = new Item(\"brick\", \"looks like a leftover brick from building a house\", null);\n Item window = new Item (\"window\", \"a nice skylight on the roof of the brick house\", null);\n window.setPickUpAble(false);\n Item rock = new Item(\"rock\", \"a flat gray rock\", null);\n Item vine = new Item(\"vine\", \"a long green vine suspended from a tree branch\", null);\n vine.setPickUpAble(false);\n\n //Where the items are placed in the game\n woods.addCharacter(owl);\n house1.addCharacter(pig1);\n house1.addItemToRoom(house1Item);\n house2.addCharacter(pig2);\n house2.addItemToRoom(leafBlower);\n house2.addItemToRoom(house2Item);\n house3.addItemToRoom(brick);\n house3.addItemToRoom(window);\n house3.addItemToRoom(house3Item);\n house3Interior.addCharacter(pig3);\n woods2.addCharacter(cop);\n river.addItemToRoom(rock);\n river.addItemToRoom(vine);\n\n //What directions the user can move throughout the game\n //Order of directions : N , S, E, W, in, out\n woods.setConnections(new Room[] {null, null, house1, null, null, null});\n house1.setConnections(new Room[] {null, house2, null, woods, null, null});\n house2.setConnections(new Room[] {house1, null, house3, null, null, null});\n house3.setConnections(new Room[] {null, null, null, house2, house3Interior, null});\n house3Interior.setConnections(new Room[] {null, null, null, null, null, house3});\n woods2.setConnections(new Room[] {house3, null, null, null, null, null});\n //river\n //home\n\n //Commands possible\n ArrayList<String> commands = new ArrayList<>(List.of(\"go\", \"show inventory\", \"pick up\", \"drop\", \"open\", \"eat\", \"talk\"));\n //Existing rooms in game\n ArrayList<Room> rooms = new ArrayList<>((List.of(woods, house1, house2, house3, house3Interior, woods2, river, home)));\n threeLittlePigs = new TextAdventure(\"Three Little Pigs\", commands, rooms, woods);\n\n //Item + item interactions possible\n threeLittlePigs.addInteraction(leafBlower, house1Item, () ->{\n house1.removeItemFromRoom(house1Item);\n house2.setAccessible(true);\n threeLittlePigs.addPoints(10);\n pig1.setIsEatable(true);\n// System.out.println(\"You have destroyed the Straw House.\");\n return \"You have destroyed the Straw House.\";\n\n });\n threeLittlePigs.addInteraction(leafBlower, house2Item, () ->{\n house2.removeItemFromRoom(house2Item);\n house3.setAccessible(true);\n threeLittlePigs.addPoints(10);\n pig2.setIsEatable(true);\n// System.out.println(\"You have destroyed the Stick House.\");\n return \"You have destroyed the Stick House\";\n });\n threeLittlePigs.addInteraction(brick, window, () ->{\n house3Interior.setAccessible(true);\n woods2.setAccessible(true);\n river.setAccessible(true);\n threeLittlePigs.getCurrentRoom().removeItemFromRoom(window);\n threeLittlePigs.getCurrentRoom().removeItemFromRoom(brick);\n house3Interior.addItemToRoom(brick);\n// System.out.println(\"You broke the window with the brick!\");\n return \"You broke the window with the brick!\";\n });\n threeLittlePigs.addInteraction(vine, rock, () -> {\n river.setAccessible(false);\n home.setAccessible(true);\n// System.out.println(\"You move the rock so that you can reach the vine and you swing across the river! The \" +\n// \"vine snaps just as you hit the other shore. You walk forwards from the shore and see a familiar neighborhood. \" +\n// \"Congratulations, you've made it home!\");\n threeLittlePigs.moveUserTo(home);\n return \"You move the rock so that you can reach the vine and you swing across the river! The \" +\n \"vine snaps just as you hit the other shore. You walk forwards from the shore and see a familiar neighborhood. \" +\n \"Congratulations, you've made it home!\";\n });\n\n //OUTLINE FOR LITTLE RED RIDING HOOD TEXT ADVENTURE\n\n Room woods3 = new Room(\"More Woods\");\n woods3.setStory(\"Congrats! You made it through a day of pig-eating and law-evading! After a good nights rest you are ready to\" +\n \" venture back out into the woods and try your luck at finding breakfast. You've recently heard that Grandma Riding-Hood\" +\n \"has fallen ill...Perhaps this is a good opportunity...\");\n woods3.setDescription(\"A dark and ominous forest.\");\n woods2.setAccessible(false); //is this needed?\n\n Room clearing = new Room(\"Clearing\");\n clearing.setStory(\"You heard whistling so you followed the noise which led you to a clearing in the woods where a wee girl in a\" +\n \"red-hooded poncho cape was bending over to pick flowers. To her left is a basket filled with muffins.\");\n clearing.setDescription(\"A sunny clearing in the woods\");\n clearing.setAccessible(false); //is this needed?\n\n Room grandmaHouse = new Room(\"Grandma's House\");\n grandmaHouse.setStory(\"You trot along the path for a while until you get to a wee cabin on a hill. \" +\n \"You smell a human inside!!\");\n grandmaHouse.setDescription(\"A cabin on a hill\");\n grandmaHouse.setAccessible(false); //Unlock once you have 'gotten directions' from lil Red\n\n Room insideGhouse = new Room(\"Inside Grandma's House\");\n insideGhouse.setStory(\"Poor Grandma lying asleep in the bed, she looks very ill, and you are very hungry...\");\n insideGhouse.setDescription(\"A rustic cabin with a huge, four poster bed and many quilts\");\n insideGhouse.setAccessible(false);\n\n Room inBed = new Room(\"Lying in Bed\");\n inBed.setStory(\"After eating Grandma and disguising yourself with her clothes, you decide to take a wee nap before lil Red arrives...\");\n inBed.setDescription(\"Lying amongst the quilts in Grandma's bed\");\n inBed.setAccessible(false); //ONLY UNLOCK ONCE GRANDMA IS EATEN\n\n Room woods4 = new Room(\"More Woods\");\n woods4.setStory(\"Congrats! You feel very full after eating so much today, perhaps its time to return home and get a good nights sleep\");\n woods4.setDescription(\"A dark and ominous forest.\");\n woods4.setAccessible(false); ////ONLY UNLOCK ONCE GRANDMA and lil Red are eaten\n\n //Now make it possible to go back to the original Room -- \"Home??\"\n\n }",
"private void crossPressed() {\n\t\tif (!talkmode) {\n\t\t\tif (checkLoot() || checkNearbyVillagers() || checkDoors(doors, player.direction) || checkSigns()) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else {\n\t\t\tif (question) {\n\t\t\t\texitQuestionDialog();\n\t\t\t}\n\n\t\t\tLoot g = dialog.getGift();\n\t\t\tif (g != null) {\n\t\t\t\tLoad.collectLoot(g);\n\t\t\t}\n\t\t\tString takeName = dialog.getTakeName();\n\t\t\tif (takeName != null) {\n\t\t\t\tint takeAmount = dialog.getTakeAmount();\n\t\t\t\tif (takeName.equals(\"gold\")) {\n\t\t\t\t\tLoad.getPartyItems().addGold(-takeAmount);\n\t\t\t\t} else {\n\t\t\t\t\tLoad.getPartyItems().take(takeName, takeAmount);\n\t\t\t\t}\n\t\t\t}\n\t\t\tHashMap<String, Integer> t = dialog.getBeforeTriggers();\n\t\t\tHashMap<String, Integer> triggerAdds = dialog.getTriggerAdds();\n\t\t\tboolean finished = dialog.isFinished();\n\t\t\tdoTriggers(t);\n\t\t\tif (triggerAdds != null) {\n\t\t\t\tDatabase.incrementStatus(triggerAdds);\n\t\t\t}\n\t\t\tif (finished) {\n\t\t\t\tsetTalking(false);\n\t\t\t\tif (dialog.shouldTrigger()) {\n\t\t\t\t\tt = dialog.getTriggers();\n\t\t\t\t\tdoTriggers(t);\n\t\t\t\t\texecuteTrigger(talkingVillager);\n\t\t\t\t} else {\n\t\t\t\t\tdialog.resetDialog();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (dialog.isQuestion()) {\n\t\t\t\t\tinitQuestionDialog();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"private void goToDetailedRune()\n\t{\n\t\tLog.e(\"before pages\", String.valueOf(player.getSummonerID()));\n\t\tRunePages tempPages = player.getPages().get(String.valueOf(player.getSummonerID()));\n\t\tLog.e(\"after pages\", String.valueOf(tempPages.getSummonerId()));\n\t\tSet<RunePage> tempSetPages = tempPages.getPages();\n\t\tRunePage currentPage = new RunePage();\n\t\tfor (RunePage tempPage : tempSetPages)\n\t\t{\n\t\t\tif (tempPage.getName() == player.getCurrentRunePage())\n\t\t\t{\n\t\t\t\tLog.e(\"temp page\", \"page found\");\n\t\t\t\tcurrentPage = tempPage;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// now we have the page, need to get the runes out of it\n\t\tList<RuneSlot> tempSlots = currentPage.getSlots();\n\t\tArrayList<Integer> tempIDs = new ArrayList<Integer>();\n\t\tLog.e(\"tempSlots size\", String.valueOf(tempSlots.size()));\n\t\tfor (int i = 0; i < tempSlots.size(); i++)\n\t\t{\t\n\t\t\tLog.e(\"tempSlot\", String.valueOf(tempSlots.get(i).getRune()));\n\t\t\ttempIDs.add(tempSlots.get(i).getRune());\n\t\t}\n\t\tfillRuneList(tempIDs);\n\t\t// go to the screen\n\t\tIntent intent = new Intent(activity, RuneDetailActivity.class);\n\t\tactivity.startActivity(intent);\n\t}",
"private void dealerTurns()\r\n\t{\r\n\t\t// loops until dealer stands or wins/loses\r\n\t\twhile ( !dealer.getStand() && !endGame )\r\n\t\t{\r\n\t\t\t// checks total score of dealer's hand\r\n\t\t\tif ( dealer.getTotal() < 17)\r\n\t\t\t{\r\n\t\t\t\t// adds card to dealer hand from cardDeck\r\n\t\t\t\tdealer.hit( cardDeck.draw() );\r\n\t\t\t\t\r\n\t\t\t\t// displays current dealer hand\r\n\t\t\t\tdisplayPlayerCards(DEALER_ID);\r\n\t\t\t\t\r\n\t\t\t\t// evaluates victory conditions\r\n\t\t\t\tevaluateWin(false);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t/* Dealer stands if they reach or already have 17 points in their hand.\r\n\t\t\t\tNo evaluation is called, because this will be handled by the final victory check. */\r\n\t\t\t\tdealer.stand();\r\n\t\t\t} // end if else\r\n\t\t} // end while\r\n\t}",
"public static boolean testDessertSolvers() {\n // Check first dessert variable skips with 8 guests and 1 skips\n Guest last = DessertSolvers.firstDessertVariableSkips(8, 1);\n // The last guest should be #8\n if (!last.toString().equals(\"#8\")) {\n System.out.println(last.toString());\n return false;\n }\n // Check first dessert variable skips with 8 guests and 3 skips\n last = DessertSolvers.firstDessertVariableSkips(8, 3);\n // The last guest should be #8\n if (!last.toString().equals(\"#3\")) {\n System.out.println(last.toString());\n return false;\n }\n // Check first dessert variable course with 8 guests and 1 course\n last = DessertSolvers.firstDessertVariableCourses(8, 1);\n // The first guest to be reserved with dessert should be #1\n if (!last.toString().equals(\"#1\")) {\n System.out.println(last.toString());\n return false;\n }\n // Check first dessert variable course with 8 guests and 2 courses\n last = DessertSolvers.firstDessertVariableCourses(8, 2);\n // The first guest to be reserved with dessert should be #8\n if (!last.toString().equals(\"#8\")) {\n System.out.println(last.toString());\n return false;\n }\n // Check first dessert variable course with 8 guests and 4 courses\n last = DessertSolvers.firstDessertVariableCourses(8, 4);\n // The first guest to be reserved with dessert should be #5\n if (!last.toString().equals(\"#5\")) {\n System.out.println(last.toString());\n return false;\n }\n // No bug, return true\n return true;\n }",
"public static String diagnose(int maxRepeats) {\n if (maxRepeats >= 181) return \"not Human\";\n else if (maxRepeats >= 40) return \"Huntington's\";\n else if (maxRepeats >= 36) return \"high risk\";\n else if (maxRepeats >= 10) return \"normal\";\n else return \"not human\";\n }",
"public void lookAround() {\n\t\t\tdisplay(\"The room is full of gold!\");\n\t\t}",
"public void reveal(GameState pState, int[] pSpecies, Deadline pDue) {\n for (int i = 0; i < pSpecies.length; i++) {\n if (pDue.remainingMs() < timeBreak)\n break;\n int birdType = pSpecies[i];\n if (birdType == Constants.SPECIES_UNKNOWN)\n continue;\n\n BirdModel bm = birdModelGuesses.get(birdType);\n Bird bird = pState.getBird(i);\n int[] obsSeq = getBirdSeqUntilDeath(bird);\n if (bm == null) {\n birdModelGuesses.put(birdType, new BirdModel(birdType));\n }\n birdModelGuesses.get(birdType).addSequence(obsSeq);\n// System.err.println(\"Bird \" + i + \" is of specie \" + pSpecies[i]);\n }\n\n\n //Räkna Baum welch\n for(BirdModel bm : birdModelGuesses.values()) {\n if (pDue.remainingMs() < timeBreak)\n break;\n int seqCount = bm.savedSequences.size();\n if (seqCount > 0) {\n// int[][] obsSeqs = bm.savedSequences.toArray(new int[seqCount][timePeriod]);\n\n BaumWelch bw = new BaumWelch(bm.model, bm.savedSequences);\n bw.run();\n// bm.emptySavedSequences();\n }\n }\n t=0;\n }",
"private static void soldierCode() throws GameActionException {\n\t\tRobotInfo[] visibleEnemyArray = rc.senseHostileRobots(rc.getLocation(), 1000000);\n\t\tSignal[] incomingSignals = rc.emptySignalQueue();\n\t\tfor(Signal s:incomingSignals){\n\t\t\tint[] message = s.getMessage();\n\t\t\tif(s.getTeam()==rc.getTeam()){\n\t\t\t\tif(message!=null){\n\t\t\t\t\tif(message[0]%10==0){\n\t\t\t\t\t\tint x = message[1]/100000;\n\t\t\t\t\t\tint y = message[1]%100000;\n\t\t\t\t\t\tcenter= new MapLocation(x,y);\n\t\t\t\t\t\tint r = message[0]/10;\n\t\t\t\t\t\tradius=r;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tint dist = rc.getLocation().distanceSquaredTo(center);\n\t\tif (visibleEnemyArray.length==0) {\n\t\t\tif (goal!=null&&(rc.senseRubble(goal)<100 || rc.senseRobotAtLocation(goal)!=null)) {\n\t\t\t\tgoal = null;\n\t\t\t\trc.setIndicatorString(0, \"done clearing\");\n\t\t\t}\t\n\t\t\tif(goal==null) {\n\t\t\t\tMapLocation[] locs = MapLocation.getAllMapLocationsWithinRadiusSq(rc.getLocation(), 8);\n\t\t\t\tArrayList<MapLocation> inside = new ArrayList<MapLocation>();\n\t\t\t\tfor(MapLocation loc: locs) {\n\t\t\t\t\tif (loc.distanceSquaredTo(center)<=1.5*radius) {\n\t\t\t\t\t\tinside.add(loc);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor(MapLocation l: inside) {\n\t\t\t\t\tif (rc.senseRubble(l)>99 && rc.senseRobotAtLocation(l)==null) {\n\t\t\t\t\t\tgoal = l;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tUtility.tryToMove(goal);\n\t\t\t}\n\t\t\t\n\t\t\tif (dist>radius && dist< 4*radius) { //Explore\n\t\t\t\tMapLocation travel = soldierFind();\n\t\t\t\tUtility.tryToMove(travel);\n\t\t\t}else{ //Move back\n\t\t\t\tMapLocation loc = center.add(center.directionTo(rc.getLocation()), (int)Math.pow(radius, 0.5)+1);\n\t\t\t\tUtility.tryToMove(loc);\n\t\t\t}\n\t\t} else { //Kite\n\t\t\tkite(visibleEnemyArray);\n\t\t}\n\t}",
"void aDayPasses(){\n\t\t\n\t\t/**\n\t\t * Modify wait time if still exists\n\t\t */\n\t\tif(!daysUntilStarts.equals(0)){\n\t\t\tdaysUntilStarts--;\n\t\t\tif((!hasInstructor() || getSize() == 0) && daysUntilStarts.equals(0)){\n\t\t\t\tif(hasInstructor())\n\t\t\t\t\tinstructor.unassignCourse();\n\t\t\t\tfor(Student student : enrolled){\n\t\t\t\t\tstudent.dropCourse();\n\t\t\t\t}\n\t\t\t\tsubject.unassign();\n\t\t\t\tinstructor = null;\n\t\t\t\tenrolled = new ArrayList<Student>();\n\t\t\t\tcancelled = true;\n\t\t\t} else if (daysUntilStarts.equals(0)) {\n\t\t\t\tsubject.unassign();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t/**\n\t\t * Modify run time if still exists\n\t\t */\n\t\tif(!daysToRun.equals(0)){\n\t\t\tdaysToRun--;\n\t\t}\n\t\t/**\n\t\t * If couse finished un-assigned people from it\n\t\t */\n\t\tif(daysToRun.equals(0) && !finished){\n\t\t\tfor(Student student : enrolled){\n\t\t\t\tstudent.graduate(subject);\n\n\t\t\t}\n\t\t\tinstructor.unassignCourse();\n\t\t\tinstructor = null;\n\t\t\tfinished = true;\n\t\t}\n\t}",
"@Test\n public void testCastWithThadaAdelAcquisitor() {\n addCard(Zone.BATTLEFIELD, playerA, \"Swamp\", 3);\n // Islandwalk\n // Whenever Thada Adel, Acquisitor deals combat damage to a player, search that player's library for an artifact card and exile it. Then that player shuffles their library.\n // Until end of turn, you may play that card.\n addCard(Zone.BATTLEFIELD, playerA, \"Thada Adel, Acquisitor\", 1); // Creature {1}{U}{U} 2/2\n\n addCard(Zone.BATTLEFIELD, playerB, \"Swamp\", 3);\n addCard(Zone.BATTLEFIELD, playerB, \"Forest\", 2);\n // Sacrifice Bottle Gnomes: You gain 3 life.\n addCard(Zone.LIBRARY, playerB, \"Bottle Gnomes\", 8); // Creature {3} 1/3\n // Return target creature card from your graveyard to your hand.\n addCard(Zone.HAND, playerB, \"Wildwood Rebirth\"); // Instant {1}{G}\n\n attack(1, playerA, \"Thada Adel, Acquisitor\");\n setChoice(playerA, \"Bottle Gnomes\");\n\n castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, \"Bottle Gnomes\");\n activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, \"Sacrifice\");\n\n castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, \"Wildwood Rebirth\", \"Bottle Gnomes\");\n castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, \"Bottle Gnomes\");\n\n setStopAt(2, PhaseStep.BEGIN_COMBAT);\n execute();\n\n assertLife(playerB, 18);\n assertLife(playerA, 23);\n assertGraveyardCount(playerB, \"Wildwood Rebirth\", 1);\n assertPermanentCount(playerB, \"Bottle Gnomes\", 1);\n }",
"public static void main(String[] args) {\n MadScientist madScientist = new MadScientist(new TimeMachine());\r\n LinearlyTimeTraveler linearlyTimeTraveler = new LinearlyTimeTraveler(\"LinearMan\", 100d);\r\n DoublyTimeTraveler doublyTimeTraveler = new DoublyTimeTraveler(\"DoubleMan\", 100d);\r\n ExpolyTimeTraveler expolyTimeTraveler = new ExpolyTimeTraveler(\"ExpoMan\", 100d, DECAY_CONSTANT);\r\n // experiment on each TimeTraveler\r\n // a TimeTraveler should always start with 100 years of time travel strength\r\n // one TimeTraveler implementation should linearly decay (i.e., one year of actual time travel reduces the\r\n // time traveler's ability by one year)\r\n //250 multi-thread to speed up the process\r\n for (int i=0; i<250; i++) {\r\n madScientist.experiment(linearlyTimeTraveler);\r\n }\r\n // one TimeTraveler implementation should decay double the travel value (i.e., one year of actual time travel reduces\r\n // the time traveler's ability by two years)\r\n //150 multi-thread\r\n for (int i=0; i<150; i++) {\r\n madScientist.experiment(doublyTimeTraveler);\r\n }\r\n // one TimeTraveler implementation should have exponential decay with a decay constant inputted by the scientist (see http://en.wikipedia.org/wiki/Exponential_decay)\r\n //50 multi-thread\r\n for (int i=0; i<50; i++) {\r\n madScientist.experiment(expolyTimeTraveler);\r\n }\r\n // continue to experiment until all the TimeTraveler's have exhausted their ability to travel\r\n }",
"public void talkToCharacter(Room room)//Made by Lexi\n {\n if (currentRoom.getTitle().equals(\"outside\")) {\n System.out.println(\"All you need to do is unlock the door...\");\n System.out.println(\"Hint: use INSPECT to examine an item in detail.\");\n if (player.inventoryContains(key))\n {\n kitchen.setLocked(false);\n System.out.println(\"The door makes a loud click.\");\n }\n }\n \n \n else if (currentRoom.getTitle().equals(\"kitchen\")) {\n System.out.println(\"In order to move on to the next room, you must first find an item which can be found by solving this riddle: \");\n System.out.println(\"A box without hinges, key, or lid, yet golden treasure inside is hid.\");\n System.out.println(\"The answer is an item in this room that will help you escape and move on to the next room.\");\n if (player.inventoryContains(egg))\n {\n poolRoom.setLocked(false);\n System.out.println(\"The door makes a loud click.\");\n }\n }\n else if (currentRoom.getTitle().equals(\"pool room\")) {\n System.out.println(\"In order to escape this room you must solve this next riddle: \");\n System.out.println(\"Wash me and I am not clean. Don't wash me and then I'm clean. What I Am?\"); //water\n System.out.println(\"The answer to the riddle is where you'll find the object needed to escape this room... \");\n if (player.inventoryContains(snorkel))\n {\n library.setLocked(false);\n System.out.println(\"The door makes a loud click.\");\n }\n }\n else if (currentRoom.getTitle().equals(\"library\")) {\n System.out.println(\"In order to escape this room you must solve this next riddle: \");\n System.out.println(\"The objects, or people, have been removed from their previous localities through the power of a naturally moving phenomenon.\");\n System.out.println(\"Once you have figured out what item belongs to the answer of this riddle you will have escaped the building!\");\n if (player.inventoryContains(blueBook))\n {\n \n exitRoom.setLocked(false);\n System.out.println(\"The door makes a loud click.\");\n }\n }\n else {\n System.out.println(\"There is nobody here, so you talk to yourself...\");\n }\n }",
"public static Activity zulrah() {\n\n Activity turnOffAllPrayers = Arrays.stream(Prayers.getActive())\n .map(prayer -> Activities.unpray(prayer))\n .collect(new ActivityCollector())\n .addPreReq(House::isInside)\n .withName(\"Turning off all prayers\")\n .build();\n\n Activity drinkFromPool = Activity.newBuilder()\n .withName(\"Drinking from pool for anti-venom + health + prayer\")\n .addPreReq(House::isInside)\n .addPreReq(() -> SceneObjects.getNearest(\"Ornate rejuvenation pool\") != null)\n .tick()\n .addSubActivity(() -> SceneObjects.getNearest(\"Ornate rejuvenation pool\").click())\n .thenSleepUntil(() -> Movement.getRunEnergy() == 100)\n .withoutPausingBetweenActivities()\n .build();\n\n Activity stepStone = Activity.newBuilder()\n .onlyIfInArea(Area.rectangular(2145, 3075, 2154, 3066))\n .addPreReq(() -> SceneObjects.getNearest(\"Stepping stone\") != null)\n .addSubActivity(() -> SceneObjects.getNearest(\"Stepping stone\").interact(\"Cross\"))\n .completeAnimation()\n .build();\n\n Activity goToDock = Activity.newBuilder()\n .onlyIfInArea(Area.rectangular(2158, 3076, 2207, 3045))\n .addSubActivity(Activities.moveTo(new Position(2211, 3056)))\n .build();\n\n Activity prepareMage = Activity.newBuilder()\n .withName(\"Preparing for mage form\")\n .addPreReq(() -> ZulrahStyle.classify().equals(ZulrahStyle.MAGE))\n .addPreReq(() -> !Equipment.contains(\"Trident of the swamp\"))\n .addSubActivity(Activities.pray(Prayer.PROTECT_FROM_MAGIC))\n .addSubActivity(Activities.unpray(Prayer.AUGURY))\n .addSubActivity(Activities.pray(Prayer.EAGLE_EYE))\n .addSubActivity(Activities.equip(\"Pegasian boots\"))\n .addSubActivity(Activities.equip(\"Toxic blowpipe\"))\n .addSubActivity(Activities.equip(\"Necklace of anguish\"))\n .addSubActivity(Activities.equip(\"Void ranger helm\"))\n .addSubActivity(Activities.equip(\"Ava's accumulator\"))\n .withoutPausingBetweenActivities()\n .build();\n\n Activity prepareRange = Activity.newBuilder()\n .withName(\"Preparing for range form\")\n .addPreReq(() -> ZulrahStyle.classify().equals(ZulrahStyle.RANGED))\n .addPreReq(() -> !Equipment.contains(\"Toxic blowpipe\"))\n .addSubActivity(Activities.pray(Prayer.PROTECT_FROM_MISSILES))\n .addSubActivity(Activities.unpray(Prayer.EAGLE_EYE))\n .addSubActivity(Activities.pray(Prayer.AUGURY))\n .addSubActivity(Activities.equip(\"Eternal boots\"))\n .addSubActivity(Activities.equip(\"Void mage helm\"))\n .addSubActivity(Activities.equip(\"Occult necklace\"))\n .addSubActivity(Activities.equip(\"Trident of the swamp\"))\n .addSubActivity(Activities.equip(\"Mage's book\"))\n .addSubActivity(Activities.equip(\"Imbued saradomin cape\"))\n .withoutPausingBetweenActivities()\n .build();\n\n Activity prepareMelee = Activity.newBuilder()\n .withName(\"Preparing for melee form\")\n .addPreReq(() -> ZulrahStyle.classify().equals(ZulrahStyle.MELEE))\n .addPreReq(() -> !Equipment.contains(\"Trident of the swamp\"))\n .addSubActivity(Activities.turnOffAllPrayers())\n .addSubActivity(Activities.pray(Prayer.AUGURY))\n .addSubActivity(Activities.equip(\"Eternal boots\"))\n .addSubActivity(Activities.equip(\"Void mage helm\"))\n .addSubActivity(Activities.equip(\"Occult necklace\"))\n .addSubActivity(Activities.equip(\"Trident of the swamp\"))\n .addSubActivity(Activities.equip(\"Mage's book\"))\n .addSubActivity(Activities.equip(\"Imbued saradomin cape\"))\n .withoutPausingBetweenActivities()\n .build();\n\n Activity takePhaseAction = Activity.newBuilder()\n .addSubActivity(() -> PatternClassifier\n .classifyPattern()\n .map(PatternClassifier.PatternPhase::getActivity)\n .ifPresent(Activity::run))\n .build();\n\n Activity killZulrah = Activity.newBuilder()\n .withName(\"Handling zulrah instance\")\n .addPreReq(Game.getClient()::isInInstancedScene)\n .addPreReq(() -> !House.isInside())\n .addSubActivity(prepareMage)\n .addSubActivity(prepareMelee)\n .addSubActivity(prepareRange)\n .addSubActivity(takePhaseAction)\n .thenPauseFor(Duration.ofMillis(600))\n .withoutPausingBetweenActivities()\n .untilPreconditionsFail()\n .build()\n .addPreActivity(Activity.of(() -> PhaseClassifier.reset()));\n\n return Activity.newBuilder()\n .addSubActivity(turnOffAllPrayers)\n .addSubActivity(drinkFromPool)\n .addSubActivity(Activities.useHouseFairyRing(FairyRing.Destination.BJS))\n .addSubActivity(stepStone)\n .addSubActivity(goToDock)\n .addSubActivity(killZulrah)\n .withoutPausingBetweenActivities()\n .build();\n }",
"public void playRollingADie() {\n\t\tSystem.out.print(\"The pirates ask you to play 'Rolling a Die'. You have to predict what is the outcome. \" + \"\\n\" + \"You can choose between: \");\n\t\tArrayList<String> gameElements2 = new ArrayList<String>(3);\n\t\tgameElements2.add(\"Even\");\n\t\tgameElements2.add(\"Odd\");\n\t\tboolean state = false;\n\t\twhile (state == false) {\n\t\t\tSystem.out.println(\"(1) Even\");\n\t\t\tSystem.out.println(\"(2) Odd\");\n\t\t\ttry { \n\t\t\t\tint selectedAction = scanner.nextInt();\n\t\t\t\tif (selectedAction <= 2 && selectedAction > 0) {\n\t\t\t\tint decision = game.determineWinnningRollingADie();\n\t\t\t\tint piratesThrows = game.getWhatPiratesThrowRD(decision, gameElements2.get(selectedAction-1));\n\t\t\t\tSystem.out.println(\"The die is showing \" + piratesThrows);\n\t\t\t\tif (decision == 0) {\n\t\t\t\t\tstate = true;\n\t\t\t\t\tint piratesDemand = game.getPiratesDemand();\n\t\t\t\t\tSystem.out.println(\"You lose! Pirates demands: \" + piratesDemand + \" coins\");\n\t\t\t\t\tif (game.checkPirateSatisfaction()) {\n\t\t\t\t\t\tgame.removeAllGoods();\n\t\t\t\t\t\tgame.backToMain();\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tgame.removeAllGoods();\n\t\t\t\t\t\tint money = game.getMoney();\n\t\t\t\t\t\tgame.updateMoney(money * -1);\n\t\t\t\t\t\tgame.gameOver(\"You lose play rock paper scissor game! \\nthe pirate took all of your money and your items in your ship!\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tstate = true;\n\t\t\t\t\tSystem.out.println(\"You Win!! You can Continue your journey to your destination!\");\n\t\t\t\t\tgame.backToMain();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.println(\"Please choose from actions above\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.out.println(INPUT_REQUIREMENTS);\n\t\t\t\tscanner.nextLine();\n\t\t\t}\n\t\t\t\n\t\t}\n\t}",
"private void makeValidActionsDiscretized() {\n validActionsDiscretized = new ArrayList<>();\n\n List<ActionType> actionTypes = problemSpec.getLevel().getAvailableActions();\n\n // Valid tire pressures\n List<TirePressure> tirePressures = Arrays.asList(\n TirePressure.FIFTY_PERCENT,\n TirePressure.SEVENTY_FIVE_PERCENT,\n TirePressure.ONE_HUNDRED_PERCENT\n );\n\n // Valid fuel levels (note that this is an arbitrary discretization)\n List<Integer> fuelLevels = new ArrayList<>();\n int fuelInterval = ProblemSpec.FUEL_MAX / FUEL_DISCRETE_INTERVALS;\n\n for (int i = 0; i < FUEL_DISCRETE_INTERVALS; i++) {\n fuelLevels.add(fuelInterval * i);\n }\n\n // Go through A1-A8 and add all possible combinations of the parameters\n for (ActionType actionType : actionTypes) {\n switch (actionType.getActionNo()) {\n case 1:\n validActionsDiscretized.add(new Action(actionType));\n break;\n\n case 2:\n for (String car : problemSpec.getCarOrder()) {\n validActionsDiscretized.add(new Action(actionType, car));\n }\n\n break;\n\n case 3:\n for (String driver : problemSpec.getDriverOrder()) {\n validActionsDiscretized.add(new Action(actionType, driver));\n }\n\n break;\n\n case 4:\n for (Tire tire : problemSpec.getTireOrder()) {\n validActionsDiscretized.add(new Action(actionType, tire));\n }\n\n break;\n\n case 5:\n for (int fuel : fuelLevels) {\n validActionsDiscretized.add(new Action(actionType, fuel));\n }\n\n break;\n\n case 6:\n for (TirePressure pressure : tirePressures) {\n validActionsDiscretized.add(new Action(actionType, pressure));\n }\n\n break;\n case 7:\n for (String car : problemSpec.getCarOrder()) {\n for (String driver : problemSpec.getDriverOrder()) {\n validActionsDiscretized.add(new Action(actionType, car, driver));\n }\n }\n\n break;\n\n case 8:\n for (TirePressure pressure : tirePressures) {\n for (int fuel : fuelLevels) {\n for (Tire tire : problemSpec.getTireOrder()) {\n validActionsDiscretized.add(new Action(actionType, tire, fuel,\n pressure));\n }\n }\n }\n\n break;\n }\n }\n }",
"static private void TalkTo() {\n if (BSChristiansen.getCurrentRoom() == currentRoom) {\n System.out.println(BSChristiansen.getDescription() + \", yet he still gives you good advice:\\n\");\n System.out.println(BSChristiansen.getDialog(0));\n System.out.println(\"\");\n woundedSurvivor();\n } else if (mysteriousCrab.getCurrentRoom() == currentRoom && inventory.getInventory().containsKey(\"Shroom\")) {\n System.out.println(mysteriousCrab.getDescription() + \"\\n\" + mysteriousCrab.getDialog(0));\n } else {\n System.out.println(\"There is nobody to communicate with in this Room\");\n }\n\n }",
"private void setupPhase() {\n ClickObserver.getInstance().setTerrainFlag(\"Setup: SelectStartTerrain\");\n for (final Player p : playerList) {\n \t\n this.player = p;\n player.flipAllUp();\n ClickObserver.getInstance().setActivePlayer(this.player);\n pause();\n \n // Cover all terrains, uncover starting pos ones\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n GUI.getRackGui().setOwner(player);\n \tBoard.applyCovers();\n \tfor (Coord spot : startingPos) {\n \t\tif (!Board.getTerrainWithCoord(spot).isOccupied())\n \t\t\tBoard.getTerrainWithCoord(spot).uncover();\n \t}\n GUI.getHelpText().setText(\"Setup Phase: \" + p.getName() \n + \", select a valid hex to start your kingdom.\");\n }\n });\n while( isPaused ){\n int num = p.getHexesOwned().size();\n if( num == 1 ){\n unPause();\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n \tPlayerBoard.getInstance().updateGold(player);\n }\n });\n System.out.println(\"done\");\n }\n try { Thread.sleep(100); } catch( Exception e ){ return; }\n }\n player.flipAllDown();\n }\n pause();\n \n // Now that all players have selected starting spots, flip over all terrains\n // *Note: Not sure I understand the rules with regards to this, but I think this is right\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n \t Board.showTerrains();\n Board.removeBadWaters();\n }\n });\n while( isPaused ){\n try { Thread.sleep(100); } catch( Exception e ){ return; }\n }\n \n // Check if player has at least two land hexes around starting spot\n for( final Player p : playerList ) {\n this.player = p;\n\n player.flipAllUp();\n ClickObserver.getInstance().setActivePlayer(this.player);\n pause();\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n GUI.getHelpText().setText(p.getName() \n + \", select a water hex to replace with from deck\");\n Board.removeBadAdjWaters();\n }\n });\n while( isPaused ){\n try { Thread.sleep(100); } catch( Exception e ){ return; }\n }\n\n player.flipAllDown();\n }\n \n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n \t\t\tTileDeck.getInstance().slideOut();\n }\n });\n\n \n // next prompt each player to select an adjacent hex\n ClickObserver.getInstance().setTerrainFlag(\"Setup: SelectTerrain\");\n // loop 2 times so each player adds 2 more hexes\n for( int i=0; i<2; i++ ){\n for( final Player p : playerList ) {\n this.player = p;\n\n player.flipAllUp();\n ClickObserver.getInstance().setActivePlayer(this.player);\n pause();\n \n final ArrayList<Terrain> ownedHexes = player.getHexesOwned();\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n Board.applyCovers();\n }\n });\n \tfor (Terrain t1 : ownedHexes) {\n \t\tIterator<Coord> keySetIterator = Board.getTerrains().keySet().iterator();\n \twhile(keySetIterator.hasNext()) {\n \t\tCoord key = keySetIterator.next();\n \t\tfinal Terrain t2 = Board.getTerrains().get(key);\n \t\tif (t2.compareTo(t1) == 1 && !t2.isOccupied() && !t2.getType().equals(\"SEA\")) {\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n \t\t\tt2.uncover();\n }\n });\n \t\t}\n \t}\n \t}\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n GUI.getRackGui().setOwner(player);\n GUI.getHelpText().setText(\"Setup Phase: \" + p.getName() \n + \", select an adjacent hex to add to your kingdom.\");\n }\n });\n // forces the GameLoop thread to wait until unpaused\n while( isPaused ){\n try { Thread.sleep(100); } catch( Exception e ){ return; }\n }\n player.flipAllDown();\n }\n }\n // prompt each player to place their first tower\n ClickObserver.getInstance().setTerrainFlag(\"Construction: ConstructFort\");\n for( final Player p : playerList ) {\n this.player = p;\n \n player.flipAllUp();\n ClickObserver.getInstance().setActivePlayer(this.player);\n pause();\n \n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n Board.applyCovers();\n GUI.getRackGui().setOwner(player);\n GUI.getHelpText().setText(\"Setup Phase: \" + p.getName() \n + \", select one of your tiles to place a tower.\");\n }\n });\n \n // sleeps to avoid null pointer (runLater is called before player.getHexesOwned() below)\n try { Thread.sleep(50); } catch( Exception e ){ return; }\n ArrayList<Terrain> ownedHexes = player.getHexesOwned();\n \n for (final Terrain t : ownedHexes) {\n \t\n \tif (t.getOwner().getName().equals(player.getName())) { \n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n \t\tt.uncover();\n }\n });\n \t}\n }\n while( isPaused ){\n try { Thread.sleep(100); } catch( Exception e ){ return; }\n }\n player.flipAllDown();\n }\n // allow players to add some or all things to their tiles.\n ClickObserver.getInstance().setTerrainFlag(\"RecruitingThings: PlaceThings\");\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n GUI.getDoneButton().setDisable(false);\n }\n });\n for (final Player p : playerList) {\n this.player = p;\n player.flipAllUp();\n doneClicked = false;\n ClickObserver.getInstance().setClickedTerrain(p.getHexesOwned().get(2));\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n \tClickObserver.getInstance().whenTerrainClicked();\n GUI.getRackGui().setOwner(player);\n Board.applyCovers();\n GUI.getHelpText().setText(\"Setup Phase: \" + p.getName()\n + \", place some or all of your things on a tile you own.\");\n }\n });\n ClickObserver.getInstance().setActivePlayer(this.player);\n pause();\n ArrayList<Terrain> ownedHexes = player.getHexesOwned();\n for (final Terrain t : ownedHexes) {\n \tif (t.getOwner().getName().equals(player.getName())) {\n\t Platform.runLater(new Runnable() {\n\t @Override\n\t public void run() {\n\t \t\tt.uncover();\n\t }\n\t });\n \t}\n }\n \n while (isPaused) {\n try { Thread.sleep(100); } catch(Exception e) { return; }\n }\n player.flipAllDown();\n }\n ClickObserver.getInstance().setTerrainFlag(\"\");\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n Board.removeCovers();\n }\n });\n }",
"public void resetForNextDay(){\n board.xml.set.generateSceneCards();\n int playerCount = board.getPlayerCount();\n Player[] players = board.getPlayers();\n for(int i = 0; i < playerCount; i++) {\n players[i].setPos(\"Trailer\");\n }\n\n board.incrementDay();\n board.resetTurn();\n if(board.getDay() > this.dayLimit){\n endGame(players);\n }\n }",
"void easy_ride_old (double min_lift, double start_speed) { \n double pitch = 0;\n double min_drag = 10000.0;\n double min_drag_speed = -1;\n for (double speed = start_speed; speed < v_max; speed += 0.5) {\n velocity = speed;\n trace(\"velocity: \" + velocity);\n for (pitch = 0; pitch <= aoa_max; pitch += 0.1) {\n craft_pitch = pitch;\n //computeFlowAndRegenPlotAndAdjust();\n recomp_all_parts();\n // if (total_drag() >= max_drag) {\n // trace(\"warning speed: \" + speed + \" pitch: \" + pitch + \" lift \" + foil_lift());\n // return;\n // }\n if (foil_lift() >= min_lift) {\n double drag = total_drag();\n if (min_drag > drag) {\n min_drag = drag;\n min_drag_speed = velocity;\n break;\n } else {\n // drag goes up now. can be done now, but\n // as a heuristic, now try from the upepr limit, and then find range:\n max_speed(min_lift, min_drag + 2, false);\n if (velocity < min_drag_speed) {\n // something went wrong (iteration stepped over the sweets spot etc)\n // so we take min_lift, min_drag, and min_drag_speed as is\n make_cruising_info(min_lift, min_drag, min_drag_speed); \n System.out.println(\"\\nDone!\\n----------------\\n\" + cruising_info);\n } else {\n // done, report with average of min_drag_speed and velocity\n make_cruising_info(min_lift, min_drag+1, (min_drag_speed+velocity)/2); \n trace(\"done with refinement! \");\n System.out.println(\"\\nDone!\\n----------------\\n\" + cruising_info);\n }\n return;\n }\n }\n }\n }\n }",
"private double eatingPreservedFoodPhase(double time) {\n\t\tdouble remainingTime = 0D;\n\t\tdouble eatingTime = time;\n\t\n\t\tint rand = RandomUtil.getRandomInt(3);\n\t\t\n\t\tif (rand == 3) {\n\t\t\t// try out dessert instead of eating preserved food\n\t\t\tsetPhase(PICK_UP_DESSERT);\n\t\t\tremainingTime = time * .75;\n\t\t}\n\t\telse {\n\t\t\t\n\t\t\tboolean enoughFood = eatPreservedFood(eatingTime);\n\t\n\t\t\t// If not enough preserved food available, change to dessert phase.\n\t\t\tif (!enoughFood) {\n\t\t\t\tsetPhase(PICK_UP_DESSERT);\n\t\t\t\tremainingTime = time * .5;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Report eating preserved food.\n\t\t\t\tsetDescription(Msg.getString(\"Task.description.eatDrink.preserved\")); //$NON-NLS-1$\n\t\t\t\t\n\t\t\t\tif ((totalEatingTime + eatingTime) >= eatingDuration) {\n\t\t\t\t\teatingTime = eatingDuration - totalEatingTime;\n\t\t\t\t}\n\n\t\t\t\tif (cumulativeProportion > foodConsumptionRate) {\n\t\t\t\t\tendTask();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (eatingTime < time) {\n\t\t\t\t\tremainingTime = time - eatingTime;\n\t\t\t\t}\n\n\t\t\t\ttotalEatingTime += eatingTime;\n\n\t\t\t\tif (totalEatingTime > getDuration())\n\t\t\t\t\tendTask();\n\t\t\t\t\t\t\n\t\t\t\tconsumeWater(false);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn remainingTime;\n\t}",
"private void displayRent(){\r\n\r\n System.out.println(\"To rent:\");\r\n for(HardwareDevice devices: hardwares){\r\n\r\n devices.displayDescription();\r\n }\r\n }",
"public void play() {\n List<String> playersData = getGameInput().getPlayersData();\n for (int id = 0; id < playersData.size() / Constants.DATAENTITY; id++) {\n getHeroes().add(getHeroFactory().getHero(\n playersData.get(id * Constants.DATAENTITY),\n Integer.parseInt(\n playersData.get(\n id * Constants.DATAENTITY\n + Constants.INDEXPOSX)),\n Integer.parseInt(\n playersData.get(\n id * Constants.DATAENTITY\n + Constants.INDEXPOSY)),\n id));\n }\n // We create the angels and add them to angels list.\n List<Integer> numOfAngels = getGameInput().getNumOfAngels();\n List<String> angelsData = getGameInput().getAngelsData();\n for (int i = 0; i < angelsData.size() / Constants.DATAENTITY; i++) {\n getAngels().add(getAngelsFactory().getAngel(\n angelsData.get(i * Constants.DATAENTITY),\n Integer.parseInt(\n angelsData.get(\n i * Constants.DATAENTITY\n + Constants.INDEXPOSX)),\n Integer.parseInt(\n angelsData.get(\n i * Constants.DATAENTITY\n + Constants.INDEXPOSY))));\n }\n\n getUtl().prepareAdmins();\n\n int angelCounter = 0; // To iterate through all angels only once.\n // We start the actual game.\n for (int i = 0; i < getMovements().size(); i++) { // For every round.\n\n getUtl().printRound(i + 1); // We start printing from round 1...\n\n for (int j = 0; j < getHeroes().size(); j++) {\n /* Apply overtime ability if the case and then hero chooses\n * strategy and moves if he is not rooted. Lastly we decrease\n * the amount of rounds that a hero must be affected by. */\n if (!getHeroes().get(j).isDead()) {\n if (getHeroes().get(j).isAffectedByAoT()) {\n getUtl().applyAoT(getHeroes().get(j));\n }\n if (!getHeroes().get(j).isRooted()) {\n getHeroes().get(j).chooseStrategy();\n getHeroes().get(j).move(getMovements().get(i).get(j));\n }\n if (getHeroes().get(j).isAffectedByAoT()) {\n getHeroes().get(j).setAffectedByAoTRounds(\n getHeroes().get(j).getAffectedByAoTRounds()\n - 1);\n }\n }\n }\n\n // Check if there are any players on the same terrain.\n for (int j = 0; j < getHeroes().size(); j++) {\n for (int k = 0; k < getHeroes().size(); k++) {\n if (k == j) {\n continue; // So a hero doesn't fight himself.\n }\n if ((getHeroes().get(j).getPosX()\n == getHeroes().get(k).getPosX())\n && (getHeroes().get(j).getPosY()\n == getHeroes().get(k).getPosY())) {\n // If they are both alive, fight.\n if (!getHeroes().get(j).isDead()\n && !getHeroes().get(k).isDead()) {\n getUtl().fight(getHeroes().get(k),\n getHeroes().get(j), getMap());\n }\n }\n }\n }\n\n // Selecting the angels that appear on round i\n for (int j = 0; j < numOfAngels.get(i); j++) {\n getUtl().spawnAngel(getAngels().get(angelCounter));\n for (int k = 0; k < getHeroes().size(); k++) {\n /* Checking if the selected angel and player k are on the\n * same terrain. */\n if (getAngels().get(angelCounter).getPosX()\n == getHeroes().get(k).getPosX()\n && (getAngels().get(angelCounter).getPosY()\n == getHeroes().get(k).getPosY())) {\n getUtl().affectHeroByAngel(\n getAngels().get(angelCounter),\n getHeroes().get(k));\n }\n }\n angelCounter++;\n }\n\n // When round is complete, everyone can fight again\n for (AbstractHero hero : getHeroes()) {\n hero.setFought(false);\n }\n getUtl().getOutput().add(\"\\n\");\n }\n printResults();\n }",
"private final void m6487e() throws C0918i {\n try {\n WDAppManager.m2565a(f2486z[4], f2486z[5]);\n } catch (C0653m e) {\n throw new C0918i((int) C0607n.wd, e.getMessage());\n }\n }",
"public void meleemode(ScannedRobotEvent e) {\r\n //run predictive_shooter()\r\n firemode = getOthers();\r\n if(getOthers() == 1) {\r\n duelmode(e);\r\n } runaway(e);\r\n }",
"public void RunwaySystem()\r\n\t{\r\n\t\t// if the wind direction is between 136 and 225\r\n\t\tif(wind_direction >= 136 && wind_direction <= 225)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Wind direction is \" + wind_direction + \"° blowing North to South\");\r\n\t\t\trunway_number = 18;\r\n\t\t\trunway_direction = \" facing South to North.\";\r\n\t\t}\r\n\t\t// if the wind direction is between 1 and 45 and between 316 and 360\r\n\t\telse if((wind_direction >= 1 && wind_direction <= 45) || \r\n\t\t\t\t(wind_direction >= 316 && wind_direction <= 360))\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Wind direction is \" + wind_direction + \"° blowing South to North\");\r\n\t\t\trunway_number = 36;\r\n\t\t\trunway_direction = \" facing North to South.\";\r\n\t\t}\r\n\t\telse if(wind_direction >= 46 && wind_direction <= 135)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Wind direction is \" + wind_direction + \"° blowing West to East\");\r\n\t\t\trunway_number = 9;\r\n\t\t\trunway_direction = \" facing East to West.\";\r\n\t\t}\r\n\t\t// if the wind direction is between 226 and 315\r\n\t\telse if(wind_direction >= 226 && wind_direction <= 315)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Wind direction is \" + wind_direction + \"° blowing East to West\");\r\n\t\t\trunway_number = 27;\r\n\t\t\trunway_direction = \" facing West to East.\";\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Not a valid wind direction\");\r\n\t\t}\r\n\t}",
"public void doWishTheDay(){\n try {\n UtilityMethods.print(\"Welcome to Day 2...\");\n } catch (Exception e) {\n UtilityMethods.print(e.getMessage());\n }\n }"
] | [
"0.49351567",
"0.49124482",
"0.48952755",
"0.48948875",
"0.4867839",
"0.48471537",
"0.48454332",
"0.48095903",
"0.47821912",
"0.472526",
"0.47160333",
"0.47138754",
"0.46874437",
"0.46743807",
"0.4660728",
"0.46589684",
"0.46449292",
"0.4641871",
"0.46376643",
"0.46357703",
"0.4618187",
"0.46141052",
"0.4611536",
"0.4591493",
"0.45824826",
"0.45782667",
"0.45579112",
"0.45566106",
"0.453697",
"0.4523141",
"0.45162237",
"0.4505413",
"0.45018584",
"0.44808608",
"0.4468394",
"0.4461378",
"0.44599995",
"0.4457388",
"0.44561866",
"0.4447431",
"0.4444021",
"0.44405353",
"0.4439075",
"0.4417286",
"0.44125962",
"0.44026482",
"0.44026473",
"0.4397608",
"0.4391416",
"0.43907732",
"0.43868494",
"0.43848568",
"0.4382481",
"0.4381145",
"0.43794093",
"0.4378203",
"0.43753484",
"0.4368839",
"0.4366165",
"0.43585983",
"0.43555072",
"0.43553057",
"0.43512788",
"0.43509853",
"0.43491787",
"0.43473023",
"0.43442148",
"0.43426394",
"0.43402654",
"0.43389618",
"0.43320262",
"0.4329301",
"0.43251517",
"0.43188822",
"0.43183276",
"0.4316241",
"0.43146172",
"0.43145683",
"0.4313025",
"0.4306427",
"0.4306349",
"0.42985302",
"0.42985016",
"0.4295188",
"0.4294095",
"0.4291673",
"0.42905414",
"0.42884704",
"0.4285621",
"0.42823732",
"0.42800805",
"0.42798224",
"0.42785332",
"0.42747998",
"0.4272015",
"0.42686135",
"0.42649138",
"0.42626733",
"0.4262616",
"0.4262383",
"0.4261573"
] | 0.0 | -1 |
Service interface for creating GeoTrak events. | public interface TrakkerService {
GeoTrak create(final GeoTrak trak);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override //to be moved to Cloud service\r\n\tpublic void createEvent(String eventName) {\n\t\t\r\n\t}",
"private void createEvents() {\n\t}",
"ConferenceScheduleBuilderService createEventsFromLunchToNetwork();",
"BasicEvents createBasicEvents();",
"EventUse createEventUse();",
"ConferenceScheduleBuilderService createEventsFromNetworkToEnd();",
"Event createEvent();",
"Event createEvent();",
"public\n CreateEvent()\n {}",
"@Override\n public SoapEvent create(SoapEvent event) {\n throw new UnsupportedOperationException();\n }",
"Fog_Services createFog_Services();",
"public static void createEvent(String token){\n ensureGraphClient(token);\n\n LinkedList<Option> requestOptions = new LinkedList<Option>();\n //requestOptions.add(new HeaderOption(\"Authorization\", \"Bearer nupl9.C5rb]aO5:yvT:3L.TKcH7tB1Im\" ));\n\n // Participantes:\n LinkedList<Attendee> attendeesList = new LinkedList<Attendee>();\n Attendee mentor = new Attendee();\n Attendee mentorado = new Attendee();\n\n EmailAddress mentorMail = new EmailAddress();\n mentorMail.address = \"dwlima@stefanini.com\";\n mentorMail.name = \"Daniell Wagner\";\n mentor.emailAddress = mentorMail;\n\n EmailAddress mentoradoMail = new EmailAddress();\n mentoradoMail.address = \"gmcarneiro@stefanini.com\";\n mentoradoMail.name = \"Guilherme Carneiro\";\n mentorado.emailAddress = mentoradoMail;\n\n mentor.type = AttendeeType.REQUIRED;\n mentorado.type = AttendeeType.REQUIRED;\n\n attendeesList.add(mentor);\n attendeesList.add(mentorado);\n\n // Evento:\n Event event = new Event();\n event.subject = \"Mentoria com \" + mentor.emailAddress.name;\n\n ItemBody body = new ItemBody();\n body.contentType = BodyType.HTML;\n body.content = \"\" +\n \"<b>Mentoria sobre SCRUM</b> <br>\" +\n \"Olá, \" + mentorado.emailAddress.name + \" <br> \" +\n \"Você tem uma mentoria marcada com o mentor \"\n + mentor.emailAddress.name + \"!!\";\n\n event.body = body;\n\n DateTimeTimeZone start = new DateTimeTimeZone();\n start.dateTime = \"2020-03-26T16:00:00\";\n start.timeZone = \"Bahia Standard Time\";\n event.start = start;\n\n DateTimeTimeZone end = new DateTimeTimeZone();\n end.dateTime = \"2020-03-26T18:00:00\";\n end.timeZone = \"Bahia Standard Time\";\n event.end = end;\n\n Location location = new Location();\n location.displayName = \"Stefanini Campina Grande\";\n event.location = location;\n\n event.attendees = attendeesList;\n\n try {\n graphClient.me().calendar().events()\n .buildRequest()\n .post(event);\n }catch(Exception e) {\n\n System.out.println(\"Deu águia: \");\n e.printStackTrace();\n }\n }",
"ConferenceScheduleBuilderService createEventsFromStartToLunch();",
"private void createEvents()\r\n\t{\r\n\t\teventsCount.add(new Event(RequestMethod.PUT, 0));\r\n\t\teventsCount.add(new Event(RequestMethod.GET, 0));\r\n\t\teventsCount.add(new Event(RequestMethod.POST, 0));\r\n\t}",
"@Transactional\n\tpublic Event createEvent(String name, String eventDate, String startTime, String endTime, String startLocation, String endLocation, String carType, String driveType, String makeOfCar, Integer meterPerStop, Integer availableSeats) {\n\t\tEvent event= new Event();\n\t\tjava.util.Date tmpDate = null;\n\t\ttry {\n\t\t\t//\"01 NOVEMBER 2018\"\n\t\t\ttmpDate = new SimpleDateFormat(\"dd MMM yyyy\").parse(eventDate);\n\t\t} catch (ParseException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t//\"10:34:34\"\n\t\tjava.sql.Date sqlDate = new java.sql.Date(tmpDate.getTime());\n\t\tTime sqlStart = Time.valueOf(startTime);\n\t\tTime sqlEnd = Time.valueOf(endTime);\n\t\tevent.setName(name);\n\t\tevent.setEventDate(sqlDate);\n\t\tevent.setStartTime(sqlStart);\n\t\tevent.setEndTime(sqlEnd);\n\t\tevent.setStartLocation(startLocation);\n\t\tevent.setEndLocation(endLocation);\n\t\tevent.setCarType(carType);\n\t\tevent.setDriveType(driveType);\n\t\tevent.setMakeOfCar(makeOfCar);\n\t\tevent.setMeterPerStop(meterPerStop);\n\t\tevent.setSeats(availableSeats);\n\t\tentityManager.persist(event);\n\t\treturn event;\n\t}",
"BasicEvent createBasicEvent();",
"@Transactional\n public EventTO createEvent(EventTO eventTO) {\n LOGGER.info(\"start of createEvent\");\n LOGGER.trace(\" create new event entity\");\n Event event = new Event();\n LOGGER.trace(\" mapping simple data types\");\n //map simple data types\n event.setName(eventTO.getName());\n if (eventTO.hasDescription()) { event.setDescription(eventTO.getDescription());}\n event.setDatetime(eventTO.getDatetime());\n event.setRadius(eventTO.getRadius());\n event.setLongitude(eventTO.getLongitude());\n event.setLatitude(eventTO.getLatitude());\n //map business user\n LOGGER.trace(\" mapping Business User {}\", eventTO.getBusinessUserId());\n BusinessUser businessUser = businessUserService.getBusinessUser(eventTO.getBusinessUserId());\n event.setBusinessUserId(businessUser);\n //map preferences\n if (eventTO.hasPreferences()) {\n LOGGER.trace(\" mapping preferences\");\n LOGGER.trace(\" create prefrences from eventTO\");\n preferenceService.createPreferencesFromEvent(eventTO);\n for (Preference p : eventTO.getPreferences()) {\n Preference preference = preferenceService.getPrefernceByValue(p.getValue()).get();\n LOGGER.trace(\" mapping preference {}-{}\", preference.getId(), preference.getValue());\n event.addPreference(preference);\n }\n }\n event = eventRepository.save(event);\n LOGGER.info(\"new event with id {} successfully created\", event.getId());\n EventTO newEventTO = mapperService.convertToEventTO(event);\n eventProducer.sendNewEvent(newEventTO);\n return newEventTO;\n }",
"EventChannel create();",
"protected abstract void createHistoryEvents();",
"java.util.concurrent.Future<CreateEventIntegrationResult> createEventIntegrationAsync(CreateEventIntegrationRequest createEventIntegrationRequest);",
"private void insertEventRecord(Device device, \n long fixtime, int statusCode, Geozone geozone,\n GeoPoint geoPoint, \n long gpioInput,\n double speedKPH, double heading, \n double altitude,\n double odomKM)\n {\n\n /* create event */\n EventData evdb = createEventRecord(device, fixtime, statusCode, geoPoint, gpioInput, speedKPH, heading, altitude, odomKM);\n\n /* insert event */\n // this will display an error if it was unable to store the event\n Print.logInfo(\"Event : [0x\" + StringTools.toHexString(statusCode,16) + \"] \" + StatusCodes.GetDescription(statusCode,null));\n if (device != null) {\n device.insertEventData(evdb); \n }\n this.eventTotalCount++;\n\n }",
"interface WithCreate\n extends DefinitionStages.WithSource,\n DefinitionStages.WithDestination,\n DefinitionStages.WithExpirationTimeIfNotActivatedUtc,\n DefinitionStages.WithFilter,\n DefinitionStages.WithPartnerTopicFriendlyDescription {\n /**\n * Executes the create request.\n *\n * @return the created resource.\n */\n EventChannel create();\n\n /**\n * Executes the create request.\n *\n * @param context The context to associate with this operation.\n * @return the created resource.\n */\n EventChannel create(Context context);\n }",
"public void create(T e);",
"private Void postDataToApi() throws IOException, ParseException {\r\n // List the next 10 events from the primary calendar.\r\n // Quick-add an event\r\n // Refer to the Java quickstart on how to setup the environment:\r\n // https://developers.google.com/google-apps/calendar/quickstart/java\r\n // Change the scope to CalendarScopes.CALENDAR and delete any stored\r\n // credentials.\r\n\r\n Event event = new Event()\r\n .setSummary(calendarText)\r\n .setLocation(martLocation)\r\n .setDescription(\"Reminder to eat healthy food!\");\r\n\r\n DateTime startDateTime = new DateTime(shoppingDateTime);\r\n EventDateTime start = new EventDateTime()\r\n .setDateTime(startDateTime)\r\n .setTimeZone(\"America/New_York\");\r\n event.setStart(start);\r\n DateTime endDateTime = new DateTime(shoppingDateTime);\r\n EventDateTime end = new EventDateTime()\r\n .setDateTime(endDateTime)\r\n .setTimeZone(\"America/New_York\");\r\n event.setEnd(end);\r\n String calendarId = \"primary\";\r\n event = mService.events().insert(calendarId, event).execute();\r\n System.out.printf(\"Event created: %s\\n\", event.getHtmlLink());\r\n return null;\r\n }",
"@Override\n public void onApplicationEvent(TransportServiceEvent event) {\n switch (event.getType()) {\n case INITIALIZED:\n case TRANSPORT_FINISHED:\n case TRANSPORT_ONFAILURE:\n case TRANSPORT_CANCELED:\n case TRANSPORT_INTERRUPTED:\n\n final TransportOrder to = repository.findOne((Long) event.getSource());\n// List<TransportOrder> transportOrders = repository.findByTransportUnitBKAndStates(to.getTransportUnitBK(), TransportOrderState.CREATED);\n LOGGER.debug(\"> Request to start the TransportOrder with PKey [{}]\", to.getPersistentKey());\n Optional<LocationGroup> lg = commonGateway.getLocationGroup(to.getTargetLocationGroup());\n Optional<Location> loc = commonGateway.getLocation(to.getTargetLocation());\n if (!lg.isPresent() && !loc.isPresent()) {\n // At least one target must be set\n throw new NotFoundException(\n \"Neither a valid target LocationGroup nor a Location are set, hence it is not possible to start the TransportOrder\");\n }\n lg.ifPresent(l -> {\n if (l.isInfeedBlocked())\n throw new StateChangeException(\"Cannot start the TransportOrder because TargetLocationGroup is blocked\");\n });\n loc.ifPresent(l -> {\n if (l.isInfeedBlocked())\n throw new StateChangeException(\"Cannot start the TransportOrder because TargetLocation is blocked\");\n });\n lg.ifPresent(l -> to.setTargetLocationGroup(l.toString()));\n loc.ifPresent(l -> to.setTargetLocation(l.toString()));\n\n List<TransportOrder> others = repository.findByTransportUnitBKAndStates(to.getTransportUnitBK(), TransportOrderState.STARTED);\n if (!others.isEmpty()) {\n throw new StateChangeException(\n \"Cannot start TransportOrder for TransportUnit [\" + to.getTransportUnitBK() + \"] because \" + others.size() + \" TransportOrders already started [\" + others.get(0).getPersistentKey() + \"]\");\n }\n to.changeState(TransportOrderState.STARTED);\n repository.save(to);\n LOGGER.info(\"TransportOrder for TransportUnit with Barcode {} STARTED at {}. Persisted key is {}\", to.getTransportUnitBK(), to.getStartDate(), to.getPk());\n break;\n }\n }",
"com.walgreens.rxit.ch.cda.EIVLEvent addNewEvent();",
"public EventHandle createInZoneEvent (){\n\n this.inZoneEventName = name+\"_inZoneEvent\";\n inZone =(EventHandle) ECAAgent.getDefaultECAAgent().createPrimitiveEvent(\n inZoneEventName , // Event name\n \"MAKEFITS.Track\", // Class name\n EventModifier.END, // Event Modifier\n \"void inZoneSignal()\", // Method Signature\n this); // Intance (track1, track2,...,or trackN)\n\n return inZone;\n }",
"ConferenceScheduleBuilderService startEvent();",
"public Event insertEvent() throws IOException {\n Event event = new Event()\n .setSummary(\"Cita médica\")\n .setLocation(\"Virtual\")\n .setDescription(\"Cita médica Virtual\");\n \n DateTime startDateTime = new DateTime(\"2020-03-25T16:00:00-05:00\");\n EventDateTime start = new EventDateTime()\n .setDateTime(startDateTime)\n .setTimeZone(TIME_ZONE);\n event.setStart(start);\n \n DateTime endDateTime = new DateTime(\"2020-03-25T17:00:00-05:00\");\n EventDateTime end = new EventDateTime()\n .setDateTime(endDateTime)\n .setTimeZone(TIME_ZONE);\n event.setEnd(end);\n \n EventAttendee[] attendees = new EventAttendee[] {\n new EventAttendee().setEmail(\"oscar.ortiz@xertica.com\"),\n new EventAttendee().setEmail(\"admin@david.eforcers.com.co\"),\n };\n event.setAttendees(Arrays.asList(attendees));\n \n EventReminder[] reminderOverrides = new EventReminder[] {\n new EventReminder().setMethod(\"popup\").setMinutes(10)\n };\n Event.Reminders reminders = new Event.Reminders()\n .setUseDefault(false)\n .setOverrides(Arrays.asList(reminderOverrides));\n event.setReminders(reminders);\n \n String calendarId = DEFAULT_CALENDAR;\n event = service.events().insert(calendarId, event).execute();\n \n return event;\n }",
"public Event createSubscribe(Address resource, String event, int expires);",
"public void createGenesisEvent() {\n handleNewEvent(buildEvent(null, null));\n }",
"protected abstract Set<Event> createEvents(String[] dataset);",
"public interface EventService {\n \n void save(Event event);\n\n List<Event> getAllEvents();\n\n List<Event> getEventsByType();\n \n Event getEventInfo(Long id);\n \n List<Event> getEvents(Map<String, String> filterParam);\n\n List<EventLocationShow> getCityEventLocation(Map<String,String> filterParam, String cityName);\n \n List<Review> getEventReview(Long eventId);\n\n List<Review> getEventReviewByCategory(Long eventId, String category);\n \n List<EventShowTime> getEventLocationShowTime(Long eventId, Long locationId);\n \n List<EventLocationShow> getEventShowTime(Long eventId);\n\n List<String> getAvailableSeat(Long eventId, Long locationId, Long showTimeId);\n\n List<String> validateSelectedSeat(Long eventId, Long locationId, Long showTimeId, List<String> seats);\n\n boolean checkSeatAvailability(Long eventId, Long locationId, Long showTimeId);\n \n List<EventPrice> getEventPrice(Long eventId, Long locationId, Long showTimeId);\n\n}",
"EventUses createEventUses();",
"BoundaryEvent createBoundaryEvent();",
"void onIssueCreatedEvent(T event);",
"@KafkaListener(topics = TW_SERVICE_TEMPLATE_EXAMPLE_TOPIC, containerFactory = EXAMPLE_CUSTOM_LISTENER)\n public void process(TemplateEvent event) {\n log.info(event.toString());\n }",
"public void addEvent(Event t, Room r, ArrayList<Speaker> s, LocalDateTime start, LocalDateTime end){\n EventMapFeatures q = new EventMapFeatures(r, s, start, end);\n eventMap.put(t, q);\n eventList.add(t);\n Collections.sort(eventList, Comparator.comparing(Event::getStartTime));\n eventIdsList.clear();\n for (Event e : eventList){\n eventIdsList.add(e.getEventId());\n }\n }",
"CreateEventViewModelFactory() {\n super(Storage.class, Authenticator.class);\n }",
"public Event createPublish(Address resource, String event, int expires);",
"StartEvent createStartEvent();",
"public void createEvent(Event e) {\n\t\tLocalDate date = e.sDate;\n\t\tif(!map.containsKey(date)) {\n\t\t\tArrayList<Event> newList = new ArrayList<>();\n\t\t\tnewList.add(e);\n\t\t\tmap.put(date, newList);\n\t\t}\n\t\telse {\n\t\t\tmap.get(date).add(e);\n\n\t\t}\n\t}",
"public interface IMapDetailsEvent {\n\n void onMapClick();\n\n void onPolylineClick(int roadPos);\n\n\n}",
"public EventHandle createReportLocationEvent(){\n reportLocationEventName = name+\"_reportLocactionEvnt\";\n reportLocation = ECAAgent.getDefaultECAAgent().createPrimitiveEvent(\n reportLocationEventName, // Event name\n \"MAKEFITS.Track\", // class Name\n EventModifier.END, // Event Modifier\n \"void setLatitudeLongitude(Latitude,Longitude)\", // Method signature\n this); // Instance (track1, track2,...,or trackN)\n return (PrimitiveEventHandle) reportLocation;\n }",
"public void createEvent(View view){\n showDatePickerDialog();\n }",
"public void eventPost(String name, String description, String date, String startTime, String endTime){\n Callback<Events> callback = new Callback<Events>() {\n @Override\n public void success(Events serverResponse, Response response2) {\n if(serverResponse.getResponseCode() == 0){\n BusProvider.getInstance().post(produceEventServerResponse(serverResponse));\n }else{\n BusProvider.getInstance().post(produceErrorEvent(serverResponse.getResponseCode(),\n serverResponse.getMessage()));\n }\n }\n\n @Override\n public void failure(RetrofitError error) {\n if(error != null ){\n Log.e(TAG, error.getMessage());\n error.printStackTrace();\n }\n BusProvider.getInstance().post(produceErrorEvent(-200,error.getMessage()));\n }\n };\n communicatorInterface.postEvent(name, description, date, startTime, endTime, callback);\n }",
"@Override\n public void onTangoEvent(TangoEvent event) {\n }",
"public interface TheBigEntity_EventService {\n\t\n\tvoid onAfterCreate(TheBigEntity_ entity);\n\t\n\tvoid onBeforeCreate(TheBigEntity_ entity);\n\t\n\tvoid onBeforeSave(TheBigEntity_ entity);\n\t\n\tvoid onAfterSave(TheBigEntity_ entity);\n\t\n\tvoid onBeforeLinkSave(TheBigEntity_ parent, Object linked);\n\t\n\tvoid onAfterLinkSave(TheBigEntity_ parent, Object linked);\n\t\n\tvoid onBeforeLinkDelete(TheBigEntity_ parent, Object linked);\n\t\n\tvoid onBeforeDelete(TheBigEntity_ entity);\n\t\n\tvoid onAfterDelete(TheBigEntity_ entity);\n\t\n\tvoid onAfterLinkDelete(TheBigEntity_ parent, Object linked);\n\t\n}",
"public interface IPortalTenantEventFactory {\n\n void publishTenantCreatedTenantEvent(HttpServletRequest request, Object source, ITenant tenant);\n\n void publishTenantUpdatedTenantEvent(HttpServletRequest request, Object source, ITenant tenant);\n\n void publishTenantRemovedTenantEvent(HttpServletRequest request, Object source, ITenant tenant);\n\n}",
"public ServiceEvent() {\n // eventSenderID and eventSenderClass are initialized by the OperatingSystem! \n }",
"private IEvent createEvent() throws RodinDBException {\n\t\tfinal IMachineRoot mch = createMachine(\"mch\");\n\t\treturn mch.createChild(IEvent.ELEMENT_TYPE, null, null);\n\t}",
"@Override\n\tpublic void createTicket(TicketData request , StreamObserver<TicketData> responseObserver) {\n\t\tSystem.out.println(\"Requested to store a new Ticket\");\n\n\t\tTicket t = SimpleTicketStore.CreateTicket(\n\t\t\t\trequest.getReporter()\n\t\t\t\t,request.getTopic()\n\t\t\t\t,de.uniba.rz.entities.Status.values()[request.getStatusValue()]\n\t\t\t\t\t\t,request.getDescription()\n\t\t\t\t\t\t,de.uniba.rz.entities.Type.values()[request.getTypeValue()]\n\t\t\t\t\t\t\t\t,Priority.values()[request.getPriorityValue()]\n\t\t\t\t);\n\n\t\tTicketData tdata = Ticket2TicketData(t);\n\n\t\tresponseObserver.onNext(tdata);\n\t\tresponseObserver.onCompleted();\n\n\t}",
"public interface Events {\n\n /**\n * Archive has stored the entities within a SIP.\n * <p>\n * Indicates that a SIP has been sent to the archive. May represent an add,\n * or an update.\n * </p>\n * <p>\n * <dl>\n * <dt>eventType</dt>\n * <dd>{@value}</dd>\n * <dt>eventOutcome</dt>\n * <dd>Number of entities archived</dd>\n * <dt>eventTarget</dt>\n * <dd>every archived entity</dd>\n * </dl>\n * </p>\n */\n public static final String ARCHIVE = \"archive\";\n\n /**\n * Signifies that an entity has been identified as a member of a specific\n * batch load process.\n * <p>\n * There may be an arbitrary number of independent events signifying the\n * same batch (same outcome, date, but different sets of targets). A unique\n * combination of date and outcome (batch label) identify a batch.\n * </p>\n * <p>\n * <dl>\n * <dt>eventType</dt>\n * <dd>{@value}</dd>\n * <dt>eventOutcome</dt>\n * <dd>Batch label/identifier</dd>\n * <dt>eventTarget</dt>\n * <dd>Entities in a batch</dd>\n * </dl>\n * </p>\n */\n public static final String BATCH = \"batch\";\n\n /**\n * File format characterization.\n * <p>\n * Indicates that a format has been verifiably characterized. Format\n * characterizations not accompanied by a corresponding characterization\n * event can be considered to be unverified.\n * </p>\n * <p>\n * <dl>\n * <dt>eventType</dt>\n * <dd>{@value}</dd>\n * <dt>eventOutcome</dt>\n * <dd>format, in the form \"scheme formatId\" (whitespace separated)</dd>\n * <dt>eventTarget</dt>\n * <dd>id of characterized file</dd>\n * </dl>\n * </p>\n */\n public static final String CHARACTERIZATION_FORMAT =\n \"characterization.format\";\n\n /**\n * Advanced file characterization and/or metadata extraction.\n * <p>\n * Indicates that some sort of characterization or extraction has produced a\n * document containing file metadata.\n * </p>\n * *\n * <dl>\n * <dt>eventType</dt>\n * <dd>{@value}</dd>\n * <dt>eventOutcome</dt>\n * <dd>id of File containing metadata</dd>\n * <dt>eventTarget</dt>\n * <dd>id of File the metadata describes</dd>\n * </dl>\n */\n public static final String CHARACTERIZATION_METADATA =\n \"characterization.metadata\";\n\n /**\n * Initial deposit/transfer of an item into the DCS, preceding ingest.\n * <p>\n * <dl>\n * <dt>eventType</dt>\n * <dd>{@value}</dd>\n * <dt>eventOutcome</dt>\n * <dd>SIP identifier uid</dd>\n * <dt>eventTarget</dt>\n * <dd>id of deposited entity</dd>\n * </dl>\n * </p>\n */\n public static final String DEPOSIT = \"deposit\";\n\n /**\n * Content retrieved by dcs.\n * <p>\n * Represents the fact that content has been downloaded/retrieved by the\n * dcs.\n * </p>\n * <dl>\n * <dt>eventType</dt>\n * <dd>{@value}</dd>\n * <dt>eventOutcome</dt>\n * <dd>http header-like key/value pairs representing circumstances\n * surrounding upload</dd>\n * <dt>eventTarget</dt>\n * <dd>id of File whose staged content has been downloaded</dd>\n * </dl>\n */\n public static final String FILE_DOWNLOAD = \"file.download\";\n\n /**\n * uploaaded/downloaded file content resolution.\n * <p>\n * Indicates that the reference URI to a unit of uploaded or downloaded file\n * content has been resolved and replaced with the DCS file access URI.\n * </p>\n * <dl>\n * <dt>eventType</dt>\n * <dd>{@value}</dd>\n * <dt>eventOutcome</dt>\n * <dd><code>reference_URI</code> 'to' <code>dcs_URI</code></dd>\n * <dt>eventTarget</dt>\n * <dd>id of File whose staged content has been resolved</dd>\n * </dl>\n */\n public static final String FILE_RESOLUTION_STAGED = \"file.resolution\";\n\n /**\n * Indicates the uploading of file content.\n * <p>\n * Represents the physical receipt of bytes from a client.\n * </p>\n * <dl>\n * <dt>eventType</dt>\n * <dd>{@value}</dd>\n * <dt>eventOutcome</dt>\n * <dd>http header-like key/value pairs representing circumstanced\n * surrounding upload</dd>\n * <dt>eventTarget</dt>\n * <dd>id of File whose staged content has been uploaded</dd>\n * </dl>\n */\n public static final String FILE_UPLOAD = \"file.upload\";\n\n /**\n * Fixity computation/validation for a particular File.\n * <p>\n * Indicates that a particular digest has been computed for given file\n * content. Digest values not accompanied by a corresponding event may be\n * considered to be un-verified.\n * </p>\n * <p>\n * <dl>\n * <dt>eventType</dt>\n * <dd>{@value}</dd>\n * <dt>eventOutcome</dt>\n * <dd>computed digest value of the form \"alorithm value\" (whitepsace\n * separated)</dd>\n * <dt>eventTarget</dt>\n * <dd>id of digested file</dd>\n * </dl>\n * </p>\n */\n public static final String FIXITY_DIGEST = \"fixity.digest\";\n\n /**\n * Assignment of an identifier to the given entity, replacing an\n * existing/temporary id. *\n * <dl>\n * <dt>eventType</dt>\n * <dd>{@value}</dd>\n * <dt>eventOutcome</dt>\n * <dd><code>old_identifier</code> 'to' <code>new_identifier</code></dd>\n * <dt>eventTarget</dt>\n * <dd>new id of object</dd>\n * </dl>\n */\n public static final String ID_ASSIGNMENT = \"identifier.assignment\";\n\n /**\n * Marks the start of an ingest process.\n * <p>\n * <dl>\n * <dt>eventType</dt>\n * <dd>{@value}</dd>\n * <dt>eventTarget</dt>\n * <dd>id of all entities an ingest SIP</dd>\n * </dl>\n * </p>\n */\n public static final String INGEST_START = \"ingest.start\";\n\n /**\n * Signifies a successful ingest outcome.\n * <p>\n * <dl>\n * <dt>eventType</dt>\n * <dd>{@value}</dd>\n * <dt>eventTarget</dt>\n * <dd>id of all entities an ingest SIP</dd>\n * </dl>\n * </p>\n */\n public static final String INGEST_SUCCESS = \"ingest.complete\";\n\n /**\n * Signifies a failed ingest outcome.\n * <p>\n * <dl>\n * <dt>eventType</dt>\n * <dd>{@value}</dd>\n * <dt>eventTarget</dt>\n * <dd>id of all entities an ingest SIP</dd>\n * </dl>\n * </p>\n */\n public static final String INGEST_FAIL = \"ingest.fail\";\n\n /**\n * Signifies that a feature extraction or transform has successfully\n * occurred.\n * <p>\n * <dl>\n * <dt>eventType</dt>\n * <dd>{@value}</dd>\n * <dt>eventTarget</dt>\n * <dd>id of a DeliverableUnit or Collection</dd>\n * </dl>\n * </p>\n */\n public static final String TRANSFORM = \"transform\";\n\n /**\n * Signifies that a feature extraction or transform failed.\n * <p>\n * <dl>\n * <dt>eventType</dt>\n * <dd>{@value}</dd>\n * <dt>eventTarget</dt>\n * <dd>id of a DeliverableUnit or Collection</dd>\n * </dl>\n * </p>\n */\n public static final String TRANSFORM_FAIL = \"transform.fail\";\n\n /**\n * Signifies a file has been scanned by the virus scanner.\n * <p>\n * Indicates that a file has been scanned by a virus scanner. There could be\n * more than one event for a file.\n * </p>\n * <p>\n * <dl>\n * <dt>eventType</dt>\n * <dd>{@value}</dd>\n * <dt>eventTarget</dt>\n * <dd>id of file whose content was scanned</dd>\n * </dl>\n * </p>\n */\n public static final String VIRUS_SCAN = \"virus.scan\";\n\n /**\n * Signifies an new deliverable unit is being ingested as an update to the target deliverable unit.\n * <p>\n * <dl>\n * <dt>eventType</dt>\n * <dd>{@value}</dd>\n * <dt>eventTarget</dt>\n * <dd>id of the deliverable unit being updated</dd>\n * </dl>\n * </p>\n */\n public static final String DU_UPDATE = \"du.update\";\n\n}",
"public EventoWS() {\n }",
"public void addEvent() {\n TimetableUserItem event;\n try {\n String description = getDescription();\n String date = getDate();\n String startTime = getStartTime();\n String endTime = getEndTime();\n verifyCorrectTime(startTime, endTime);\n String location = getLocation();\n event = new TimetableUserItem(description, date, startTime, endTime, location);\n verifyNoConflict(event);\n timetable.addEvent(event.getDayOfWeek(), event);\n timetable.addToEvents(event);\n addUI.printEventMessage(event);\n } catch (AddException e) {\n e.printMessage();\n logger.log(Level.WARNING, \"Invalid event created, event has not been added to timetable\");\n }\n }",
"public Event createEvent(String name) {\r\n\t\tEvent newEvent = new Event(this.GID, name);\r\n\t\tevents.add(newEvent);\r\n\t\treturn newEvent;\r\n\t}",
"public static void main(String[] args)\n throws IOException, ExecutionException, InterruptedException {\n String projectId = ServiceOptions.getDefaultProjectId();\n String defaultCatalog =\n String.format(\"projects/%s/locations/global/catalogs/default_catalog\", projectId);\n // visitorId is generated randomly\n String visitorId = UUID.randomUUID().toString();\n\n writeUserEvent(defaultCatalog, visitorId);\n }",
"@Override\n\tpublic void execute(RoadMap r) {\n\t\tLogger log = Logger.getLogger(NewHighwayEvent.class.getName());\n\t\tlog.info(\"Attempting to execute NewHighwayEvent...\");\n\t\tr.addRoad(createHighway(r));\n\t\tlog.info(\"Event executed\");\n\t}",
"@Override\n\tpublic EventDto createEvent(EventDto event) {\n\t\tEventEntity eventEntity=new EventEntity();\n\t\tBeanUtils.copyProperties(event, eventEntity);\n\t\t\n\t\tString eventid=utils.generateEventId(20);\n\t\teventEntity.setEventid(eventid);\n\t\t\n\t\tEventEntity storedEvent=eventRepository.save(eventEntity);\n\t\t\n\t\tEventDto returnvalue=new EventDto();\n\t\tBeanUtils.copyProperties(storedEvent, returnvalue);\n\t\t\n\t\treturn returnvalue;\n\t}",
"EventChannel create(Context context);",
"public EventHandleThread(){\n gson = new Gson();\n producer = KafkaProducerCreator.createProducer();\n this.paymentController = new PaymentController();\n }",
"@WebMethod public Event createEvent(Date date, Team a, Team b) throws EventAlreadyExist;",
"public void createServiceRequest() {\n getMainActivity().startService(new Intent(getMainActivity(), RequestService.class));\n }",
"public Evento getEvento() { \n\t\t Evento evento = new Evento();\n\t\t List<Prenda> Lprendas = new ArrayList<Prenda>();\n\t\t Sugerencia sug = new Sugerencia();\n\t Prenda prend = new Prenda();\n Categoria categoria = new Categoria();\n\n categoria.setCodCategoria(1);\n categoria.setDescripcion(\"Zapatillas\");\n TipoPrenda tp = new TipoPrenda();\n tp.setDescripcion(\"lalal\");\n tp.setCategoria(categoria);\n tp.setCodTipoPrenda(1);\n \n \n Guardarropa guard = new Guardarropa();\n guard.setCompartido(false);\n guard.setDescripcion(\"guardarropa\");\n guard.setId(0); \n prend.setGuardarropa(guard);\n prend.setColorPrimario(\"rojo\");\n prend.setTipoPrenda(tp);\n prend.setColorSecundario(\"azul\");\n prend.setDescripcion(\"prenda 1\");\n prend.setNumeroDeCapa(EnumCapa.Primera);\n \tfor( int i = 0 ; i <= 4; i++) {\n prend.setCodPrenda(i);\n\t\t\tLprendas.add(prend);\t\t\t\n\t\t}\n \tsug.setIdSugerencia(1);\n \tsug.setMaxCapaInferior(0);\n \tsug.setMaxCapaSuperior(2);\t\n \tsug.setUsuario(new Usuario());\n \tsug.setListaPrendasSugeridas(Lprendas);\n \tevento.AgregarSugerenciaAEvento(sug);\n \tevento.AgregarSugerenciaAEvento(sug);\n \tevento.AgregarSugerenciaAEvento(sug);\n \tevento.AgregarSugerenciaAEvento(sug);\n \tevento.AgregarSugerenciaAEvento(sug);\n\n \t return evento;\n\t }",
"@Inject\n public EventService(BackgroundTaskRunnerService taskRunner) {\n this.taskRunner = taskRunner;\n final ConcurrentMap<EventType, List<EventListener<? extends Event>>> tmp = new ConcurrentHashMap<>();\n for (EventType eventType : EventType.values()) {\n tmp.put(eventType, new CopyOnWriteArrayList<>());\n }\n this.eventListeners = tmp;\n }",
"public interface TTSLocatorListener {\n\n void saveTTSLocator(String locator);\n}",
"public static void create() {\n\t\tScanner sc = new Scanner(System.in);\n\t\tString title = \"\";\n\t\tString date = \"\";\n\t\tString startTime = \"\";\n\t\tString endTime = \"\";\n\t\tSystem.out.println(\"Enter the title of the event you would like to create: \");\n\t\tif (sc.hasNextLine()) {\n\t\t\ttitle = sc.nextLine().toLowerCase();\n\t\t}\n\t\tSystem.out.println(\"Enter the date on MM/DD/YYYY format: \");\n\t\tif (sc.hasNextLine()) {\n\t\t\tdate = sc.nextLine().toLowerCase();\n\t\t}\n\t\tSystem.out.println(\"Enter the starting time in 24 hour format (ex 15:30): \");\n\t\tif (sc.hasNextLine()) {\n\t\t\tstartTime = sc.nextLine().toLowerCase();\n\t\t}\n\t\tSystem.out.println(\"Enter the ending time: in 24 hour format (ex 15:30): \"); // if there's no end time set the\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// end time to the start time.\n\t\tif (sc.hasNextLine()) {\n\t\t\tendTime = sc.nextLine().toLowerCase();\n\t\t\tif (endTime.equals(\"\")) {\n\t\t\t\tendTime = startTime;\n\t\t\t}\n\t\t}\n\t\tEvent toAdd = new Event(title, date, startTime, endTime);\n\n\t\tGregorianCalendar calendar = new GregorianCalendar(toAdd.getYear(), toAdd.getMonth(), toAdd.getDay());\n\t\tif (calendarToEvent.get(calendar) == null) { // there are no events under this date\n\t\t\tTreeSet<Event>treeSetForMap = new TreeSet<Event>();\n\t\t\ttreeSetForMap.add(toAdd);\n\t\t\tcalendarToEvent.put(calendar, treeSetForMap);\n\t\t} else { // there are already events, add event to the treeset\n\t\t\tboolean canAdd = true;\n\t\t\tfor (Event e : calendarToEvent.get(calendar)) {\n\t\t\t\tif (e.conflictCheck(toAdd)) { //check this (e.getIntEndTime()) < (toAdd.getIntStartTime()) ////return true if there is a conflict, false if there isn't\n\t\t\t\t\tSystem.out.println(\"Sorry can't add that event, there is a conflict\");\n\t\t\t\t\tcanAdd = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (canAdd) {\n\t\t\t\tcalendarToEvent.get(calendar).add(toAdd); // THAT'S WHAT IT USED TO BE calendarToEvent.get(toAdd.getDate()).add(toAdd);\n\t\t\t}\n\t\t}\n\t}",
"SystemEvent createSystemEvent();",
"public RetailStore addTransportTask(RetailscmUserContext userContext, String retailStoreId, String name, String start, Date beginTime, String driverId, String truckId, String belongsToId, BigDecimal latitude, BigDecimal longitude , String [] tokensExpr) throws Exception;",
"public static void main(String[] args) {\n IEventoDAO eventoDAO = DAOFactory.getInstance().getEventoDAO();\r\n EventoTO eventoReceptor = new EventoTO(\"Nuevo evento\", \"Nueva descripcion\");\r\n\r\n boolean respuesta = eventoDAO.crearEvento(eventoReceptor);\r\n if(respuesta){\r\n System.out.println(\"Evento creado\");\r\n }\r\n else{\r\n System.out.println(\"Evento no creado\");\r\n }\r\n \r\n \r\n }",
"public void startNewEvent() {\n // JCudaDriver.cuEventRecord(cUevent,stream);\n }",
"WithCreate withDestination(EventChannelDestination destination);",
"protected void logEventCreation(final GossipEvent event) {\n logger.debug(CREATE_EVENT.getMarker(), \"Creating {}\", event::toString);\n }",
"public void createEvent(String name, Calendar date, String description, String place, ArrayList<Person> people) throws LogicLayerException\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tdataService.createEvent(new Event (name, date, description, place, people));\r\n\t\t}\r\n\t\tcatch (DataLayerException e)\r\n\t\t{\r\n\t\t\tthrow new LogicLayerException(e.getMessage());\r\n\t\t}\r\n\t\t\r\n\t}",
"@Override\n\tpublic void createEvent(CalendarCreate calendar) {\n\t\tprojectDao.createEvent(calendar);\n\t\t\n\t}",
"public Event createNotify(Address resource, String event);",
"net.webservicex.www.WeatherForecasts addNewWeatherForecasts();",
"abstract public Transports createTransports();",
"RemoteEvent createRemoteEvent();",
"Event generateEventWithName(String description) throws Exception {\n fordate++;\n return new Event(\n new Description(description),\n new StartTime(\"0800\"),\n new StartDate(Integer.toString(Integer.parseInt(\"100301\") + fordate)),\n new EndTime(\"1200\"),\n new EndDate(Integer.toString(Integer.parseInt(\"100301\") + fordate)),\n new Location(\"House of 1\"),\n new UniqueTagList(new Tag(\"tag\"))\n );\n }",
"public interface ZoneClickedEventListener extends EventListener {\n\n void handleClick(ZoneClickedEvent event);\n}",
"public PersistentLogEventListener() {\n\t\tthis(new EventDAO());\n\t}",
"@Service\npublic interface EventHandler {\n public AppdirectAPIResponse handleEvent(EventInfo eventInfo);\n}",
"void onCommitCreatedEvent(T event);",
"WithCreate withSource(EventChannelSource source);",
"public interface GsoapCallEventListener {\n void onEventSend(int eventType, String... data);\n}",
"public void makeEvent(String type) {\n\t\teventName = type;\n\t}",
"public static Event createEntity(EntityManager em) {\n Event event = new Event()\n .name(DEFAULT_NAME)\n .gpx(DEFAULT_GPX)\n .gpxContentType(DEFAULT_GPX_CONTENT_TYPE)\n .kmRoute(DEFAULT_KM_ROUTE)\n .timeRoute(DEFAULT_TIME_ROUTE)\n .date(DEFAULT_DATE)\n .descripction(DEFAULT_DESCRIPCTION)\n .observacionsPrev(DEFAULT_OBSERVACIONS_PREV);\n return event;\n }",
"public static String createCalEvent(HttpServletRequest request, HttpServletResponse response) {\r\n Delegator delegator = (Delegator) request.getAttribute(\"delegator\");\r\n LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute(\"dispatcher\");\r\n Map<String,Object> params = UtilHttp.getParameterMap(request);\r\n String returnValue = ModelService.RESPOND_SUCCESS;\r\n Map<String, Object> result = null;\r\n Map<String, Object> context = new HashMap<String,Object>();\r\n \ttry {\r\n \t\tcontext.put(\"partyId\", params.get(\"partyId\"));\r\n \t\tcontext.put(\"roleTypeId\", \"CAL_OWNER\");\r\n \t\tcontext.put(\"statusId\", \"PRTYASGN_ASSIGNED\");\r\n \t\tcontext.put(\"workEffortName\", params.get(\"workEffortName\"));\r\n \t\tcontext.put(\"description\", params.get(\"description\"));\r\n \t\tcontext.put(\"currentStatusId\", params.get(\"currentStatusId\"));\r\n \t\tcontext.put(\"scopeEnumId\", params.get(\"scopeEnumId\"));\r\n \t\tcontext.put(\"estimatedStartDate\", params.get(\"estimatedStartDate\"));\r\n \t\tcontext.put(\"estimatedCompletionDate\", params.get(\"estimatedCompletionDate\"));\r\n \t\tcontext.put(\"workEffortTypeId\", params.get(\"workEffortTypeId\"));\r\n// \t\tGenericValue userLogin = delegator.findOne(\"UserLogin\", UtilMisc.toMap(\"userLoginId\", \"system\"), true);\r\n \t\tGenericValue userLogin = (GenericValue) request.getSession().getAttribute(\"userLogin\");\r\n \t\tcontext.put(\"userLogin\", userLogin);\r\n \t\t\r\n \t\t//call create work effort service\r\n\t\t\t\tresult = dispatcher.runSync(\"createWorkEffortAndPartyAssign\", context);\r\n\t\t\t\tcontext.clear();\r\n\t\t\t\tString workEffortId =null;\r\n\t\t\t\tworkEffortId=(String) result.get(\"workEffortId\");\r\n\t\t\t\t\r\n\t\t\t\t//call service for create Content\r\n\t\t\t\tif(workEffortId!=null)\r\n\t \t{\r\n\t \t\tcontext.put(\"contentId\", workEffortId);\r\n\t \t\tcontext.put(\"dataResourceId\", workEffortId);\r\n\t \t\tcontext.put(\"userLogin\", userLogin);\r\n\t \t\t//call service for create DataResource\r\n\t \t\tresult = dispatcher.runSync(\"createDataResource\", context);\r\n\t \t\tif(result.get(\"dataResourceId\")!=null)\r\n\t \t\t{\t\r\n\t \t\t\tcontext.put(\"ownerContentId\", \"TI_EVENT\");\r\n\t \t\t\t//call service for create content\r\n\t \t\t\tresult = dispatcher.runSync(\"createContent\", context);\r\n\t \t\t\tString contentId= (String) result.get(\"contentId\");\r\n\t \t\t\tif(contentId!=null)\r\n\t \t\t\t{\r\n\t \t\t\t\tcontext.put(\"textData\", params.get(\"textData\"));\r\n\t \t\t\t\t//call service for create Electronic text\r\n\t \t\t\t\tresult = dispatcher.runSync(\"createElectronicText\", context);\r\n\t \t\t\t\tif(result.get(\"dataResourceId\")!=null)\r\n\t \t\t\t\t{\r\n\t \t\t\t\t\tcontext.clear();\r\n\t \t\t\t\t\tcontext.put(\"workEffortId\", workEffortId);\r\n\t \t\t\t\t\tcontext.put(\"contentId\", contentId);\r\n\t \t\t\t\t\tcontext.put(\"workEffortContentTypeId\", \"TI_EVENT_TEXT\");\r\n\t \t\t\t\t\tcontext.put(\"fromDate\",new Timestamp(System.currentTimeMillis()));\r\n\t \t\t\t\t\tcontext.put(\"thruDate\",new Timestamp(System.currentTimeMillis()));\r\n\t \t\t\t\t\t//service for associate content to workeffort \r\n\t \t\t\t\t\tGenericValue workEffortContent= delegator.create(\"WorkEffortContent\", context);\r\n\t \t\t\t\t}\t \t\t\t\t\r\n\t \t\t\t}\r\n\t \t\t}\r\n\t \t\t\r\n\t \t}\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\t\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n \t\r\n \r\n if(UtilValidate.isNotEmpty(result)){\r\n\t if (!result.containsKey(ModelService.RESPONSE_MESSAGE)) {\r\n\t \treturnValue = ModelService.RESPOND_SUCCESS;\r\n\t } else {\r\n\t \treturnValue = (String) result.get(ModelService.RESPONSE_MESSAGE);\r\n\t }\r\n }\r\n request.setAttribute(\"responseMessage\", \"Event created..\");\r\n return returnValue;\r\n }",
"@WebMethod public void createEvent(String description, LocalDate eventDate) throws EventAlreadyExist;",
"public Eventd() {\n }",
"@RequestMapping(\"/createEvent\")\n public String createEvent(@RequestParam String eventtitle, @RequestParam Timestamp starttime, @RequestParam Timestamp endtime,\n @RequestParam String eventdescription, @RequestParam Integer numofpeople, @RequestParam String eventtag,\n @RequestParam String eventphoto, @RequestParam Integer creatorid, @RequestParam String location,\n @RequestParam(\"equipmentid\") List<Integer> equipmentid){\n if(userRepository.findByUserid(creatorid) != null && userRepository.findByUserid(creatorid).getIsdelete() == false){\n Integer nownum = 1;\n com.BackEnd.domain.Event event = eventRepository.save(new com.BackEnd.domain.Event(eventtitle, starttime,\n endtime, eventdescription, numofpeople, nownum, eventtag, creatorid, eventphoto, location, false));\n for(Integer eId: equipmentid){\n eventEquipmentRepository.save(new com.BackEnd.domain.EventEquipment(event.getEventid(), eId));\n }\n// ArrayList<Integer>\n// for(int i = 0; i < equipmentid.size(); i++)\n// {\n// Integer eId = equipmentid.get(i);\n// eventEquipmentRepository.save(new com.BackEnd.domain.EventEquipment(event.getEventid(), eId));\n// }\n// eventEquipmentRepository.save(new com.BackEnd.domain.EventEquipment(event.getEventid(),\n// equipmentRepository.findByEquipmentname(equipmentname).getEquipmentid()));\n return \"success\";\n }\n return \"failure\";\n\n }",
"@Override\n protected Void doInBackground(Void... params) {\n try {\n createEventInCalendar();\n } catch (Exception e) {\n mLastError = e;\n cancel(true);\n return null;\n }\n return null;\n }",
"@Test\n public void createEventSimpleTest() {\n try (Context context = GrCUDATestUtil.buildTestContext().build()) {\n Value createEvent = context.eval(\"grcuda\", \"cudaEventCreate\");\n Value event = createEvent.execute();\n assertNotNull(event);\n assertTrue(event.isNativePointer());\n }\n }",
"@ApiMethod(name = \"insertEvent\")\n public Event insertEvent(Event event) {\n DatastoreService datastoreService = DatastoreServiceFactory.getDatastoreService();\n // TODO: Implement this function\n logger.info(\"Calling insertEvent method\");\n return event;\n }",
"Delivery createDelivery();",
"@Override\r\n\tpublic Element newEvent(String source, String type, int t) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tif(!mEventStarted) {\r\n\t\t\tmRoot = mDocument.createElement(\"slice\");\r\n\t\t\tmRoot.setAttribute(\"date\", Integer.toString(t));\r\n\t\t\tmDocument.appendChild(mRoot);\r\n\t\t} else if (t != mLastCycle) {\r\n\t\t\tthis.finishEvent();\r\n\t\t\tmRoot = mDocument.createElement(\"slice\");\r\n\t\t\tmRoot.setAttribute(\"date\", Integer.toString(t));\r\n\t\t\tmDocument.appendChild(mRoot);\r\n\t\t}\r\n\t\tmLastCycle = t;\r\n\t\tmEventStarted = true;\r\n\t\t\r\n\t\tmID++;\r\n\t\tmCurrentEvent = mDocument.createElement(\"event\");\r\n\t\tmCurrentEvent.setAttribute(\"id\", Integer.toString(mID));\r\n\t\tmCurrentEvent.setAttribute(\"source\", source);\r\n\t\tmCurrentEvent.setAttribute(\"date\", Integer.toString(t));\r\n\t\tElement typeElement = mDocument.createElement(\"type\");\r\n//\t\ttypeElement.setTextContent(type);\r\n\t\ttypeElement.appendChild(mDocument.createTextNode(type));\r\n\t\tmCurrentEvent.appendChild(typeElement);\r\n\t\tmRoot.appendChild(mCurrentEvent);\r\n\r\n\t\treturn mCurrentEvent;\r\n\t}",
"Geq createGeq();",
"void addEvent(IShape shape, IEvent event, int eventBegin, int eventEnd);",
"private Event createEditedEvent(Optional<EventName> name, Optional<Address> location, Optional<Set<Tag>> tags) {\n EventName eventName = name.orElse(currentEvent.getName());\n Address eventLocation = location.orElse(currentEvent.getLocation());\n Set<Tag> eventTags = tags.orElse(currentEvent.getTags());\n Event editedEvent = new Event(eventName, eventLocation, eventTags);\n\n if (currentEvent.getDate().isPresent()) {\n editedEvent.setDate(currentEvent.getDate().get());\n }\n if (currentEvent.getStartTime().isPresent() && currentEvent.getEndTime().isPresent()) {\n editedEvent.setTime(currentEvent.getStartTime().get(), currentEvent.getEndTime().get());\n }\n editedEvent.setOrganiser(currentEvent.getOrganiser());\n editedEvent.setPolls(currentEvent.getPolls());\n editedEvent.setParticipantList(currentEvent.getParticipantList());\n return editedEvent;\n }"
] | [
"0.6633074",
"0.6313725",
"0.6002454",
"0.5949874",
"0.59223205",
"0.58940035",
"0.5777664",
"0.5777664",
"0.5605618",
"0.56020355",
"0.55665195",
"0.5536347",
"0.5498922",
"0.54617935",
"0.54525256",
"0.5439144",
"0.54146075",
"0.5414336",
"0.5404899",
"0.54026395",
"0.53739107",
"0.5356666",
"0.53443205",
"0.53360844",
"0.5311334",
"0.53111076",
"0.53036505",
"0.5287907",
"0.52439153",
"0.5242735",
"0.5177803",
"0.51687825",
"0.51680326",
"0.51545274",
"0.5154394",
"0.51519793",
"0.5147162",
"0.51452994",
"0.51117224",
"0.51042867",
"0.5094393",
"0.5089758",
"0.508877",
"0.5075977",
"0.505517",
"0.5047456",
"0.50391287",
"0.50380903",
"0.5031093",
"0.50293535",
"0.5027446",
"0.50265974",
"0.50203896",
"0.5004187",
"0.49979118",
"0.4997544",
"0.49801502",
"0.49735504",
"0.49710774",
"0.4956965",
"0.49451903",
"0.49415153",
"0.494036",
"0.49296305",
"0.4920623",
"0.49190223",
"0.4910301",
"0.49074903",
"0.48991254",
"0.48986563",
"0.48871073",
"0.4883774",
"0.4881564",
"0.48798183",
"0.487703",
"0.4875115",
"0.48742345",
"0.48633423",
"0.48613575",
"0.4855995",
"0.4850948",
"0.4845747",
"0.48429093",
"0.48427722",
"0.48382467",
"0.4834869",
"0.48342234",
"0.48229104",
"0.48179892",
"0.48171824",
"0.4817126",
"0.48164836",
"0.48160952",
"0.4816029",
"0.48098683",
"0.48088095",
"0.48073378",
"0.48050767",
"0.48044112",
"0.4802877"
] | 0.6656149 | 0 |
populates our list of student users with init data | public static ArrayList<Student> get_student_users() throws IOException {
ArrayList<Student> studentList = new ArrayList<Student>();
ReadCSV readStudentlist = new ReadCSV("students.csv");
try {
// auto-generated primary key for authors table
while (true) {
List<String> tuple = readStudentlist.next();
if (tuple == null) {
break;
}
//Reads each value in from our string list and inserts them into the appropriate attribute of our student object
Iterator<String> i = tuple.iterator();
Student students = new Student();
students.setName(i.next());
String password = MD5.getMd5(i.next());
students.setPassword(password);
students.setEmail(i.next());
students.set_faculty_code(i.next());
students.setType(Integer.parseInt(i.next()));
studentList.add(students);
}
return studentList;
} finally {
readStudentlist.close();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void initialize() {\n\n list.add(user1);\n list.add(user2);\n list.add(user3);\n }",
"private static void initUsers() {\n\t\tusers = new ArrayList<User>();\n\n\t\tusers.add(new User(\"Majo\", \"abc\", true));\n\t\tusers.add(new User(\"Alvaro\", \"def\", false));\n\t\tusers.add(new User(\"Luis\", \"ghi\", true));\n\t\tusers.add(new User(\"David\", \"jkl\", false));\n\t\tusers.add(new User(\"Juan\", \"mno\", true));\n\t\tusers.add(new User(\"Javi\", \"pqr\", false));\n\t}",
"public void initUsers() {\n User user1 = new User(\"Alicja\", \"Grzyb\", \"111111\", \"grzyb\");\n User user2 = new User(\"Krzysztof\", \"Kowalski\", \"222222\", \"kowalski\");\n User user3 = new User(\"Karolina\", \"Nowak\", \"333333\", \"nowak\");\n User user4 = new User(\"Zbigniew\", \"Stonoga \", \"444444\", \"stonoga\");\n User user5 = new User(\"Olek\", \"Michnik\", \"555555\", \"michnik\");\n users.add(user1);\n users.add(user2);\n users.add(user3);\n users.add(user4);\n users.add(user5);\n }",
"public static void initializeUserList() {\r\n\t\tUser newUser1 = new User(1, \"Elijah Hickey\", \"snhuEhick\", \"4255\", \"Admin\");\r\n\t\tuserList.add(newUser1);\r\n\t\t\r\n\t\tUser newUser2 = new User(2, \"Bob Ross\", \"HappyClouds\", \"200\", \"Employee\");\r\n\t\tuserList.add(newUser2);\r\n\t\t\r\n\t\tUser newUser3 = new User(3, \"Jane Doe\", \"unknown person\", \"0\", \"Intern\");\r\n\t\tuserList.add(newUser3);\r\n\t}",
"private void populateUserList() {\n UserAdapter userAdapter = new UserAdapter(this, users.toArray((Map<String, String>[]) new Map[users.size()]));\n lstUsers.setAdapter(userAdapter);\n }",
"private void createAllUsersList(String s){\n\t\tunassignedUsersList.clear();\n\t\tlistedUsersAddList.clear();\n\t\tArrayList<User> users = jdbc.getUsersWithQual(s);\n\t\tfor (int i = 0; i < users.size(); i++) {\n\t\t\tunassignedUsersList.addElement(String.format(\"%s, %s\", users.get(i).get_lastname(), users.get(i).get_firstname()));\n\t\t\tlistedUsersAvailList.addElement(String.format(\"%s, %s\", users.get(i).get_lastname(), users.get(i).get_firstname()));\n\t\t}\n\t}",
"private void createAllUsersList(){\n\t\tunassignedUsersList.clear();\n\t\tlistedUsersAvailList.clear();\n\t\tArrayList<User> users = jdbc.get_users();\n\t\tfor (int i = 0; i < users.size(); i++) {\n\t\t\tunassignedUsersList.addElement(String.format(\"%s, %s\", users.get(i).get_lastname(), users.get(i).get_firstname()));\n\t\t\tlistedUsersAvailList.addElement(String.format(\"%s, %s\", users.get(i).get_lastname(), users.get(i).get_firstname()));\n\t\t}\n\t}",
"protected void getUserList() {\n\t\tmyDatabaseHandler db = new myDatabaseHandler();\n\t\tStatement statement = db.getStatement();\n\t\t// db.createUserTable(statement);\n\t\tuserList = new ArrayList();\n\t\tsearchedUserList = new ArrayList();\n\t\tsearchedUserList = db.getUserList(statement);\n\t\tuserList = db.getUserList(statement);\n\t\tusers.removeAllElements();\n\t\tfor (User u : userList) {\n\t\t\tusers.addElement(u.getName());\n\t\t}\n\t}",
"public void userListStart() {\n\t\tfor (int i = 0; i < userServices.getAllUsers().length; i++) {\n\t\t\tuserList.add(userServices.getAllUsers()[i]);\n\t\t}\n\t}",
"private static ArrayList<User> loadInitialData(){\n\t\tArrayList<User> users = new ArrayList<User>();\n\t\t// From the users list get all the user names\n\t\tfor (String username:Utils.FileUtils.getFileLines(Global.Constants.LIST_OF_USERS)){ // refers \"users\" file\n\t\t\tArrayList<Directory> directories = new ArrayList<Directory>();\n\t\t\t// For a user name, read the names of directories registered\n\t\t\t// Note: All directory names are provided in the file bearing user name\n\t\t\tif (Utils.FileUtils.exists(Global.Constants.DIRECTORY_LOCATION + username)) { // refers to a specific user file \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t // that has directories\n\t\t\t\tfor (String dir:Utils.FileUtils.getFileLines(Global.Constants.DIRECTORY_LOCATION + username)) {\n\t\t\t\t\tArrayList<String> documents = new ArrayList<String>();\n\t\t\t\t\t// For each directory, read names of files saved\n\t\t\t\t\t// Note: All file names are provided in the file bearing username$dirname\n\t\t\t\t\tif (Utils.FileUtils.exists(Global.Constants.DIRECTORY_LOCATION, username + \"$\" + dir)) {\n\t\t\t\t\t\tfor (String doc:Utils.FileUtils.getFileLines(Global.Constants.DIRECTORY_LOCATION + username + \"$\" + dir)) {\n\t\t\t\t\t\t\tdocuments.add(doc);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdirectories.add(new Directory(dir, documents));\n\t\t\t\t}\n\t\t\t}\n\t\t\tusers.add(new User(username, directories));\n\t\t}\n\t\treturn users;\n\t}",
"@PostConstruct\n public void initUsers() {\n List<MyUser> users = Stream.of(\n new MyUser(\"1\",\"Vaibhav\",\"Vaibhav\"),\n new MyUser(\"2\",\"Abhishek\",\"Abhishek\"),\n new MyUser(\"3\",\"admin\",\"admin\")\n ).collect(Collectors.toList());\n repository.saveAll(users);\n }",
"@Override\n public void initializeUsersForImportation() {\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"initializeUsersForImportation\");\n }\n clearAddPanels();\n setRenderImportUserPanel(true);\n\n List<User> users;\n\n usersForImportation = new ArrayList<Pair<Boolean, User>>();\n\n if (Role.isLoggedUserAdmin() || Role.isLoggedUserProjectManager()) {\n choosenInstitutionForAdmin = (Institution) Component.getInstance(CHOOSEN_INSTITUTION_FOR_ADMIN);\n\n if (choosenInstitutionForAdmin != null) {\n users = User.listUsersForCompany(choosenInstitutionForAdmin);\n } else {\n users = User.listAllUsers();\n }\n } else {\n users = User.listUsersForCompany(Institution.getLoggedInInstitution());\n }\n boolean emailAlreadyExists;\n for (User user : users) {\n emailAlreadyExists = false;\n\n for (ConnectathonParticipant cp : connectathonParticipantsDataModel().getAllItems(FacesContext.getCurrentInstance())) {\n\n if (user.getEmail().equals(cp.getEmail())) {\n emailAlreadyExists = true;\n }\n }\n\n if (!emailAlreadyExists) {\n usersForImportation.add(new Pair<Boolean, User>(false, user));\n }\n }\n }",
"private void createUserList() {\n\t\tif (!userList.isEmpty() && !listUsers.isSelectionEmpty()) {\n\t\t\tlistUsers.clearSelection();\n\t\t}\t\t\n\t\tif (!archivedUserList.isEmpty() && !listArchivedUsers.isSelectionEmpty()) {\n\t\t\tlistArchivedUsers.clearSelection();\n\t\t}\t\t\n\t\tarchivedUserList.clear();\n\t\tuserList.clear();\n\t\tArrayList<User> users = jdbc.get_users();\n\t\tfor (int i = 0; i < users.size(); i++) {\n\t\t\tif (users.get(i).active()) {\n\t\t\t\tuserList.addElement(String.format(\"%s, %s [%s]\", users.get(i).get_lastname(), users.get(i).get_firstname(), users.get(i).get_username()));\n\t\t\t} else {\n\t\t\t\tarchivedUserList.addElement(String.format(\"%s, %s [%s]\", users.get(i).get_lastname(), users.get(i).get_firstname(), users.get(i).get_username()));\n\t\t\t}\t\t\n\t\t}\n\t}",
"private void initializeStudentRegList() {\r\n try {\r\n String query = \"SELECT * FROM ongoingregistrations WHERE studentid=?\";\r\n PreparedStatement pstmt = conn.prepareStatement(query);\r\n pstmt.setInt(1, id);\r\n ResultSet rs = pstmt.executeQuery();\r\n studentRegList = new ArrayList<>();\r\n while (rs.next()) {\r\n studentRegList.add(new Registration(rs.getInt(\"studentid\"), rs.getInt(\"courseid\"), rs.getInt(\"secnum\"), rs.getString(\"grade\"), conn));\r\n }\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n }",
"private void createUserListQual() {\n\t\tuserListAvailQual.clear();\n\t\tArrayList<User> users = jdbc.get_users();\n\t\tfor (int i = 0; i < users.size(); i++) {\n\t\t\tuserListAvailQual.addElement(String.format(\"%s, %s [%s]\", users.get(i).get_lastname(), users.get(i).get_firstname(), users.get(i).get_username()));\n\t\t}\n\t}",
"private void initUser() {\n\t}",
"private List<User> createUserList() {\n for (int i = 1; i<=5; i++) {\n User u = new User();\n u.setId(i);\n u.setEmail(\"user\"+i+\"@mail.com\");\n u.setPassword(\"pwd\"+i);\n userList.add(u);\n }\n return userList;\n }",
"private void populateUserProfile() {\n setProfilePic();\n mDisplayNameTextView.setText(user.getName());\n mUsernameTextView.setText(String.format(\"@%s\", user.getUsername()));\n mBioTextView.setText(user.getBio());\n setAdapterForUserStories();\n\n new Thread(new Runnable() {\n public void run(){\n setFollowingCount();\n setFollowersCount();\n setStoriesCount();\n queryStoriesFromUser();\n }\n }).start();\n }",
"public AllUsers(int datacenterId) {\r\n this.datacenterId = datacenterId;\r\n users= new ArrayList<>();\r\n }",
"public UserList()\n\t\t{\n\t\t\tusers = new ArrayList<User>();\n\t\t}",
"public void populateUserDetails() {\n\n this.enterprise = system.getOpRegionDirectory().getOperationalRegionList()\n .stream().filter(op -> op.getRegionId() == user.getNetworkId())\n .findFirst()\n .get()\n .getBuDir()\n .getBusinessUnitList()\n .stream()\n .filter(bu -> bu.getUnitType() == BusinessUnitType.CHEMICAL)\n .map(unit -> (ChemicalManufacturingBusiness) unit)\n .filter(chemBusiness -> chemBusiness.getEnterpriseId() == user.getEnterpriseId())\n .findFirst()\n .get();\n\n this.organization = (ChemicalManufacturer) enterprise\n .getOrganizationList().stream()\n .filter(o -> o.getOrgId() == user.getOrganizationId())\n .findFirst()\n .get();\n\n }",
"@Override\r\n\tprotected final void objectDataMapping() throws BillingSystemException{\r\n\t\tString[][] data=getDataAsArray(USER_DATA_FILE);\r\n\t\tif(validateData(data,\"Authorised User\",COL_LENGTH)){\r\n\t\tList<User> listUser=new ArrayList<User>();\r\n\t\t\r\n\t\tfor(int i=0;i<data.length;i++){\r\n\t \t\r\n\t \tUser usr=new User();\r\n\t \t\t\r\n\t \tusr.setUsername(data[i][0]);\r\n\t \tusr.setPassword(data[i][1]);\r\n\t \tusr.setRole(getRoleByCode(data[i][2]));\r\n\t \t\r\n\t \tlistUser.add(usr);\t\r\n\t }\r\n\r\n\t\t\r\n\t\tthis.listUser=listUser;\r\n\t\t}\r\n\t}",
"private void populateUser() {\n // After user is authenticated, grab their data from the net\n // TODO This will ping the net on every resume (which is probably frequent).\n userListener = saplynService.viewUser();\n\n userListener.subscribeOn(Schedulers.newThread())\n .observeOn(AndroidSchedulers.mainThread())\n .subscribe(\n\n // We got a valid user from the web. Populate our local object and spawn\n // the dashboard.\n user -> {\n this.user = user;\n FragmentTransaction ft = fm.beginTransaction();\n ft.add(R.id.main_fragment_container_home, new DashboardFragment());\n ft.commit();\n },\n throwable -> {\n if(throwable instanceof HttpException) {\n ResponseBody body = ((HttpException) throwable).response().errorBody();\n Log.e(TAG, \"onErrorFromPopulateUser: \"\n + body.toString());\n }\n }\n );\n }",
"public users() {\n initComponents();\n connect();\n autoID();\n loaduser();\n \n \n }",
"private final void initializeCache() {\r\n try {\r\n UserIndex index = makeUserIndex(this.dbManager.getUserIndex());\r\n for (UserRef ref : index.getUserRef()) {\r\n String email = ref.getEmail();\r\n String userString = this.dbManager.getUser(email);\r\n User user = makeUser(userString);\r\n this.updateCache(user);\r\n }\r\n }\r\n catch (Exception e) {\r\n server.getLogger().warning(\"Failed to initialize users \" + StackTrace.toString(e));\r\n }\r\n }",
"public static void getXMLUserList() {\n\t\t// Make some local arrays to use below\n\t\tArrayList<Student> activeList = new ArrayList<Student>();\n\t\tArrayList<Student> archiveList = new ArrayList<Student>();\n\t\ttry {\n\t\t\tFile xmlFile = new File(\"Users.xml\");\n\t\t\tDocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\n\t\t\tDocumentBuilder builder = factory.newDocumentBuilder();\n\t\t\tDocument users = builder.parse(xmlFile);\n\t\t\t\n\t\t NodeList studentNodes = users.getElementsByTagName(\"student\");\n\t\t for(int i = 0; i < studentNodes.getLength(); i++) { // Go through each student node\n\t\t \t\n\t\t Node studentNode = studentNodes.item(i);\n\t\t if(studentNode.getNodeType() == Node.ELEMENT_NODE) {\n\t\t Element studentEl = (Element) studentNode;\n\t\t // Get the student's info (and convert types when necessary)\n\t\t String fn = studentEl.getElementsByTagName(\"firstName\").item(0).getTextContent();\n\t\t String ln = studentEl.getElementsByTagName(\"lastName\").item(0).getTextContent();\n\t\t String id = studentEl.getElementsByTagName(\"ucid\").item(0).getTextContent();\n\t\t int ucid = Integer.parseInt(id);\n\t\t String cB = studentEl.getElementsByTagName(\"currentBorrowing\").item(0).getTextContent();\n\t\t int cb = Integer.parseInt(cB);\n\t\t String iA = studentEl.getElementsByTagName(\"isActive\").item(0).getTextContent();\n\t\t boolean ia = Boolean.parseBoolean(iA);\n\t\t String username = studentEl.getElementsByTagName(\"username\").item(0).getTextContent();\n\t\t String pW = studentEl.getElementsByTagName(\"password\").item(0).getTextContent();\n\t\t String iL = studentEl.getElementsByTagName(\"isLibrarian\").item(0).getTextContent();\n\t\t boolean isLib = Boolean.parseBoolean(iL);\n\t\t \n\t\t // And then create all a new instance of Student with the info\n\t\t\t Student newStudent = new Student(fn, ln, ucid, cb, ia, username, pW, isLib);\n\t\t\t // Put the newly created student in the right list\n\t\t\t if(ia) {\n\t\t\t \tactiveList.add(newStudent);\n\t\t\t } else {\n\t\t\t \tarchiveList.add(newStudent);\n\t\t\t }\n\t\t }\n\t\t }\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Something went wrong with the Users.xml parsing\");\n\t\t\tSystem.out.println(e);\n\t\t}\n\t\t// Store our arrays so they are accessible elsewhere\n\t\tManageUsers.setActiveList(activeList);\n\t\tManageUsers.setArchiveList(archiveList);\n\t}",
"@Override\n\tpublic void initialize() {\n\t\thideAdditionElements();\n\t//\tinitializeUserList();\n\t\t// TODO fill list with saved users\n\t\t\n//\t\tif(userList.size() > 0) {\n//\t\t\tuserListView.getSelectionModel().select(0);\n//\t\t}\n\t\t\n\t\tuserListView.getSelectionModel().selectedIndexProperty().addListener((obs, oldVal, newVal) -> selectUser());\n\t\tuserListView.setItems(userList);\n\t}",
"private void populateLocationsAndIssuingUsersDropDowns(MarriageRegister notice) {\n //get current users location displaying lists,initial values are set by the service\n locationList = commonUtil.populateActiveUserLocations(user, language);\n userList = new HashMap<String, String>();\n List<User> users = userLocationDAO.getMarriageCertificateSignUsersByLocationId(locationList.keySet().\n iterator().next(), true);\n for (User u : users) {\n MRDivision mrDivisionMaleNotice = notice.getMrDivisionOfMaleNotice();\n MRDivision mrDivisionFemaleNotice = notice.getMrDivisionOfFemaleNotice();\n if ((mrDivisionMaleNotice != null && user.isAllowedAccessToMRDSDivision(mrDivisionMaleNotice.getMrDivisionUKey())) ||\n (mrDivisionFemaleNotice != null && user.isAllowedAccessToMRDSDivision(mrDivisionFemaleNotice.getMrDivisionUKey()))) {\n userList.put(u.getUserId(), NameFormatUtil.getDisplayName(u.getUserName(), 50));\n }\n }\n }",
"private static Student newUser(ArrayList<Student> students){\n\t\tStudent newStudent = new Student();\n\t\n\t\tdo{\n\t\t\ttry{\n\t\t\t\tSystem.out.println(\"Enter first name:\");\n\t\t\t\tnewStudent.setFirstName(input.nextLine());\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} while(newStudent.getFirstName() == null);\n\n\t\tdo{\n\t\t\ttry{\n\t\t\t\tSystem.out.println(\"Enter last name:\");\n\t\t\t\tnewStudent.setLastName(input.nextLine());\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} while(newStudent.getLastName() == null);\n\t\t\n\t\tdo{\n\t\t\ttry{\n\t\t\t\tSystem.out.println(\"Enter age:\");\n\t\t\t\tnewStudent.setAge(Integer.parseInt(input.nextLine()));\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} while(newStudent.getAge() == -1);\n\n\t\tdo{\n\t\t\ttry{\n\t\t\t\tSystem.out.println(\"Enter gender(M/F):\");\n\t\t\t\tnewStudent.setGender(input.nextLine());\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} while(newStudent.getGender() == null);\n\n\t\tdo{\n\t\t\ttry{\n\t\t\t\tSystem.out.println(\"Enter SSN:\");\n\t\t\t\tnewStudent.setSSN(input.nextLine());\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} while(newStudent.getSSN() == null);\n\t\t \n\t\tdo{\n\t\t\ttry{\n\t\t\t\tSystem.out.println(\"Enter address:\");\n\t\t\t\tnewStudent.setAddress(input.nextLine());\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} while(newStudent.getAddress() == null);\n\t\t\n\t\tdo{\n\t\t\ttry{\n\t\t\t\tSystem.out.println(\"Enter city:\");\n\t\t\t\tnewStudent.setCity(input.nextLine());\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} while(newStudent.getCity() == null);\t\t\n\n\t\tdo{\n\t\t\ttry{\n\t\t\t\tSystem.out.println(\"Enter state(two character abbreviation):\");\n\t\t\t\tnewStudent.setState(input.nextLine());\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} while(newStudent.getState() == null);\n\n\t\tdo{\n\t\t\ttry{\n\t\t\t\tSystem.out.println(\"Enter zip:\");\n\t\t\t\tnewStudent.setZip(input.nextLine());\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} while(newStudent.getZip() == null);\n\n\t\tdo{\n\t\t\ttry{\n\t\t\t\tSystem.out.println(\"Enter email:\");\n\t\t\t\tnewStudent.setEmail(input.nextLine());\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} while(newStudent.getEmail() == null);\n\t\t\n\t\tdo{\n\t\t\ttry{\n\t\t\t\tSystem.out.println(\"Enter phone:\");\n\t\t\t\tString temp = input.nextLine();\n\t\t\t\t// remove all non-numeric characters\n\t\t\t\ttemp = temp.replaceAll(\"[^\\\\d.]\", \"\");\n\t\t\t\tnewStudent.setPhone(temp);\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} while(newStudent.getPhone() == null);\n\n\t\tdo{\n\t\t\ttry{\n\t\t\t\tSystem.out.println(\"Enter ID (Numeric):\");\n\t\t\t\tnewStudent.setID(Integer.parseInt(input.nextLine()));\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} while(newStudent.getID() == -1);\n\t\t\n\t\tdo{\n\t\t\ttry{\n\t\t\t\tSystem.out.println(\"Enter college:\");\n\t\t\t\tnewStudent.setCollege(input.nextLine());\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} while(newStudent.getCollege() == null);\n\n\t\tString usr = null;\n\t\tboolean failUsrCheck = false;\n\t\t\n\t\tdo{\n\n\t\t\tSystem.out.println(\"Enter user name:\");\n\t\t\tusr = input.nextLine(); \n\t\t\tfor(Student studentI : students) {\n\t\t\t\tif(usr.equals(studentI.getUsername().replace(\"\\r\",\"\"))){\n\t\t\t\t\tfailUsrCheck = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(failUsrCheck){\n\t\t\t\tSystem.out.println(\"User name already used.\");\n\t\t\t}\n\t\t}while (failUsrCheck);\n\t\tnewStudent.setUsername(usr);\n\n\t\t// Display the block of text with the password requirements\n\t\tSystem.out.println(newStudent.PASSWORD_REQUIREMENTS);\n\t\tdo{\n\t\t\ttry{\n\t\t\t\tSystem.out.println(\"Enter password:\");\n\t\t\t\tnewStudent.setPassword(input.nextLine());\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} while(newStudent.getPassword() == null);\n\t\t\n\t\treturn newStudent;\n\t}",
"private void populateUserTable() {\n DefaultTableModel model = (DefaultTableModel)userJTable.getModel();\n model.setRowCount(0);\n \n for(Network nw : system.getNetworkList()){\n for(Enterprise ep : nw.getEnterpriseDirectory().getEnterpriseList()){\n if(ep instanceof SupplierEnterpise){\n for (Organization org : ep.getOrganazDirectory().getOrganizationList()) {\n for (UserAccount ua : org.getUserAccountDirectory().getUserAccountList()) {\n Object[] row = new Object[3];\n row[0] = ep.getName();\n row[1] = nw.getName();\n row[2] = ua.getUsername();\n\n model.addRow(row);\n }\n } \n }else{\n for (UserAccount ua : ep.getUserAccountDirectory().getUserAccountList()) {\n Object[] row = new Object[3];\n row[0] = ep.getName();\n row[1] = nw.getName();\n row[2] = ua.getUsername();\n\n model.addRow(row);\n }\n }\n }\n }\n }",
"public void setTableData(List<Usermodel> UserList) {\n UserData = FXCollections.observableArrayList();\n\n // add the student objects to an observable list object for use with the GUI table\n UserList.forEach(s -> {\n UserData.add(s);\n });\n\n // set the the table items to the data in studentData; refresh the table\n UserTable.setItems(UserData);\n UserTable.refresh();\n }",
"public List<User> getAllStudent() {\n\t\t return userDao.getAllUsers();\r\n\t }",
"private UserDao() {\n\t\tusersList = new HashMap<String, User>();\n\t\tusersDetails = JsonFilehandling.read();\n\t\tfor (JSONObject obj : usersDetails) {\n\t\t\tusersList.put(obj.get(\"id\").toString(), new User(obj.get(\"id\").toString(),obj.get(\"name\").toString(), obj.get(\"profession\").toString()));\n\t\t}\n\t}",
"private void createUsers() {\n\n\t\tList<User> UserList = Arrays.asList(new User(\"Kiran\", \"kumar\", \"kiran@gmail.com\", 20),\n\t\t\t\tnew User(\"Ram\", \"kumar\", \"ram@gmail.com\", 22), new User(\"RamKiran\", \"LaxmiKiran\", \"sita@gmail.com\", 30),\n\t\t\t\tnew User(\"Lakshamn\", \"Seth\", \"seth@gmail.com\", 50), new User(\"Sita\", \"Kumar\", \"lakshman@gmail.com\", 50),\n\t\t\t\tnew User(\"Ganesh\", \"Kumar\", \"ganesh@gmail.com\", 50),\n\t\t\t\tnew User(\"KiranKiran\", \"kumar\", \"kiran@gmail.com\", 20),\n\t\t\t\tnew User(\"RamRam\", \"kumar\", \"ram@gmail.com\", 22),\n\t\t\t\tnew User(\"RamKiranRamKiran\", \"LaxmiKiran\", \"sita@gmail.com\", 30),\n\t\t\t\tnew User(\"RamKiranRamKiran\", \"Seth\", \"seth@gmail.com\", 50),\n\t\t\t\tnew User(\"SitaSita\", \"Kumar\", \"lakshman@gmail.com\", 50),\n\t\t\t\tnew User(\"GaneshSita\", \"Kumar\", \"ganesh@gmail.com\", 50));\n\n\t\tIterable<User> list = userService.saveAllUsers(UserList);\n\t\tfor (User User : list) {\n\t\t\tSystem.out.println(\"User Object\" + User.toString());\n\n\t\t}\n\n\t}",
"public Users() {\r\n this.user = new ArrayList<>();\r\n }",
"public UsersInF() {\n initComponents();\n dao = new UsersDAO();\n loadTableUsers(dao.readAll());\n }",
"private void populateUserMap(List<User> list) {\n\t\tfor (User user : list) {\n\t\t\tuserMap.put(user.getUserName(), user);\n\t\t}\n\n\t}",
"private void setupUsersInRoomDB() {\n Log.d(TAG, \"setupUsersInRoomDB: start to setup list of 200 user\");\n userList = new ArrayList<>();\n int j = 0;\n for (int i = 0; i < 200; i++) {\n switch (j) {\n case 0:\n Log.d(TAG, \"setupUsersInRoomDB: case 0 set the user with image one\");\n userList.add(new User(\"user\" + i, getImageOne()));\n j++;\n break;\n case 1:\n userList.add(new User(\"user\" + i, getImageTwo()));\n j++;\n break;\n case 2:\n userList.add(new User(\"user\" + i, getImageThree()));\n j = 0;\n break;\n }\n }\n\n db.userDao().insertListOfUser(userList);\n Log.d(TAG, \"setupUsersInRoomDB: insert list of users in room database\");\n Shared.sharedSave(MainActivity.this, \"usersdb\", USERS_EXIST);\n Toast.makeText(getApplicationContext(), \"finish set database\", Toast.LENGTH_LONG).show();\n }",
"public ArrayList<SimUser> generateUsers(){\n simUserFact = new SimUserFactory();\r\n simUserStateFact = new SimUserStateFactory();\r\n \r\n ArrayList<SimUser> su = new ArrayList<SimUser>();\r\n\r\n // Generate a set amount of each type of user with their state set to shopping\r\n for(int x =0; x < COMPANYUSERS; x++)\r\n su.add(simUserFact.createUser(\"Company\", simUserStateFact.getUserState(\"Shopping\"), simUserStateFact));\r\n \r\n for(int x = 0; x < INDIVIDUALUSERS; x++)\r\n su.add(simUserFact.createUser(\"Person\", simUserStateFact.getUserState(\"Shopping\"), simUserStateFact));\r\n \r\n return su;\r\n }",
"private void populateUserInfo() {\n User user = Session.getInstance().getUser();\n labelDisplayFirstname.setText(user.getFirstname());\n labelDisplayLastname.setText(user.getLastname());\n lblEmail.setText(user.getEmail());\n lblUsername.setText(user.getUsername());\n }",
"public void setStuData() {\n\n System.out.print(\"Enter The Name : \"); \t String Entered_Name = Scan.next();\n\n System.out.print(\"Enter User Name : \");\t String Entered_User = Scan.next();\n\n System.out.print(\"Enter Password : \");\t int Entered_Pass = Scan.nextInt();\n\n System.out.print(\"Enter Feild : \");\t\t String Entered_Feild = Scan.next();\n\n Students_list.add(new Student(Entered_User , Entered_Name , Entered_Pass , Entered_Feild));\n\n System.out.print(\"Data Has been Saved!\");\n\n }",
"static void initializeStudentSystem() {\r\n\r\n Course math = new Course(\"1000\", \"Mathematics\", \"College of Science\");\r\n Course computing = new Course(\"1001\", \"Computing\", \"College of Engineering\");\r\n Course english = new Course(\"1002\", \"English\", \"College of Liberal Arts\");\r\n Course history = new Course(\"1003\", \"History\", \"College of Liberal Arts\");\r\n Course biology = new Course(\"1004\", \"Biology\", \"College of Science\");\r\n courses.put(math.getCRN(), math);\r\n courses.put(computing.getCRN(), computing);\r\n courses.put(english.getCRN(), english);\r\n courses.put(history.getCRN(), history);\r\n courses.put(biology.getCRN(), biology);\r\n //\r\n User admin = new User();\r\n admin.setUsername(\"admin\");\r\n admin.setPassword(\"admin\");\r\n admin.setAccountType(4);\r\n accounts.put(admin.getUsername(), admin);\r\n //\r\n Student defaultStudent = new Student();\r\n defaultStudent.setName(\"Jose Cabrera\");\r\n defaultStudent.setUsername(\"John1\");\r\n defaultStudent.setPassword(\"123\");\r\n defaultStudent.setId(\"80539934\");\r\n defaultStudent.setMajor(\"CS\");\r\n defaultStudent.setAccountType(1);\r\n defaultStudent.setGraduationStatus(21);\r\n accounts.put(\"John1\", defaultStudent);\r\n //\r\n Student defaultStudent2 = new Student();\r\n defaultStudent2.setName(\"Raul Hinostroza\");\r\n defaultStudent2.setUsername(\"John2\");\r\n defaultStudent2.setPassword(\"123\");\r\n defaultStudent2.setId(\"805393\");\r\n defaultStudent2.setMajor(\"CS\");\r\n defaultStudent2.setAccountType(1);\r\n accounts.put(\"John2\", defaultStudent2);\r\n //\r\n Student defaultStudent3 = new Student();\r\n defaultStudent3.setName(\"Max Morales\");\r\n defaultStudent3.setUsername(\"John3\");\r\n defaultStudent3.setPassword(\"123\");\r\n defaultStudent3.setId(\"8053923\");\r\n defaultStudent3.setMajor(\"CS\");\r\n defaultStudent3.setAccountType(1);\r\n accounts.put(\"John3\", defaultStudent3);\r\n defaultStudent.addCourses(\"1000\");\r\n defaultStudent2.addCourses(\"1000\");\r\n defaultStudent3.addCourses(\"1000\");\r\n //\r\n Faculty defaultFaculty = new Faculty();\r\n defaultFaculty.setAccountType(2);\r\n defaultFaculty.setName(\"Smith\");\r\n defaultFaculty.setUsername(\"Smith1\");\r\n defaultFaculty.setPassword(\"123\");\r\n accounts.put(defaultFaculty.getUsername(), defaultFaculty);\r\n //\r\n Staff defaultStaff = new Staff();\r\n defaultStaff.setAccountType(3);\r\n defaultStaff.setName(\"Smith\");\r\n defaultStaff.setUsername(\"Smith2\");\r\n defaultStaff.setPassword(\"123\");\r\n accounts.put(defaultStaff.getUsername(), defaultStaff);\r\n }",
"private void updateUserList() {\n\t\tUser u = jdbc.get_user(lastClickedUser);\n\t\tString s = String.format(\"%s, %s [%s]\", u.get_lastname(), u.get_firstname(), u.get_username());\n\t\tuserList.setElementAt(s, lastClickedIndex);\n\t}",
"private void prepareReviewData(Map<String,Object> students) {\n //iterate through each user\n for (Map.Entry<String, Object> entry : students.entrySet()){\n //Get user map and Uid and typecast it to Student object\n Map joinedStudent = (Map) entry.getValue();\n String uid = entry.getKey();\n // Review is done only for blacklisted students\n if(joinedStudent.get(\"isBlacklisted\").toString().equals(\"Blacklisted\")) {\n Student student = new Student(joinedStudent.get(\"name\").toString(),\n Integer.valueOf(joinedStudent.get(\"state\").toString()),\n joinedStudent.get(\"isBlacklisted\").toString(),\n joinedStudent.get(\"review\").toString(), uid,\n Integer.valueOf(joinedStudent.get(\"blacklistedState\").toString())\n );\n mStudentList.add(student);\n }\n }\n mAdapter.notifyDataSetChanged(); // start loading into layout\n }",
"@Override\r\n\tpublic List<User> getAllUser() {\n\t\tList<User> listStudents = new ArrayList<User>();\r\n\t\tlistStudents = userReposotory.findAll();\r\n\t\treturn listStudents;\r\n\t}",
"public void populateUserListFromDatabase() {\n\t\tList<com.expensetracker.model.User> modelUserList = null;\n\t\tLogger.logMessage(\"UserManager.populateUserListFromDatabase() : Populating user list cache..\");\n\t\ttry {\n\t\t\tmodelUserList = Service.getService().getUserList();\n\t\t\tList<User> list = ConvertUtil.modelToPojo(modelUserList);\n\t\t\tif (list != null) {\n\t\t\t\tuserList.addAll(list);\n\t\t\t\tpopulateUserMap(list);\n\t\t\t} else {\n\t\t\t\tLogger.logMessage(\"UserManager.populateUserListFromDatabase() : No data received from database for populating userlist cache\");\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLogger.logMessage(\"UserManager.populateUserListFromDatabase() : Error in getting list of users from database for populating userlist cache \"\n\t\t\t\t\t+ e);\n\t\t}\n\t}",
"public final void getUsersList() throws ServiceException {\r\n\t\tList<Bems> usersList = testReqmtService.getUsersList();\r\n\t\tList<SelectItem> userDetails= new ArrayList<SelectItem>();\r\n\t\t\r\n\t\tfor(Bems user:usersList) {\r\n\t\t\tStringBuilder name=new StringBuilder();\r\n\t\t\t name.append(user.getLastName().trim());\r\n\t\t\t name.append(\",\"+\" \");\r\n\t\t\t name.append(user.getFirstName().trim());\r\n\t\t\tif(CommonUtils.isStringNotEmpty(user.getMiddleName())){\r\n\t\t\t\tname.append(\" \");\r\n\t\t\t\tname.append(user.getMiddleName());\r\n\t\t\t}\r\n\t\t\tuserDetails.add(new SelectItem(user.getBemsID(), name.toString()));\r\n\t\t \r\n\t\t}\r\n\t\tuiTestReqEditModel.setUserList(userDetails);\r\n\t}",
"public ListOfUsers() {\n initComponents();\n }",
"private void getUserList() {\n // GET ENTRIES FROM DB AND TURN THEM INTO LIST \n DefaultListModel listModel = new DefaultListModel();\n Iterator itr = DBHandler.getListOfObjects(\"FROM DBUser ORDER BY xname\");\n while (itr.hasNext()) {\n DBUser user = (DBUser) itr.next();\n listModel.addElement(user.getUserLogin());\n }\n // SET THIS LIST FOR INDEX OF ENTRIES\n userList.setModel(listModel);\n }",
"private void initObjects() {\n listUsers = new ArrayList<>();\n usersRecyclerAdapter = new UsersRecyclerAdapter(listUsers,UsersListActivity.this);\n RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(getApplicationContext());\n recyclerViewUsers.setLayoutManager(mLayoutManager);\n recyclerViewUsers.setItemAnimator(new DefaultItemAnimator());\n recyclerViewUsers.setHasFixedSize(true);\n recyclerViewUsers.setAdapter(usersRecyclerAdapter);\n\n databaseHelper = new HomeDatabaseHelper(activity);\n Intent extras = getIntent();\n emailFromIntent = extras.getStringExtra(\"EMAIL\");\n textViewRole = this.findViewById(R.id.textViewName);\n textViewRole.setText(emailFromIntent);\n getDataFromSQLite();\n }",
"public UserData() {\n\t\tvalid = false;\n\t\tcode = \"\";\n\t\t\n\t\tphone = \"\";\n\t\temail = \"\";\n\t\t\n\t\taccounts = new ArrayList<Account>();\n\t\tpayees = new ArrayList<Payee>();\n\t}",
"private void readUsers(String filter) {\n Filter userFilter = Filter.createORFilter(\n Filter.createSubAnyFilter(\"cn\", filter),\n Filter.createSubAnyFilter(\"sn\", filter),\n Filter.createSubAnyFilter(\"givenname\", filter)\n );\n\n SearchResult searchResult = OpenLDAP.searchUser(userFilter);\n for (int i = 0; i < searchResult.getEntryCount(); i++) {\n SearchResultEntry entry = searchResult.getSearchEntries().get(i);\n User user = new User();\n user.setDistinguishedName(entry.getDN());\n user.setUsername(entry.getAttributeValue(\"cn\"));\n user.setFirstname(entry.getAttributeValue(\"givenname\"));\n user.setLastname(entry.getAttributeValue(\"sn\"));\n user.setEmail(entry.getAttributeValue(\"mail\"));\n user.setMobile(entry.getAttributeValue(\"mobile\"));\n getUsers().put(user.getUsername(), user);\n }\n }",
"public static void init() {\n\t\tList<Object> objects = FileManager.readObjectFromFile(\"student.dat\");\n\t\tfor (Object o : objects)\n\t\t\tStudentList.add((Student) o);\n\t}",
"private void setUsersIntoComboBox() {\n if (mainModel.getUserList() != null) {\n try {\n mainModel.loadUsers();\n cboUsers.getItems().clear();\n cboUsers.getItems().addAll(mainModel.getUserList());\n } catch (ModelException ex) {\n alertManager.showAlert(\"Could not get the users.\", \"An error occured: \" + ex.getMessage());\n }\n }\n }",
"private UserAggregate() {\n userList = new ArrayList<>();\n }",
"public void init(String userName){\r\n\r\n this.userName = userName;\r\n udb_FriendsListView.setStyle(\"-fx-font: 18pt 'Arial'\");\r\n udb_PostsTableView.setStyle(\"-fx-font-size: 18pt\");\r\n try{\r\n\r\n ObservableList<Profiles> prof = ProfilesDao.searchProfiles(userName);\r\n System.out.println(\"Running\");\r\n System.out.println(prof.get(0).getAge());\r\n System.out.println(prof.get(0).getFirstName());\r\n setFirstNameLabel(prof.get(0).getFirstName().toUpperCase());\r\n setLastNameLabel(prof.get(0).getLastName().toUpperCase());\r\n setAge(calculateAge(prof.get(0).getAge()));\r\n setEmail(prof.get(0).getEmail().toUpperCase());\r\n loadFriends();\r\n loadStatus();\r\n initTable();\r\n loadPosts();\r\n\r\n } catch(Exception e) {\r\n\r\n }\r\n }",
"public static List<User> createUserList() {\r\n\t\tList<User> users = new ArrayList<User>();\r\n\t\t\r\n\t\tusers.add(createUser(1, \"Isha\", \"Khandelwal\", \"isha.khandelwal@gmail.com\", \"ishaa\", \"ThinkHR\"));\r\n\t\tusers.add(createUser(2, \"Sharmila\", \"Tagore\", \"stagore@gmail.com\", \"stagore\", \"ASI\"));\r\n\t\tusers.add(createUser(3, \"Surabhi\", \"Bhawsar\", \"sbhawsar@gmail.com\", \"sbhawsar\", \"Pepcus\"));\r\n\t\tusers.add(createUser(4, \"Shubham\", \"Solanki\", \"ssolanki@gmail.com\", \"ssolanki\", \"Pepcus\"));\r\n\t\tusers.add(createUser(5, \"Ajay\", \"Jain\", \"ajain@gmail.com\", \"ajain\", \"TCS\"));\r\n\t\tusers.add(createUser(6, \"Sandeep\", \"Vishwakarma\", \"svishwakarma@gmail.com\", \"svishwakarma\", \"CIS\"));\r\n\t\tusers.add(createUser(7, \"Sushil\", \"Mahajan\", \"smahajan@gmail.com\", \"smahajan\", \"ASI\"));\r\n\t\tusers.add(createUser(8, \"Sumedha\", \"Wani\", \"swani@gmail.com\", \"swani\", \"InfoBeans\"));\r\n\t\tusers.add(createUser(9, \"Mohit\", \"Jain\", \"mjain@gmail.com\", \"mjain\", \"Pepcus\"));\r\n\t\tusers.add(createUser(10, \"Avi\", \"Jain\", \"ajain@gmail.com\", \"ajain\", \"Pepcus\"));\r\n\t\t\r\n\t\treturn users;\r\n\t}",
"private void populateLocationList(MarriageRegister register) {\n userList = new HashMap<String, String>();\n\n locationList = commonUtil.populateActiveUserLocations(user, language);\n int firstLocation = locationList.keySet().iterator().next();\n List<User> users = userLocationDAO.getMarriageCertificateSignUsersByLocationId(firstLocation, true);\n register.setExtractIssuedLocation(locationDAO.getLocation(firstLocation));\n\n MRDivision mrDivision = register.getMrDivision();\n if (mrDivision != null) {\n for (User u : users) {\n if (user.isAllowedAccessToMRDSDivision(mrDivision.getDsDivision().getDsDivisionUKey())) {\n userList.put(u.getUserId(), NameFormatUtil.getDisplayName(u.getUserName(), 50));\n }\n }\n }\n if (userList != null && !userList.isEmpty()) {\n register.setExtractCertifiedUser(userDAO.getUserByPK(userList.keySet().iterator().next()));\n }\n }",
"private void populateUserView()\n\t{\n\t\t/* create dummy user properties, throw away later */\n\t\tPlayerViewModel userViewModel = new PlayerViewModel(currentUser.getString(\"facebookId\"), \n\t\t\t\t\t\t\t\t\t\tcurrentUser.getString(\"profilePicUrl\")+\"?type=large\", \n\t\t\t\t\t\t\t\t\t\tlocalCountMap.get(currentUser.getString(\"facebookId\")), \n\t\t\t\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\t\t\t\tfalse);\n\t\t\n\t\t/* create adapter for user view */\n\t\tuserCheeseTextView = (TextView) findViewById(R.id.cheeseCountTextView);\n\t\t//userProfileImageView = (ImageView) findViewById(R.id.userProfileImageView);\n\t\tuserProfileImageView = (CircularImageView) findViewById(R.id.userProfileImageView);\n\t\tuserViewAdapter = new UserViewAdapter(this, userCheeseTextView, userProfileImageView);\n\t\t\n\t\t/* set display values via adapter */\n\t\tuserViewAdapter.setUser(userViewModel);\t\t\n\t}",
"public UserList(){\n\t\tthis.head = new User();\n\t\tthis.tail = this.head;\n\n\t}",
"private static void init() {\n\n students = new HashMap<String, Student>(); //redundant but there for my reference\n\n //new Student objects, from the Student class, that are in our new HashMap called students\n Student annette = new Student(\"Annette\");\n annette.addGrade(90); // addGrade method from the Student class\n annette.addGrade(85);\n annette.addGrade(40);\n\n annette.recordAttendance( \"2019-10-01\", \"A\");\n annette.recordAttendance( \"2019-10-02\", \"P\");\n annette.recordAttendance( \"2019-10-03\", \"A\");\n annette.recordAttendance( \"2019-10-04\", \"P\");\n\n\n Student bridget = new Student(\"Bridget\");\n bridget.addGrade(90);\n bridget.addGrade(70);\n bridget.addGrade(60);\n\n bridget.recordAttendance( \"2019-10-01\", \"A\");\n bridget.recordAttendance( \"2019-10-02\", \"P\");\n bridget.recordAttendance( \"2019-10-03\", \"A\");\n bridget.recordAttendance( \"2019-10-04\", \"P\");\n\n\n Student bev = new Student(\"Bev\");\n bev.addGrade(97);\n bev.addGrade(96);\n bev.addGrade(95);\n\n bev.recordAttendance( \"2019-10-01\", \"A\");\n bev.recordAttendance( \"2019-10-02\", \"P\");\n bev.recordAttendance( \"2019-10-03\", \"A\");\n bev.recordAttendance( \"2019-10-04\", \"P\");\n\n\n Student glo = new Student(\"Glo\");\n glo.addGrade(94);\n glo.addGrade(93);\n glo.addGrade(92);\n\n glo.recordAttendance( \"2019-10-01\", \"A\");\n glo.recordAttendance( \"2019-10-02\", \"P\");\n glo.recordAttendance( \"2019-10-03\", \"A\");\n glo.recordAttendance( \"2019-10-04\", \"P\");\n\n\n // sets the usernames as keys\n // and values that are student objects\n students.put(\"bmills\", bridget);\n students.put(\"annette1\", annette);\n students.put(\"bevvybev\", bev);\n students.put(\"thegloUp\", glo);\n\n }",
"public void newUserDirectory() {\n\t\tusers = new LinkedAbstractList<User>(100);\n\t}",
"public void setUserMap() {\n ResultSet rs = Business.getInstance().getData().getAllUsers();\n try {\n while (rs.next()) {\n userMap.put(rs.getString(\"username\"), new User(rs.getInt(\"id\"),\n rs.getString(\"name\"),\n rs.getString(\"username\"),\n rs.getString(\"password\"),\n rs.getBoolean(\"log\"),\n rs.getBoolean(\"medicine\"),\n rs.getBoolean(\"appointment\"),\n rs.getBoolean(\"caseAccess\")));\n\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }",
"private void reloadUserLists(){\n users = udbHelper.getUsers();\n userInfo = userManager.generateUserInfo(users);\n\n ArrayAdapter <String> userAdapter = new ArrayAdapter<String>(this, R.layout.support_simple_spinner_dropdown_item, userInfo);\n userSpinner.setAdapter(userAdapter);\n\n uid.setText(\"UID:\");\n editUsername.setText(\"\");\n editPassword.setText(\"\");\n }",
"@PostConstruct\r\n public void init() {\r\n students = new ArrayList<>();\r\n students.add(new Student(\"Marek\", \"Smorąg\", 3.0));\r\n students.add(new Student(\"Bartosz\", \"Rudecki\", 4.54));\r\n students.add(new Student(\"Jakub\", \"Dąbała\", 5.43));\r\n students.add(new Student(\"Jakub\", \"Rek\", 4.23));\r\n students.add(new Student(\"Julia\", \"Smorąg\", 3.56));\r\n students.add(new Student(\"Arkadiusz\", \"Abramowski\", 3.56));\r\n students.add(new Student(\"Marta\", \"Nowak\", 4.23));\r\n students.add(new Student(\"Rafał\", \"Zalewski\", 4.67));\r\n students.add(new Student(\"Adrian\", \"Zalewski\", 5.0));\r\n students.add(new Student(\"Mirosław\", \"Kulesza\", 4.12));\r\n students.add(new Student(\"Michał\", \"Kostro\", 3.67));\r\n students.add(new Student(\"Jan\", \"Nowak\", 3.38));\r\n }",
"@RequestMapping(method = RequestMethod.GET)\n public List<User> start()\n {\n userService.addUser(new User(rightService.getByName(\"USER\"),userGroupService.getByName(\"STUDENTS\"),login,password,token,mail));\n login=login+\" \"+inc;\n password=password+\" \"+inc;\n token=token+\" \"+inc;\n mail=mail+\" \"+inc;\n inc++;\n userService.addUser(new User(rightService.getByName(\"MODERATOR\"),userGroupService.getByName(\"TEACHERS\"),login,password,token,mail));\n login=login+\" \"+inc;\n password=password+\" \"+inc;\n token=token+\" \"+inc;\n mail=mail+\" \"+inc;\n inc++;\n userService.addUser(new User(rightService.getByName(\"USER\"),userGroupService.getByName(\"STUDENTS\"),login,password,token,mail));\n\n return userService.getAll();\n }",
"public void dummyUsersToDB(){\n\t\tUser nick = new User(db,\"Nick\",9);\n\t\tUser lin = new User(db,\"Lin\",10);\n\t\tUser evan = new User(db,\"Evan\",8);\n\t\tUser karthik = new User(db,\"Karthik\",10);\n\t\tUser bernadette = new User(db,\"Bernadette\",8);\n\t\tUser james = new User(db,\"James\",7);\n\t}",
"public void getUserNames(){\n //populate all the usernames in here\n if(dbConnection.ConnectDB()){\n //we are connected to the database\n //get the userList from the database\n if(this.dbConnection.populateUserList()){\n //the list was created by the database method \n this.userNames = this.dbConnection.getUserNames();\n \n }\n }else{\n System.out.println(\"Connected to database\");\n \n }\n }",
"public UserList(ArrayList<User> users)\n\t\t{\n\t\t\tthis.users = users;\n\t }",
"public User(){\n userOptionalInfoList = new ArrayList<>();\n workHistoryList = new ArrayList<>();\n educationHistoryList = new ArrayList<>();\n setState(AccountState.PENDING_APPROVAL);\n }",
"public UserDirectory() {\n\t\tusers = new LinkedAbstractList<User>(100);\n\t}",
"public void fillUsers(int totalEntries) {\n\n StoreAPI storeOperations = new StoreAPIMongoImpl();\n for (int i = 0; i < totalEntries; i++) {\n storeOperations.createAccount(\"user_\" + i, \"password_\" + i, Fairy.create().person().getFirstName(), Fairy.create().person().getLastName());\n }\n }",
"public void fillUserStats(){\n\t\t \t\t\t \t\n\t\t \tif (curResults.getCount()==0){ // sets to 0 if there are no results\n\t\t \t\ttxtTime.setText(\"0\");\n\t\t \t\ttxtDate.setText(\"0\");\n\n\t\t \t}\n\t\t \telse{ //sets them to the users last result if there are results\n\t\t \t\tcurResults.moveToLast();\n\t\t \t\ttxtTime.setText(curResults.getString(3));\n\t\t \t\ttxtDate.setText(curResults.getString(2));\n\t\t \t}\n\t\t }",
"public void populateUserInformation()\n {\n ViewInformationUser viewInformationUser = new ViewFXInformationUser();\n\n viewInformationUser.buildViewProfileInformation(clientToRegisteredClient((Client) user), nameLabel, surnameLabel, phoneLabel, emailLabel, addressVbox);\n }",
"@ModelAttribute(\"roles\")\n\tpublic List<UserProfile> initializeProfiles() {\n\t\treturn userProfileService.findAll();\n\t}",
"public void setUserList(CopyOnWriteArrayList<User> userList) {\r\n\t\tBootstrap.userList = userList;\r\n\t}",
"@ModelAttribute(\"roles\")\r\n\tpublic List<UserProfile> initializeProfiles() {\r\n\t\treturn userProfileService.findAll();\r\n\t}",
"public NewUsers() {\n initComponents();\n currentTimeDate();\n }",
"@Override\n\tpublic List<StudentForm> findAllUsers() {\n\t\treturn null;\n\t}",
"private void loadUserData() {\n\t\tuserData = new UserData();\n }",
"public void updateUsersList() {\n\t adapter = new UsersAdapter(getActivity(), allUsers);\n setListAdapter(adapter);\n\t getListView().setOnItemClickListener(this);\n\t}",
"private void loadInitialValues() {\n // get the current user\n final FirebaseUser fUser = FirebaseAuth.getInstance().getCurrentUser();\n // get a reference to the firebase database.\n // NOTE: null pointer exception warning is not an issue as the user needs to be logged in to access this page\n DatabaseReference ref = FirebaseDatabase.getInstance().getReference();//.child(fUser.getUid());\n\n //change a value in the database to invoke event listener below\n ref.child(\"access\").setValue(RNG.generateNumber());\n\n //add an event listener to capture data on change\n ref.addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot dataSnapshot) {\n //get all users\n for (DataSnapshot ds : dataSnapshot.child(\"user\").getChildren()) {\n //check to see if user id in firebase matches with current user id of logged in user\n // NOTE: null pointer exception warning is not an issue as the user needs to be logged in to access this page\n if (ds.getKey().equals(fUser.getUid())) {\n //if so, get the data and set the appropriate fields\n User u = ds.getValue(User.class);\n m_ChangeName.setText(u.getName());\n m_ChangeAge.setText(u.getAge());\n m_ChangeBio.setText(u.getBio());\n if(u.getImage()!=null) {\n try {\n m_ProfilePic.setImageBitmap(decodeFromFirebaseBase64(u.getImage()));\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n }\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError databaseError) {\n\n }\n });\n\n\n }",
"private void populateStudentAndFaculty() {\n for (int i = 0; i < 25; i++) {\n System.out\n .println(\"INSERT INTO `4400`.`StudentAndFaculty` (`username`, `firstName`, `lastName`, `dob`, `gender`, `email`, `address`, `isFaculty`, `isDebarred`, `dept`, `penalty`) VALUES ('user\"\n + i\n + \"', '\"\n + MALE_NAMES[i]\n + \"', '\"\n + LAST_NAMES[i]\n + \"', '19\"\n + randomInt(50, 96)\n + \"-\"\n + MONTHS[randomInt(0, MONTHS.length - 1)]\n + \"-\"\n + randomInt(1, 27)\n + \"', 'male', '\"\n + MALE_NAMES[i]\n + LAST_NAMES[i]\n + \"@\"\n + EMAILS[randomInt(0, EMAILS.length - 1)]\n + \"', '\"\n + ADDRESSES[i] + \"', '0', '0', NULL, '0.00');\");\n }\n for (int i = 0; i < 25; i++) {\n System.out\n .println(\"INSERT INTO `4400`.`StudentAndFaculty` (`username`, `firstName`, `lastName`, `dob`, `gender`, `email`, `address`, `isFaculty`, `isDebarred`, `dept`, `penalty`) VALUES ('user\"\n + (i + 25)\n + \"', '\"\n + FEMALE_NAMES[i]\n + \"', '\"\n + LAST_NAMES[i + 25]\n + \"', '19\"\n + randomInt(50, 96)\n + \"-\"\n + MONTHS[randomInt(0, MONTHS.length - 1)]\n + \"-\"\n + randomInt(1, 27)\n + \"', 'female', '\"\n + FEMALE_NAMES[i]\n + LAST_NAMES[i + 25]\n + \"@\"\n + EMAILS[randomInt(0, EMAILS.length - 1)]\n + \"', '\"\n + ADDRESSES[i + 25] + \"', '0', '0', NULL, '0.00');\");\n }\n }",
"public void saveUsers() {\n\t\ttry {\n\t\t\t\n\t\t\tFile xmlFile = new File(\"Users.xml\");\n\t\t\tDocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\n\t\t\tDocumentBuilder builder = factory.newDocumentBuilder();\n\t\t\tDocument document = builder.parse(xmlFile);\n\t\t\tElement users = document.getDocumentElement();\n\t\t\t\n\t\t\tArrayList<Student> u = ManageUsers.getActiveList();\n\t\t\tfor (int i = 0; i < u.size(); i++) {\n\t\t\t\t// Grab the info for a specific student\n\t\t\t\tStudent s = u.get(i);\n\t\t\t\tString fName = s.getFirstName();\n\t\t\t\tString lName = s.getLastName();\n\t\t\t\tint ucid = s.getUcid();\n\t\t\t\tint currentBorrowing = s.getCurrentBorrowing();\n\t\t\t\tboolean isActive = true;\n\t\t\t String username = s.getUsername();\n\t\t\t String password = s.getPassword();\n\t\t\t boolean isLibrarian = s.getIsLibrarian();\n\t\t\t \n\t\t\t Element student = document.createElement(\"student\");\n\t\t\t \n\t\t\t // Make a new element <student>\n\t\t\t // Add the element to the xml as a child of <Users>\n\t\t\t // Add the above fields (fName, etc.) as child nodes to the new student node\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Something went wrong with writing to the xml\");\n\t\t\tSystem.out.println(e);\n\t\t}\n\t}",
"@ModelAttribute(\"roles\")\n public List<UserProfile> initializeProfiles() {\n return userProfileService.findAll();\n }",
"private void initObjects() {\n databaseHelper = new DatabaseHelper(activity);\n currentUser = databaseHelper.getAllUser().get(userIndex);\n\n textViewName.setText(userName);\n textViewEmail.setText(currentUser.getEmail());\n textViewPhone.setText(currentUser.getNumber());\n double rent = currentUser.getRent();\n String rentStr = new Double(rent).toString();\n textViewRent.setText(rentStr);\n textViewChores.setText(currentUser.getChores());\n\n /*for(int i=0; i<listUsers.size(); i++){\n TextView textView = new TextView(this);\n final int passingInt = i;\n textView.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n String testMsg = listUsers.get(passingInt).getName();\n Log.d(\"User Clicked: \", testMsg);\n\n Intent editUserIntent = new Intent(EditChosenUserActivity.this, EditChosenUserActivity.class);\n }\n });\n\n textView.setTextSize(60.0f);\n textView.setText(listUsers.get(i).getName());\n users_list.addView(textView);\n }*/\n }",
"private void init() {\n UsersListAdapter usersListAdapter = new UsersListAdapter(getSupportFragmentManager());\n mViewPagerUserListing.setAdapter(usersListAdapter);\n\n // attach tab layout with view pager\n mTabLayoutUserListing.setupWithViewPager(mViewPagerUserListing);\n\n }",
"private void CreateStudentList() {\r\n\t\tStudentList=new ArrayList<Student>();\t\r\n}",
"public void getAllUsers() {\n\t\t\n\t}",
"public void init() throws ServletException {\n\t\tList<User> list = new ArrayList<>();\n\t\t\n\t\t//store the list in ServletContext domain\n\t\tthis.getServletContext().setAttribute(\"list\", list);\n\t}",
"public void loadUsers() {\n CustomUser userOne = new CustomUser();\n userOne.setUsername(SpringJPABootstrap.MWESTON);\n userOne.setPassword(SpringJPABootstrap.PASSWORD);\n\n CustomUser userTwo = new CustomUser();\n userTwo.setUsername(SpringJPABootstrap.TEST_ACCOUNT_USER_NAME);\n userTwo.setPassword(SpringJPABootstrap.TEST_ACCOUNT_PASSWORD);\n\n String firstUserName = userOne.getUsername();\n\n /*\n * for now I am not checking for a second user because there is no delete method being\n * used so if the first user is created the second user is expected to be created. this\n * could cause a bug later on but I will add in more logic if that is the case in a\n * future build.\n */\n if(userService.isUserNameTaken(firstUserName)) {\n log.debug(firstUserName + \" is already taken\");\n return ;\n }\n userService.save(userOne);\n userService.save(userTwo);\n\n log.debug(\"Test user accounts have been loaded!\");\n }",
"public sear() {\n initComponents();\n findUsers();\n }",
"public void initData(Users user){\n \n this.selectedUser = user;\n String idValue = String.valueOf(selectedUser.getId());\n String expiresValue = String.valueOf(selectedUser.getExpires_at());\n String enabledValue = String.valueOf(selectedUser.getEnabled());\n String lastLoginValue = String.valueOf(selectedUser.getLast_login());\n email.setText(selectedUser.getEmail());\n password.setText(selectedUser.getPassword());\n role.setText(selectedUser.getRoles());\n idField.setText(idValue);\n expiresField.setText(expiresValue);\n enabledField.setText(enabledValue);\n lockedTextField.setText(lastLoginValue);\n lastLoginTextField.setText(idValue);\n System.out.println(user.toString());\n }",
"public void displayUsers(){\n //go through the userName arraylist and add them to the listView\n for(String val:this.userNames){\n this.userListView.getItems().add(val);\n }\n }",
"public User_Account() {\r\n\t\tfirstName=middleName=lastName = null;\r\n\t\taddress=city=state=zip=null;\r\n\t\tphone=email=webLinks= new ArrayList <String>(); \r\n\t\tedu = new ArrayList <Education>();\r\n\t\twork = new ArrayList <Work>();\r\n\t}",
"private void loadUserList()\n\t{\n\t\tfinal ProgressDialog dia = ProgressDialog.show(this, null,\n\t\t\t\tgetString(R.string.alert_loading));\n\t\tParseUser.getQuery().whereNotEqualTo(\"username\", user.getUsername())\n\t\t\t\t.findInBackground(new FindCallback<ParseUser>() {\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void done(List<ParseUser> li, ParseException e) {\n\t\t\t\t\t\tdia.dismiss();\n\t\t\t\t\t\tif (li != null) {\n\t\t\t\t\t\t\tif (li.size() == 0)\n\t\t\t\t\t\t\t\tToast.makeText(UserList.this,\n\t\t\t\t\t\t\t\t\t\tR.string.msg_no_user_found,\n\t\t\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\n\t\t\t\t\t\t\tuList = new ArrayList<ParseUser>(li);\n\t\t\t\t\t\t\tListView list = (ListView) findViewById(R.id.list);\n\t\t\t\t\t\t\tlist.setAdapter(new UserAdapter());\n\t\t\t\t\t\t\tlist.setOnItemClickListener(new OnItemClickListener() {\n\n\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\tpublic void onItemClick(AdapterView<?> arg0,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tView arg1, int pos, long arg3) {\n\t\t\t\t\t\t\t\t\tstartActivity(new Intent(UserList.this,\n\t\t\t\t\t\t\t\t\t\t\tChat.class).putExtra(\n\t\t\t\t\t\t\t\t\t\t\tConst.EXTRA_DATA, uList.get(pos)\n\t\t\t\t\t\t\t\t\t\t\t\t\t.getUsername()));\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\tUtils.showDialog(\n\t\t\t\t\t\t\t\t\tUserList.this,\n\t\t\t\t\t\t\t\t\tgetString(R.string.err_users) + \" \"\n\t\t\t\t\t\t\t\t\t\t\t+ e.getMessage());\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}",
"private void initEnrolledUsersListView() {\n\n\t\tSet<EnrolledUser> users = controller.getActualCourse().getEnrolledUsers();\n\n\t\tObservableList<EnrolledUser> observableUsers = FXCollections.observableArrayList(users);\n\t\tobservableUsers.sort(EnrolledUser.NAME_COMPARATOR);\n\t\tfilteredEnrolledList = new FilteredList<>(observableUsers);\n\t\tfilteredEnrolledList.predicateProperty().addListener(p -> updatePredicadeEnrolledList());\n\t\t// Activamos la selección múltiple en la lista de participantes\n\t\tlistParticipants.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);\n\n\t\tlistParticipants.getSelectionModel().getSelectedItems()\n\t\t\t\t.addListener((Change<? extends EnrolledUser> usersSelected) -> updateListViewEnrolledUser());\n\n\t\t/// Mostramos la lista de participantes\n\t\tlistParticipants.setItems(filteredEnrolledList);\n\n\t\tlistParticipants.setCellFactory(callback -> new ListCell<EnrolledUser>() {\n\t\t\t@Override\n\t\t\tpublic void updateItem(EnrolledUser user, boolean empty) {\n\t\t\t\tsuper.updateItem(user, empty);\n\t\t\t\tif (empty || user == null) {\n\t\t\t\t\tsetText(null);\n\t\t\t\t\tsetGraphic(null);\n\t\t\t\t} else {\n\t\t\t\t\tInstant lastCourseAccess = user.getLastcourseaccess();\n\t\t\t\t\tInstant lastAccess = user.getLastaccess();\n\t\t\t\t\tInstant lastLogInstant = controller.getActualCourse().getLogs().getLastDatetime().toInstant();\n\t\t\t\t\tsetText(user + \"\\n\" + I18n.get(\"label.course\")\n\t\t\t\t\t\t\t+ UtilMethods.formatDates(lastCourseAccess, lastLogInstant) + \" | \"\n\t\t\t\t\t\t\t+ I18n.get(\"text.moodle\") + UtilMethods.formatDates(lastAccess, lastLogInstant));\n\n\t\t\t\t\tsetTextFill(LastActivityFactory.getColorActivity(lastCourseAccess, lastLogInstant));\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tImage image = new Image(new ByteArrayInputStream(user.getImageBytes()), 50, 50, false, false);\n\t\t\t\t\t\tsetGraphic(new ImageView(image));\n\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\tLOGGER.error(\"No se ha podido cargar la imagen de: {}\", user);\n\t\t\t\t\t\tsetGraphic(new ImageView(new Image(\"/img/default_user.png\")));\n\t\t\t\t\t}\n\t\t\t\t\tContextMenu menu = new ContextMenu();\n\t\t\t\t\tMenuItem seeUser = new MenuItem(I18n.get(\"text.see\") + user);\n\t\t\t\t\tseeUser.setOnAction(e -> userInfo(user));\n\t\t\t\t\tmenu.getItems().addAll(seeUser);\n\t\t\t\t\tsetContextMenu(menu);\n\t\t\t\t}\n\t\t\t}\n\n\t\t});\n\t}",
"public void buildConsultantData(){\r\n // Connect to database and perform select query on user table\r\n Database db = new Database();\r\n Connection connection = null;\r\n try{\r\n connection = db.jdbc_connection.connect();\r\n Statement statement = connection.createStatement(); // Set up statement\r\n \r\n String sql = \"SELECT userID, userName FROM user\";\r\n ResultSet results = statement.executeQuery(sql); \r\n \r\n while(results.next()) { \r\n int id = results.getInt(\"userID\");\r\n String name = results.getString(\"userName\");\r\n \r\n User user = new User(id, name);\r\n user_list.add(user);\r\n }\r\n \r\n combo_user.setItems(user_list);\r\n \r\n }catch(Exception e) {\r\n System.out.println(e.getMessage());\r\n }finally {\r\n try {\r\n connection.close();\r\n } catch (Exception e2) { // Closing databse error handling\r\n System.err.println(e2.getMessage());\r\n }\r\n } \r\n }",
"private void init(){\n this.firstNameTF.setText(user.getFirstName());\n this.nameTF.setText(user.getName());\n this.phoneTF.setText(user.getPhone());\n\n this.mailLabel.setText(user.getMail());\n this.roleLabel.setText(user.getFirstName());\n }",
"private void fillInCurrentStudentInfo() {\n // Extract info from Student object\n String name = WordUtils.capitalizeFully(mCurrentStudent.getName());\n int sex = mCurrentStudent.getSex();\n mStudentBirthdate = mCurrentStudent.getBirthdate();\n int grade = mCurrentStudent.getGrade();\n mChosenClassesList = (ArrayList<String>) mCurrentStudent.getClasses();\n String classes = TextUtils.join(\", \", mChosenClassesList);\n String photoUrl = mCurrentStudent.getPhotoUrl();\n\n // Populate views with the current student's information\n mStudentNameEditText.setText(name);\n mStudentBirthdateTextView.setText(DateUtils.convertDateLongToString(mStudentBirthdate));\n mStudentGradeEditText.setText(String.valueOf(grade));\n mStudentClassesTextView.setText(classes);\n mStudentClassesTextView.setVisibility(View.VISIBLE);\n\n // Set student photo (if it exists)\n if (!TextUtils.isEmpty(photoUrl)) {\n Glide.with(mAddPhotoView.getContext())\n .load(photoUrl)\n .into(mAddPhotoView);\n studentHasPhoto = true;\n }\n\n // Set student sex spinner\n switch (sex) {\n case SEX_MALE_INT:\n mStudentSexSpinner.setSelection(SEX_MALE_INT);\n break;\n case SEX_FEMALE_INT:\n mStudentSexSpinner.setSelection(SEX_FEMALE_INT);\n break;\n default:\n throw new IllegalArgumentException(\"Invalid sex\");\n }\n }"
] | [
"0.76020014",
"0.7478837",
"0.74507946",
"0.74091786",
"0.70608",
"0.7049387",
"0.70237625",
"0.698359",
"0.69117683",
"0.6900979",
"0.6875947",
"0.6769537",
"0.6748518",
"0.6713417",
"0.6625145",
"0.65933573",
"0.6589966",
"0.6567094",
"0.6499525",
"0.6483519",
"0.6470496",
"0.6467477",
"0.64216906",
"0.641955",
"0.64141446",
"0.63938046",
"0.63872135",
"0.6378408",
"0.6350243",
"0.6349619",
"0.63278663",
"0.6323286",
"0.6322603",
"0.63085145",
"0.6303624",
"0.63031834",
"0.6284208",
"0.627024",
"0.62616616",
"0.62576365",
"0.62412846",
"0.6235291",
"0.62094337",
"0.620033",
"0.6193423",
"0.6191433",
"0.61884606",
"0.6176587",
"0.6159517",
"0.6142514",
"0.61395603",
"0.61279964",
"0.6127236",
"0.6123789",
"0.611584",
"0.6104048",
"0.6091432",
"0.60679287",
"0.6062462",
"0.6052932",
"0.6037416",
"0.6029697",
"0.6026947",
"0.60177606",
"0.60004765",
"0.59950554",
"0.59930605",
"0.5973166",
"0.5969424",
"0.595752",
"0.59558004",
"0.5946536",
"0.59335077",
"0.5932771",
"0.5923615",
"0.59230137",
"0.5914552",
"0.59144443",
"0.5914335",
"0.58976185",
"0.58955187",
"0.5890822",
"0.58861",
"0.5871946",
"0.5862668",
"0.586158",
"0.58601445",
"0.5857493",
"0.58457685",
"0.5835956",
"0.58338404",
"0.58240294",
"0.581966",
"0.58039534",
"0.5801538",
"0.5788848",
"0.57868624",
"0.5786644",
"0.57827115",
"0.57676876"
] | 0.622632 | 42 |
Resolves rules that weren't resolved during first parsing. That means that everything that was discovered during first walk and is saved as a string name will be replaced by reference to the this.rules element. Flattens lexer rules so that they become either strings or regexes. | public static GrammarInfo generateGrammar(ParserResult parserResult) throws IngridParserException {
GrammarInfo grammar = new GrammarInfo(parserResult.grammarName);
Map<String, Rule> rules = parserResult.rules;
// Lexer rules must be resolved first so that parser rules can reference them
// Lexer rules do not contain references to parser rules
// We need to copy the array because we are changing it inside forEach
new ArrayList<>(rules.keySet())
.stream()
.filter(name -> rules.get(name) instanceof LexerRule || rules.get(name) instanceof RegexRule)
.forEach(name -> {
FlatLexerRule flatRule = null;
// We always get updated Rule from rule set again, because we might have updated it
flatRule = flattenLexerRule(rules.get(name), rules);
grammar.rules.put(name, flatRule);
// We need to put it to the old set too, so resolving in the second step works too,
// because we create new flatRule objects inside flattenLexerRule.
rules.put(name, flatRule);
});
// We need to copy the array because we are changing it inside forEach
new ArrayList<>(rules.values())
.stream()
.filter(r -> r instanceof ParserRule)
.forEach(rule -> {
resolveParserRule((ParserRule) rule, rules);
// We do not call "new Rule" inside here, so we don't need to update old rule set.
// Unlike in the first step, ParserRule objects stay the same, just their content is changed.
grammar.rules.put(rule.name, rule);
});
grammar.rootRule = grammar.rules.get(parserResult.rootRule);
for (String ruleToRemove : parserResult.fragmentLexerRules) {
grammar.rules.remove(ruleToRemove);
}
return grammar;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static FlatLexerRule flattenLexerRule(Rule rule, Map<String, Rule> rules) {\n // Because some rules were resolved as a dependency of another rule,\n // it might happen that it is already flattened.\n if (rule instanceof FlatLexerRule) {\n return (FlatLexerRule) rule;\n }\n\n if (rule instanceof UnresolvedLexerRule) {\n throw new IngridParserException(\n \"Rule '\" + rule.name + \"' must be resolved before flattening\");\n }\n\n LexerRule lexerRule = (LexerRule) rule;\n\n // If we have only one element, we might be looking at a literal rule..\n // We count all elements of all alternatives:\n if (lexerRule.alternatives.size() == 1 && lexerRule.alternatives.get(0).size() == 1) {\n Rule only = lexerRule.alternatives.get(0).get(0);\n if (only instanceof LiteralRule) {\n return new LiteralRule(rule.name, ((LiteralRule) only).value);\n }\n }\n\n // We can construct one big regex out of sub rules\n List<List<String>> regexs = new ArrayList<>();\n\n // Gather all sub rule contents (or resolve them, if wasn't resolved before)\n for (List<Rule> alternative : lexerRule.alternatives) {\n List<String> subRegex = new ArrayList<>();\n\n for (Rule element : alternative) {\n // Is each sub element already resolved?\n if (!(element instanceof FlatLexerRule)) {\n if (element instanceof QuantifierRule) {\n int lastIndex = subRegex.size() - 1;\n\n if (lastIndex < 0) {\n throw new IngridParserException(\"Quantifier suffix found with no prefix regex\");\n }\n\n // If more characters, we might need braces\n // There are cases where we might not, such as [A-Z] or (foo), so might be improved a little\n // It's tricky though, because of cases such as [A-Z][a-z], so simple heuristics is not enough\n String prevRegex = subRegex.get(lastIndex);\n if (prevRegex.length() > 1) {\n prevRegex = '(' + prevRegex + ')';\n }\n\n // We append it to the previous rule\n String quantifier = ((QuantifierRule) element).quantity.toString();\n\n subRegex.set(lastIndex, prevRegex + quantifier);\n\n } else if(element instanceof BlockStartRule) {\n subRegex.add(\"(\");\n } else if(element instanceof BlockEndRule) {\n subRegex.add(\")\");\n } else if(element instanceof BlockAltRule) {\n subRegex.add(\"|\");\n } else if (element instanceof UnresolvedLexerRule) {\n if (!rules.containsKey(element.name)) {\n throw new UnresolvableRuleException(\"Failed to resolve lexer rule '\" + element.name + \"'\");\n }\n\n try {\n FlatLexerRule flatRule = flattenLexerRule(rules.get(element.name), rules);\n rules.put(element.name, flatRule);\n subRegex.add(flatRule.getContent());\n } catch (StackOverflowError t) {\n throw new IngridParserException(\n \"Lexer rule '\" + rule.name + \"' or some of its subrules is recursive! \" +\n \"Ingrid cannot handle cyclic rules :(\");\n }\n } else {\n throw new IngridParserException(\n \"Rule '\" + element.name + \"' (\" + element.getClass().getSimpleName() + \") failed to be flattened\");\n }\n } else {\n // We need to escape literal rule\n // e.g. <?xml to <\\?xml\n String regex;\n if (element instanceof LiteralRule) {\n regex = escapeLiteral((LiteralRule) element);\n } else {\n regex = ((FlatLexerRule) element).getContent();\n }\n\n subRegex.add(regex);\n }\n }\n\n regexs.add(subRegex);\n }\n\n // Build regex from gathered strings\n return new RegexRule(rule.name, buildLexerRegex(regexs));\n }",
"private static void resolveParserRule(ParserRule rule, Map<String, Rule> rules) throws IngridParserException {\n // For each alternative line..\n for (Alternative alternative : rule.alternatives) {\n // For each element on the line..\n for (int i = 0; i < alternative.elements.size(); ++i) {\n RuleReference ref = alternative.elements.get(i);\n\n // Rule referenced in this alternative element\n Rule element = ref.rule;\n\n if (element instanceof UnresolvedRule) {\n // Lexer rules were resolved first, so they are ready to be referenced\n if (rules.containsKey(element.name)) {\n Rule lookedUpRule = rules.get(element.name);\n alternative.elements.set(i, new RuleReference(lookedUpRule, ref.quantity));\n } else {\n // Special EOF token might not be defined, but is a valid reference\n if (element.name.equals(\"EOF\")) {\n // We can ignore this rule\n alternative.elements.remove(i);\n --i;\n continue;\n }\n\n throw new IngridParserException(\n \"Couldn't resolve rule '\" + element.name + \"' (inside \" + rule.name + \")\");\n }\n } else if (element instanceof QuantifierRule) {\n if (i == 0) {\n throw new IngridParserException(\n \"Quantifier suffix found with no previous reference\");\n }\n\n // Apply quantifier to previous element of alternative\n alternative.elements.get(i - 1).quantity = ((QuantifierRule) element).quantity;\n // Remove quantifier itself\n alternative.elements.remove(i);\n --i;\n }\n }\n }\n }",
"public void deduceRules()\n{\n List<RuleInstance> allrules = loadRules();\n\n List<UpodRule> rules = new ArrayList<UpodRule>();\n for (UpodRule ur : for_program.getRules()) {\n if (ur.isExplicit()) {\n\t rules.add(ur);\n\t RuleInstance ri = new RuleInstance(ur,from_world.getUniverse());\n\t allrules.add(ri);\n }\n }\n\n Set<Condition> allconds = getConditions(allrules);\n\n tree_root = new TreeNode(allrules,null);\n\n expandTree(tree_root,allconds);\n\n generateRules(tree_root);\n}",
"private void explore(RuleContext ctx) {\n if (ctx.getChildCount() != 1) {\n String ruleName = Python3Parser.ruleNames[ctx.getRuleIndex()];\n astRepresenation.append(ruleName);\n astRepresenation.append(\": \");\n astRepresenation.append(ctx.getText());\n astRepresenation.append(\"\\n\");\n }\n for (int i = 0; i < ctx.getChildCount(); i++) {\n ParseTree element = ctx.getChild(i);\n if (element instanceof RuleContext) {\n explore((RuleContext) element);\n }\n }\n }",
"public static void lmd_parseTree(){\n\n e_stack.push(\"$\");\n e_stack.push(pc.first_rule);\n head_node=new node(pc.first_rule);\n\n // Evaluate\n // Building the tree as well\n\n node cur=head_node;\n\n for(int i=0;i<token_stream.length;i++){\n System.out.println(e_stack);\n if(!pc.isTerminal(e_stack.peek())){\n String rule_token =pc.parse_Table.get(e_stack.pop(),token_stream[i]).right;\n\n if(!rule_token.equals(\"empty\")) {\n String to_put[]=rule_token.split(\" \");\n for(int j=to_put.length-1;j>=0;j--)\n e_stack.push(to_put[j]);\n\n // add children\n for(int j=0;j<to_put.length;j++)\n addNode(cur,to_put[j]);\n // set cur\n cur=cur.next;\n }\n else {\n // if rule_token is empty\n addNode(cur,\"empty\");\n cur=cur.next.next; // as \"empty\" node will not have any children\n }\n i--;\n }\n else {\n // if(e_stack.peek().equals(token_stream[i]))\n e_stack.pop();\n if(cur.next!=null ) cur=cur.next;\n }\n }\n }",
"@SuppressWarnings(\"unchecked\")\n\tprivate void setRules() {\n\t\tthis.result = Result.START;\n\t\t// Create all initial rule executors, and shuffle them if needed.\n\t\tthis.rules = new LinkedList<>();\n\t\tModule module = getModule();\n\t\tfor (Rule rule : module.getRules()) {\n\t\t\tRuleStackExecutor executor = (RuleStackExecutor) getExecutor(rule, getSubstitution());\n\t\t\texecutor.setContext(module);\n\t\t\tthis.rules.add(executor);\n\t\t}\n\t\tif (getRuleOrder() == RuleEvaluationOrder.RANDOM || getRuleOrder() == RuleEvaluationOrder.RANDOMALL) {\n\t\t\tCollections.shuffle((List<RuleStackExecutor>) this.rules);\n\t\t}\n\t}",
"public Set<SWRLRule> translate() throws Exception {\n NodeList nodeList = doc.getElementsByTagName(\"rule\");\n if (nodeList == null) {\n throw new Exception(\"No rule tag in xml file\");\n }\n Set<SWRLRule> ruleSwrl = new HashSet<SWRLRule>();\n for (int i = 0; i < nodeList.getLength(); i++) {\n Set<SWRLAtom> antecedent = new HashSet<SWRLAtom>();\n Set<SWRLAtom> consequent = new HashSet<SWRLAtom>();\n Node node = nodeList.item(i);\n NodeList children = node.getChildNodes();\n for (int j = 0; j < children.getLength(); j++) {\n Node child = children.item(j);\n switch (child.getNodeName()) {\n case \"if\": {\n generateAntecedent((Element) child, antecedent);\n break;\n }\n case \"then\": {\n generateConsequent((Element) child, consequent);\n break;\n }\n }\n }\n SWRLRule rules = factory.getSWRLRule(antecedent, consequent);\n ruleSwrl.add(rules);\n }\n return ruleSwrl;\n }",
"@Override\n public Map<String, Predicate<Map<String, String>>> decode(String jsonRules) throws AnalyzerException, DecoderException {\n Map<String, String> rulesMap = JsonUtils.mapFromJson(jsonRules);\n Map<String, Predicate<Map<String, String>>> result = new HashMap<>(rulesMap.size());\n\n for (String s : rulesMap.keySet()) {\n String rule = rulesMap.get(s);\n\n if (rule != null && !rule.isBlank()) {\n List<Token> tokens = new PredicateLexicalAnalyzer(rule).getTokens();\n tokens = toReversePolishNotation(tokens);\n\n for (Token t : tokens) {\n if (PredicateTokens.VALUE == toPredicateToken(t) && !containsPropAndVal.test(t)) {\n throw new DecoderException(DecoderErrorCodes.UNKNOWN_PROPERTY_OR_VALUE, t.toString());\n }\n }\n\n result.put(s, decodeReversePolishNotation(tokens));\n }\n }\n\n return result;\n }",
"public java.lang.String GetRules() throws IOException {\r\n java.lang.String RulesString = new java.lang.String();\r\n Scanner scanner = new Scanner(new FileInputStream(RulesFile), \"UTF-8\");\r\n while (scanner.hasNextLine()) {\r\n RulesString = RulesString + scanner.nextLine() + \"\\n\";\r\n }\r\n return RulesString;\r\n }",
"private void readRules(Hashtable<String, ? extends Number> lexRulesTable, Hashtable<String, ? extends Number> intRulesTable, \n\t\t\tHashtable<String, Double> posCatFreqTable, Hashtable<String, Double> intCatFreqTable) {\t\t\n\t\tlexRules = new int[lexRulesSize][2];\n\t\tlexLogProb = new double[lexRulesSize];\n\t\tintBinaryRules = new int[intBinaryRulesSize][3];\n\t\tintBinaryLogProb = new double[intBinaryRulesSize];\n\t\tintUnaryRules = new int[intUnaryRulesSize][2];\n\t\tintUnaryLogProb = new double[intUnaryRulesSize];\t\t\t\t\n\t\trulesOfWord = new int[lexCount][];\n\t\tbinaryRulesOfLeftChild = new int[catCount][];\n\t\tunaryRulesOfLeftChild = new int[catCount][];\n\t\tint lexRuleCount = 0;\n\t\tfor(Enumeration<String> e = lexRulesTable.keys(); e.hasMoreElements(); ) {\n\t\t\tString rule = (String)e.nextElement();\n\t\t\tdouble count = lexRulesTable.get(rule).doubleValue();\t\n\t\t\tString[] ruleSplit = rule.split(\" \");\n\t\t\tint parentIndex = catIndex.get(ruleSplit[0]);\n\t\t\tint wordIndex = lexIndex.get(ruleSplit[1]);\t\t\t\t\t\t\t\t\t\n\t\t\tdouble parentFreq = posCatFreqTable.get(ruleSplit[0]);\t\t\t\n\t\t\tlexRules[lexRuleCount] = new int[]{parentIndex, wordIndex};\n\t\t\tlexLogProb[lexRuleCount] = Math.log(count / parentFreq);\n\t\t\trulesOfWord[wordIndex] = Utility.appendIntArraySet(rulesOfWord[wordIndex], lexRuleCount);\n\t\t\tlexRuleCount++;\n\t\t}\n\t\tint intBinaryRuleCount=0, intUnaryRuleCount=0;\n\t\tfor(Enumeration<String> e = intRulesTable.keys(); e.hasMoreElements(); ) {\n\t\t\tString rule = (String)e.nextElement();\n\t\t\tdouble count = intRulesTable.get(rule).doubleValue();\t\n\t\t\tString[] ruleSplit = rule.split(\" \");\n\t\t\tint parentIndex = catIndex.get(ruleSplit[0]);\n\t\t\tint leftDaughterIndex = catIndex.get(ruleSplit[1]);\n\t\t\tdouble parentFreq = intCatFreqTable.get(ruleSplit[0]);\n\t\t\tif (ruleSplit.length>2) {\n\t\t\t\tint rightDaughterIndex = catIndex.get(ruleSplit[2]);\t\t\t\t\n\t\t\t\tintBinaryRules[intBinaryRuleCount] = new int[]{parentIndex, leftDaughterIndex, rightDaughterIndex};\t\t\t\t\t\t\n\t\t\t\tintBinaryLogProb[intBinaryRuleCount] = Math.log(count / parentFreq);\n\t\t\t\tbinaryRulesOfLeftChild[leftDaughterIndex] = Utility.appendIntArraySet(binaryRulesOfLeftChild[leftDaughterIndex], intBinaryRuleCount);\n\t\t\t\tintBinaryRuleCount++;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tintUnaryRules[intUnaryRuleCount] = new int[]{parentIndex, leftDaughterIndex};\n\t\t\t\tintUnaryLogProb[intUnaryRuleCount] = Math.log(count / parentFreq);\n\t\t\t\tunaryRulesOfLeftChild[leftDaughterIndex] = Utility.appendIntArraySet(unaryRulesOfLeftChild[leftDaughterIndex], intUnaryRuleCount);\n\t\t\t\tintUnaryRuleCount++;\n\t\t\t}\n\t\t}\n\t}",
"public RETEReasoner addRules(List rules) {\n List combined = new List( this.rules );\n combined.addAll( rules );\n setRules( combined );\n return this;\n }",
"public void loadRules(String path) {\n\n // Checking if the file exists...\n File ruleFile = new File(path);\n if (!ruleFile.exists()) {\n System.err.println(\"The file at \" + path + \" could not be found in RuleLoader!\");\n return;\n }\n\n Scanner sc;\n try {\n sc = new Scanner(ruleFile);\n } catch (FileNotFoundException e) {\n System.err.println(\"The file at \" + path + \" could not be found in RuleLoader!\");\n return;\n }\n sc.useDelimiter(\",\");\n\n // Now begin reading each line in the file.\n // - Lines which are blank or start with # (comment) are ignored.\n // - PathRules start with an & to indicate that they are\n // referencing an existing rule.\n // - Rules created from each line are added to the PhuJusAgent via the\n // addRule method.\n while (sc.hasNextLine()) {\n String readLine = sc.nextLine();\n\n // Ignore blank lines or comments\n if (readLine.length() == 0 || readLine.startsWith(\"#\")) {\n continue;\n }\n\n TFRule tfNewbie = null;\n // PathRules start with a ~/= to indicate that they are pathrules\n if (readLine.startsWith(\"&\")) {\n //TODO: Fix the PathRule loading code\n agent.debugPrintln(\"PathRule loading code not implemented.\");\n //pathNewbie = createPathRuleFromLine(readLine);\n }\n else {\n tfNewbie = createTFRuleFromLine(readLine);\n System.out.println(\"Loading rule \" + readLine);\n }\n if (tfNewbie != null) agent.addRule(tfNewbie);\n }\n }",
"public static void parse(String tokens) {\n\t\tstate.set(STATE_PARSING);\n\t\t\n\t\ttokens = detectAliases(spellPunctuation(tokens));\n\t\t\n\t\tInstructionPossibilities possibilities = new InstructionPossibilities();\n\t\t\n\t\tScanner scanner = new Scanner(tokens);\n\t\tString token;\n\t\tInstructionPossibility instruction = null;\n\t\tboolean unresolved = true;\n\t\tboolean unknownAction = false;\n\t\t\n\t\twhile (scanner.hasNext()) {\n\t\t\tunresolved = true;\n\t\t\t\n\t\t\t//get next token\n\t\t\ttoken = scanner.next();\n\t\t\t\n\t\t\t//update instruction possibilities\n\t\t\tif (possibilities.resolve(token)) {\n\t\t\t\t/*\n\t\t\t\t * If possibilities have resolved into one mapping, fill in the rest of the tokens \n\t\t\t\t * and execute the action or learn the lesson.\n\t\t\t\t */\n\t\t\t\tinstruction = possibilities.finish(scanner);\n\t\t\t\t\n\t\t\t\tif (instruction == null) { //instruction did not match mapping\n\t\t\t\t\tLogger.logError(\"mapping candidate for given instruction failed to resolve\");\n\t\t\t\t\tunresolved = false;\n\t\t\t\t\tunknownAction = true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tunresolved = false;\n\t\t\t\t\tCompiler.enqueue(instruction);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/*\n\t\t * If there are multiple remaining possibilities (or none), pick the best.\n\t\t */\n\t\tif (unresolved) {\n\t\t\tinstruction = possibilities.finish(true);\n\t\t\t\n\t\t\tif (instruction == null) { //there were no remaining possibilities\n\t\t\t\tunknownAction = true;\n\t\t\t\tLogger.logError(\"no mappings matched given instruction\");\n\t\t\t}\n\t\t\telse {\t\t\t\t\n\t\t\t\tCompiler.enqueue(instruction);\n\t\t\t}\n\t\t}\n\t\t\n\t\tscanner.close();\n\t\tif (unknownAction) {\n\t\t\t//notify unknown action\n\t\t\tLogger.log(\"perhaps \\\"\" + tokens + \"\\\" contains actions I've not learned yet?\", Logger.LEVEL_SPEECH);\n\t\t}\n\t\telse {\n\t\t\t//follow through\n\t\t\tCompiler.compile();\n\t\t}\n\t\t\n\t\t\n\t\tstate.set(STATE_DONE);\n\t\tstate.set(STATE_IDLE);\n\t}",
"private LispTree getRuleLispTree() {\n LispTree tree = LispTree.proto.newList();\n tree.addChild(\"rules\");\n getRuleLispTreeRecurs(tree);\n return tree;\n }",
"public static String explodeRulesAndCreateString(String rules)\n\t{\n\t\tGrammar grammar = new Grammar();\n\t\tList<IPattern> patterns = explodeRules(grammar, rules);\n\t\tStringBuilder str = new StringBuilder(100);\n\n\t\tboolean first = true;\n\t\tfor (IPattern pattern : patterns)\n\t\t{\n\t\t\tif (!first)\n\t\t\t{\n\t\t\t\tstr.append(\"\\n\");\n\t\t\t}\n\t\t\tstr.append(pattern.toString2(grammar));\n\t\t\tfirst = false;\n\t\t}\n\t\t\n\t\tif (debugFlag)\n\t\t{\n\t\t\tOut.print(str.toString());\n\t\t}\n\n\t\treturn str.toString();\n\t}",
"public void clearRules() {\n this.rules_ = emptyProtobufList();\n }",
"public static List<IPattern> explodeRules(Grammar grammar, String rules)\n\t{\n\t\tList<GrammarRule> rules2 = parseGrammar(grammar, rules);\n\t\treturn grammar.setGrammarRules(rules2);\n\t}",
"private Rule honorRules(InstanceWaypoint context){\n \t\t\n \t\tStyle style = getStyle(context);\n \t\tRule[] rules = SLD.rules(style);\n \t\t\n \t\t//do rules exist?\n \t\t\n \t\tif(rules == null || rules.length == 0){\n \t\t\treturn null;\n \t\t}\n \t\t\n \t\t\n \t\t//sort the elserules at the end\n \t\tif(rules.length > 1){\n \t\t\trules = sortRules(rules);\n \t\t}\n \t\t\n \t\t//if rule exists\n \t\tInstanceReference ir = context.getValue();\n \t\tInstanceService is = (InstanceService) PlatformUI.getWorkbench().getService(InstanceService.class);\n \t\tInstance inst = is.getInstance(ir);\n \t\t\t\n \t\tfor (int i = 0; i < rules.length; i++){\n \t\t\t\n \t\t\tif(rules[i].getFilter() != null){\t\t\t\t\t\t\n \t\t\t\t\n \t\t\t\tif(rules[i].getFilter().evaluate(inst)){\n \t\t\t\t\treturn rules[i];\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\t//if a rule exist without a filter and without being an else-filter,\n \t\t\t//the found rule applies to all types\n \t\t\telse{\n \t\t\t\tif(!rules[i].isElseFilter()){\n \t\t\t\t\treturn rules[i];\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\t\n \t\t//if there is no appropriate rule, check if there is an else-rule\n \t\tfor (int i = 0; i < rules.length; i++){\n \t\t\tif(rules[i].isElseFilter()){\n \t\t\t\treturn rules[i];\n \t\t\t}\n \t\t}\n \t\t\n \t \n \t\t//return null if no rule was found\n \t\treturn null;\n \t\n \t}",
"private String L() throws SyntaxException, ParserException {\n\t\tswitch (current) {\n\t\t\tcase 'a':\n\t\t\t\t// L -> a\n\t\t\t\teat('a');\n\t\t\t\treturn \"a\";\n\t\t\tcase 'b':\n\t\t\t\t// L -> b\n\t\t\t\teat('b');\n\t\t\t\treturn \"b\";\n\t\t\tcase 'c':\n\t\t\t\t// L -> c\n\t\t\t\teat('c');\n\t\t\t\treturn \"c\";\n\t\t\tdefault:\n\t\t\t\tthrow new SyntaxException(ErrorType.NO_RULE,current);\n\t\t}\n\t}",
"public void parse(Lexer lex);",
"public Tree<TokenAttributes> start(TranslationGrammarParser.ProgContext ctx, String firstRuleName) {\n ctx.rulee().forEach((t) -> {\n rules.put(t.NODE_NAME().getSymbol().getText(), t);\n });\n Tree<TokenAttributes> eCST = new Tree<>(new UniversalToken(\"root\", -1));\n ArrayList<Node<TokenAttributes>> result = (ArrayList<Node<TokenAttributes>>) magicVisit(getRuleContext(firstRuleName), current_node);\n if (result == null) {\n return null;\n }\n eCST.getRoot().addChildren(result);\n result.forEach((t) -> {\n t.setParent(eCST.getRoot());\n });\n return eCST;\n }",
"public RETEReasoner(List rules) {\n if (rules == null) throw new NullPointerException( \"null rules\" );\n this.rules = rules;\n }",
"public void clear()\n {\n for (final Rule rule : this.rules)\n {\n rule.clear();\n }\n\n this.rules.clear();\n }",
"protected void extractEmbeddedRules(String rulesXml) {\n\t\tDocumentBuilder db = getXMLParser();\n\n\t\tDocument docExtra = null;\n\t\ttry {\n\t\t\tInputSource is = new InputSource(new StringReader(rulesXml));\n\t\t\tdocExtra = db.parse(is);\n\t\t\t\n\t\t} catch (DOMException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (SAXException 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\tif (docExtra != null) {\n\t\t\tprocessStandoffMarkup(docExtra);\n\t\t}\n\n\t}",
"private void fillDistinctRules(){\n\tint totRules =0;\n\tfor(int i=1;i<ConditionTree.length;i++){\n\t\tif((!ConditionTree[i][1].equals(ConditionTree[i-1][1])) && ConditionTree[i][4].equals(\"String\")){\n\t\t\ttotRules++;\n\t\t}\n\t}\n\n\tdistinctRules = new String[totRules][2];\n\n\t//filling distinct rules array first column i-e rules names only\n\tint disRulIndex = 0;\n\tfor(int i=1;i<ConditionTree.length;i++){\n\t\tif((!ConditionTree[i][1].equals(ConditionTree[i-1][1])) && ConditionTree[i][4].equals(\"String\")){\n\t\t\tdistinctRules[disRulIndex][0] = ConditionTree[i][1];\n\t\t\tdisRulIndex++;\n\t\t}\n\t}\n\t\n\t\n\t\n\tfor(int a=0;a<distinctRules.length;a++){\n\t\tdistinctRules[a][1] = \"\";\n\t\tfor(int i=0;i<ConditionTree.length;i++){\n\t\t\tif(distinctRules[a][0].equals(ConditionTree[i][1])){\n\t\t\t\tdistinctRules[a][1] += ConditionTree[i][3] + \",\";\n\t\t\t}\n\t\t}\n\t\t//removing the last comma\n\t\tdistinctRules[a][1] = distinctRules[a][1].substring(0, distinctRules[a][1].length()-1);\n//\t\tSystem.out.println(distinctRules[a][0] + \" : \" + distinctRules[a][1]);\n\t}\n}",
"private Rule[] sortRules(Rule[] rules){\n \t\t\n \t\tArrayList<Rule> temp = new ArrayList<Rule>();\n \t\t\n \t\tfor(int i = 0; i < rules.length; i++){\n \t\t\t\n \t\t\tif(!rules[i].isElseFilter()){\n \t\t\t\ttemp.add(rules[i]);\n \t\t\t}\n \t\t}\n \t\t\n \t\tfor(int i = 0; i < rules.length; i++){\n \t\t\t\n \t\t\tif(rules[i].isElseFilter()){\n \t\t\t\ttemp.add(rules[i]);\n \t\t\t}\n \t\t\t\n \t\t}\n \t\t\n \t\tRule[] newRules = new Rule[temp.size()];\t\t\n \t\treturn temp.toArray(newRules);\n \t}",
"public void setRules(ArrayList<Rule> rules) {\n\t\tthis.rules = rules;\n\t}",
"static void lookUp(){\r\n\r\n if (lexeme.equals(\"(\"))\r\n token = \"LEFT_PAREN\";\r\n else if (lexeme.equals(\")\"))\r\n token = \"RIGHT_PAREN\";\r\n else if (lexeme.equals(\"true\"))\r\n token = \"TRUE\";\r\n else if (lexeme.equals(\"false\"))\r\n token = \"FALSE\";\r\n else if (lexeme.equals(\"-\"))\r\n token = \"MINUS\";\r\n else if (lexeme.equals(\"+\"))\r\n token = \"PLUS\";\r\n else if (lexeme.equals(\"*\"))\r\n token = \"STAR\";\r\n else if (lexeme.equals(\"/\"))\r\n token = \"DIVOP\";\r\n else if (lexeme.equals(\"%\"))\r\n token = \"MOD\";\r\n else if (lexeme.equals(\">\"))\r\n token = \"GREATER_THAN\";\r\n else if (lexeme .equals(\"<\"))\r\n token = \"LESS_THAN\";\r\n else if (lexeme.equals(\"=\"))\r\n token = \"EQUALS\";\r\n else if (lexeme.equals(\"<=\"))\r\n token = \"LESS_OR_EQUAL\";\r\n else if (lexeme.equals(\">=\"))\r\n token = \"GREATER_OR_EQUAL\";\r\n else if (lexeme.equals(\"!=\"))\r\n token = \"NOT_EQUAL\";\r\n else\r\n token = \"ILLEGAL\";\r\n }",
"static public Rule parse(OrchestraSystem catalog, String rule, \r\n\t\t\tMap<String,RelationContext> locals) throws ParseException, RelationNotFoundException {\r\n\t\tHolder<Integer> counter = new Holder<Integer>(0);\r\n\t\tPositionedString str = new PositionedString(rule);\r\n\t\tstr.skipWhitespace();\r\n\t\tUntypedAtom h = UntypedAtom.parse(str, counter);\r\n\t\tboolean negateHead = false;\r\n\t\tif (h.getName().startsWith(\"NOT_\")) {\r\n\t\t\th.setName(h.getName().substring(4));\r\n\t\t\tnegateHead = true;\r\n\t\t}\r\n\r\n\t\tstr.skipWhitespace();\r\n\t\tif (!str.skipString(\":-\")) {\r\n\t\t\tcomplain(str, \"':-'\");\r\n\t\t}\r\n\t\tstr.skipWhitespace();\r\n\t\tArrayList<Atom> body = new ArrayList<Atom>();\r\n\t\tboolean first = true;\r\n\t\tstr.skipWhitespace();\r\n\t\twhile (str.inRange()) {\r\n\t\t\tif (first) {\r\n\t\t\t\tfirst = false;\r\n\t\t\t} else {\r\n\t\t\t\tif (!str.skipString(\",\")) {\r\n\t\t\t\t\tcomplain(str, \"','\");\r\n\t\t\t\t}\r\n\t\t\t\tstr.skipWhitespace();\r\n\t\t\t}\r\n\t\t\tUntypedAtom b = UntypedAtom.parse(str, counter);\r\n\t\t\tboolean isNegated = false;\r\n\t\t\tif (b.getName().startsWith(\"NOT_\")) {\r\n\t\t\t\tisNegated = true;\r\n\t\t\t\tb.setName(b.getName().substring(4));\r\n\t\t\t}\r\n\t\t\tAtom n = b.getTyped(catalog, locals);\r\n\t\t\tn.setNeg(isNegated);\r\n\t\t\tbody.add(n);\r\n\t\t\tstr.skipWhitespace();\r\n\t\t}\r\n\t\tAtom th;\r\n\t\ttry {\r\n\t\t\tth = h.getTyped(catalog, locals);\r\n\t\t} catch (ParseException e) {\r\n\t\t\tth = h.getTyped(body);\r\n\t\t\t// Add this as a local view definition\r\n\t\t\tif (!locals.containsKey(th.getRelationContext().toString()))\r\n\t\t\t\tlocals.put(th.getRelationContext().toString(), th.getRelationContext());\r\n\t\t} catch (RelationNotFoundException e) {\r\n\t\t\tth = h.getTyped(body);\r\n\t\t\t// Add this as a local view definition\r\n\t\t\tif (!locals.containsKey(th.getRelationContext().toString()))\r\n\t\t\t\tlocals.put(th.getRelationContext().toString(), th.getRelationContext());\r\n\t\t}\r\n\t\tth.setNeg(negateHead);\r\n\r\n\t\treturn new Rule(th, body, null, catalog.getMappingDb().getBuiltInSchemas());\r\n\t}",
"public void testUnfoldingWithNoRulesForResolutions() {\n\t\tDatalogProgram p = fac.getDatalogProgram();\n\t\tFunction body = fac.getFunction(fac.getPredicate(\"T1\", 2), fac.getVariable(\"x\"), fac.getVariable(\"y\"));\n\t\tFunction head = fac.getFunction(fac.getPredicate(\"A\", 1), fac.getVariable(\"x\"));\n\t\tCQIE rule2 = fac.getCQIE(head, body);\n\t\tp.appendRule(rule2);\n\n\t\tDatalogProgram query = fac.getDatalogProgram();\n\t\t// main rule q(x,y) :- LJ(A(x), R(x,y))\n\t\tFunction a = fac.getFunction(fac.getClassPredicate(\"A\"), fac.getVariable(\"x\"));\n\t\tFunction R = fac.getFunction(fac.getObjectPropertyPredicate(\"R\"), fac.getVariable(\"x\"), fac.getVariable(\"y\"));\n\t\tFunction lj = fac.getSPARQLLeftJoin(a, R);\n\t\thead = fac.getFunction(fac.getPredicate(\"q\", 2), fac.getVariable(\"x\"), fac.getVariable(\"y\"));\n\t\tCQIE rule1 = fac.getCQIE(head, lj);\n\t\tquery.appendRule(rule1);\n\n\t\tDatalogUnfolder unfolder = new DatalogUnfolder(p.getRules());\n\t\tDatalogProgram result = unfolder.unfold(query, \"q\");\n\n\t\t// Only one rule should be returned where y is null\n\t\tSystem.out.println(result);\n\t\tassertEquals(1, result.getRules().size());\n\t\tassertTrue(result.getRules().toString().contains(\"null\"));\n\t\tassertTrue(result.getRules().toString().contains(\"T1(\"));\n\t\tassertFalse(result.getRules().toString().contains(\"A(\"));\n\t\tassertFalse(result.getRules().toString().contains(\"R(\"));\n\t\tassertFalse(result.getRules().toString().contains(\"LeftJoin(\"));\n\t\tassertTrue(result.getRules().get(0).getBody().size() == 1);\n\n\t}",
"int yyparse()\n{\nboolean doaction;\n init_stacks();\n yynerrs = 0;\n yyerrflag = 0;\n yychar = -1; //impossible char forces a read\n yystate=0; //initial state\n state_push(yystate); //save it\n val_push(yylval); //save empty value\n while (true) //until parsing is done, either correctly, or w/error\n {\n doaction=true;\n if (yydebug) debug(\"loop\"); \n //#### NEXT ACTION (from reduction table)\n for (yyn=yydefred[yystate];yyn==0;yyn=yydefred[yystate])\n {\n if (yydebug) debug(\"yyn:\"+yyn+\" state:\"+yystate+\" yychar:\"+yychar);\n if (yychar < 0) //we want a char?\n {\n yychar = yylex(); //get next token\n if (yydebug) debug(\" next yychar:\"+yychar);\n //#### ERROR CHECK ####\n if (yychar < 0) //it it didn't work/error\n {\n yychar = 0; //change it to default string (no -1!)\n if (yydebug)\n yylexdebug(yystate,yychar);\n }\n }//yychar<0\n yyn = yysindex[yystate]; //get amount to shift by (shift index)\n if ((yyn != 0) && (yyn += yychar) >= 0 &&\n yyn <= YYTABLESIZE && yycheck[yyn] == yychar)\n {\n if (yydebug)\n debug(\"state \"+yystate+\", shifting to state \"+yytable[yyn]);\n //#### NEXT STATE ####\n yystate = yytable[yyn];//we are in a new state\n state_push(yystate); //save it\n val_push(yylval); //push our lval as the input for next rule\n yychar = -1; //since we have 'eaten' a token, say we need another\n if (yyerrflag > 0) //have we recovered an error?\n --yyerrflag; //give ourselves credit\n doaction=false; //but don't process yet\n break; //quit the yyn=0 loop\n }\n\n yyn = yyrindex[yystate]; //reduce\n if ((yyn !=0 ) && (yyn += yychar) >= 0 &&\n yyn <= YYTABLESIZE && yycheck[yyn] == yychar)\n { //we reduced!\n if (yydebug) debug(\"reduce\");\n yyn = yytable[yyn];\n doaction=true; //get ready to execute\n break; //drop down to actions\n }\n else //ERROR RECOVERY\n {\n if (yyerrflag==0)\n {\n yyerror(\"syntax error\");\n yynerrs++;\n }\n if (yyerrflag < 3) //low error count?\n {\n yyerrflag = 3;\n while (true) //do until break\n {\n if (stateptr<0) //check for under & overflow here\n {\n yyerror(\"stack underflow. aborting...\"); //note lower case 's'\n return 1;\n }\n yyn = yysindex[state_peek(0)];\n if ((yyn != 0) && (yyn += YYERRCODE) >= 0 &&\n yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)\n {\n if (yydebug)\n debug(\"state \"+state_peek(0)+\", error recovery shifting to state \"+yytable[yyn]+\" \");\n yystate = yytable[yyn];\n state_push(yystate);\n val_push(yylval);\n doaction=false;\n break;\n }\n else\n {\n if (yydebug)\n debug(\"error recovery discarding state \"+state_peek(0)+\" \");\n if (stateptr<0) //check for under & overflow here\n {\n yyerror(\"Stack underflow. aborting...\"); //capital 'S'\n return 1;\n }\n state_pop();\n val_pop();\n }\n }\n }\n else //discard this token\n {\n if (yychar == 0)\n return 1; //yyabort\n if (yydebug)\n {\n yys = null;\n if (yychar <= YYMAXTOKEN) yys = yyname[yychar];\n if (yys == null) yys = \"illegal-symbol\";\n debug(\"state \"+yystate+\", error recovery discards token \"+yychar+\" (\"+yys+\")\");\n }\n yychar = -1; //read another\n }\n }//end error recovery\n }//yyn=0 loop\n if (!doaction) //any reason not to proceed?\n continue; //skip action\n yym = yylen[yyn]; //get count of terminals on rhs\n if (yydebug)\n debug(\"state \"+yystate+\", reducing \"+yym+\" by rule \"+yyn+\" (\"+yyrule[yyn]+\")\");\n if (yym>0) //if count of rhs not 'nil'\n yyval = val_peek(yym-1); //get current semantic value\n yyval = dup_yyval(yyval); //duplicate yyval if ParserVal is used as semantic value\n switch(yyn)\n {\n//########## USER-SUPPLIED ACTIONS ##########\ncase 1:\n//#line 63 \"./sinj.y\"\n{ this.ast = new Program (lexico.getLine(), lexico.getColumn(), (List<Sentence>)val_peek(1), (List<Definition>)val_peek(8),(List<VariableDefinition>)val_peek(2) ); }\nbreak;\ncase 2:\n//#line 66 \"./sinj.y\"\n{ yyval = new ArrayList<Definition>(); }\nbreak;\ncase 3:\n//#line 67 \"./sinj.y\"\n{ \n\t\t\t\t\t\t\t\t\t\t\tyyval = val_peek(1);\n\t\t\t\t\t\t\t\t\t\t\t((ArrayList<Definition> )yyval).addAll((ArrayList<Definition>)val_peek(0));\n\t\t\t\t\t\t\t\t\t\t\t}\nbreak;\ncase 6:\n//#line 78 \"./sinj.y\"\n{ \n\t\t\t\t\t\t\t\t\t\t\t\tTypeFunction type = new TypeFunction ((Type)val_peek(8), (ArrayList<VariableDefinition>) val_peek(5));\n\t\t\t\t\t\t\t\t\t\t\t\tList<Sentence> body = new ArrayList<Sentence> ();\n\t\t\t\t\t\t\t\t\t\t\t\tbody.addAll((List<Sentence>)val_peek(2));\n\t\t\t\t\t\t\t\t\t\t\t\tbody.addAll((List<Sentence>)val_peek(1));\n\t\t\t\t\t\t\t\t\t\t\t\tDefinition def = new FunctionDefinition (lexico.getLine(), lexico.getColumn(), type, (String) val_peek(7), body);\n\t\t\t\t\t\t\t\t\t\t\t\tList<Definition> xx = new ArrayList<Definition> ();\n\t\t\t\t\t\t\t\t\t\t\t\txx.add(def);\n\t\t\t\t\t\t\t\t\t\t\t\tyyval = xx;\n }\nbreak;\ncase 7:\n//#line 89 \"./sinj.y\"\n{ yyval = new ArrayList<VariableDefinition> (); }\nbreak;\ncase 9:\n//#line 93 \"./sinj.y\"\n{ \n\t\t\t\t\t\tyyval = new ArrayList<VariableDefinition>();\n\t\t\t\t\t\tVariable v = new Variable (lexico.getLine(), lexico.getColumn(), val_peek(0).toString());\n\t\t\t\t\t\t((ArrayList<Definition>)yyval).add(new VariableDefinition(lexico.getLine(), lexico.getColumn(), v, (Type)val_peek(1)));\n\t\t\t\t\t}\nbreak;\ncase 10:\n//#line 98 \"./sinj.y\"\n{\n\t\t\t\t\t\t\t\t\t\tyyval = val_peek(3);\n\t\t\t\t\t\t\t\t\t\tVariable v = new Variable (lexico.getLine(), lexico.getColumn(), val_peek(0).toString());\n\t\t\t\t\t\t\t\t\t\tVariableDefinition vd = new VariableDefinition(lexico.getLine(), lexico.getColumn(), v, (Type)val_peek(1));\n\t\t\t\t\t\t\t\t\t\tif (!((ArrayList<VariableDefinition>)yyval).contains (vd))\n\t\t\t\t\t\t\t\t\t\t\t((ArrayList<Definition>) yyval).add(vd);\n\t\t\t\t\t\t\t\t\t\telse \n\t\t\t\t\t\t\t\t\t\t\tthrow new RuntimeException (\"One param is duplicate\");\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}\nbreak;\ncase 11:\n//#line 111 \"./sinj.y\"\n{ \n\t\t\t\t\t\t\t\t\t\t\t\t\tArrayList<VariableDefinition> xx = new ArrayList<VariableDefinition>();\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor (Variable v: (ArrayList<Variable>)val_peek(1)) \n\t\t\t\t\t\t\t\t\t\t\t\t\t \txx.add(new VariableDefinition(lexico.getLine(), lexico.getColumn(), v, (Type)val_peek(2))); \n\t\t\t\t\t\t\t\t\t\t\t\t\tyyval = xx; \n\t\t\t\t\t\t\t\t\t\t\t\t\t }\nbreak;\ncase 12:\n//#line 123 \"./sinj.y\"\n{ \n\t\t\t\t\t\t\t\tList<Variable> xx = new ArrayList<Variable>(); \n\t\t\t\t\t\t\t\txx.add(new Variable (lexico.getLine(), lexico.getColumn(), (String) val_peek(0))); \n\t\t\t\t\t\t\t\tyyval = xx; \n\t\t\t\t\t\t\t\t}\nbreak;\ncase 13:\n//#line 128 \"./sinj.y\"\n{ \n\t\t\t\t\t\t\t\t\t\t\t\t\t\tyyval = val_peek(2); \n\t\t\t\t\t\t\t\t\t\t\t\t\t\tVariable v = new Variable (lexico.getLine(), lexico.getColumn(), (String)val_peek(0));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!((ArrayList<Variable>)yyval).contains(v))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t((ArrayList<Variable>)yyval).add(v); \n\t\t\t\t\t\t\t\t\t\t\t\t\t\telse \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthrow new RuntimeException (\"One variable is duplicate\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\nbreak;\ncase 14:\n//#line 144 \"./sinj.y\"\n{ yyval = new ArrayList<VariableDefinition> ();}\nbreak;\ncase 15:\n//#line 145 \"./sinj.y\"\n{ \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tyyval = val_peek(1); \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor (VariableDefinition vd: (ArrayList<VariableDefinition>)val_peek(0)) \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(!((ArrayList<VariableDefinition>)yyval).contains(vd))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t((ArrayList<VariableDefinition>)yyval).add(vd); \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthrow new RuntimeException(\"One field struct is duplicate\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\nbreak;\ncase 16:\n//#line 156 \"./sinj.y\"\n{yyval = new ArrayList<Sentence> (); }\nbreak;\ncase 17:\n//#line 157 \"./sinj.y\"\n{ \n\t\t\t\t\t\t\t\t\t\t\t\tyyval = val_peek(1);\n\t\t\t\t\t\t\t\t\t\t\t\t((ArrayList<Sentence>)yyval).add((Sentence)val_peek(0)); \n\t\t\t\t\t\t\t\t\t\t\t\t }\nbreak;\ncase 18:\n//#line 163 \"./sinj.y\"\n{ \n\t\t\t\t\t\t\tyyval = new ArrayList<Expression>();\n\t\t\t\t\t\t\t((ArrayList<Expression>)yyval).add((Expression)val_peek(0)); \n\t\t\t\t\t\t\t}\nbreak;\ncase 19:\n//#line 167 \"./sinj.y\"\n{\n\t\t\t\t\t \t\t\t\t\t\t\tyyval = val_peek(2);\n\t\t\t\t\t\t\t\t\t\t\t\t((ArrayList<Expression>)yyval).add((Expression)val_peek(0)); \n\t\t\t\t\t\t\t\t\t\t\t\t}\nbreak;\ncase 20:\n//#line 174 \"./sinj.y\"\n{ yyval = new ArrayList<Expression> (); }\nbreak;\ncase 29:\n//#line 187 \"./sinj.y\"\n{yyval = new Write(lexico.getLine(), lexico.getColumn(), (List<Expression>)val_peek(1)); }\nbreak;\ncase 30:\n//#line 188 \"./sinj.y\"\n{ yyval = new Read(lexico.getLine(), lexico.getColumn(), (List<Expression>)val_peek(1)); }\nbreak;\ncase 31:\n//#line 189 \"./sinj.y\"\n{ yyval = new Assign(lexico.getLine(), lexico.getColumn(), (Expression)val_peek(3), (Expression)val_peek(1)); }\nbreak;\ncase 32:\n//#line 190 \"./sinj.y\"\n{ yyval = new Invocation (lexico.getLine(), lexico.getColumn(), (String) val_peek(4), (List<Expression>)val_peek(2)); }\nbreak;\ncase 33:\n//#line 191 \"./sinj.y\"\n{ yyval = new Return (lexico.getLine(), lexico.getColumn(), (Expression) val_peek(1)); }\nbreak;\ncase 34:\n//#line 192 \"./sinj.y\"\n{ yyval = new While (lexico.getLine(), lexico.getColumn(), (Expression) val_peek(4), (List<Sentence>) val_peek(1)); }\nbreak;\ncase 35:\n//#line 195 \"./sinj.y\"\n{ \n\t\t\t\t\t\t\t\t\tList<Sentence> ifBody = new ArrayList<Sentence> ();\n\t\t\t\t\t\t\t\t\tifBody.add((Sentence) val_peek(0));\n\t\t\t\t\t\t\t\t\tyyval = new If(lexico.getLine(), lexico.getColumn(), (Expression) val_peek(2), ifBody, new ArrayList<Sentence>());\n\t\t\t\t\t\t\t\t\t}\nbreak;\ncase 36:\n//#line 200 \"./sinj.y\"\n{\n\t\t\t\t\t\t\t\t\t\t\t\t\tList<Sentence> ifBody = new ArrayList<Sentence> ();\n\t\t\t\t\t\t\t\t\t\t\t\t\tList<Sentence> elseBody = new ArrayList<Sentence> ();\n\t\t\t\t\t\t\t\t\t\t\t\t\tifBody.add((Sentence) val_peek(2));\n\t\t\t\t\t\t\t\t\t\t\t\t\telseBody.add((Sentence)val_peek(0));\n\t\t\t\t\t\t\t\t\t\t\t\t\tyyval = new If(lexico.getLine(), lexico.getColumn(), (Expression)val_peek(4), ifBody, elseBody);\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\nbreak;\ncase 37:\n//#line 207 \"./sinj.y\"\n{\n\t\t\t\t\t\t\t\t\t\t\t\t\tList<Sentence> ifBody = new ArrayList<Sentence> ();\n\t\t\t\t\t\t\t\t\t\t\t\t\tList<Sentence> elseBody = new ArrayList<Sentence> ();\n\t\t\t\t\t\t\t\t\t\t\t\t\tifBody.addAll((List<Sentence>) val_peek(4));\n\t\t\t\t\t\t\t\t\t\t\t\t\telseBody.add((Sentence)val_peek(2));\n\t\t\t\t\t\t\t\t\t\t\t\t\tyyval = new If(lexico.getLine(), lexico.getColumn(), (Expression)val_peek(6), ifBody, elseBody);\n\t\t\t\t\t\t\t\t\t\t\t\t\t }\nbreak;\ncase 38:\n//#line 215 \"./sinj.y\"\n{\n\t\t\t\t\t\t\t\t\t\t\t\t\tList<Sentence> ifBody = new ArrayList<Sentence> ();\n\t\t\t\t\t\t\t\t\t\t\t\t\tList<Sentence> elseBody = new ArrayList<Sentence> ();\n\t\t\t\t\t\t\t\t\t\t\t\t\tifBody.addAll((List<Sentence>) val_peek(6));\n\t\t\t\t\t\t\t\t\t\t\t\t\telseBody.addAll((List<Sentence>)val_peek(4));\n\t\t\t\t\t\t\t\t\t\t\t\t\tyyval = new If(lexico.getLine(), lexico.getColumn(), (Expression)val_peek(8), ifBody, elseBody);\n\t\t\t\t\t\t\t\t\t\t\t\t\t }\nbreak;\ncase 39:\n//#line 223 \"./sinj.y\"\n{\n\t\t\t\t\t\t\t\t\t\t\t\t\tList<Sentence> ifBody = new ArrayList<Sentence> ();\n\t\t\t\t\t\t\t\t\t\t\t\t\tList<Sentence> elseBody = new ArrayList<Sentence> ();\n\t\t\t\t\t\t\t\t\t\t\t\t\tifBody.addAll((List<Sentence>) val_peek(2));\n\t\t\t\t\t\t\t\t\t\t\t\t\tyyval = new If(lexico.getLine(), lexico.getColumn(), (Expression)val_peek(4), ifBody, elseBody);\n\t}\nbreak;\ncase 40:\n//#line 234 \"./sinj.y\"\n{ yyval = new TypeInteger(); }\nbreak;\ncase 41:\n//#line 235 \"./sinj.y\"\n{ yyval = new TypeDouble(); }\nbreak;\ncase 42:\n//#line 236 \"./sinj.y\"\n{ yyval = new TypeChar(); }\nbreak;\ncase 43:\n//#line 237 \"./sinj.y\"\n{ yyval = createArray((Type)val_peek(3), Integer.parseInt(String.valueOf((val_peek(1)))));/*$$ = new TypeArray((Type)$1, Integer.parseInt(String.valueOf(($3))));*/ }\nbreak;\ncase 44:\n//#line 238 \"./sinj.y\"\n{ yyval = new TypeVoid (); }\nbreak;\ncase 45:\n//#line 239 \"./sinj.y\"\n{ \n\t\t\t\t\t\t\tList <VariableDefinition> variables = (ArrayList<VariableDefinition>) val_peek(1);\n\t\t\t\t\t\t\tList <FieldDefinition> fieldsStruct = new ArrayList<FieldDefinition> ();\n\t\t\t\t\t\t\tfor (VariableDefinition vd : variables) {\n\t\t\t\t\t\t\t\tFieldDefinition field = new FieldDefinition (vd.getLine(), vd.getColumn(), vd.getType(), vd.getVariable());\n\t\t\t\t\t\t\t\tfieldsStruct.add(field);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tyyval = new TypeStruct (fieldsStruct);\n\t\t\t\t\t\t\t}\nbreak;\ncase 46:\n//#line 253 \"./sinj.y\"\n{ yyval= new Arithmetic(lexico.getLine(), lexico.getColumn(), (Expression) val_peek(2), (String)val_peek(1) , (Expression)val_peek(0)); }\nbreak;\ncase 47:\n//#line 254 \"./sinj.y\"\n{ yyval= new Arithmetic(lexico.getLine(), lexico.getColumn(), (Expression)val_peek(2), (String)val_peek(1) , (Expression)val_peek(0)); }\nbreak;\ncase 48:\n//#line 255 \"./sinj.y\"\n{ yyval= new Arithmetic(lexico.getLine(), lexico.getColumn(), (Expression)val_peek(2), (String)val_peek(1) , (Expression)val_peek(0)); }\nbreak;\ncase 49:\n//#line 256 \"./sinj.y\"\n{ yyval= new Arithmetic(lexico.getLine(), lexico.getColumn(), (Expression)val_peek(2), (String)val_peek(1) , (Expression)val_peek(0)); }\nbreak;\ncase 50:\n//#line 257 \"./sinj.y\"\n{ yyval= new Arithmetic(lexico.getLine(), lexico.getColumn(), (Expression)val_peek(2), (String)val_peek(1) , (Expression)val_peek(0)); }\nbreak;\ncase 51:\n//#line 258 \"./sinj.y\"\n{ yyval= new AccesoArray(lexico.getLine(), lexico.getColumn(), (Expression)val_peek(3), (Expression)val_peek(1)); }\nbreak;\ncase 52:\n//#line 259 \"./sinj.y\"\n{ yyval = new Comparation(lexico.getLine(), lexico.getColumn(), (Expression)val_peek(2), (String)val_peek(1) , (Expression)val_peek(0)); }\nbreak;\ncase 53:\n//#line 260 \"./sinj.y\"\n{ yyval = new Comparation(lexico.getLine(), lexico.getColumn(), (Expression)val_peek(2), (String)val_peek(1) , (Expression)val_peek(0)); }\nbreak;\ncase 54:\n//#line 261 \"./sinj.y\"\n{ yyval = new Comparation(lexico.getLine(), lexico.getColumn(), (Expression)val_peek(2), (String)val_peek(1) , (Expression)val_peek(0)); }\nbreak;\ncase 55:\n//#line 262 \"./sinj.y\"\n{ yyval = new Comparation(lexico.getLine(), lexico.getColumn(), (Expression)val_peek(2), (String)val_peek(1) , (Expression)val_peek(0)); }\nbreak;\ncase 56:\n//#line 263 \"./sinj.y\"\n{ yyval = new Comparation(lexico.getLine(), lexico.getColumn(), (Expression)val_peek(2), (String)val_peek(1) , (Expression)val_peek(0)); }\nbreak;\ncase 57:\n//#line 264 \"./sinj.y\"\n{ yyval = new Comparation(lexico.getLine(), lexico.getColumn(), (Expression)val_peek(2), (String)val_peek(1) , (Expression)val_peek(0)); }\nbreak;\ncase 58:\n//#line 265 \"./sinj.y\"\n{ yyval = new Logic(lexico.getLine(), lexico.getColumn(), (Expression)val_peek(2), (String)val_peek(1) , (Expression)val_peek(0)); }\nbreak;\ncase 59:\n//#line 266 \"./sinj.y\"\n{ yyval = new Logic(lexico.getLine(), lexico.getColumn(), (Expression)val_peek(2), (String)val_peek(1) , (Expression)val_peek(0)); }\nbreak;\ncase 60:\n//#line 267 \"./sinj.y\"\n{ yyval= new UnaryNegation (lexico.getLine(), lexico.getColumn(), (Expression)val_peek(0)); }\nbreak;\ncase 61:\n//#line 268 \"./sinj.y\"\n{ yyval= new Literal (lexico.getLine(), lexico.getColumn(), (Integer) val_peek(0)); }\nbreak;\ncase 62:\n//#line 269 \"./sinj.y\"\n{ yyval = new Variable (lexico.getLine(), lexico.getColumn(), val_peek(0).toString()); }\nbreak;\ncase 63:\n//#line 270 \"./sinj.y\"\n{ yyval= new RealNumber (lexico.getLine(), lexico.getColumn(), (Double) val_peek(0)); }\nbreak;\ncase 64:\n//#line 271 \"./sinj.y\"\n{ yyval= val_peek(1);}\nbreak;\ncase 65:\n//#line 272 \"./sinj.y\"\n{ yyval = new FieldAccess (lexico.getLine(), lexico.getColumn(), (Expression) val_peek(2), new Variable (lexico.getLine(), lexico.getColumn(), val_peek(0).toString()));}\nbreak;\ncase 66:\n//#line 273 \"./sinj.y\"\n{ yyval = new FunctionInvocation (lexico.getLine(), lexico.getColumn(), (String) val_peek(3), (List<Expression>)val_peek(1)); }\nbreak;\ncase 67:\n//#line 274 \"./sinj.y\"\n{ yyval = new Cast (lexico.getLine(), lexico.getColumn(), (Type) val_peek(2), (Expression) val_peek(0)); }\nbreak;\ncase 68:\n//#line 275 \"./sinj.y\"\n{ yyval = new LogicalNegation (lexico.getLine(), lexico.getColumn(), (Expression)val_peek(0)); }\nbreak;\ncase 69:\n//#line 276 \"./sinj.y\"\n{ yyval = new Char (lexico.getLine(), lexico.getColumn(), val_peek(0).toString()); }\nbreak;\n//#line 1070 \"Parser.java\"\n//########## END OF USER-SUPPLIED ACTIONS ##########\n }//switch\n //#### Now let's reduce... ####\n if (yydebug) debug(\"reduce\");\n state_drop(yym); //we just reduced yylen states\n yystate = state_peek(0); //get new state\n val_drop(yym); //corresponding value drop\n yym = yylhs[yyn]; //select next TERMINAL(on lhs)\n if (yystate == 0 && yym == 0)//done? 'rest' state and at first TERMINAL\n {\n if (yydebug) debug(\"After reduction, shifting from state 0 to state \"+YYFINAL+\"\");\n yystate = YYFINAL; //explicitly say we're done\n state_push(YYFINAL); //and save it\n val_push(yyval); //also save the semantic value of parsing\n if (yychar < 0) //we want another character?\n {\n yychar = yylex(); //get next character\n if (yychar<0) yychar=0; //clean, if necessary\n if (yydebug)\n yylexdebug(yystate,yychar);\n }\n if (yychar == 0) //Good exit (if lex returns 0 ;-)\n break; //quit the loop--all DONE\n }//if yystate\n else //else not done yet\n { //get next state and push, for next yydefred[]\n yyn = yygindex[yym]; //find out where to go\n if ((yyn != 0) && (yyn += yystate) >= 0 &&\n yyn <= YYTABLESIZE && yycheck[yyn] == yystate)\n yystate = yytable[yyn]; //get new state\n else\n yystate = yydgoto[yym]; //else go to new defred\n if (yydebug) debug(\"after reduction, shifting from state \"+state_peek(0)+\" to state \"+yystate+\"\");\n state_push(yystate); //going again, so push state & val...\n val_push(yyval); //for next action\n }\n }//main loop\n return 0;//yyaccept!!\n}",
"int yyparse()\n{\nboolean doaction;\n init_stacks();\n yynerrs = 0;\n yyerrflag = 0;\n yychar = -1; //impossible char forces a read\n yystate=0; //initial state\n state_push(yystate); //save it\n val_push(yylval); //save empty value\n while (true) //until parsing is done, either correctly, or w/error\n {\n doaction=true;\n if (yydebug) debug(\"loop\"); \n //#### NEXT ACTION (from reduction table)\n for (yyn=yydefred[yystate];yyn==0;yyn=yydefred[yystate])\n {\n if (yydebug) debug(\"yyn:\"+yyn+\" state:\"+yystate+\" yychar:\"+yychar);\n if (yychar < 0) //we want a char?\n {\n yychar = yylex(); //get next token\n if (yydebug) debug(\" next yychar:\"+yychar);\n //#### ERROR CHECK ####\n if (yychar < 0) //it it didn't work/error\n {\n yychar = 0; //change it to default string (no -1!)\n if (yydebug)\n yylexdebug(yystate,yychar);\n }\n }//yychar<0\n yyn = yysindex[yystate]; //get amount to shift by (shift index)\n if ((yyn != 0) && (yyn += yychar) >= 0 &&\n yyn <= YYTABLESIZE && yycheck[yyn] == yychar)\n {\n if (yydebug)\n debug(\"state \"+yystate+\", shifting to state \"+yytable[yyn]);\n //#### NEXT STATE ####\n yystate = yytable[yyn];//we are in a new state\n state_push(yystate); //save it\n val_push(yylval); //push our lval as the input for next rule\n yychar = -1; //since we have 'eaten' a token, say we need another\n if (yyerrflag > 0) //have we recovered an error?\n --yyerrflag; //give ourselves credit\n doaction=false; //but don't process yet\n break; //quit the yyn=0 loop\n }\n\n yyn = yyrindex[yystate]; //reduce\n if ((yyn !=0 ) && (yyn += yychar) >= 0 &&\n yyn <= YYTABLESIZE && yycheck[yyn] == yychar)\n { //we reduced!\n if (yydebug) debug(\"reduce\");\n yyn = yytable[yyn];\n doaction=true; //get ready to execute\n break; //drop down to actions\n }\n else //ERROR RECOVERY\n {\n if (yyerrflag==0)\n {\n yyerror(\"syntax error\");\n yynerrs++;\n }\n if (yyerrflag < 3) //low error count?\n {\n yyerrflag = 3;\n while (true) //do until break\n {\n if (stateptr<0) //check for under & overflow here\n {\n yyerror(\"stack underflow. aborting...\"); //note lower case 's'\n return 1;\n }\n yyn = yysindex[state_peek(0)];\n if ((yyn != 0) && (yyn += YYERRCODE) >= 0 &&\n yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)\n {\n if (yydebug)\n debug(\"state \"+state_peek(0)+\", error recovery shifting to state \"+yytable[yyn]+\" \");\n yystate = yytable[yyn];\n state_push(yystate);\n val_push(yylval);\n doaction=false;\n break;\n }\n else\n {\n if (yydebug)\n debug(\"error recovery discarding state \"+state_peek(0)+\" \");\n if (stateptr<0) //check for under & overflow here\n {\n yyerror(\"Stack underflow. aborting...\"); //capital 'S'\n return 1;\n }\n state_pop();\n val_pop();\n }\n }\n }\n else //discard this token\n {\n if (yychar == 0)\n return 1; //yyabort\n if (yydebug)\n {\n yys = null;\n if (yychar <= YYMAXTOKEN) yys = yyname[yychar];\n if (yys == null) yys = \"illegal-symbol\";\n debug(\"state \"+yystate+\", error recovery discards token \"+yychar+\" (\"+yys+\")\");\n }\n yychar = -1; //read another\n }\n }//end error recovery\n }//yyn=0 loop\n if (!doaction) //any reason not to proceed?\n continue; //skip action\n yym = yylen[yyn]; //get count of terminals on rhs\n if (yydebug)\n debug(\"state \"+yystate+\", reducing \"+yym+\" by rule \"+yyn+\" (\"+yyrule[yyn]+\")\");\n if (yym>0) //if count of rhs not 'nil'\n yyval = val_peek(yym-1); //get current semantic value\n switch(yyn)\n {\n//########## USER-SUPPLIED ACTIONS ##########\ncase 1:\n//#line 36 \"src/parsers/AdvConditionParser.y\"\n{\r\n\ttopAdvCondition=(AdvCondition)val_peek(0).obj;\r\n\tSystem.out.println(\"AdvConditionParser work completed. \"); \r\n}\nbreak;\ncase 2:\n//#line 42 \"src/parsers/AdvConditionParser.y\"\n{Expression e=new tokens.Number(val_peek(0).ival);yyval=new AdvConditionParserVal(e);}\nbreak;\ncase 3:\n//#line 43 \"src/parsers/AdvConditionParser.y\"\n{Expression e=new Variable(getStringValue(val_peek(0)));yyval=new AdvConditionParserVal(e);}\nbreak;\ncase 4:\n//#line 45 \"src/parsers/AdvConditionParser.y\"\n{\r\n \tExpression e=new CompositeExpression((Expression)val_peek(2).obj,(Expression)val_peek(0).obj,CompositeExpression.TYPE_PLUS);\r\n \tyyval=new AdvConditionParserVal(e);\r\n }\nbreak;\ncase 5:\n//#line 50 \"src/parsers/AdvConditionParser.y\"\n{\r\n \tExpression e=new CompositeExpression((Expression)val_peek(2).obj,(Expression)val_peek(0).obj,CompositeExpression.TYPE_MINUS);\r\n \tyyval=new AdvConditionParserVal(e);\r\n }\nbreak;\ncase 6:\n//#line 55 \"src/parsers/AdvConditionParser.y\"\n{\r\n \tExpression e=new CompositeExpression((Expression)val_peek(2).obj,(Expression)val_peek(0).obj,CompositeExpression.TYPE_MULTIPLY);\r\n \tyyval=new AdvConditionParserVal(e);\r\n }\nbreak;\ncase 7:\n//#line 61 \"src/parsers/AdvConditionParser.y\"\n{\r\n \tExpression e=new NegativeExpression((Expression)val_peek(0).obj);\r\n \tyyval=new AdvConditionParserVal(e);\r\n }\nbreak;\ncase 8:\n//#line 67 \"src/parsers/AdvConditionParser.y\"\n{\r\n \tyyval=val_peek(1);\r\n }\nbreak;\ncase 9:\n//#line 72 \"src/parsers/AdvConditionParser.y\"\n{yyval=new AdvConditionParserVal(new AdvCondition((Condition)val_peek(0).obj));}\nbreak;\ncase 10:\n//#line 74 \"src/parsers/AdvConditionParser.y\"\n{\r\n yyval=new AdvConditionParserVal(new AdvCondition((AdvCondition)val_peek(3).obj,(AdvCondition)val_peek(0).obj,AdvCondition.Type_AND)); \r\n}\nbreak;\ncase 11:\n//#line 79 \"src/parsers/AdvConditionParser.y\"\n{\r\n yyval=new AdvConditionParserVal(new AdvCondition((AdvCondition)val_peek(3).obj,(AdvCondition)val_peek(0).obj,AdvCondition.Type_OR));\r\n}\nbreak;\ncase 12:\n//#line 84 \"src/parsers/AdvConditionParser.y\"\n{yyval=val_peek(1);}\nbreak;\ncase 13:\n//#line 88 \"src/parsers/AdvConditionParser.y\"\n{yyval=val_peek(0);((AdvCondition)yyval.obj).negateSelf();}\nbreak;\ncase 14:\n//#line 91 \"src/parsers/AdvConditionParser.y\"\n{\r\n \tCondition c=new Condition((Expression)val_peek(3).obj,(Expression)val_peek(0).obj,ConType.equal);\r\n \tyyval=new AdvConditionParserVal(c);\r\n }\nbreak;\ncase 15:\n//#line 96 \"src/parsers/AdvConditionParser.y\"\n{\r\n \tCondition c=new Condition((Expression)val_peek(3).obj,(Expression)val_peek(0).obj,ConType.notequal);\r\n \tyyval=new AdvConditionParserVal(c);\r\n }\nbreak;\ncase 16:\n//#line 101 \"src/parsers/AdvConditionParser.y\"\n{\r\n \tCondition c=new Condition((Expression)val_peek(3).obj,(Expression)val_peek(0).obj,ConType.equalsmaller);\r\n \tyyval=new AdvConditionParserVal(c);\r\n }\nbreak;\ncase 17:\n//#line 106 \"src/parsers/AdvConditionParser.y\"\n{\r\n \tCondition c=new Condition((Expression)val_peek(3).obj,(Expression)val_peek(0).obj,ConType.equallarger);\r\n \tyyval=new AdvConditionParserVal(c);\r\n }\nbreak;\ncase 18:\n//#line 111 \"src/parsers/AdvConditionParser.y\"\n{\r\n \tCondition c=new Condition((Expression)val_peek(2).obj,(Expression)val_peek(0).obj,ConType.smaller);\r\n \tyyval=new AdvConditionParserVal(c);\r\n }\nbreak;\ncase 19:\n//#line 116 \"src/parsers/AdvConditionParser.y\"\n{\r\n \tCondition c=new Condition((Expression)val_peek(2).obj,(Expression)val_peek(0).obj,ConType.larger);\r\n \tyyval=new AdvConditionParserVal(c);\r\n }\nbreak;\n//#line 689 \"AdvConditionParser.java\"\n//########## END OF USER-SUPPLIED ACTIONS ##########\n }//switch\n //#### Now let's reduce... ####\n if (yydebug) debug(\"reduce\");\n state_drop(yym); //we just reduced yylen states\n yystate = state_peek(0); //get new state\n val_drop(yym); //corresponding value drop\n yym = yylhs[yyn]; //select next TERMINAL(on lhs)\n if (yystate == 0 && yym == 0)//done? 'rest' state and at first TERMINAL\n {\n if (yydebug) debug(\"After reduction, shifting from state 0 to state \"+YYFINAL+\"\");\n yystate = YYFINAL; //explicitly say we're done\n state_push(YYFINAL); //and save it\n val_push(yyval); //also save the semantic value of parsing\n if (yychar < 0) //we want another character?\n {\n yychar = yylex(); //get next character\n if (yychar<0) yychar=0; //clean, if necessary\n if (yydebug)\n yylexdebug(yystate,yychar);\n }\n if (yychar == 0) //Good exit (if lex returns 0 ;-)\n break; //quit the loop--all DONE\n }//if yystate\n else //else not done yet\n { //get next state and push, for next yydefred[]\n yyn = yygindex[yym]; //find out where to go\n if ((yyn != 0) && (yyn += yystate) >= 0 &&\n yyn <= YYTABLESIZE && yycheck[yyn] == yystate)\n yystate = yytable[yyn]; //get new state\n else\n yystate = yydgoto[yym]; //else go to new defred\n if (yydebug) debug(\"after reduction, shifting from state \"+state_peek(0)+\" to state \"+yystate+\"\");\n state_push(yystate); //going again, so push state & val...\n val_push(yyval); //for next action\n }\n }//main loop\n return 0;//yyaccept!!\n}",
"protected void extractExternalRules(String external) {\n\t\tDocumentBuilder db = getXMLParser();\n\n\t\tDocument docExtra = null;\n\t\ttry {\n\t\t\t\n\t\t\t// load the standoff rules\n\t\t\tif (external.startsWith(\"http\")) {\n\t\t\t\tdocExtra = db.parse(external);\n\t\t\t} else {\n\t\t\t\tdocExtra = db.parse(docRoot + external);\t\n\t\t\t}\n\t\t\t\n\t\t} catch (DOMException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (SAXException 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\tif (docExtra != null) {\n\t\t\tprocessStandoffMarkup(docExtra);\n\t\t}\n\n\t}",
"private static List<GrammarRule> parseGrammar(Grammar grammar, String grammarRules)\n\t{\n\t\treturn AntlrHelpers.parseGrammar(grammar, grammarRules);\n\t}",
"List<? extends Rule> getRules();",
"public RuleMap(){\n rules = new HashMap<Character, String>();\n }",
"int yyparse()\n {\n boolean doaction;\n init_stacks();\n yynerrs = 0;\n yyerrflag = 0;\n yychar = -1; //impossible char forces a read\n yystate=0; //initial state\n state_push(yystate); //save it\n val_push(yylval); //save empty value\n while (true) //until parsing is done, either correctly, or w/error\n {\n doaction=true;\n if (yydebug) debug(\"loop\");\n //#### NEXT ACTION (from reduction table)\n for (yyn=yydefred[yystate];yyn==0;yyn=yydefred[yystate])\n {\n if (yydebug) debug(\"yyn:\"+yyn+\" state:\"+yystate+\" yychar:\"+yychar);\n if (yychar < 0) //we want a char?\n {\n yychar = yylex(); //get next token\n if (yydebug) debug(\" next yychar:\"+yychar);\n //#### ERROR CHECK ####\n if (yychar < 0) //it it didn't work/error\n {\n yychar = 0; //change it to default string (no -1!)\n if (yydebug)\n yylexdebug(yystate,yychar);\n }\n }//yychar<0\n yyn = yysindex[yystate]; //get amount to shift by (shift index)\n if ((yyn != 0) && (yyn += yychar) >= 0 &&\n yyn <= YYTABLESIZE && yycheck[yyn] == yychar)\n {\n if (yydebug)\n debug(\"state \"+yystate+\", shifting to state \"+yytable[yyn]);\n //#### NEXT STATE ####\n yystate = yytable[yyn];//we are in a new state\n state_push(yystate); //save it\n val_push(yylval); //push our lval as the input for next rule\n yychar = -1; //since we have 'eaten' a token, say we need another\n if (yyerrflag > 0) //have we recovered an error?\n --yyerrflag; //give ourselves credit\n doaction=false; //but don't process yet\n break; //quit the yyn=0 loop\n }\n\n yyn = yyrindex[yystate]; //reduce\n if ((yyn !=0 ) && (yyn += yychar) >= 0 &&\n yyn <= YYTABLESIZE && yycheck[yyn] == yychar)\n { //we reduced!\n if (yydebug) debug(\"reduce\");\n yyn = yytable[yyn];\n doaction=true; //get ready to execute\n break; //drop down to actions\n }\n else //ERROR RECOVERY\n {\n if (yyerrflag==0)\n {\n yyerror(\"syntax error\");\n yynerrs++;\n }\n if (yyerrflag < 3) //low error count?\n {\n yyerrflag = 3;\n while (true) //do until break\n {\n if (stateptr<0) //check for under & overflow here\n {\n yyerror(\"stack underflow. aborting...\"); //note lower case 's'\n return 1;\n }\n yyn = yysindex[state_peek(0)];\n if ((yyn != 0) && (yyn += YYERRCODE) >= 0 &&\n yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)\n {\n if (yydebug)\n debug(\"state \"+state_peek(0)+\", error recovery shifting to state \"+yytable[yyn]+\" \");\n yystate = yytable[yyn];\n state_push(yystate);\n val_push(yylval);\n doaction=false;\n break;\n }\n else\n {\n if (yydebug)\n debug(\"error recovery discarding state \"+state_peek(0)+\" \");\n if (stateptr<0) //check for under & overflow here\n {\n yyerror(\"Stack underflow. aborting...\"); //capital 'S'\n return 1;\n }\n state_pop();\n val_pop();\n }\n }\n }\n else //discard this token\n {\n if (yychar == 0)\n return 1; //yyabort\n if (yydebug)\n {\n yys = null;\n if (yychar <= YYMAXTOKEN) yys = yyname[yychar];\n if (yys == null) yys = \"illegal-symbol\";\n debug(\"state \"+yystate+\", error recovery discards token \"+yychar+\" (\"+yys+\")\");\n }\n yychar = -1; //read another\n }\n }//end error recovery\n }//yyn=0 loop\n if (!doaction) //any reason not to proceed?\n continue; //skip action\n yym = yylen[yyn]; //get count of terminals on rhs\n if (yydebug)\n debug(\"state \"+yystate+\", reducing \"+yym+\" by rule \"+yyn+\" (\"+yyrule[yyn]+\")\");\n if (yym>0) //if count of rhs not 'nil'\n yyval = val_peek(yym-1); //get current semantic value\n yyval = dup_yyval(yyval); //duplicate yyval if ParserVal is used as semantic value\n switch(yyn)\n {\n//########## USER-SUPPLIED ACTIONS ##########\n case 1:\n//#line 25 \"GramaticaGrupo8.y\"\n {}\n break;\n case 2:\n//#line 26 \"GramaticaGrupo8.y\"\n {yyerror(\"No hay sentencia\");}\n break;\n case 3:\n//#line 27 \"GramaticaGrupo8.y\"\n {yyerror(\"No hay sentencia\");}\n break;\n case 4:\n//#line 27 \"GramaticaGrupo8.y\"\n {}\n break;\n case 5:\n//#line 30 \"GramaticaGrupo8.y\"\n {}\n break;\n case 6:\n//#line 31 \"GramaticaGrupo8.y\"\n {}\n break;\n case 7:\n//#line 34 \"GramaticaGrupo8.y\"\n {}\n break;\n case 8:\n//#line 35 \"GramaticaGrupo8.y\"\n {}\n break;\n case 9:\n//#line 38 \"GramaticaGrupo8.y\"\n {\n Vector<ParserVal> vectorTokens = (Vector<ParserVal>)(val_peek(1).obj);\n String tipo = (val_peek(2).sval);/* para que esto ande tocar la regla del no terminal tipo*/\n tipo = tipo.toLowerCase();\n for(int i=0; i< vectorTokens.size();i++){\n ParserVal token = vectorTokens.elementAt(i);\n Symbol simbolo =(Symbol) token.obj;\n if (!simbolo.isUsada()){\n simbolo.setUsada(true);\n simbolo.setEsMutable(true);\n simbolo.setTipoVar(val_peek(2).sval);}\n else\n yyerror(\"Se esta intentado redeclarar la variable \"+simbolo.getLexema(),token.getFila(),token.getColumna());\n }\n\n }\n break;\n case 10:\n//#line 54 \"GramaticaGrupo8.y\"\n {yyerror(\"Declaracion mal definida \");}\n break;\n case 11:\n//#line 57 \"GramaticaGrupo8.y\"\n {/* id.add( ((Symbol)($1.obj)).getLexema() );*/\n Vector<ParserVal> vect = new Vector<ParserVal>();/*$1 es el parser val con el symbolo de ese ID*/\n vect.add(val_peek(0));/*ver si anda, hay que castear a Symbol?*/\n yyval.obj = vect; }\n break;\n case 12:\n//#line 61 \"GramaticaGrupo8.y\"\n {\t((Symbol)(val_peek(0).obj)).setEspuntero(true); /*reconoce puntero*/\n /*id.add(((Symbol)($2.obj)).getLexema());//} //agrega a lista de identificadores reconocidos*/\n Vector<ParserVal> vect = new Vector<ParserVal>();/*$2 es el parser val con el symbolo de ese ID*/\n vect.add(val_peek(0));/*ver si anda, hay que castear a Symbol? .obj*/\n yyval.obj = vect;\n }\n break;\n case 13:\n//#line 68 \"GramaticaGrupo8.y\"\n {/*id.add(((Symbol)($1.obj)).getLexema());*/\n Vector<ParserVal> vect = (Vector<ParserVal>)(val_peek(0).obj); /*$3 me trae el vector original primero y desp aumenta*/\n vect.add(val_peek(2));/*ver si anda, hay que castear a Symbol? .obj*/\n yyval.obj = vect;\n }\n break;\n case 14:\n//#line 73 \"GramaticaGrupo8.y\"\n {/*id.add(((Symbol)($2.obj)).getLexema());*/\n ((Symbol)(val_peek(2).obj)).setEspuntero(true); /*reconoce puntero*/\n Vector<ParserVal> vect = (Vector<ParserVal>)(val_peek(0).obj); /*$4 me trae el vector original primero y desp aumenta*/\n vect.add(val_peek(2));/*ver si anda, hay que castear a Symbol? .obj*/\n yyval.obj = vect;\n }\n break;\n case 15:\n//#line 79 \"GramaticaGrupo8.y\"\n {yyerror(\"Se esperaba ';' \",val_peek(1).getFila(),val_peek(1).getColumna());}\n break;\n case 16:\n//#line 82 \"GramaticaGrupo8.y\"\n {yyval.sval=\"integer\";}\n break;\n case 17:\n//#line 83 \"GramaticaGrupo8.y\"\n {yyval.sval=\"single\";}\n break;\n case 18:\n//#line 84 \"GramaticaGrupo8.y\"\n {yyerror(\"Tipo indefinido\",val_peek(1).getFila(),val_peek(1).getColumna());}\n break;\n case 19:\n//#line 87 \"GramaticaGrupo8.y\"\n {}\n break;\n case 20:\n//#line 88 \"GramaticaGrupo8.y\"\n {}\n break;\n case 21:\n//#line 91 \"GramaticaGrupo8.y\"\n {}\n break;\n case 22:\n//#line 92 \"GramaticaGrupo8.y\"\n {/*#######Solo llego aca si termino un if o un loop*/\n Integer i = p.pop();\n if (listaTercetos.get(i).getOperador() == \"BI\")\n {\n listaTercetos.get(i).setOperando1(contadorTerceto);\n\n }\n if (listaTercetos.get(i).getOperador() == \"BF\")\n {\tlistaTercetos.get(i).setOperando2(contadorTerceto);\n }\n if (intLoop == 0){\n Terceto t = new T_Fin(contadorTerceto,\"FIN_DE_SALTO\",\"trampita\",\"trampita\",st);\n contadorTerceto ++;\n listaTercetos.add(t);\n }\n else\n { ((T_BF)listaTercetos.get(i)).invertFlags();\n listaTercetos.get(i).setOperando2(intLoop);\n intLoop=0;\n }\n /*podriamos hacer un terceto fin aca que sea a donde apunte el salto, este terceto no haria nada solo funcionaria de label del salto*/\n }\n break;\n case 23:\n//#line 104 \"GramaticaGrupo8.y\"\n {}\n break;\n case 24:\n//#line 107 \"GramaticaGrupo8.y\"\n {\n Terceto t = new T_Suma_Resta(contadorTerceto,\"+\",val_peek(2).obj,val_peek(0).obj,st);\n /*st es la tabla de simbolos, paso lexema porque lo uso para buscar en la tabla de simbolos*/\n t.setVariableAux(contadorVarAux);\n contadorVarAux++;\n for(int i=0; i< t.errores.size();i++){\n yyerror(t.errores.elementAt(i),val_peek(2).getFila(),val_peek(2).getColumna());\n ;}\n contadorTerceto ++;\n listaTercetos.add(t);\n System.out.println(t.toString());\n yyval=val_peek(2);\n yyval.obj = t;\n }\n break;\n case 25:\n//#line 121 \"GramaticaGrupo8.y\"\n {\n Terceto t = new T_Suma_Resta(contadorTerceto,\"-\",val_peek(2).obj,val_peek(0).obj,st);\n /*st es la tabla de simbolos, paso lexema porque lo uso para buscar en la tabla de simbolos*/\n t.setVariableAux(contadorVarAux);\n contadorVarAux++;\n for(int i=0; i< t.errores.size();i++){\n yyerror(t.errores.elementAt(i),val_peek(2).getFila(),val_peek(2).getColumna());\n ;}\n contadorTerceto ++;\n listaTercetos.add(t);\n System.out.println(t.toString());\n yyval=val_peek(2);\n yyval.obj = t;\n }\n break;\n case 26:\n//#line 135 \"GramaticaGrupo8.y\"\n {yyval=val_peek(0);\n yyval.obj=val_peek(0).obj; /*creo que es necesario para que no se pierdan los lexemas, si quieren reveanlo*/\n }\n break;\n case 27:\n//#line 141 \"GramaticaGrupo8.y\"\n {\n Terceto t = new T_Mult_Div(contadorTerceto,\"/\",val_peek(2).obj,val_peek(0).obj,st);\n t.setVariableAux(contadorVarAux);\n contadorVarAux++;\n for(int i=0; i< t.errores.size();i++){\n yyerror(t.errores.elementAt(i),val_peek(2).getFila(),val_peek(2).getColumna());\n ;}\n contadorTerceto ++;\n listaTercetos.add(t);\n System.out.println(t.toString());\n yyval=val_peek(2);\n yyval.obj = t;\n\n }\n break;\n case 28:\n//#line 155 \"GramaticaGrupo8.y\"\n {\n Terceto t = new T_Mult_Div(contadorTerceto,\"*\",val_peek(2).obj,val_peek(0).obj,st);\n t.setVariableAux(contadorVarAux);\n contadorVarAux++;\n for(int i=0; i< t.errores.size();i++){\n yyerror(t.errores.elementAt(i),val_peek(2).getFila(),val_peek(2).getColumna());\n ;}\n contadorTerceto ++;\n listaTercetos.add(t);\n System.out.println(t.toString());\n yyval=val_peek(2);\n yyval.obj = t;\n }\n break;\n case 29:\n//#line 168 \"GramaticaGrupo8.y\"\n {yyval=val_peek(0);\n /* terceto*/\n yyval.obj=val_peek(0).obj;\n }\n break;\n case 30:\n//#line 175 \"GramaticaGrupo8.y\"\n {yyval=val_peek(0);}\n break;\n case 31:\n//#line 176 \"GramaticaGrupo8.y\"\n {yyval=val_peek(0);}\n break;\n case 32:\n//#line 177 \"GramaticaGrupo8.y\"\n {if(!((Symbol)(val_peek(0).obj)).isUsada()){\n /*error*/\n yyerror(\"variable no declarada\",val_peek(0).getFila(),val_peek(0).getColumna());\n }\n yyval=val_peek(0);\n }\n break;\n case 33:\n//#line 183 \"GramaticaGrupo8.y\"\n { /** Revisar sino pierdo el puntero al elemento qe necesito **/\n yyval=val_peek(0);\n /*Symbol aux = st.getSymbol(lex.lastSymbol);*/\n st.addcambiarSigno(((Symbol)(val_peek(0).obj))); /*((Symbol))($2.obj))*/\n }\n break;\n case 34:\n//#line 188 \"GramaticaGrupo8.y\"\n {\t\t\t/** Revisar sino pierdo el puntero al elemento qe necesito **/\n yyval=val_peek(0);\n /* Antes qedaban atributos sin setear*/\n /* Symbol aux = st.getSymbol(lex.lastSymbol);*/\n st.addcambiarSigno(((Symbol)(val_peek(0).obj))); /*((Symbol))($2.obj))*/\n }\n break;\n case 35:\n//#line 196 \"GramaticaGrupo8.y\"\n {\t\t/*necesito el tipo de la expresion*/\n if (!((Symbol)(val_peek(2).obj)).isUsada()){\n yyerror(\"La variable no esta definida \",val_peek(2).getFila(),val_peek(2).getColumna());\n }else{if (!((Symbol)(val_peek(2).obj)).getEsMutable()){\n yyerror(\"La variable no es mutable \",val_peek(2).getFila(),val_peek(2).getColumna());\n }}\n Terceto t = new T_Asignacion(contadorTerceto,\":=\",val_peek(2).obj,val_peek(0).obj,st);\n t.setVariableAux(contadorVarAux);//casi seguro que si hay que crearla aca*\n contadorVarAux++;//*/\n for(int i=0; i< t.errores.size();i++){\n yyerror(t.errores.elementAt(i),val_peek(2).getFila(),val_peek(2).getColumna());\n ;}\n contadorTerceto ++;\n listaTercetos.add(t);\n System.out.println(t.toString());\n yyval=val_peek(2);\n yyval.obj = t;\n estructuras.add(\"Asignacion \"+\" fila \"+val_peek(2).getFila()+\" columna \"+val_peek(2).getColumna());}\n break;\n case 36:\n//#line 215 \"GramaticaGrupo8.y\"\n { /* Estoy definiendo una variable*/\n if (((Symbol)(val_peek(3).obj)).isUsada()){\n yyerror(\"La variable ya esta definida \",val_peek(6).getFila(),val_peek(6).getColumna());\n }else{\n Symbol s = ((Symbol)(val_peek(3).obj));\n s.setUsada(true);\n s.setEsMutable(false);\n s.setEspuntero(true);\n s.setTipoVar(val_peek(5).sval);\n /* faltaria mutabilidad de lo apuntado*/\n }\n if (!((Symbol)(val_peek(0).obj)).isUsada()){\n yyerror(\"La variable no esta definida, &ID \",val_peek(6).getFila(),val_peek(6).getColumna());\n }else{\n Symbol s = ((Symbol)(val_peek(0).obj));\n Symbol sy = ((Symbol)(val_peek(3).obj));\n if (s.isEsPuntero())\n yyerror(\"No se permiten punteros multiples \",val_peek(6).getFila(),val_peek(6).getColumna());\n }\n Terceto t = new T_Asignacion(contadorTerceto,\"&\",val_peek(3).obj,val_peek(0).obj,st);\n t.setVariableAux(contadorVarAux);\n contadorVarAux++;\n for(int i=0; i< t.errores.size();i++){\n yyerror(t.errores.elementAt(i),val_peek(6).getFila(),val_peek(6).getColumna());\n ;}\n contadorTerceto ++;\n listaTercetos.add(t);\n System.out.println(t.toString());\n yyval=val_peek(6);\n yyval.obj = t;\n estructuras.add(\"Asignacion de puntero \"+\" fila \"+val_peek(6).getFila()+\" columna \"+val_peek(6).getColumna());}\n break;\n case 37:\n//#line 246 \"GramaticaGrupo8.y\"\n {/*Estoy definiendo una variable*/\n if (((Symbol)(val_peek(2).obj)).isUsada()){\n yyerror(\"La variable ya esta definida \",val_peek(4).getFila(),val_peek(4).getColumna());\n }else{\n Symbol s = ((Symbol)(val_peek(2).obj));\n s.setUsada(true);\n s.setEsMutable(false);\n s.setEspuntero(false);\n s.setTipoVar(val_peek(3).sval);\n /* faltaria mutabilidad de lo apuntado }*/\n Terceto t = new T_Asignacion(contadorTerceto,\":=\",val_peek(2).obj,val_peek(0).obj,st);\n t.setVariableAux(contadorVarAux);\n contadorVarAux++;\n for(int i=0; i< t.errores.size();i++){\n yyerror(t.errores.elementAt(i),val_peek(4).getFila(),val_peek(4).getColumna());\n ;}\n contadorTerceto ++;\n listaTercetos.add(t);\n System.out.println(t.toString());\n yyval=val_peek(4);\n yyval.obj = t;\n }\n estructuras.add(\"Asignacion \"+\" fila \"+val_peek(4).getFila()+\" columna \"+val_peek(4).getColumna());}\n break;\n case 38:\n//#line 269 \"GramaticaGrupo8.y\"\n {yyerror(\"Falta elemento de asignacion y palabra reservada 'let'\",val_peek(1).getFila(),val_peek(1).getColumna());}\n break;\n case 39:\n//#line 270 \"GramaticaGrupo8.y\"\n {yyerror(\"Falta elemento de asignacion \",val_peek(1).getFila(),val_peek(1).getColumna());}\n break;\n case 40:\n//#line 271 \"GramaticaGrupo8.y\"\n {yyerror(\"no se encontro ':=' \",val_peek(1).getFila(),val_peek(1).getColumna());}\n break;\n case 41:\n//#line 274 \"GramaticaGrupo8.y\"\n {estructuras.add(\"Expresion print \"+\" fila \"+val_peek(3).getFila()+\" columna \"+val_peek(3).getColumna());\n Terceto t = new T_Print(contadorTerceto,\"PRINT\",val_peek(1).obj,\"\",st);\n // t.setVariableAux(contadorVarAux); //un print no tiene resultado por ende no tiene tipo*/\n //contadorVarAux++; // creo que para los print no es necesario porque los aux son para el resultado*/\n for(int i=0; i< t.errores.size();i++){\n yyerror(t.errores.elementAt(i),val_peek(3).getFila(),val_peek(3).getColumna());\n ;}\n contadorTerceto ++;\n listaTercetos.add(t);\n System.out.println(t.toString());\n yyval=val_peek(3);\n yyval.obj = t;\n }\n break;\n case 42:\n//#line 287 \"GramaticaGrupo8.y\"\n {yyerror(\"Linea Error en la construccion del print\",val_peek(1).getFila(),val_peek(1).getColumna());}\n break;\n case 43:\n//#line 290 \"GramaticaGrupo8.y\"\n {}\n break;\n case 44:\n//#line 291 \"GramaticaGrupo8.y\"\n {}\n break;\n case 45:\n//#line 295 \"GramaticaGrupo8.y\"\n {estructuras.add(\"Sentencia IF Else\" +\" fila \"+val_peek(5).getFila()+\" columna \"+val_peek(5).getColumna());\n\n /*Terceto t = new T_Fin(contadorTerceto,\"FIN_DE_SALTO\",\"trampita\",\"trampita\",st);\n contadorTerceto ++;\n listaTercetos.add(t);*/\n }\n break;\n case 46:\n//#line 296 \"GramaticaGrupo8.y\"\n {estructuras.add(\"Sentencia IF \" +\" fila \"+val_peek(3).getFila()+\" columna \"+val_peek(3).getColumna());}\n break;\n case 47:\n//#line 297 \"GramaticaGrupo8.y\"\n {yyerror(\" falta la palabra reservada IF\",val_peek(3).getFila(),val_peek(3).getColumna());}\n break;\n case 48:\n//#line 298 \"GramaticaGrupo8.y\"\n {yyerror(\" Error en la construccion de la sentencia IF \",val_peek(2).getFila(),val_peek(2).getColumna());}\n break;\n case 49:\n//#line 299 \"GramaticaGrupo8.y\"\n {yyerror(\" Falta la palabra reservada ELSE \",val_peek(3).getFila(),val_peek(3).getColumna());}\n break;\n case 50:\n//#line 302 \"GramaticaGrupo8.y\"\n {estructuras.add(\"Sentencia Loop \" +\" fila \"+val_peek(3).getFila()+\" columna \"+val_peek(3).getColumna());}\n break;\n case 51:\n//#line 303 \"GramaticaGrupo8.y\"\n {yyerror(\"Linea Falta palabra reservada UNTIL\",val_peek(2).getFila(),val_peek(2).getColumna());}\n break;\n case 52:\n//#line 306 \"GramaticaGrupo8.y\"\n {}\n break;\n case 53:\n//#line 307 \"GramaticaGrupo8.y\"\n {}\n break;\n case 54:\n//#line 308 \"GramaticaGrupo8.y\"\n {yyerror(\"LInea Omision de la palabra reservada '{' \",val_peek(2).getFila(),val_peek(2).getColumna());}\n break;\n case 55:\n//#line 311 \"GramaticaGrupo8.y\"\n {/*#### unica forma de marcar donde comienza el loop y ver donde salto (no diferenciamos bloque de loop)*/\n p.push(contadorTerceto);\n intLoop = contadorTerceto;\n Terceto t = new T_Fin(contadorTerceto,\"FIN_DE_SALTO\",\"trampita\",\"trampita\",st);\n\n listaTercetos.add(t);\n contadorTerceto ++;\n }\n break;\n case 56:\n//#line 316 \"GramaticaGrupo8.y\"\n {/*#### aca hacemos el salto incondicional, debimos inventar este no terminal porque no diferenciamos bloque else de bloque if*/\n /*aca ya hicimos el pop cuando termino el cuerpo del if*/\n Terceto t = new T_BI(contadorTerceto,\"BI\",\"trampita\",\"trampita\",st);\n contadorTerceto ++;\n listaTercetos.add(t);\n Integer i = p.pop();\n if (listaTercetos.get(i).getOperador() == \"BF\")\n listaTercetos.get(i).setOperando2(contadorTerceto);\n else\n listaTercetos.get(i).setOperando1(contadorTerceto);\n p.push(contadorTerceto-1);\n /*podriamos hacer un terceto fin aca que sea a donde apunte el salto, este terceto no haria nada solo funcionaria de label del salto*/\n System.out.println(t.toString());\n yyval=val_peek(0);\n yyval.obj = t;\n }\n break;\n case 57:\n//#line 334 \"GramaticaGrupo8.y\"\n { /*#### aca hacemos lo del salto para no repetirlo en todas las condiciones*/\n p.push(contadorTerceto);\n Terceto t = new T_BF(contadorTerceto,\"BF\",val_peek(1).obj,\"trampita\",st);/*##use trampita por las dudas, ya por deporte, no parece que sea necesario*/\n contadorTerceto ++;\n listaTercetos.add(t);\n System.out.println(t.toString());\n yyval=val_peek(2);\n yyval.obj = t;\n\n }\n break;\n case 58:\n//#line 345 \"GramaticaGrupo8.y\"\n {\n Terceto t = new T_Comparador(contadorTerceto,\">\",val_peek(2).obj,val_peek(0).obj,st);\n /* t.setVariableAux(contadorVarAux);//revisar, creo que aca no va*/\n /* contadorVarAux++;//osea una comparacion SI TIENE RESULTADO, pero no necesito el tipo del resultado?, nose*/\n for(int i=0; i< t.errores.size();i++){\n yyerror(t.errores.elementAt(i),val_peek(2).getFila(),val_peek(2).getColumna());\n ;}\n contadorTerceto ++;\n listaTercetos.add(t);\n System.out.println(t.toString());\n yyval=val_peek(2);\n yyval.obj = t;\n }\n break;\n case 59:\n//#line 358 \"GramaticaGrupo8.y\"\n {\n Terceto t = new T_Comparador(contadorTerceto,\"<\",val_peek(2).obj,val_peek(0).obj,st);\n /* t.setVariableAux(contadorVarAux);//revisar, creo que aca no va*/\n /* contadorVarAux++;//osea una comparacion SI TIENE RESULTADO, pero no necesito el tipo del resultado?, nose*/\n for(int i=0; i< t.errores.size();i++){\n yyerror(t.errores.elementAt(i),val_peek(2).getFila(),val_peek(2).getColumna());\n ;}\n contadorTerceto ++;\n listaTercetos.add(t);\n System.out.println(t.toString());\n yyval=val_peek(2);\n yyval.obj = t;\t\t\t\t\t\t\t\t\t\t}\n break;\n case 60:\n//#line 370 \"GramaticaGrupo8.y\"\n { Terceto t = new T_Comparador(contadorTerceto,\"=\",val_peek(2).obj,val_peek(0).obj,st);\n /* t.setVariableAux(contadorVarAux);//revisar, creo que aca no va*/\n /* contadorVarAux++;//osea una comparacion SI TIENE RESULTADO, pero no necesito el tipo del resultado?, nose*/\n for(int i=0; i< t.errores.size();i++){\n yyerror(t.errores.elementAt(i),val_peek(2).getFila(),val_peek(2).getColumna());\n ;}\n contadorTerceto ++;\n listaTercetos.add(t);\n System.out.println(t.toString());\n yyval=val_peek(2);\n yyval.obj = t;\t\t\t\t\t\t\t\t\t\t}\n break;\n case 61:\n//#line 381 \"GramaticaGrupo8.y\"\n {\n Terceto t = new T_Comparador(contadorTerceto,\"!=\",val_peek(2).obj,val_peek(0).obj,st);\n /* t.setVariableAux(contadorVarAux);//revisar, creo que aca no va*/\n /* contadorVarAux++;//osea una comparacion SI TIENE RESULTADO, pero no necesito el tipo del resultado?, nose*/\n for(int i=0; i< t.errores.size();i++){\n yyerror(t.errores.elementAt(i),val_peek(2).getFila(),val_peek(2).getColumna());\n ;}\n contadorTerceto ++;\n listaTercetos.add(t);\n System.out.println(t.toString());\n yyval=val_peek(2);\n yyval.obj = t;\t\t\t\t\t\t\t\t\t\t}\n break;\n case 62:\n//#line 393 \"GramaticaGrupo8.y\"\n {\n Terceto t = new T_Comparador(contadorTerceto,\">=\",val_peek(2).obj,val_peek(0).obj,st);\n /* t.setVariableAux(contadorVarAux);//revisar, creo que aca no va*/\n /* contadorVarAux++;//osea una comparacion SI TIENE RESULTADO, pero no necesito el tipo del resultado?, nose*/\n for(int i=0; i< t.errores.size();i++){\n yyerror(t.errores.elementAt(i),val_peek(2).getFila(),val_peek(2).getColumna());\n ;}\n contadorTerceto ++;\n listaTercetos.add(t);\n System.out.println(t.toString());\n yyval=val_peek(2);\n yyval.obj = t;\t\t\t\t\t\t\t\t\t\t}\n break;\n case 63:\n//#line 405 \"GramaticaGrupo8.y\"\n {\n Terceto t = new T_Comparador(contadorTerceto,\"<=\",val_peek(2).obj,val_peek(0).obj,st);\n /* t.setVariableAux(contadorVarAux);//revisar, creo que aca no va*/\n /* contadorVarAux++;//osea una comparacion SI TIENE RESULTADO, pero no necesito el tipo del resultado?, nose*/\n for(int i=0; i< t.errores.size();i++){\n yyerror(t.errores.elementAt(i),val_peek(2).getFila(),val_peek(2).getColumna());\n ;}\n contadorTerceto ++;\n listaTercetos.add(t);\n System.out.println(t.toString());\n yyval=val_peek(2);\n yyval.obj = t;\t\t\t\t\t\t\t\t\t\t}\n break;\n case 64:\n//#line 417 \"GramaticaGrupo8.y\"\n {yyerror(\"Linea se esperaba una expresion y se encontro '>'\",val_peek(1).getFila(),val_peek(1).getColumna());}\n break;\n case 65:\n//#line 418 \"GramaticaGrupo8.y\"\n {yyerror(\"Linea se esperaba una expresion y se encontro '<'\",val_peek(1).getFila(),val_peek(1).getColumna());}\n break;\n case 66:\n//#line 419 \"GramaticaGrupo8.y\"\n {yyerror(\"Linea se esperaba una expresion y se encontro '>='\",val_peek(1).getFila(),val_peek(1).getColumna());}\n break;\n case 67:\n//#line 420 \"GramaticaGrupo8.y\"\n {yyerror(\"Linea se esperaba una expresion y se encontro '<='\",val_peek(1).getFila(),val_peek(1).getColumna());}\n break;\n//#line 1102 \"Parser.java\"\n//########## END OF USER-SUPPLIED ACTIONS ##########\n }//switch\n //#### Now let's reduce... ####\n if (yydebug) debug(\"reduce\");\n state_drop(yym); //we just reduced yylen states\n yystate = state_peek(0); //get new state\n val_drop(yym); //corresponding value drop\n yym = yylhs[yyn]; //select next TERMINAL(on lhs)\n if (yystate == 0 && yym == 0)//done? 'rest' state and at first TERMINAL\n {\n if (yydebug) debug(\"After reduction, shifting from state 0 to state \"+YYFINAL+\"\");\n yystate = YYFINAL; //explicitly say we're done\n state_push(YYFINAL); //and save it\n val_push(yyval); //also save the semantic value of parsing\n if (yychar < 0) //we want another character?\n {\n yychar = yylex(); //get next character\n if (yychar<0) yychar=0; //clean, if necessary\n if (yydebug)\n yylexdebug(yystate,yychar);\n }\n if (yychar == 0) //Good exit (if lex returns 0 ;-)\n break; //quit the loop--all DONE\n }//if yystate\n else //else not done yet\n { //get next state and push, for next yydefred[]\n yyn = yygindex[yym]; //find out where to go\n if ((yyn != 0) && (yyn += yystate) >= 0 &&\n yyn <= YYTABLESIZE && yycheck[yyn] == yystate)\n yystate = yytable[yyn]; //get new state\n else\n yystate = yydgoto[yym]; //else go to new defred\n if (yydebug) debug(\"after reduction, shifting from state \"+state_peek(0)+\" to state \"+yystate+\"\");\n state_push(yystate); //going again, so push state & val...\n val_push(yyval); //for next action\n }\n }//main loop\n return 0;//yyaccept!!\n }",
"private PrismRule addRule(PrismRule lastRule, PrismRule newRule) {\n\n if (lastRule == null) {\n m_rules = newRule;\n } else {\n lastRule.m_next = newRule;\n }\n return newRule;\n }",
"private void enterRules()\n {\n String ruleString = ruleTextField.getText();\n transition.buildRulesFromString(ruleString);\n ruleString = transition.buildStringFromRules();\n ruleTextField.setText(ruleString);\n optionsPanel.getWorkspacePanel().requestFocusInWindow();\n optionsPanel.getWorkspacePanel().repaint();\n // Daniel didn't like this automatic switching any more.\n // optionsPanel.getWorkspacePanel().setTool(LMWorkspacePanel.SELECT_TOOL);\n }",
"String getRules();",
"public void readRules( String filename ) {\r\n\t\ttry {\r\n\t\t\ts.readRules(filename);\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"public void addRule(Rule r) {\r\n\t\tIterator<Rule> it = rules.iterator();\r\n\t\t\r\n\t\twhile(it.hasNext()) {\r\n\t\t\tRule rule = it.next();\r\n\t\t\tif(rule.getRuleName().equals(r.getRuleName()))\r\n\t\t\t\tit.remove();\r\n\t\t}\r\n\t\trules.add(r);\r\n\t\tnew BuildRules(r, this).calculate();;\r\n\t}",
"int yyparse()\n{\nboolean doaction;\n init_stacks();\n yynerrs = 0;\n yyerrflag = 0;\n yychar = -1; //impossible char forces a read\n yystate=0; //initial state\n state_push(yystate); //save it\n while (true) //until parsing is done, either correctly, or w/error\n {\n doaction=true;\n //if (yydebug) debug(\"loop\"); \n //#### NEXT ACTION (from reduction table)\n for (yyn=yydefred[yystate];yyn==0;yyn=yydefred[yystate])\n {\n //if (yydebug) debug(\"yyn:\"+yyn+\" state:\"+yystate+\" yychar:\"+yychar);\n if (yychar < 0) //we want a char?\n {\n yychar = yylex(); //get next token\n //if (yydebug) debug(\" next yychar:\"+yychar);\n //#### ERROR CHECK ####\n //if (yychar < 0) //it it didn't work/error\n // {\n // yychar = 0; //change it to default string (no -1!)\n //if (yydebug)\n // yylexdebug(yystate,yychar);\n // }\n }//yychar<0\n yyn = yysindex[yystate]; //get amount to shift by (shift index)\n if ((yyn != 0) && (yyn += yychar) >= 0 &&\n yyn <= YYTABLESIZE && yycheck[yyn] == yychar)\n {\n //if (yydebug)\n //debug(\"state \"+yystate+\", shifting to state \"+yytable[yyn]);\n //#### NEXT STATE ####\n yystate = yytable[yyn];//we are in a new state\n state_push(yystate); //save it\n val_push(yylval); //push our lval as the input for next rule\n yychar = -1; //since we have 'eaten' a token, say we need another\n if (yyerrflag > 0) //have we recovered an error?\n --yyerrflag; //give ourselves credit\n doaction=false; //but don't process yet\n break; //quit the yyn=0 loop\n }\n\n yyn = yyrindex[yystate]; //reduce\n if ((yyn !=0 ) && (yyn += yychar) >= 0 &&\n yyn <= YYTABLESIZE && yycheck[yyn] == yychar)\n { //we reduced!\n //if (yydebug) debug(\"reduce\");\n yyn = yytable[yyn];\n doaction=true; //get ready to execute\n break; //drop down to actions\n }\n else //ERROR RECOVERY\n {\n if (yyerrflag==0)\n {\n yyerror(\"syntax error\");\n yynerrs++;\n }\n if (yyerrflag < 3) //low error count?\n {\n yyerrflag = 3;\n while (true) //do until break\n {\n if (stateptr<0 || valptr<0) //check for under & overflow here\n {\n return 1;\n }\n yyn = yysindex[state_peek(0)];\n if ((yyn != 0) && (yyn += YYERRCODE) >= 0 &&\n yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)\n {\n //if (yydebug)\n //debug(\"state \"+state_peek(0)+\", error recovery shifting to state \"+yytable[yyn]+\" \");\n yystate = yytable[yyn];\n state_push(yystate);\n val_push(yylval);\n doaction=false;\n break;\n }\n else\n {\n //if (yydebug)\n //debug(\"error recovery discarding state \"+state_peek(0)+\" \");\n if (stateptr<0 || valptr<0) //check for under & overflow here\n {\n return 1;\n }\n state_pop();\n val_pop();\n }\n }\n }\n else //discard this token\n {\n if (yychar == 0)\n return 1; //yyabort\n //if (yydebug)\n //{\n //yys = null;\n //if (yychar <= YYMAXTOKEN) yys = yyname[yychar];\n //if (yys == null) yys = \"illegal-symbol\";\n //debug(\"state \"+yystate+\", error recovery discards token \"+yychar+\" (\"+yys+\")\");\n //}\n yychar = -1; //read another\n }\n }//end error recovery\n }//yyn=0 loop\n if (!doaction) //any reason not to proceed?\n continue; //skip action\n yym = yylen[yyn]; //get count of terminals on rhs\n //if (yydebug)\n //debug(\"state \"+yystate+\", reducing \"+yym+\" by rule \"+yyn+\" (\"+yyrule[yyn]+\")\");\n if (yym>0) //if count of rhs not 'nil'\n yyval = val_peek(yym-1); //get current semantic value\n if (reduceListener == null || reduceListener.onReduce(yyrule[yyn])) // if intercepted!\n switch(yyn)\n {\n//########## USER-SUPPLIED ACTIONS ##########\ncase 1:\n//#line 61 \"Parser.y\"\n{\n\t\t\t\t\t\ttree = new Tree.TopLevel(val_peek(0).clist, val_peek(0).loc);\n\t\t\t\t\t}\nbreak;\ncase 2:\n//#line 67 \"Parser.y\"\n{\n\t\t\t\t\t\tyyval.clist.add(val_peek(0).cdef);\n\t\t\t\t\t}\nbreak;\ncase 3:\n//#line 71 \"Parser.y\"\n{\n \t\tyyval.clist = new ArrayList<Tree.ClassDef>();\n \t\tyyval.clist.add(val_peek(0).cdef);\n \t}\nbreak;\ncase 5:\n//#line 81 \"Parser.y\"\n{\n\t\t\t\t\t\tyyval.vdef = new Tree.VarDef(val_peek(0).ident, val_peek(1).type, val_peek(0).loc);\n\t\t\t\t\t}\nbreak;\ncase 6:\n//#line 87 \"Parser.y\"\n{\n\t\t\t\t\t\tyyval.type = new Tree.TypeIdent(Tree.INT, val_peek(0).loc);\n\t\t\t\t\t}\nbreak;\ncase 7:\n//#line 91 \"Parser.y\"\n{\n \t\tyyval.type = new Tree.TypeIdent(Tree.VOID, val_peek(0).loc);\n \t}\nbreak;\ncase 8:\n//#line 95 \"Parser.y\"\n{\n \t\tyyval.type = new Tree.TypeIdent(Tree.BOOL, val_peek(0).loc);\n \t}\nbreak;\ncase 9:\n//#line 99 \"Parser.y\"\n{\n \t\tyyval.type = new Tree.TypeIdent(Tree.STRING, val_peek(0).loc);\n \t}\nbreak;\ncase 10:\n//#line 103 \"Parser.y\"\n{\n \t\tyyval.type = new Tree.TypeClass(val_peek(0).ident, val_peek(1).loc);\n \t}\nbreak;\ncase 11:\n//#line 107 \"Parser.y\"\n{\n \t\tyyval.type = new Tree.TypeArray(val_peek(2).type, val_peek(2).loc);\n \t}\nbreak;\ncase 12:\n//#line 113 \"Parser.y\"\n{\n\t\t\t\t\t\tyyval.cdef = new Tree.ClassDef(val_peek(4).ident, val_peek(3).ident, val_peek(1).flist, val_peek(5).loc,false);\n\t\t\t\t\t}\nbreak;\ncase 13:\n//#line 117 \"Parser.y\"\n{\n\t\t\t\t\t\tyyval.cdef = new Tree.ClassDef(val_peek(4).ident, val_peek(3).ident, val_peek(1).flist, val_peek(5).loc,true);\n\t\t\t\t\t}\nbreak;\ncase 14:\n//#line 123 \"Parser.y\"\n{\n\t\t\t\t\t\tyyval.ident = val_peek(0).ident;\n\t\t\t\t\t}\nbreak;\ncase 15:\n//#line 127 \"Parser.y\"\n{\n \t\tyyval = new SemValue();\n \t}\nbreak;\ncase 16:\n//#line 133 \"Parser.y\"\n{\n\t\t\t\t\t\tyyval.flist.add(val_peek(0).vdef);\n\t\t\t\t\t}\nbreak;\ncase 17:\n//#line 137 \"Parser.y\"\n{\n\t\t\t\t\t\tyyval.flist.add(val_peek(0).fdef);\n\t\t\t\t\t}\nbreak;\ncase 18:\n//#line 141 \"Parser.y\"\n{\n \t\tyyval = new SemValue();\n \t\tyyval.flist = new ArrayList<Tree>();\n \t}\nbreak;\ncase 20:\n//#line 149 \"Parser.y\"\n{\n \t\tyyval = new SemValue();\n \t\tyyval.vlist = new ArrayList<Tree.VarDef>(); \n \t}\nbreak;\ncase 21:\n//#line 156 \"Parser.y\"\n{\n\t\t\t\t\t\tyyval.vlist.add(val_peek(0).vdef);\n\t\t\t\t\t}\nbreak;\ncase 22:\n//#line 160 \"Parser.y\"\n{\n \t\tyyval.vlist = new ArrayList<Tree.VarDef>();\n\t\t\t\t\t\tyyval.vlist.add(val_peek(0).vdef);\n \t}\nbreak;\ncase 23:\n//#line 167 \"Parser.y\"\n{\n\t\t\t\t\t\tyyval.fdef = new MethodDef(true, val_peek(4).ident, val_peek(5).type, val_peek(2).vlist, (Block) val_peek(0).stmt, val_peek(4).loc);\n\t\t\t\t\t}\nbreak;\ncase 24:\n//#line 171 \"Parser.y\"\n{\n\t\t\t\t\t\tyyval.fdef = new MethodDef(false, val_peek(4).ident, val_peek(5).type, val_peek(2).vlist, (Block) val_peek(0).stmt, val_peek(4).loc);\n\t\t\t\t\t}\nbreak;\ncase 25:\n//#line 177 \"Parser.y\"\n{\n\t\t\t\t\t\tyyval.stmt = new Block(val_peek(1).slist, val_peek(2).loc);\n\t\t\t\t\t}\nbreak;\ncase 26:\n//#line 183 \"Parser.y\"\n{\n\t\t\t\t\t\tyyval.slist.add(val_peek(0).stmt);\n\t\t\t\t\t}\nbreak;\ncase 27:\n//#line 187 \"Parser.y\"\n{\n \t\tyyval = new SemValue();\n \t\tyyval.slist = new ArrayList<Tree>();\n \t}\nbreak;\ncase 28:\n//#line 194 \"Parser.y\"\n{\n\t\t\t\t\t\tyyval.stmt = val_peek(0).vdef;\n\t\t\t\t\t}\nbreak;\ncase 29:\n//#line 199 \"Parser.y\"\n{\n \t\tif (yyval.stmt == null) {\n \t\t\tyyval.stmt = new Tree.Skip(val_peek(0).loc);\n \t\t}\n \t}\nbreak;\ncase 40:\n//#line 217 \"Parser.y\"\n{\n\t\t\t\t\t\tyyval.stmt = new Tree.Foreach(val_peek(6).bvar,val_peek(4).expr,val_peek(2).expr,val_peek(0).stmt, val_peek(6).loc);\n\t\t\t\t\t}\nbreak;\ncase 41:\n//#line 221 \"Parser.y\"\n{\n\t\t\t\t\t\tyyval.stmt = new Tree.Foreach(val_peek(4).bvar,val_peek(2).expr,val_peek(0).stmt, val_peek(4).loc);\n\t\t\t\t\t}\nbreak;\ncase 42:\n//#line 227 \"Parser.y\"\n{\n\t\t\t\t\tyyval.bvar = new Tree.BoundVariable(val_peek(0).ident, val_peek(0).loc);\n\t\t\t\t\t}\nbreak;\ncase 43:\n//#line 231 \"Parser.y\"\n{\n\t\t\t\t\tyyval.bvar = new Tree.BoundVariable(val_peek(1).type,val_peek(0).ident, val_peek(0).loc);\n\t\t\t\t\t}\nbreak;\ncase 44:\n//#line 236 \"Parser.y\"\n{\n\t\t\t\t\tyyval.stmt = new Tree.GuardedStmt(val_peek(1).elist, val_peek(1).loc);\n\t\t\t\t}\nbreak;\ncase 45:\n//#line 241 \"Parser.y\"\n{\n\t\t\t\t\tyyval.elist.add(val_peek(0).expr);\n\t\t\t\t}\nbreak;\ncase 46:\n//#line 246 \"Parser.y\"\n{\n yyval = new SemValue();\n yyval.elist = new ArrayList<Expr> ();\n yyval.elist.add(val_peek(0).expr);\n }\nbreak;\ncase 47:\n//#line 252 \"Parser.y\"\n{\n \t\tyyval = new SemValue();\n \t}\nbreak;\ncase 48:\n//#line 258 \"Parser.y\"\n{\n\t\t\t\t\tyyval.expr = new Tree.IfBranch(val_peek(2).expr, val_peek(0).stmt, val_peek(2).loc);\t\t\t\t\n\t\t\t\t}\nbreak;\ncase 49:\n//#line 263 \"Parser.y\"\n{\n\t\t\t\t\tyyval.stmt = new Scopy(val_peek(3).ident,val_peek(1).expr,val_peek(5).loc);\t\n\t\t\t\t}\nbreak;\ncase 50:\n//#line 269 \"Parser.y\"\n{\n\t\t\t\t\t\tyyval.stmt = new Tree.Assign(val_peek(2).lvalue, val_peek(0).expr, val_peek(1).loc);\n\t\t\t\t\t}\nbreak;\ncase 51:\n//#line 273 \"Parser.y\"\n{\n \t\tyyval.stmt = new Tree.Exec(val_peek(0).expr, val_peek(0).loc);\n \t}\nbreak;\ncase 52:\n//#line 277 \"Parser.y\"\n{\n \t\tyyval = new SemValue();\n \t}\nbreak;\ncase 54:\n//#line 284 \"Parser.y\"\n{\n \t\tyyval = new SemValue();\n \t}\nbreak;\ncase 55:\n//#line 290 \"Parser.y\"\n{\n\t\t\t\t\t\tyyval.lvalue = new Tree.Ident(val_peek(1).expr, val_peek(0).ident, val_peek(0).loc);\n\t\t\t\t\t\tif (val_peek(1).loc == null) {\n\t\t\t\t\t\t\tyyval.loc = val_peek(0).loc;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\nbreak;\ncase 56:\n//#line 297 \"Parser.y\"\n{\n \t\tyyval.lvalue = new Tree.Indexed(val_peek(3).expr, val_peek(1).expr, val_peek(3).loc);\n \t}\nbreak;\ncase 58:\n//#line 304 \"Parser.y\"\n{\n \tyyval.lvalue = new Tree.Var(val_peek(1).expr, val_peek(0).ident, val_peek(0).loc);\n\t\t\t\t\t\tif (val_peek(1).loc == null) {\n\t\t\t\t\t\t\tyyval.loc = val_peek(0).loc;\n\t\t\t\t\t\t}\n }\nbreak;\ncase 59:\n//#line 313 \"Parser.y\"\n{\n\t\t\t\t\t\tyyval.expr = new Tree.CallExpr(val_peek(4).expr, val_peek(3).ident, val_peek(1).elist, val_peek(3).loc);\n\t\t\t\t\t\tif (val_peek(4).loc == null) {\n\t\t\t\t\t\t\tyyval.loc = val_peek(3).loc;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\nbreak;\ncase 60:\n//#line 322 \"Parser.y\"\n{\n\t\t\t\t\t\tyyval.expr = val_peek(0).lvalue;\n\t\t\t\t\t}\nbreak;\ncase 63:\n//#line 328 \"Parser.y\"\n{\n \t\tyyval.expr = new Tree.Binary(Tree.PLUS, val_peek(2).expr, val_peek(0).expr, val_peek(1).loc);\n \t}\nbreak;\ncase 64:\n//#line 332 \"Parser.y\"\n{\n \t\tyyval.expr = new Tree.Binary(Tree.MINUS, val_peek(2).expr, val_peek(0).expr, val_peek(1).loc);\n \t}\nbreak;\ncase 65:\n//#line 336 \"Parser.y\"\n{\n \t\tyyval.expr = new Tree.Binary(Tree.MUL, val_peek(2).expr, val_peek(0).expr, val_peek(1).loc);\n \t}\nbreak;\ncase 66:\n//#line 340 \"Parser.y\"\n{\n \t\tyyval.expr = new Tree.Binary(Tree.DIV, val_peek(2).expr, val_peek(0).expr, val_peek(1).loc);\n \t}\nbreak;\ncase 67:\n//#line 344 \"Parser.y\"\n{\n \t\tyyval.expr = new Tree.Binary(Tree.MOD, val_peek(2).expr, val_peek(0).expr, val_peek(1).loc);\n \t}\nbreak;\ncase 68:\n//#line 348 \"Parser.y\"\n{\n \t\tyyval.expr = new Tree.Binary(Tree.EQ, val_peek(2).expr, val_peek(0).expr, val_peek(1).loc);\n \t}\nbreak;\ncase 69:\n//#line 352 \"Parser.y\"\n{\n \t\tyyval.expr = new Tree.Binary(Tree.NE, val_peek(2).expr, val_peek(0).expr, val_peek(1).loc);\n \t}\nbreak;\ncase 70:\n//#line 356 \"Parser.y\"\n{\n \t\tyyval.expr = new Tree.Binary(Tree.LT, val_peek(2).expr, val_peek(0).expr, val_peek(1).loc);\n \t}\nbreak;\ncase 71:\n//#line 360 \"Parser.y\"\n{\n \t\tyyval.expr = new Tree.Binary(Tree.GT, val_peek(2).expr, val_peek(0).expr, val_peek(1).loc);\n \t}\nbreak;\ncase 72:\n//#line 364 \"Parser.y\"\n{\n \t\tyyval.expr = new Tree.Binary(Tree.LE, val_peek(2).expr, val_peek(0).expr, val_peek(1).loc);\n \t}\nbreak;\ncase 73:\n//#line 368 \"Parser.y\"\n{\n \t\tyyval.expr = new Tree.Binary(Tree.GE, val_peek(2).expr, val_peek(0).expr, val_peek(1).loc);\n \t}\nbreak;\ncase 74:\n//#line 372 \"Parser.y\"\n{\n \t\tyyval.expr = new Tree.Binary(Tree.AND, val_peek(2).expr, val_peek(0).expr, val_peek(1).loc);\n \t}\nbreak;\ncase 75:\n//#line 376 \"Parser.y\"\n{\n \t\tyyval.expr = new Tree.Binary(Tree.OR, val_peek(2).expr, val_peek(0).expr, val_peek(1).loc);\n \t}\nbreak;\ncase 76:\n//#line 380 \"Parser.y\"\n{\n \t\tyyval = val_peek(1);\n \t}\nbreak;\ncase 77:\n//#line 384 \"Parser.y\"\n{\n \t\tyyval.expr = new Tree.Unary(Tree.NEG, val_peek(0).expr, val_peek(1).loc);\n \t}\nbreak;\ncase 78:\n//#line 388 \"Parser.y\"\n{\n \t\tyyval.expr = new Tree.Unary(Tree.NOT, val_peek(0).expr, val_peek(1).loc);\n \t}\nbreak;\ncase 79:\n//#line 392 \"Parser.y\"\n{\n \t\tyyval.expr = new Tree.ReadIntExpr(val_peek(2).loc);\n \t}\nbreak;\ncase 80:\n//#line 396 \"Parser.y\"\n{\n \t\tyyval.expr = new Tree.ReadLineExpr(val_peek(2).loc);\n \t}\nbreak;\ncase 81:\n//#line 400 \"Parser.y\"\n{\n \t\tyyval.expr = new Tree.ThisExpr(val_peek(0).loc);\n \t}\nbreak;\ncase 82:\n//#line 404 \"Parser.y\"\n{\n \t\tyyval.expr = new Tree.NewClass(val_peek(2).ident, val_peek(3).loc);\n \t}\nbreak;\ncase 83:\n//#line 408 \"Parser.y\"\n{\n \t\tyyval.expr = new Tree.NewArray(val_peek(3).type, val_peek(1).expr, val_peek(4).loc);\n \t}\nbreak;\ncase 84:\n//#line 412 \"Parser.y\"\n{\n \t\tyyval.expr = new Tree.TypeTest(val_peek(3).expr, val_peek(1).ident, val_peek(5).loc);\n \t}\nbreak;\ncase 85:\n//#line 416 \"Parser.y\"\n{\n \t\tyyval.expr = new Tree.TypeCast(val_peek(2).ident, val_peek(0).expr, val_peek(0).loc);\n \t}\nbreak;\ncase 86:\n//#line 420 \"Parser.y\"\n{\n \t\tyyval.expr = new Tree.ArrayRepeat(val_peek(2).expr, val_peek(0).expr, val_peek(2).loc);\n \t}\nbreak;\ncase 87:\n//#line 424 \"Parser.y\"\n{\n \t\tyyval.expr = new Tree.ArrayAdd(val_peek(2).expr, val_peek(0).expr, val_peek(2).loc);\n\t }\nbreak;\ncase 88:\n//#line 428 \"Parser.y\"\n{\n \t\tyyval.expr = new Tree.subArray(val_peek(5).expr, val_peek(3).expr,val_peek(1).expr,val_peek(5).loc);\n\t \t}\nbreak;\ncase 89:\n//#line 432 \"Parser.y\"\n{\n \t\tyyval.expr = new Tree.ArrayDefault(val_peek(5).expr, val_peek(3).expr,val_peek(0).expr,val_peek(5).loc);\n\t \t}\nbreak;\ncase 90:\n//#line 436 \"Parser.y\"\n{\n \t\tyyval.expr = new Tree.ArrayPython(val_peek(5).expr, val_peek(3).ident,val_peek(1).expr,val_peek(5).loc);\n\t \t}\nbreak;\ncase 91:\n//#line 440 \"Parser.y\"\n{\n \t\tyyval.expr = new Tree.ArrayPython(val_peek(7).expr, val_peek(5).ident,val_peek(3).expr,val_peek(1).expr,val_peek(7).loc);\n\t \t}\nbreak;\ncase 92:\n//#line 446 \"Parser.y\"\n{\n\t\t\t\t\t\tyyval.expr = new Tree.Literal(val_peek(0).typeTag, val_peek(0).literal, val_peek(0).loc);\n\t\t\t\t\t}\nbreak;\ncase 93:\n//#line 450 \"Parser.y\"\n{\n\t\t\t\t\t\tyyval.expr = new Null(val_peek(0).loc);\n\t\t\t\t\t}\nbreak;\ncase 94:\n//#line 454 \"Parser.y\"\n{\n\t\t\t\t\n\t\t\t\t\t\tyyval.expr = new Tree.ListConst(val_peek(1).elist, val_peek(1).loc);\n\t\t\t\t}\nbreak;\ncase 95:\n//#line 461 \"Parser.y\"\n{\n\t\t\t\t\tyyval = new SemValue();\n yyval.elist = new ArrayList<Expr> ();\n yyval.elist.add(val_peek(0).expr);\n\t\t\t\t}\nbreak;\ncase 96:\n//#line 467 \"Parser.y\"\n{\n\t\t\t\t\tyyval.elist.add(val_peek(0).expr);\n\t\t\t\t}\nbreak;\ncase 97:\n//#line 471 \"Parser.y\"\n{\n\t\t\t\t\tyyval = new SemValue();\n\t\t\t\t}\nbreak;\ncase 99:\n//#line 479 \"Parser.y\"\n{\n \t\tyyval = new SemValue();\n \t\tyyval.elist = new ArrayList<Tree.Expr>();\n \t}\nbreak;\ncase 100:\n//#line 486 \"Parser.y\"\n{\n\t\t\t\t\t\tyyval.elist.add(val_peek(0).expr);\n\t\t\t\t\t}\nbreak;\ncase 101:\n//#line 490 \"Parser.y\"\n{\n \t\tyyval.elist = new ArrayList<Tree.Expr>();\n\t\t\t\t\t\tyyval.elist.add(val_peek(0).expr);\n \t}\nbreak;\ncase 102:\n//#line 497 \"Parser.y\"\n{\n\t\t\t\t\t\tyyval.stmt = new Tree.WhileLoop(val_peek(2).expr, val_peek(0).stmt, val_peek(4).loc);\n\t\t\t\t\t}\nbreak;\ncase 103:\n//#line 503 \"Parser.y\"\n{\n\t\t\t\t\t\tyyval.stmt = new Tree.ForLoop(val_peek(6).stmt, val_peek(4).expr, val_peek(2).stmt, val_peek(0).stmt, val_peek(8).loc);\n\t\t\t\t\t}\nbreak;\ncase 104:\n//#line 509 \"Parser.y\"\n{\n\t\t\t\t\t\tyyval.stmt = new Tree.Break(val_peek(0).loc);\n\t\t\t\t\t}\nbreak;\ncase 105:\n//#line 515 \"Parser.y\"\n{\n\t\t\t\t\t\tyyval.stmt = new Tree.If(val_peek(3).expr, val_peek(1).stmt, val_peek(0).stmt, val_peek(5).loc);\n\t\t\t\t\t}\nbreak;\ncase 106:\n//#line 521 \"Parser.y\"\n{\n\t\t\t\t\t\tyyval.stmt = val_peek(0).stmt;\n\t\t\t\t\t}\nbreak;\ncase 107:\n//#line 525 \"Parser.y\"\n{\n\t\t\t\t\t\tyyval = new SemValue();\n\t\t\t\t\t}\nbreak;\ncase 108:\n//#line 531 \"Parser.y\"\n{\n\t\t\t\t\t\tyyval.stmt = new Tree.Return(val_peek(0).expr, val_peek(1).loc);\n\t\t\t\t\t}\nbreak;\ncase 109:\n//#line 535 \"Parser.y\"\n{\n \t\tyyval.stmt = new Tree.Return(null, val_peek(0).loc);\n \t}\nbreak;\ncase 110:\n//#line 541 \"Parser.y\"\n{\n\t\t\t\t\t\tyyval.stmt = new Print(val_peek(1).elist, val_peek(3).loc);\n\t\t\t\t\t}\nbreak;\n//#line 1539 \"Parser.java\"\n//########## END OF USER-SUPPLIED ACTIONS ##########\n }//switch\n //#### Now let's reduce... ####\n //if (yydebug) debug(\"reduce\");\n state_drop(yym); //we just reduced yylen states\n yystate = state_peek(0); //get new state\n val_drop(yym); //corresponding value drop\n yym = yylhs[yyn]; //select next TERMINAL(on lhs)\n if (yystate == 0 && yym == 0)//done? 'rest' state and at first TERMINAL\n {\n //if (yydebug) debug(\"After reduction, shifting from state 0 to state \"+YYFINAL+\"\");\n yystate = YYFINAL; //explicitly say we're done\n state_push(YYFINAL); //and save it\n val_push(yyval); //also save the semantic value of parsing\n if (yychar < 0) //we want another character?\n {\n yychar = yylex(); //get next character\n //if (yychar<0) yychar=0; //clean, if necessary\n //if (yydebug)\n //yylexdebug(yystate,yychar);\n }\n if (yychar == 0) //Good exit (if lex returns 0 ;-)\n break; //quit the loop--all DONE\n }//if yystate\n else //else not done yet\n { //get next state and push, for next yydefred[]\n yyn = yygindex[yym]; //find out where to go\n if ((yyn != 0) && (yyn += yystate) >= 0 &&\n yyn <= YYTABLESIZE && yycheck[yyn] == yystate)\n yystate = yytable[yyn]; //get new state\n else\n yystate = yydgoto[yym]; //else go to new defred\n //if (yydebug) debug(\"after reduction, shifting from state \"+state_peek(0)+\" to state \"+yystate+\"\");\n state_push(yystate); //going again, so push state & val...\n val_push(yyval); //for next action\n }\n }//main loop\n return 0;//yyaccept!!\n}",
"public void xsetRules(com.walgreens.rxit.ch.cda.StrucDocTable.Rules rules)\n {\n synchronized (monitor())\n {\n check_orphaned();\n com.walgreens.rxit.ch.cda.StrucDocTable.Rules target = null;\n target = (com.walgreens.rxit.ch.cda.StrucDocTable.Rules)get_store().find_attribute_user(RULES$26);\n if (target == null)\n {\n target = (com.walgreens.rxit.ch.cda.StrucDocTable.Rules)get_store().add_attribute_user(RULES$26);\n }\n target.set(rules);\n }\n }",
"java.lang.String getRule();",
"public void unsetRules()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_attribute(RULES$26);\n }\n }",
"String rulesAsText();",
"int yyparse()\r\n{\r\nboolean doaction;\r\n init_stacks();\r\n yynerrs = 0;\r\n yyerrflag = 0;\r\n yychar = -1; //impossible char forces a read\r\n yystate=0; //initial state\r\n state_push(yystate); //save it\r\n while (true) //until parsing is done, either correctly, or w/error\r\n {\r\n doaction=true;\r\n //if (yydebug) debug(\"loop\"); \r\n //#### NEXT ACTION (from reduction table)\r\n for (yyn=yydefred[yystate];yyn==0;yyn=yydefred[yystate])\r\n {\r\n //if (yydebug) debug(\"yyn:\"+yyn+\" state:\"+yystate+\" yychar:\"+yychar);\r\n if (yychar < 0) //we want a char?\r\n {\r\n yychar = yylex(); //get next token\r\n //if (yydebug) debug(\" next yychar:\"+yychar);\r\n //#### ERROR CHECK ####\r\n //if (yychar < 0) //it it didn't work/error\r\n // {\r\n // yychar = 0; //change it to default string (no -1!)\r\n //if (yydebug)\r\n // yylexdebug(yystate,yychar);\r\n // }\r\n }//yychar<0\r\n yyn = yysindex[yystate]; //get amount to shift by (shift index)\r\n if ((yyn != 0) && (yyn += yychar) >= 0 &&\r\n yyn <= YYTABLESIZE && yycheck[yyn] == yychar)\r\n {\r\n //if (yydebug)\r\n //debug(\"state \"+yystate+\", shifting to state \"+yytable[yyn]);\r\n //#### NEXT STATE ####\r\n yystate = yytable[yyn];//we are in a new state\r\n state_push(yystate); //save it\r\n val_push(yylval); //push our lval as the input for next rule\r\n yychar = -1; //since we have 'eaten' a token, say we need another\r\n if (yyerrflag > 0) //have we recovered an error?\r\n --yyerrflag; //give ourselves credit\r\n doaction=false; //but don't process yet\r\n break; //quit the yyn=0 loop\r\n }\r\n\r\n yyn = yyrindex[yystate]; //reduce\r\n if ((yyn !=0 ) && (yyn += yychar) >= 0 &&\r\n yyn <= YYTABLESIZE && yycheck[yyn] == yychar)\r\n { //we reduced!\r\n //if (yydebug) debug(\"reduce\");\r\n yyn = yytable[yyn];\r\n doaction=true; //get ready to execute\r\n break; //drop down to actions\r\n }\r\n else //ERROR RECOVERY\r\n {\r\n if (yyerrflag==0)\r\n {\r\n yyerror(\"syntax error\");\r\n yynerrs++;\r\n }\r\n if (yyerrflag < 3) //low error count?\r\n {\r\n yyerrflag = 3;\r\n while (true) //do until break\r\n {\r\n if (stateptr<0 || valptr<0) //check for under & overflow here\r\n {\r\n return 1;\r\n }\r\n yyn = yysindex[state_peek(0)];\r\n if ((yyn != 0) && (yyn += YYERRCODE) >= 0 &&\r\n yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)\r\n {\r\n //if (yydebug)\r\n //debug(\"state \"+state_peek(0)+\", error recovery shifting to state \"+yytable[yyn]+\" \");\r\n yystate = yytable[yyn];\r\n state_push(yystate);\r\n val_push(yylval);\r\n doaction=false;\r\n break;\r\n }\r\n else\r\n {\r\n //if (yydebug)\r\n //debug(\"error recovery discarding state \"+state_peek(0)+\" \");\r\n if (stateptr<0 || valptr<0) //check for under & overflow here\r\n {\r\n return 1;\r\n }\r\n state_pop();\r\n val_pop();\r\n }\r\n }\r\n }\r\n else //discard this token\r\n {\r\n if (yychar == 0)\r\n return 1; //yyabort\r\n //if (yydebug)\r\n //{\r\n //yys = null;\r\n //if (yychar <= YYMAXTOKEN) yys = yyname[yychar];\r\n //if (yys == null) yys = \"illegal-symbol\";\r\n //debug(\"state \"+yystate+\", error recovery discards token \"+yychar+\" (\"+yys+\")\");\r\n //}\r\n yychar = -1; //read another\r\n }\r\n }//end error recovery\r\n }//yyn=0 loop\r\n if (!doaction) //any reason not to proceed?\r\n continue; //skip action\r\n yym = yylen[yyn]; //get count of terminals on rhs\r\n //if (yydebug)\r\n //debug(\"state \"+yystate+\", reducing \"+yym+\" by rule \"+yyn+\" (\"+yyrule[yyn]+\")\");\r\n if (yym>0) //if count of rhs not 'nil'\r\n yyval = val_peek(yym-1); //get current semantic value\r\n if (reduceListener == null || reduceListener.onReduce(yyrule[yyn])) // if intercepted!\r\n switch(yyn)\r\n {\r\n//########## USER-SUPPLIED ACTIONS ##########\r\ncase 1:\r\n//#line 59 \"Parser.y\"\r\n{\r\n\t\t\t\t\t\ttree = new Tree.TopLevel(val_peek(0).clist, val_peek(0).loc);\r\n\t\t\t\t\t}\r\nbreak;\r\ncase 2:\r\n//#line 65 \"Parser.y\"\r\n{\r\n\t\t\t\t\t\tyyval.clist.add(val_peek(0).cdef);\r\n\t\t\t\t\t}\r\nbreak;\r\ncase 3:\r\n//#line 69 \"Parser.y\"\r\n{\r\n \t\tyyval.clist = new ArrayList<Tree.ClassDef>();\r\n \t\tyyval.clist.add(val_peek(0).cdef);\r\n \t}\r\nbreak;\r\ncase 5:\r\n//#line 79 \"Parser.y\"\r\n{\r\n\t\t\t\t\t\tyyval.vdef = new Tree.VarDef(val_peek(0).ident, val_peek(1).type, val_peek(0).loc);\r\n\t\t\t\t\t}\r\nbreak;\r\ncase 6:\r\n//#line 85 \"Parser.y\"\r\n{\r\n\t\t\t\t\t\tyyval.type = new Tree.TypeIdent(Tree.INT, val_peek(0).loc);\r\n\t\t\t\t\t}\r\nbreak;\r\ncase 7:\r\n//#line 89 \"Parser.y\"\r\n{\r\n \t\tyyval.type = new Tree.TypeIdent(Tree.VOID, val_peek(0).loc);\r\n \t}\r\nbreak;\r\ncase 8:\r\n//#line 93 \"Parser.y\"\r\n{\r\n \t\tyyval.type = new Tree.TypeIdent(Tree.BOOL, val_peek(0).loc);\r\n \t}\r\nbreak;\r\ncase 9:\r\n//#line 97 \"Parser.y\"\r\n{\r\n \t\tyyval.type = new Tree.TypeIdent(Tree.STRING, val_peek(0).loc);\r\n \t}\r\nbreak;\r\ncase 10:\r\n//#line 101 \"Parser.y\"\r\n{\r\n \t\tyyval.type = new Tree.TypeClass(val_peek(0).ident, val_peek(1).loc);\r\n \t}\r\nbreak;\r\ncase 11:\r\n//#line 105 \"Parser.y\"\r\n{\r\n \t\tyyval.type = new Tree.TypeArray(val_peek(2).type, val_peek(2).loc);\r\n \t}\r\nbreak;\r\ncase 12:\r\n//#line 111 \"Parser.y\"\r\n{\r\n\t\t\t\t\t\tyyval.cdef = new Tree.ClassDef(val_peek(4).ident, val_peek(3).ident, val_peek(1).flist, val_peek(5).loc);\r\n\t\t\t\t\t}\r\nbreak;\r\ncase 13:\r\n//#line 117 \"Parser.y\"\r\n{\r\n\t\t\t\t\t\tyyval.ident = val_peek(0).ident;\r\n\t\t\t\t\t}\r\nbreak;\r\ncase 14:\r\n//#line 121 \"Parser.y\"\r\n{\r\n \t\tyyval = new SemValue();\r\n \t}\r\nbreak;\r\ncase 15:\r\n//#line 127 \"Parser.y\"\r\n{\r\n\t\t\t\t\t\tyyval.flist.add(val_peek(0).vdef);\r\n\t\t\t\t\t}\r\nbreak;\r\ncase 16:\r\n//#line 131 \"Parser.y\"\r\n{\r\n\t\t\t\t\t\tyyval.flist.add(val_peek(0).fdef);\r\n\t\t\t\t\t}\r\nbreak;\r\ncase 17:\r\n//#line 135 \"Parser.y\"\r\n{\r\n \t\tyyval = new SemValue();\r\n \t\tyyval.flist = new ArrayList<Tree>();\r\n \t}\r\nbreak;\r\ncase 19:\r\n//#line 143 \"Parser.y\"\r\n{\r\n \t\tyyval = new SemValue();\r\n \t\tyyval.vlist = new ArrayList<Tree.VarDef>(); \r\n \t}\r\nbreak;\r\ncase 20:\r\n//#line 150 \"Parser.y\"\r\n{\r\n\t\t\t\t\t\tyyval.vlist.add(val_peek(0).vdef);\r\n\t\t\t\t\t}\r\nbreak;\r\ncase 21:\r\n//#line 154 \"Parser.y\"\r\n{\r\n \t\tyyval.vlist = new ArrayList<Tree.VarDef>();\r\n\t\t\t\t\t\tyyval.vlist.add(val_peek(0).vdef);\r\n \t}\r\nbreak;\r\ncase 22:\r\n//#line 161 \"Parser.y\"\r\n{\r\n\t\t\t\t\t\tyyval.fdef = new MethodDef(true, val_peek(4).ident, val_peek(5).type, val_peek(2).vlist, (Block) val_peek(0).stmt, val_peek(4).loc);\r\n\t\t\t\t\t}\r\nbreak;\r\ncase 23:\r\n//#line 165 \"Parser.y\"\r\n{\r\n\t\t\t\t\t\tyyval.fdef = new MethodDef(false, val_peek(4).ident, val_peek(5).type, val_peek(2).vlist, (Block) val_peek(0).stmt, val_peek(4).loc);\r\n\t\t\t\t\t}\r\nbreak;\r\ncase 24:\r\n//#line 171 \"Parser.y\"\r\n{\r\n\t\t\t\t\t\tyyval.stmt = new Block(val_peek(1).slist, val_peek(2).loc);\r\n\t\t\t\t\t}\r\nbreak;\r\ncase 25:\r\n//#line 177 \"Parser.y\"\r\n{\r\n\t\t\t\t\t\tyyval.slist.add(val_peek(0).stmt);\r\n\t\t\t\t\t}\r\nbreak;\r\ncase 26:\r\n//#line 181 \"Parser.y\"\r\n{\r\n \t\tyyval = new SemValue();\r\n \t\tyyval.slist = new ArrayList<Tree>();\r\n \t}\r\nbreak;\r\ncase 27:\r\n//#line 188 \"Parser.y\"\r\n{\r\n\t\t\t\t\t\tyyval.stmt = val_peek(0).vdef;\r\n\t\t\t\t\t}\r\nbreak;\r\ncase 28:\r\n//#line 193 \"Parser.y\"\r\n{\r\n \t\tif (yyval.stmt == null) {\r\n \t\t\tyyval.stmt = new Tree.Skip(val_peek(0).loc);\r\n \t\t}\r\n \t}\r\nbreak;\r\ncase 39:\r\n//#line 211 \"Parser.y\"\r\n{\r\n\t\t\t\t\t\tyyval.stmt = new Tree.Assign(val_peek(2).lvalue, val_peek(0).expr, val_peek(1).loc);\r\n\t\t\t\t\t}\r\nbreak;\r\ncase 40:\r\n//#line 215 \"Parser.y\"\r\n{\r\n \t\tyyval.stmt = new Tree.Exec(val_peek(0).expr, val_peek(0).loc);\r\n \t}\r\nbreak;\r\ncase 41:\r\n//#line 219 \"Parser.y\"\r\n{\r\n \t\tyyval = new SemValue();\r\n \t}\r\nbreak;\r\ncase 43:\r\n//#line 226 \"Parser.y\"\r\n{\r\n \t\tyyval = new SemValue();\r\n \t}\r\nbreak;\r\ncase 44:\r\n//#line 232 \"Parser.y\"\r\n{\r\n\t\t\t\t\t\tyyval.lvalue = new Tree.Ident(val_peek(1).expr, val_peek(0).ident, val_peek(0).loc);\r\n\t\t\t\t\t\tif (val_peek(1).loc == null) {\r\n\t\t\t\t\t\t\tyyval.loc = val_peek(0).loc;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\nbreak;\r\ncase 45:\r\n//#line 239 \"Parser.y\"\r\n{\r\n \t\tyyval.lvalue = new Tree.Indexed(val_peek(3).expr, val_peek(1).expr, val_peek(3).loc);\r\n \t}\r\nbreak;\r\ncase 46:\r\n//#line 245 \"Parser.y\"\r\n{\r\n\t\t\t\t\t\tyyval.expr = new Tree.CallExpr(val_peek(4).expr, val_peek(3).ident, val_peek(1).elist, val_peek(3).loc);\r\n\t\t\t\t\t\tif (val_peek(4).loc == null) {\r\n\t\t\t\t\t\t\tyyval.loc = val_peek(3).loc;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\nbreak;\r\ncase 47:\r\n//#line 254 \"Parser.y\"\r\n{\r\n\t\t\t\t\t\tyyval.expr = val_peek(0).lvalue;\r\n\t\t\t\t\t}\r\nbreak;\r\ncase 50:\r\n//#line 260 \"Parser.y\"\r\n{\r\n \t\tyyval.expr = new Tree.Binary(Tree.PLUS, val_peek(2).expr, val_peek(0).expr, val_peek(1).loc);\r\n \t}\r\nbreak;\r\ncase 51:\r\n//#line 264 \"Parser.y\"\r\n{\r\n \t\tyyval.expr = new Tree.Binary(Tree.MINUS, val_peek(2).expr, val_peek(0).expr, val_peek(1).loc);\r\n \t}\r\nbreak;\r\ncase 52:\r\n//#line 268 \"Parser.y\"\r\n{\r\n \t\tyyval.expr = new Tree.Binary(Tree.MUL, val_peek(2).expr, val_peek(0).expr, val_peek(1).loc);\r\n \t}\r\nbreak;\r\ncase 53:\r\n//#line 272 \"Parser.y\"\r\n{\r\n \t\tyyval.expr = new Tree.Binary(Tree.DIV, val_peek(2).expr, val_peek(0).expr, val_peek(1).loc);\r\n \t}\r\nbreak;\r\ncase 54:\r\n//#line 276 \"Parser.y\"\r\n{\r\n \t\tyyval.expr = new Tree.Binary(Tree.MOD, val_peek(2).expr, val_peek(0).expr, val_peek(1).loc);\r\n \t}\r\nbreak;\r\ncase 55:\r\n//#line 280 \"Parser.y\"\r\n{\r\n \t\tyyval.expr = new Tree.Binary(Tree.EQ, val_peek(2).expr, val_peek(0).expr, val_peek(1).loc);\r\n \t}\r\nbreak;\r\ncase 56:\r\n//#line 284 \"Parser.y\"\r\n{\r\n \t\tyyval.expr = new Tree.Binary(Tree.NE, val_peek(2).expr, val_peek(0).expr, val_peek(1).loc);\r\n \t}\r\nbreak;\r\ncase 57:\r\n//#line 288 \"Parser.y\"\r\n{\r\n \t\tyyval.expr = new Tree.Binary(Tree.LT, val_peek(2).expr, val_peek(0).expr, val_peek(1).loc);\r\n \t}\r\nbreak;\r\ncase 58:\r\n//#line 292 \"Parser.y\"\r\n{\r\n \t\tyyval.expr = new Tree.Binary(Tree.GT, val_peek(2).expr, val_peek(0).expr, val_peek(1).loc);\r\n \t}\r\nbreak;\r\ncase 59:\r\n//#line 296 \"Parser.y\"\r\n{\r\n \t\tyyval.expr = new Tree.Binary(Tree.LE, val_peek(2).expr, val_peek(0).expr, val_peek(1).loc);\r\n \t}\r\nbreak;\r\ncase 60:\r\n//#line 300 \"Parser.y\"\r\n{\r\n \t\tyyval.expr = new Tree.Binary(Tree.GE, val_peek(2).expr, val_peek(0).expr, val_peek(1).loc);\r\n \t}\r\nbreak;\r\ncase 61:\r\n//#line 304 \"Parser.y\"\r\n{\r\n \t\tyyval.expr = new Tree.Binary(Tree.AND, val_peek(2).expr, val_peek(0).expr, val_peek(1).loc);\r\n \t}\r\nbreak;\r\ncase 62:\r\n//#line 308 \"Parser.y\"\r\n{\r\n \t\tyyval.expr = new Tree.Binary(Tree.OR, val_peek(2).expr, val_peek(0).expr, val_peek(1).loc);\r\n \t}\r\nbreak;\r\ncase 63:\r\n//#line 312 \"Parser.y\"\r\n{\r\n \t\tyyval = val_peek(1);\r\n \t}\r\nbreak;\r\ncase 64:\r\n//#line 316 \"Parser.y\"\r\n{\r\n \t\tyyval.expr = new Tree.Unary(Tree.NEG, val_peek(0).expr, val_peek(1).loc);\r\n \t}\r\nbreak;\r\ncase 65:\r\n//#line 320 \"Parser.y\"\r\n{\r\n \t\tyyval.expr = new Tree.Unary(Tree.NOT, val_peek(0).expr, val_peek(1).loc);\r\n \t}\r\nbreak;\r\ncase 66:\r\n//#line 324 \"Parser.y\"\r\n{\r\n \t\tyyval.expr = new Tree.ReadIntExpr(val_peek(2).loc);\r\n \t}\r\nbreak;\r\ncase 67:\r\n//#line 328 \"Parser.y\"\r\n{\r\n \t\tyyval.expr = new Tree.ReadLineExpr(val_peek(2).loc);\r\n \t}\r\nbreak;\r\ncase 68:\r\n//#line 332 \"Parser.y\"\r\n{\r\n \t\tyyval.expr = new Tree.ThisExpr(val_peek(0).loc);\r\n \t}\r\nbreak;\r\ncase 69:\r\n//#line 336 \"Parser.y\"\r\n{\r\n \t\tyyval.expr = new Tree.NewClass(val_peek(2).ident, val_peek(3).loc);\r\n \t}\r\nbreak;\r\ncase 70:\r\n//#line 340 \"Parser.y\"\r\n{\r\n \t\tyyval.expr = new Tree.NewArray(val_peek(3).type, val_peek(1).expr, val_peek(4).loc);\r\n \t}\r\nbreak;\r\ncase 71:\r\n//#line 344 \"Parser.y\"\r\n{\r\n \t\tyyval.expr = new Tree.TypeTest(val_peek(3).expr, val_peek(1).ident, val_peek(5).loc);\r\n \t}\r\nbreak;\r\ncase 72:\r\n//#line 348 \"Parser.y\"\r\n{\r\n \t\tyyval.expr = new Tree.TypeCast(val_peek(2).ident, val_peek(0).expr, val_peek(0).loc);\r\n \t}\r\nbreak;\r\ncase 73:\r\n//#line 352 \"Parser.y\"\r\n{\r\n \t\tyyval.expr = new Tree.Ternary(Tree.COND, val_peek(4).expr, val_peek(2).expr, val_peek(0).expr, val_peek(4).loc);\r\n \t}\r\nbreak;\r\ncase 74:\r\n//#line 356 \"Parser.y\"\r\n{\r\n \t\tyyval.expr = new Tree.Binary(Tree.PCLONE, val_peek(2).expr, val_peek(0).expr, val_peek(1).loc);\r\n \t}\r\nbreak;\r\ncase 75:\r\n//#line 362 \"Parser.y\"\r\n{\r\n\t\t\t\t\t\tyyval.expr = new Tree.Literal(val_peek(0).typeTag, val_peek(0).literal, val_peek(0).loc);\r\n\t\t\t\t\t}\r\nbreak;\r\ncase 76:\r\n//#line 366 \"Parser.y\"\r\n{\r\n\t\t\t\t\t\tyyval.expr = new Null(val_peek(0).loc);\r\n\t\t\t\t\t}\r\nbreak;\r\ncase 78:\r\n//#line 373 \"Parser.y\"\r\n{\r\n \t\tyyval = new SemValue();\r\n \t\tyyval.elist = new ArrayList<Tree.Expr>();\r\n \t}\r\nbreak;\r\ncase 79:\r\n//#line 380 \"Parser.y\"\r\n{\r\n\t\t\t\t\t\tyyval.elist.add(val_peek(0).expr);\r\n\t\t\t\t\t}\r\nbreak;\r\ncase 80:\r\n//#line 384 \"Parser.y\"\r\n{\r\n \t\tyyval.elist = new ArrayList<Tree.Expr>();\r\n\t\t\t\t\t\tyyval.elist.add(val_peek(0).expr);\r\n \t}\r\nbreak;\r\ncase 81:\r\n//#line 391 \"Parser.y\"\r\n{\r\n\t\t\t\t\t\tyyval.stmt = new Tree.WhileLoop(val_peek(2).expr, val_peek(0).stmt, val_peek(4).loc);\r\n\t\t\t\t\t}\r\nbreak;\r\ncase 82:\r\n//#line 397 \"Parser.y\"\r\n{\r\n\t\t\t\t\t\tyyval.stmt = new Tree.Repeat(val_peek(4).stmt, val_peek(1).expr, val_peek(5).loc);\r\n\t\t\t\t\t}\r\nbreak;\r\ncase 83:\r\n//#line 403 \"Parser.y\"\r\n{\r\n\t\t\t\t\t\tyyval.stmt = new Tree.ForLoop(val_peek(6).stmt, val_peek(4).expr, val_peek(2).stmt, val_peek(0).stmt, val_peek(8).loc);\r\n\t\t\t\t\t}\r\nbreak;\r\ncase 84:\r\n//#line 409 \"Parser.y\"\r\n{\r\n\t\t\t\t\t\tyyval.stmt = new Tree.Break(val_peek(0).loc);\r\n\t\t\t\t\t}\r\nbreak;\r\ncase 85:\r\n//#line 415 \"Parser.y\"\r\n{\r\n\t\t\t\t\t\tyyval.stmt = new Tree.If(val_peek(3).expr, val_peek(1).stmt, val_peek(0).stmt, val_peek(5).loc);\r\n\t\t\t\t\t}\r\nbreak;\r\ncase 86:\r\n//#line 421 \"Parser.y\"\r\n{\r\n\t\t\t\t\t\tyyval.stmt = val_peek(0).stmt;\r\n\t\t\t\t\t}\r\nbreak;\r\ncase 87:\r\n//#line 425 \"Parser.y\"\r\n{\r\n\t\t\t\t\t\tyyval = new SemValue();\r\n\t\t\t\t\t}\r\nbreak;\r\ncase 88:\r\n//#line 431 \"Parser.y\"\r\n{\r\n\t\t\t\t\t\tyyval.stmt = new Tree.Return(val_peek(0).expr, val_peek(1).loc);\r\n\t\t\t\t\t}\r\nbreak;\r\ncase 89:\r\n//#line 435 \"Parser.y\"\r\n{\r\n \t\tyyval.stmt = new Tree.Return(null, val_peek(0).loc);\r\n \t}\r\nbreak;\r\ncase 90:\r\n//#line 441 \"Parser.y\"\r\n{\r\n\t\t\t\t\t\tyyval.stmt = new Print(val_peek(1).elist, val_peek(3).loc);\r\n\t\t\t\t\t}\r\nbreak;\r\ncase 91:\r\n//#line 447 \"Parser.y\"\r\n{\r\n\t\t\t\t\t\tyyval.stmt = new Tree.Switch(val_peek(5).expr, val_peek(2).slist, val_peek(1).stmt, val_peek(7).loc);\r\n\t\t\t\t\t}\r\nbreak;\r\ncase 92:\r\n//#line 453 \"Parser.y\"\r\n{\r\n\t\t\t\t\t\tyyval.slist.add(val_peek(0).stmt);\r\n\t\t\t\t\t}\r\nbreak;\r\ncase 93:\r\n//#line 457 \"Parser.y\"\r\n{\r\n\t\t\t\t\t\tyyval = new SemValue();\r\n \t\tyyval.slist = new ArrayList<Tree>();\r\n\t\t\t\t\t}\r\nbreak;\r\ncase 94:\r\n//#line 464 \"Parser.y\"\r\n{\r\n\t\t\t\t\t\tyyval.stmt = new Tree.Case(val_peek(2).expr, val_peek(0).slist, val_peek(3).loc);\r\n\t\t\t\t\t}\r\nbreak;\r\ncase 95:\r\n//#line 470 \"Parser.y\"\r\n{\r\n\t\t\t\t\t\tyyval.stmt = new Tree.Default(val_peek(0).slist, val_peek(2).loc);\r\n\t\t\t\t\t}\r\nbreak;\r\ncase 96:\r\n//#line 474 \"Parser.y\"\r\n{\r\n\t\t\t\t\t\tyyval = new SemValue();\r\n\t\t\t\t\t}\r\nbreak;\r\ncase 97:\r\n//#line 480 \"Parser.y\"\r\n{\r\n\t\t\t\t\t\tyyval.stmt = new Tree.Continue(val_peek(0).loc);\r\n\t\t\t\t\t}\r\nbreak;\r\n//#line 1319 \"Parser.java\"\r\n//########## END OF USER-SUPPLIED ACTIONS ##########\r\n }//switch\r\n //#### Now let's reduce... ####\r\n //if (yydebug) debug(\"reduce\");\r\n state_drop(yym); //we just reduced yylen states\r\n yystate = state_peek(0); //get new state\r\n val_drop(yym); //corresponding value drop\r\n yym = yylhs[yyn]; //select next TERMINAL(on lhs)\r\n if (yystate == 0 && yym == 0)//done? 'rest' state and at first TERMINAL\r\n {\r\n //if (yydebug) debug(\"After reduction, shifting from state 0 to state \"+YYFINAL+\"\");\r\n yystate = YYFINAL; //explicitly say we're done\r\n state_push(YYFINAL); //and save it\r\n val_push(yyval); //also save the semantic value of parsing\r\n if (yychar < 0) //we want another character?\r\n {\r\n yychar = yylex(); //get next character\r\n //if (yychar<0) yychar=0; //clean, if necessary\r\n //if (yydebug)\r\n //yylexdebug(yystate,yychar);\r\n }\r\n if (yychar == 0) //Good exit (if lex returns 0 ;-)\r\n break; //quit the loop--all DONE\r\n }//if yystate\r\n else //else not done yet\r\n { //get next state and push, for next yydefred[]\r\n yyn = yygindex[yym]; //find out where to go\r\n if ((yyn != 0) && (yyn += yystate) >= 0 &&\r\n yyn <= YYTABLESIZE && yycheck[yyn] == yystate)\r\n yystate = yytable[yyn]; //get new state\r\n else\r\n yystate = yydgoto[yym]; //else go to new defred\r\n //if (yydebug) debug(\"after reduction, shifting from state \"+state_peek(0)+\" to state \"+yystate+\"\");\r\n state_push(yystate); //going again, so push state & val...\r\n val_push(yyval); //for next action\r\n }\r\n }//main loop\r\n return 0;//yyaccept!!\r\n}",
"private static void getRulesFromFile() {\n File ruleFolder = new File(\"rules\");\n List<String> packageManagersWithRules = Stream.of(ruleFolder.list())\n .filter(f -> f.endsWith(\".rules\"))\n .map(f -> f.substring(0,f.lastIndexOf('.')))\n .sorted()\n .collect(Collectors.toList());\n\n RULES_BY_PACKAGE = new HashMap<>();\n for (String packagemanager : packageManagersWithRules) {\n RULES_BY_PACKAGE.put(packagemanager, parseRules(ruleFolder, packagemanager));\n }\n\n }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public ParserRule getRule() { return rule; }",
"public String eval(String input)\n\t{\n\t\ttry\n\t\t{\n\t\tProgramRule ptmp = new ProgramRule(this.value);\n\t\tString res = \"\";\n\t\tres = ptmp.transform(input);\n\t\t//recursively evaluate the children nodes.\n\t\tfor(ParseTreeNode ptn: this.children)\n\t\t{\n\t\t\tptn.eval(input);\n\t\t}\n\t\tthis.tmpEval = res;\n\t\treturn res;\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\treturn \"\";\n\t\t}\n\t}",
"private void loadRuleSets() throws CSSException {\n StyleSheet stylesheet = cssCode.getParsedCSS();\n for (RuleBlock block : stylesheet) {\n if (block instanceof RuleSet) {\n\n StringBuilder selectorString = new StringBuilder();\n RuleSet ruleSet = (RuleSet) block;\n\n List<CombinedSelector> selectors = ruleSet.getSelectors();\n Iterator<CombinedSelector> selectorsIterator = selectors.iterator();\n while (selectorsIterator.hasNext()) {\n CombinedSelector selector = selectorsIterator.next();\n selectorString.append(selector.toString());\n if (selectorsIterator.hasNext()) {\n selectorString.append(\", \");\n }\n }\n\n List<CSSRule> cssRules = new ArrayList<>();\n CSSRule cssRule;\n Declaration.Source source;\n DeclarationPosition declarationPosition;\n\n for (Declaration declaration : ruleSet) {\n cssRule = new CSSRule(declaration.getProperty(), \"\");\n\n source = declaration.getSource();\n if (source == null) {\n declarationPosition = null;\n } else {\n declarationPosition = new DeclarationPosition(source.getLine(), source.getPosition());\n }\n cssRule.setDeclarationPosition(declarationPosition);\n\n cssRules.add(cssRule);\n }\n\n CSSRuleSet cssRuleSet = new CSSRuleSet(selectorString.toString(), cssRules);\n\n this.cssRuleBlocks.add(cssRuleSet);\n\n // add record to the position-declaration map\n for (CSSRule iCssRule : cssRuleSet.getCssRules()) {\n this.declarationPositionMap.put(\n iCssRule.getDeclarationPosition(),\n new DeclarationSource(cssRuleSet, iCssRule)\n );\n }\n }\n }\n }",
"private void readGrammar(Hashtable<String, ? extends Number> lexRulesTable, \n\t\t\tHashtable<String, ? extends Number> intRulesTable) {\n\t\tFileUtil.appendReturn(\"Starting fedePar ... reading grammar\", Parameters.logFile);\n\t\tTreeSet<String> lexicon = new TreeSet<String>();\n\t\tTreeSet<String> categories = new TreeSet<String>();\n\t\tHashtable<String, Double> intCatFreqTable = new Hashtable<String, Double>();\n\t\tHashtable<String, Double> posCatFreqTable = new Hashtable<String, Double>();\n\t\tlexRulesSize = lexRulesTable.size();\n\t\tfor(Enumeration<String> e = lexRulesTable.keys(); e.hasMoreElements(); ) {\n\t\t\tString rule = (String)e.nextElement();\n\t\t\tdouble count = lexRulesTable.get(rule).doubleValue();\t\n\t\t\tString[] ruleSplit = rule.split(\" \");\n\t\t\tUtility.increaseStringDouble(posCatFreqTable, ruleSplit[0], count);\n\t\t\tcategories.add(ruleSplit[0]);\n\t\t\tlexicon.add(ruleSplit[1]);\n\t\t}\n\t\tfor(Enumeration<String> e = intRulesTable.keys(); e.hasMoreElements(); ) {\n\t\t\tString rule = (String)e.nextElement();\n\t\t\tdouble count = intRulesTable.get(rule).doubleValue();\t\n\t\t\tString[] ruleSplit = rule.split(\" \");\n\t\t\tUtility.increaseStringDouble(intCatFreqTable, ruleSplit[0], count);\n\t\t\tcategories.add(ruleSplit[0]);\n\t\t\tcategories.add(ruleSplit[1]);\n\t\t\tif (ruleSplit.length>2) {\n\t\t\t\tcategories.add(ruleSplit[2]);\n\t\t\t\tintBinaryRulesSize++;\n\t\t\t}\n\t\t\telse intUnaryRulesSize++;\n\t\t}\n\t\t//check overlapping between posTags and intTags\n\t\tHashSet<String> overlapping = new HashSet<String>(posCatFreqTable.keySet());\n\t\toverlapping.retainAll(intCatFreqTable.keySet());\n\t\tif (!overlapping.isEmpty()) {\n\t\t\tSystem.out.println(\"Overlapping between internal nodes and pos tags: \" + overlapping.toString());\n\t\t}\n\t\tlexCount = lexicon.size();\n\t\tcatCount = categories.size();\n\t\tlexArray = lexicon.toArray(new String[] {});\n\t\tcatArray = categories.toArray(new String[] {});\n\t\tlexIndex = new Hashtable<String, Integer>();\n\t\tcatIndex = new Hashtable<String, Integer>();\t\t\n\t\tfor(int i=0; i<lexArray.length; i++) lexIndex.put(lexArray[i], i);\n\t\tfor(int i=0; i<catArray.length; i++) catIndex.put(catArray[i], i);\n\t\treadRules(lexRulesTable, intRulesTable, posCatFreqTable, intCatFreqTable);\n\t}",
"public interface ValidParserRules {\n String getName();\n String getPrefix();\n PropertyType getType();\n ValidParserRules getParent();\n}"
] | [
"0.6492653",
"0.60348326",
"0.5414569",
"0.49536648",
"0.49206161",
"0.49084395",
"0.48261362",
"0.47826725",
"0.47817478",
"0.46746117",
"0.4650481",
"0.46471938",
"0.4629295",
"0.4624315",
"0.46154448",
"0.4602935",
"0.46027857",
"0.45945805",
"0.45902625",
"0.45493397",
"0.45367658",
"0.45051235",
"0.44960886",
"0.4495234",
"0.4488655",
"0.44884726",
"0.44834143",
"0.44815597",
"0.4469301",
"0.44681516",
"0.44664392",
"0.44664392",
"0.44645545",
"0.44629687",
"0.44591734",
"0.44399",
"0.44389036",
"0.44308186",
"0.4429657",
"0.4425447",
"0.44226563",
"0.4416698",
"0.44059956",
"0.44045994",
"0.4403173",
"0.43888858",
"0.43620276",
"0.43597627",
"0.43559954",
"0.43473795",
"0.43473795",
"0.43473795",
"0.43473795",
"0.43473795",
"0.43473795",
"0.43473795",
"0.43473795",
"0.43473795",
"0.43473795",
"0.43473795",
"0.43473795",
"0.43473795",
"0.43473795",
"0.43473795",
"0.43473795",
"0.43473795",
"0.43473795",
"0.43473795",
"0.43473795",
"0.43473795",
"0.43473795",
"0.43473795",
"0.43473795",
"0.43473795",
"0.43473795",
"0.43473795",
"0.43473795",
"0.43473795",
"0.43473795",
"0.43473795",
"0.43473795",
"0.43473795",
"0.43473795",
"0.43473795",
"0.43473795",
"0.43473795",
"0.43473795",
"0.43473795",
"0.43473795",
"0.43473795",
"0.43473795",
"0.43473795",
"0.43473795",
"0.43473795",
"0.43473795",
"0.43473795",
"0.4343965",
"0.4333866",
"0.43239263",
"0.4318171"
] | 0.47767505 | 9 |
Matches (string) references inside rule alternatives with actual pointers to rule definitions. | private static void resolveParserRule(ParserRule rule, Map<String, Rule> rules) throws IngridParserException {
// For each alternative line..
for (Alternative alternative : rule.alternatives) {
// For each element on the line..
for (int i = 0; i < alternative.elements.size(); ++i) {
RuleReference ref = alternative.elements.get(i);
// Rule referenced in this alternative element
Rule element = ref.rule;
if (element instanceof UnresolvedRule) {
// Lexer rules were resolved first, so they are ready to be referenced
if (rules.containsKey(element.name)) {
Rule lookedUpRule = rules.get(element.name);
alternative.elements.set(i, new RuleReference(lookedUpRule, ref.quantity));
} else {
// Special EOF token might not be defined, but is a valid reference
if (element.name.equals("EOF")) {
// We can ignore this rule
alternative.elements.remove(i);
--i;
continue;
}
throw new IngridParserException(
"Couldn't resolve rule '" + element.name + "' (inside " + rule.name + ")");
}
} else if (element instanceof QuantifierRule) {
if (i == 0) {
throw new IngridParserException(
"Quantifier suffix found with no previous reference");
}
// Apply quantifier to previous element of alternative
alternative.elements.get(i - 1).quantity = ((QuantifierRule) element).quantity;
// Remove quantifier itself
alternative.elements.remove(i);
--i;
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public final void ruleR() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMLRegression.g:141:2: ( ( ( rule__R__Alternatives ) ) )\n // InternalMLRegression.g:142:2: ( ( rule__R__Alternatives ) )\n {\n // InternalMLRegression.g:142:2: ( ( rule__R__Alternatives ) )\n // InternalMLRegression.g:143:3: ( rule__R__Alternatives )\n {\n before(grammarAccess.getRAccess().getAlternatives()); \n // InternalMLRegression.g:144:3: ( rule__R__Alternatives )\n // InternalMLRegression.g:144:4: rule__R__Alternatives\n {\n pushFollow(FOLLOW_2);\n rule__R__Alternatives();\n\n state._fsp--;\n\n\n }\n\n after(grammarAccess.getRAccess().getAlternatives()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void ruleExpressions() throws RecognitionException {\n\n \t\tHiddenTokens myHiddenTokenState = ((XtextTokenStream)input).setHiddenTokens(\"RULE_ML_COMMENT\", \"RULE_SL_COMMENT\", \"RULE_WS\");\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:908:2: ( ( ( rule__Expressions__Alternatives ) ) )\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:909:1: ( ( rule__Expressions__Alternatives ) )\n {\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:909:1: ( ( rule__Expressions__Alternatives ) )\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:910:1: ( rule__Expressions__Alternatives )\n {\n before(grammarAccess.getExpressionsAccess().getAlternatives()); \n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:911:1: ( rule__Expressions__Alternatives )\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:911:2: rule__Expressions__Alternatives\n {\n pushFollow(FOLLOW_rule__Expressions__Alternatives_in_ruleExpressions1687);\n rule__Expressions__Alternatives();\n\n state._fsp--;\n\n\n }\n\n after(grammarAccess.getExpressionsAccess().getAlternatives()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n \tmyHiddenTokenState.restore();\n\n }\n return ;\n }",
"private void createRules(List<PatternToken> elemList,\n List<PatternToken> tmpPatternTokens, int numElement) {\n String shortMessage = \"\";\n if (this.shortMessage != null && this.shortMessage.length() > 0) {\n shortMessage = this.shortMessage.toString();\n } else if (shortMessageForRuleGroup != null && shortMessageForRuleGroup.length() > 0) {\n shortMessage = this.shortMessageForRuleGroup.toString();\n }\n if (numElement >= elemList.size()) {\n AbstractPatternRule rule;\n if (tmpPatternTokens.size() > 0) {\n rule = new PatternRule(id, language, tmpPatternTokens, name,\n message.toString(), shortMessage,\n suggestionsOutMsg.toString(), phrasePatternTokens.size() > 1, interpretPosTagsPreDisambiguation);\n rule.addTags(ruleTags);\n rule.addTags(ruleGroupTags);\n rule.addTags(categoryTags);\n rule.setSourceFile(sourceFile);\n } else if (regex.length() > 0) {\n int flags = regexCaseSensitive ? 0 : Pattern.CASE_INSENSITIVE|Pattern.UNICODE_CASE;\n String regexStr = regex.toString();\n if (regexMode == RegexpMode.SMART) {\n // Note: it's not that easy to add \\b because the regex might look like '(foo)' or '\\d' so we cannot just look at the last character\n regexStr = replaceSpacesInRegex(regexStr);\n }\n if (ruleAntiPatterns.size() > 0 || rulegroupAntiPatterns.size() > 0) {\n throw new RuntimeException(\"<regexp> rules currently cannot be used together with <antipattern>. Rule id: \" + id + \"[\" + subId + \"]\");\n }\n rule = new RegexPatternRule(id, name, message.toString(), shortMessage, suggestionsOutMsg.toString(), language, Pattern.compile(regexStr, flags), regexpMark);\n rule.setSourceFile(sourceFile);\n } else {\n throw new IllegalStateException(\"Neither '<pattern>' tokens nor '<regex>' is set in rule '\" + id + \"'\");\n }\n setRuleFilter(filterClassName, filterArgs, rule);\n prepareRule(rule);\n rules.add(rule);\n } else {\n PatternToken patternToken = elemList.get(numElement);\n if (patternToken.hasOrGroup()) {\n // When creating a new rule, we finally clear the backed-up variables. All the elements in\n // the OR group should share the values of backed-up variables. That's why these variables\n // are backed-up.\n List<Match> suggestionMatchesBackup = new ArrayList<>(suggestionMatches);\n List<Match> suggestionMatchesOutMsgBackup = new ArrayList<>(suggestionMatchesOutMsg);\n int startPosBackup = startPos;\n int endPosBackup = endPos;\n List<DisambiguationPatternRule> ruleAntiPatternsBackup = new ArrayList<>(ruleAntiPatterns);\n for (PatternToken patternTokenOfOrGroup : patternToken.getOrGroup()) {\n List<PatternToken> tmpElements2 = new ArrayList<>();\n tmpElements2.addAll(tmpPatternTokens);\n tmpElements2.add(ObjectUtils.clone(patternTokenOfOrGroup));\n createRules(elemList, tmpElements2, numElement + 1);\n startPos = startPosBackup;\n endPos = endPosBackup;\n suggestionMatches = suggestionMatchesBackup;\n suggestionMatchesOutMsg = suggestionMatchesOutMsgBackup;\n ruleAntiPatterns.addAll(ruleAntiPatternsBackup);\n }\n }\n tmpPatternTokens.add(ObjectUtils.clone(patternToken));\n createRules(elemList, tmpPatternTokens, numElement + 1);\n }\n }",
"public final void ruleArguments() throws RecognitionException {\n\n \t\tHiddenTokens myHiddenTokenState = ((XtextTokenStream)input).setHiddenTokens(\"RULE_ML_COMMENT\", \"RULE_SL_COMMENT\", \"RULE_WS\");\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:800:2: ( ( ( rule__Arguments__Alternatives ) ) )\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:801:1: ( ( rule__Arguments__Alternatives ) )\n {\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:801:1: ( ( rule__Arguments__Alternatives ) )\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:802:1: ( rule__Arguments__Alternatives )\n {\n before(grammarAccess.getArgumentsAccess().getAlternatives()); \n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:803:1: ( rule__Arguments__Alternatives )\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:803:2: rule__Arguments__Alternatives\n {\n pushFollow(FOLLOW_rule__Arguments__Alternatives_in_ruleArguments1482);\n rule__Arguments__Alternatives();\n\n state._fsp--;\n\n\n }\n\n after(grammarAccess.getArgumentsAccess().getAlternatives()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n \tmyHiddenTokenState.restore();\n\n }\n return ;\n }",
"private static FlatLexerRule flattenLexerRule(Rule rule, Map<String, Rule> rules) {\n // Because some rules were resolved as a dependency of another rule,\n // it might happen that it is already flattened.\n if (rule instanceof FlatLexerRule) {\n return (FlatLexerRule) rule;\n }\n\n if (rule instanceof UnresolvedLexerRule) {\n throw new IngridParserException(\n \"Rule '\" + rule.name + \"' must be resolved before flattening\");\n }\n\n LexerRule lexerRule = (LexerRule) rule;\n\n // If we have only one element, we might be looking at a literal rule..\n // We count all elements of all alternatives:\n if (lexerRule.alternatives.size() == 1 && lexerRule.alternatives.get(0).size() == 1) {\n Rule only = lexerRule.alternatives.get(0).get(0);\n if (only instanceof LiteralRule) {\n return new LiteralRule(rule.name, ((LiteralRule) only).value);\n }\n }\n\n // We can construct one big regex out of sub rules\n List<List<String>> regexs = new ArrayList<>();\n\n // Gather all sub rule contents (or resolve them, if wasn't resolved before)\n for (List<Rule> alternative : lexerRule.alternatives) {\n List<String> subRegex = new ArrayList<>();\n\n for (Rule element : alternative) {\n // Is each sub element already resolved?\n if (!(element instanceof FlatLexerRule)) {\n if (element instanceof QuantifierRule) {\n int lastIndex = subRegex.size() - 1;\n\n if (lastIndex < 0) {\n throw new IngridParserException(\"Quantifier suffix found with no prefix regex\");\n }\n\n // If more characters, we might need braces\n // There are cases where we might not, such as [A-Z] or (foo), so might be improved a little\n // It's tricky though, because of cases such as [A-Z][a-z], so simple heuristics is not enough\n String prevRegex = subRegex.get(lastIndex);\n if (prevRegex.length() > 1) {\n prevRegex = '(' + prevRegex + ')';\n }\n\n // We append it to the previous rule\n String quantifier = ((QuantifierRule) element).quantity.toString();\n\n subRegex.set(lastIndex, prevRegex + quantifier);\n\n } else if(element instanceof BlockStartRule) {\n subRegex.add(\"(\");\n } else if(element instanceof BlockEndRule) {\n subRegex.add(\")\");\n } else if(element instanceof BlockAltRule) {\n subRegex.add(\"|\");\n } else if (element instanceof UnresolvedLexerRule) {\n if (!rules.containsKey(element.name)) {\n throw new UnresolvableRuleException(\"Failed to resolve lexer rule '\" + element.name + \"'\");\n }\n\n try {\n FlatLexerRule flatRule = flattenLexerRule(rules.get(element.name), rules);\n rules.put(element.name, flatRule);\n subRegex.add(flatRule.getContent());\n } catch (StackOverflowError t) {\n throw new IngridParserException(\n \"Lexer rule '\" + rule.name + \"' or some of its subrules is recursive! \" +\n \"Ingrid cannot handle cyclic rules :(\");\n }\n } else {\n throw new IngridParserException(\n \"Rule '\" + element.name + \"' (\" + element.getClass().getSimpleName() + \") failed to be flattened\");\n }\n } else {\n // We need to escape literal rule\n // e.g. <?xml to <\\?xml\n String regex;\n if (element instanceof LiteralRule) {\n regex = escapeLiteral((LiteralRule) element);\n } else {\n regex = ((FlatLexerRule) element).getContent();\n }\n\n subRegex.add(regex);\n }\n }\n\n regexs.add(subRegex);\n }\n\n // Build regex from gathered strings\n return new RegexRule(rule.name, buildLexerRegex(regexs));\n }",
"public static void main(String[] args) {\n\t\t\n//\t\t//PA4 a\n//\t\tArrayList<ArrayList<String>> rhs1 = new ArrayList<>();\n//\t\tArrayList<String> rhs11 = new ArrayList<>();\n//\t\trhs11.add(\"S\");rhs11.add(\"a\");\n//\t\tArrayList<String> rhs12 = new ArrayList<>();\n//\t\trhs12.add(\"b\");\t\t\n//\t\trhs1.add(rhs11);\n//\t\trhs1.add(rhs12);\n//\n//\t\tRule r1 = new Rule(\"S\", rhs1); // S -> Aa | b\n//\t\tArrayList<Rule> rules = new ArrayList<>();\n//\t\trules.add(r1);\n//\t\tGrammar g = new Grammar(rules);\n//\t\tg.eliminateEpsilonRule();\n//\t\tg.eliminateLR();\n//\t\tSystem.out.println(g);\n//\t\tSystem.out.println(\"----------------------\");\n\t\t\n//\t\t//PA4 b\n//\t\tArrayList<ArrayList<String>> rhs1 = new ArrayList<>();\n//\t\tArrayList<String> rhs11 = new ArrayList<>();\n//\t\trhs11.add(\"S\");rhs11.add(\"a\");rhs11.add(\"b\");\n//\t\tArrayList<String> rhs12 = new ArrayList<>();\n//\t\trhs12.add(\"c\");rhs12.add(\"d\");\t\t\n//\t\trhs1.add(rhs11);\n//\t\trhs1.add(rhs12);\n//\n//\t\tRule r1 = new Rule(\"S\", rhs1); // S -> Aa | b\n//\t\tArrayList<Rule> rules = new ArrayList<>();\n//\t\trules.add(r1);\n//\t\tGrammar g = new Grammar(rules);\n//\t\tg.eliminateEpsilonRule();\n//\t\tg.eliminateLR();\n//\t\tSystem.out.println(g);\n//\t\tSystem.out.println(\"----------------------\");\n\t\t\n//\t\t//PA4 c\n//\t\tArrayList<ArrayList<String>> rhs1 = new ArrayList<>();\n//\t\tArrayList<String> rhs11 = new ArrayList<>();\n//\t\trhs11.add(\"S\");rhs11.add(\"U\");rhs11.add(\"S\");\n//\t\tArrayList<String> rhs12 = new ArrayList<>();\n//\t\trhs12.add(\"S\");rhs12.add(\"S\");\t\t\n//\t\tArrayList<String> rhs13 = new ArrayList<>();\n//\t\trhs13.add(\"S\");rhs13.add(\"*\");\n//\t\tArrayList<String> rhs14 = new ArrayList<>();\n//\t\trhs14.add(\"(\");rhs14.add(\"S\");rhs14.add(\")\");\n//\t\tArrayList<String> rhs15 = new ArrayList<>();\n//\t\trhs15.add(\"a\");\n//\t\trhs1.add(rhs11);\n//\t\trhs1.add(rhs12);\n//\t\trhs1.add(rhs13);\n//\t\trhs1.add(rhs14);\n//\t\trhs1.add(rhs15);\n//\n//\n//\t\tRule r1 = new Rule(\"S\", rhs1); // S -> Aa | b\n//\t\tArrayList<Rule> rules = new ArrayList<>();\n//\t\trules.add(r1);\n//\t\tGrammar g = new Grammar(rules);\n//\t\tg.eliminateEpsilonRule();\n//\t\tg.eliminateLR();\n//\t\tSystem.out.println(g);\n//\t\tSystem.out.println(\"----------------------\");\n\t\t\n\t\t\n//\t\t//PA-3 d\n//\t\t\n//\t\tArrayList<ArrayList<String>> rhs1 = new ArrayList<>();\n//\t\tArrayList<String> rhs11 = new ArrayList<>();\n//\t\trhs11.add(\"rexpr\");rhs11.add(\"U\");rhs11.add(\"rterm\");\t\n//\t\tArrayList<String> rhs12 = new ArrayList<>();\n//\t\trhs12.add(\"rterm\");\n//\t\trhs1.add(rhs11);\n//\t\trhs1.add(rhs12);\n//\t\tRule r1 = new Rule(\"rexpr\", rhs1);\n//\n//\t\tArrayList<ArrayList<String>> rhs2 = new ArrayList<>();\n//\t\tArrayList<String> rhs21 = new ArrayList<>();\n//\t\trhs21.add(\"rterm\");rhs21.add(\"r factor\");\n//\t\tArrayList<String> rhs22 = new ArrayList<>();\n//\t\trhs22.add(\"r factor\");\n//\t\trhs2.add(rhs21);\n//\t\trhs2.add(rhs22);\n//\t\tRule r2 = new Rule(\"rterm\", rhs2);\n//\n//\t\tArrayList<ArrayList<String>> rhs3 = new ArrayList<>();\n//\t\tArrayList<String> rhs31 = new ArrayList<>();\n//\t\trhs31.add(\"r factor\");rhs31.add(\"*\");\n//\t\tArrayList<String> rhs32 = new ArrayList<>();\n//\t\trhs32.add(\"rprimary\");\n//\t\trhs3.add(rhs31);\n//\t\trhs3.add(rhs32);\n//\t\tRule r3 = new Rule(\"r factor\", rhs3);\n//\t\t\n//\t\tArrayList<ArrayList<String>> rhs4 = new ArrayList<>();\n//\t\tArrayList<String> rhs41 = new ArrayList<>();\n//\t\trhs41.add(\"a\");\n//\t\tArrayList<String> rhs42 = new ArrayList<>();\n//\t\trhs42.add(\"b\");\n//\t\trhs4.add(rhs41);\n//\t\trhs4.add(rhs42);\n//\t\tRule r4 = new Rule(\"rprimary\", rhs4);\n//\n//\t\tArrayList<Rule> rules = new ArrayList<>();\n//\t\trules.add(r1);\n//\t\trules.add(r2);\n//\t\trules.add(r3);\n//\t\trules.add(r4);\n//\t\tGrammar g = new Grammar(rules);\n//\t\tg.eliminateEpsilonRule();\n//\t\tg.eliminateLR();\n//\n//\t\tSystem.out.println(g);\n//\t\tSystem.out.println(\"----------------------\");\t\n\t\t\t\n//\t\t//PA-3 e\t\n//\t\t\n//\t\tArrayList<ArrayList<String>> rhs1 = new ArrayList<>();\n//\t\tArrayList<String> rhs11 = new ArrayList<>();\n//\t\trhs11.add(\"0\");\n//\t\tArrayList<String> rhs12 = new ArrayList<>();\n//\t\trhs12.add(\"T\");rhs12.add(\"1\");\t\t\n//\t\trhs1.add(rhs11);\n//\t\trhs1.add(rhs12);\n//\t\t\n//\t\tArrayList<ArrayList<String>> rhs2 = new ArrayList<>();\n//\t\tArrayList<String> rhs21 = new ArrayList<>();\n//\t\trhs21.add(\"1\");\n//\t\tArrayList<String> rhs22 = new ArrayList<>();\n//\t\trhs22.add(\"A\");rhs22.add(\"0\");\t\t\n//\t\trhs2.add(rhs21);\n//\t\trhs2.add(rhs22);\n//\n//\t\tRule r1 = new Rule(\"A\", rhs1);\n//\t\tRule r2 = new Rule(\"T\", rhs2);\n//\n//\t\tArrayList<Rule> rules = new ArrayList<>();\n//\t\trules.add(r1);\n//\t\trules.add(r2);\n//\t\tGrammar g = new Grammar(rules);\n//\t\tg.eliminateEpsilonRule();\n//\t\tg.eliminateLR();\n//\t\tSystem.out.println(g);\n//\t\tSystem.out.println(\"----------------------\");\n\n\n\t\t\n//\t\t//PA-3 f\n//\t\t\n//\t\tArrayList<ArrayList<String>> rhs1 = new ArrayList<>();\n//\t\tArrayList<String> rhs11 = new ArrayList<>();\n//\t\trhs11.add(\"B\");rhs11.add(\"C\");\t\n//\t\trhs1.add(rhs11);\n//\t\tRule r1 = new Rule(\"A\", rhs1);\n//\n//\t\tArrayList<ArrayList<String>> rhs2 = new ArrayList<>();\n//\t\tArrayList<String> rhs21 = new ArrayList<>();\n//\t\trhs21.add(\"B\");rhs21.add(\"b\");\n//\t\tArrayList<String> rhs22 = new ArrayList<>();\n//\t\trhs22.add(\"e\");\n//\t\trhs2.add(rhs21);\n//\t\trhs2.add(rhs22);\n//\t\tRule r2 = new Rule(\"B\", rhs2);\n//\n//\t\tArrayList<ArrayList<String>> rhs3 = new ArrayList<>();\n//\t\tArrayList<String> rhs31 = new ArrayList<>();\n//\t\trhs31.add(\"A\");rhs31.add(\"C\");\n//\t\tArrayList<String> rhs32 = new ArrayList<>();\n//\t\trhs32.add(\"a\");\n//\t\trhs3.add(rhs31);\n//\t\trhs3.add(rhs32);\n//\t\tRule r3 = new Rule(\"C\", rhs3);\n//\n//\t\tArrayList<Rule> rules = new ArrayList<>();\n//\t\trules.add(r1);\n//\t\trules.add(r2);\n//\t\trules.add(r3);\n//\t\tGrammar g = new Grammar(rules);\n//\t\tSystem.out.println(g);\n//\t\tg.eliminateEpsilonRule();\n//\t\tSystem.out.println(g);\n//\n//\t\tg.eliminateLR();\n//\n//\t\tSystem.out.println(g);\n//\t\tSystem.out.println(\"----------------------\");\n\n\t}",
"public final void ruleExpression() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalBrowser.g:266:2: ( ( ( rule__Expression__Alternatives ) ) )\n // InternalBrowser.g:267:2: ( ( rule__Expression__Alternatives ) )\n {\n // InternalBrowser.g:267:2: ( ( rule__Expression__Alternatives ) )\n // InternalBrowser.g:268:3: ( rule__Expression__Alternatives )\n {\n before(grammarAccess.getExpressionAccess().getAlternatives()); \n // InternalBrowser.g:269:3: ( rule__Expression__Alternatives )\n // InternalBrowser.g:269:4: rule__Expression__Alternatives\n {\n pushFollow(FOLLOW_2);\n rule__Expression__Alternatives();\n\n state._fsp--;\n\n\n }\n\n after(grammarAccess.getExpressionAccess().getAlternatives()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public Map<String, Match> getReferenceMatches();",
"@Test\n public void testFromFollowedByQuery() throws Exception {\n final String text = \"rule X when Cheese() from $cheesery ?person( \\\"Mark\\\", 42; ) then end\";\n RuleDescr rule = ((RuleDescr) (parse(\"rule\", text)));\n TestCase.assertFalse(parser.getErrors().toString(), parser.hasErrors());\n PatternDescr pattern = ((PatternDescr) (getDescrs().get(0)));\n TestCase.assertEquals(\"Cheese\", pattern.getObjectType());\n TestCase.assertEquals(\"from $cheesery\", pattern.getSource().getText());\n TestCase.assertFalse(pattern.isQuery());\n pattern = ((PatternDescr) (getDescrs().get(1)));\n TestCase.assertEquals(\"person\", pattern.getObjectType());\n TestCase.assertTrue(pattern.isQuery());\n }",
"public final void ruleAddress() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.example.mydsl.extensions.ui/src-gen/org/xtext/example/mydsl/extensions/ui/contentassist/antlr/internal/InternalMyDsl.g:101:2: ( ( ( rule__Address__Alternatives ) ) )\n // ../org.xtext.example.mydsl.extensions.ui/src-gen/org/xtext/example/mydsl/extensions/ui/contentassist/antlr/internal/InternalMyDsl.g:102:1: ( ( rule__Address__Alternatives ) )\n {\n // ../org.xtext.example.mydsl.extensions.ui/src-gen/org/xtext/example/mydsl/extensions/ui/contentassist/antlr/internal/InternalMyDsl.g:102:1: ( ( rule__Address__Alternatives ) )\n // ../org.xtext.example.mydsl.extensions.ui/src-gen/org/xtext/example/mydsl/extensions/ui/contentassist/antlr/internal/InternalMyDsl.g:103:1: ( rule__Address__Alternatives )\n {\n before(grammarAccess.getAddressAccess().getAlternatives()); \n // ../org.xtext.example.mydsl.extensions.ui/src-gen/org/xtext/example/mydsl/extensions/ui/contentassist/antlr/internal/InternalMyDsl.g:104:1: ( rule__Address__Alternatives )\n // ../org.xtext.example.mydsl.extensions.ui/src-gen/org/xtext/example/mydsl/extensions/ui/contentassist/antlr/internal/InternalMyDsl.g:104:2: rule__Address__Alternatives\n {\n pushFollow(FollowSets000.FOLLOW_rule__Address__Alternatives_in_ruleAddress154);\n rule__Address__Alternatives();\n\n state._fsp--;\n\n\n }\n\n after(grammarAccess.getAddressAccess().getAlternatives()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void ruleIdOrString() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.eclipse.ese.android.dsl.ui/src-gen/org/eclipse/ese/ui/contentassist/antlr/internal/InternalAndroid.g:270:2: ( ( ( rule__IdOrString__Alternatives ) ) )\n // ../org.eclipse.ese.android.dsl.ui/src-gen/org/eclipse/ese/ui/contentassist/antlr/internal/InternalAndroid.g:271:1: ( ( rule__IdOrString__Alternatives ) )\n {\n // ../org.eclipse.ese.android.dsl.ui/src-gen/org/eclipse/ese/ui/contentassist/antlr/internal/InternalAndroid.g:271:1: ( ( rule__IdOrString__Alternatives ) )\n // ../org.eclipse.ese.android.dsl.ui/src-gen/org/eclipse/ese/ui/contentassist/antlr/internal/InternalAndroid.g:272:1: ( rule__IdOrString__Alternatives )\n {\n before(grammarAccess.getIdOrStringAccess().getAlternatives()); \n // ../org.eclipse.ese.android.dsl.ui/src-gen/org/eclipse/ese/ui/contentassist/antlr/internal/InternalAndroid.g:273:1: ( rule__IdOrString__Alternatives )\n // ../org.eclipse.ese.android.dsl.ui/src-gen/org/eclipse/ese/ui/contentassist/antlr/internal/InternalAndroid.g:273:2: rule__IdOrString__Alternatives\n {\n pushFollow(FollowSets000.FOLLOW_rule__IdOrString__Alternatives_in_ruleIdOrString514);\n rule__IdOrString__Alternatives();\n _fsp--;\n\n\n }\n\n after(grammarAccess.getIdOrStringAccess().getAlternatives()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"@Test\n public void testFromWithTernaryFollowedByQuery() throws Exception {\n final String text = \"rule X when Cheese() from (isFull ? $cheesery : $market) ?person( \\\"Mark\\\", 42; ) then end\";\n RuleDescr rule = ((RuleDescr) (parse(\"rule\", text)));\n TestCase.assertFalse(parser.getErrors().toString(), parser.hasErrors());\n PatternDescr pattern = ((PatternDescr) (getDescrs().get(0)));\n TestCase.assertEquals(\"Cheese\", pattern.getObjectType());\n TestCase.assertEquals(\"from (isFull ? $cheesery : $market)\", pattern.getSource().getText());\n TestCase.assertFalse(pattern.isQuery());\n pattern = ((PatternDescr) (getDescrs().get(1)));\n TestCase.assertEquals(\"person\", pattern.getObjectType());\n TestCase.assertTrue(pattern.isQuery());\n }",
"public final void ruleResult() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalGo.g:817:2: ( ( ( rule__Result__Alternatives ) ) )\r\n // InternalGo.g:818:2: ( ( rule__Result__Alternatives ) )\r\n {\r\n // InternalGo.g:818:2: ( ( rule__Result__Alternatives ) )\r\n // InternalGo.g:819:3: ( rule__Result__Alternatives )\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getResultAccess().getAlternatives()); \r\n }\r\n // InternalGo.g:820:3: ( rule__Result__Alternatives )\r\n // InternalGo.g:820:4: rule__Result__Alternatives\r\n {\r\n pushFollow(FOLLOW_2);\r\n rule__Result__Alternatives();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getResultAccess().getAlternatives()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }",
"@Test\n\tvoid testFormattedRE() {\n\t\tRegularLanguage rl[] = new RegularLanguage[lengthToFormatRE]; \n\t\tint i = 0;\n\t\tfor (String re : toFormatRE) {\n\t\t\trl[i++] = RegularExpression.isValidRE(re);\n\t\t}\n\t\t// Verify if all objects were created\n\t\tfor (RegularLanguage re : rl) {\n\t\t\tif (re.equals(null)) {\n\t\t\t\tfail(); // object couldn't be created\n\t\t\t}\n\t\t}\n\n\t\t// a***** -> a*\n\t\tassertEquals(\"a*\", rl[0].getRE().getFormattedRegex());\n\t\t// aa????? -> a?\n\t\tassertEquals(\"a?\", rl[1].getRE().getFormattedRegex());\n\t\t// a+++++ -> a+\n\t\tassertEquals(\"a+\", rl[2].getRE().getFormattedRegex());\n\t\t// a?*?*?***???* -> a*\n\t\tassertEquals(\"a*\", rl[3].getRE().getFormattedRegex());\n\t\t// a?+?+?+++???+ -> a*\n\t\tassertEquals(\"a*\", rl[4].getRE().getFormattedRegex());\n\t\t// a*+*+*++++***+* -> a*\n\t\tassertEquals(\"a*\", rl[5].getRE().getFormattedRegex());\n\t\t// a?+*?+?***???+++***?+?*+* -> a*\n\t\tassertEquals(\"a*\", rl[6].getRE().getFormattedRegex());\n\t\t\t\n\t}",
"public final void rule__IdOrString__Alternatives() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.eclipse.ese.android.dsl.ui/src-gen/org/eclipse/ese/ui/contentassist/antlr/internal/InternalAndroid.g:339:1: ( ( RULE_ID ) | ( RULE_STRING ) )\n int alt3=2;\n int LA3_0 = input.LA(1);\n\n if ( (LA3_0==RULE_ID) ) {\n alt3=1;\n }\n else if ( (LA3_0==RULE_STRING) ) {\n alt3=2;\n }\n else {\n NoViableAltException nvae =\n new NoViableAltException(\"335:1: rule__IdOrString__Alternatives : ( ( RULE_ID ) | ( RULE_STRING ) );\", 3, 0, input);\n\n throw nvae;\n }\n switch (alt3) {\n case 1 :\n // ../org.eclipse.ese.android.dsl.ui/src-gen/org/eclipse/ese/ui/contentassist/antlr/internal/InternalAndroid.g:340:1: ( RULE_ID )\n {\n // ../org.eclipse.ese.android.dsl.ui/src-gen/org/eclipse/ese/ui/contentassist/antlr/internal/InternalAndroid.g:340:1: ( RULE_ID )\n // ../org.eclipse.ese.android.dsl.ui/src-gen/org/eclipse/ese/ui/contentassist/antlr/internal/InternalAndroid.g:341:1: RULE_ID\n {\n before(grammarAccess.getIdOrStringAccess().getIDTerminalRuleCall_0()); \n match(input,RULE_ID,FollowSets000.FOLLOW_RULE_ID_in_rule__IdOrString__Alternatives665); \n after(grammarAccess.getIdOrStringAccess().getIDTerminalRuleCall_0()); \n\n }\n\n\n }\n break;\n case 2 :\n // ../org.eclipse.ese.android.dsl.ui/src-gen/org/eclipse/ese/ui/contentassist/antlr/internal/InternalAndroid.g:346:6: ( RULE_STRING )\n {\n // ../org.eclipse.ese.android.dsl.ui/src-gen/org/eclipse/ese/ui/contentassist/antlr/internal/InternalAndroid.g:346:6: ( RULE_STRING )\n // ../org.eclipse.ese.android.dsl.ui/src-gen/org/eclipse/ese/ui/contentassist/antlr/internal/InternalAndroid.g:347:1: RULE_STRING\n {\n before(grammarAccess.getIdOrStringAccess().getSTRINGTerminalRuleCall_1()); \n match(input,RULE_STRING,FollowSets000.FOLLOW_RULE_STRING_in_rule__IdOrString__Alternatives682); \n after(grammarAccess.getIdOrStringAccess().getSTRINGTerminalRuleCall_1()); \n\n }\n\n\n }\n break;\n\n }\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public boolean processMatch(ParseTreeNode ptn, Integer patId,\r\n\t\t\tArrayList<ParseTreeNode> frontiers,\r\n\t\t\tArrayList<GrammarRule> targetStrings);",
"public final void ruleLiteral() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalGo.g:2692:2: ( ( ( rule__Literal__Alternatives ) ) )\r\n // InternalGo.g:2693:2: ( ( rule__Literal__Alternatives ) )\r\n {\r\n // InternalGo.g:2693:2: ( ( rule__Literal__Alternatives ) )\r\n // InternalGo.g:2694:3: ( rule__Literal__Alternatives )\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getLiteralAccess().getAlternatives()); \r\n }\r\n // InternalGo.g:2695:3: ( rule__Literal__Alternatives )\r\n // InternalGo.g:2695:4: rule__Literal__Alternatives\r\n {\r\n pushFollow(FOLLOW_2);\r\n rule__Literal__Alternatives();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getLiteralAccess().getAlternatives()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }",
"public void setTermsAlternative(final List<BasicString> termsAlternative) {\n this.termsAlternative = termsAlternative;\n }",
"public static Annotation ruleResolvePronoun(Annotation[] basenps, int num, Document doc)\r\n{\n Annotation np2 = basenps[num];\r\n // Get some properties of the np\r\n FeatureUtils.PRTypeEnum type2 = Pronoun.getValue(np2, doc);\r\n String str2 = doc.getAnnotString(np2);\r\n boolean reflexive = FeatureUtils.isReflexive(str2);\r\n // Get the possible antecedents\r\n ArrayList<Annotation> antes = new ArrayList<Annotation>();\r\n ArrayList<Integer> nums = new ArrayList<Integer>();\r\n if (DEBUG) {\r\n System.err.println(\"Pronoun: \" + doc.getAnnotText(np2));\r\n }\r\n if (FeatureUtils.getPronounPerson(str2) == PersonPronounTypeEnum.FIRST) {\r\n if (NumberEnum.SINGLE.equals(Number.getValue(np2, doc)))\r\n return ruleResolvePronounI(np2, basenps, num, doc);\r\n else\r\n return ruleResolvePronounWe(np2, basenps, num, doc);\r\n }\r\n if (FeatureUtils.getPronounPerson(str2) == PersonPronounTypeEnum.SECOND)\r\n return ruleResolvePronounYou(np2, basenps, num, doc);\r\n else {\r\n int sentnum = 0;\r\n for (int i = num - 1; i >= 0 && sentnum <= 3; i--) {\r\n Annotation np1 = basenps[i];\r\n sentnum = sentNum(np1, np2, doc);\r\n if (DEBUG) {\r\n System.err.println(\"Possible antecedent: \" + i + \" :\" + doc.getAnnotText(np1));\r\n }\r\n if (!isNumberIncompatible(np1, np2, doc) && !isGenderIncompatible(np1, np2, doc)\r\n && !isAnimacyIncompatible(np1, np2, doc) && isWNClassComp(np1, np2, doc) && isProComp(np1, np2, doc)\r\n && !Embedded.getValue(np1, doc) && isSyntax(np1, np2, doc)) {\r\n if (DEBUG) {\r\n System.err.println(\"Candidate antecedent: \" + i + \" :\" + doc.getAnnotText(np1));\r\n }\r\n antes.add(0, np1);\r\n nums.add(0, i);\r\n }\r\n }\r\n }\r\n if (antes.size() == 0) return null;\r\n // Check for reflexsives\r\n if (FeatureUtils.isReflexive(doc.getAnnotText(np2))) {\r\n union(nums.get(nums.size() - 1).intValue(), num);\r\n return antes.get(antes.size() - 1);\r\n }\r\n if (antes.size() == 1) {\r\n // Rule 1: Unique in discourse\r\n if (DEBUG) {\r\n System.err.println(\"Rule 1 match!!!\");\r\n }\r\n union(nums.get(0).intValue(), num);\r\n return antes.get(0);\r\n }\r\n // Rule 2: Reflexive -- the last possible antecedent\r\n if (reflexive) {\r\n if (DEBUG) {\r\n System.err.println(\"Rule 2 match!!!\");\r\n }\r\n union(nums.get(nums.size() - 1).intValue(), num);\r\n return antes.get(antes.size() - 1);\r\n }\r\n // Rule 3: Unique current + Prior\r\n ArrayList<Annotation> antes1 = new ArrayList<Annotation>();\r\n ArrayList<Integer> nums1 = new ArrayList<Integer>();\r\n int counter = 0;\r\n for (Annotation np1 : antes) {\r\n if (sentNum(np1, np2, doc) < 2) {\r\n antes1.add(np1);\r\n nums1.add(nums.get(counter));\r\n }\r\n counter++;\r\n }\r\n if (antes1.size() == 1) {\r\n if (DEBUG) {\r\n System.err.println(\"Rule 3 match!!!\");\r\n }\r\n union(nums1.get(0).intValue(), num);\r\n return antes1.get(0);\r\n }\r\n // Rule 4: Possesive Pro\r\n\r\n if (FeatureUtils.isPossesive(str2) && antes1.size() > 0) {\r\n Integer found = null;\r\n Annotation ant = null;\r\n boolean multiple = false;\r\n for (int i = 0; i < antes1.size() && !multiple; i++) {\r\n Annotation np1 = antes1.get(i);\r\n if (doc.getAnnotText(np1).equalsIgnoreCase(str2) && sentNum(np1, np2, doc) == 1) {\r\n if (found == null) {\r\n found = nums1.get(i);\r\n ant = antes1.get(i);\r\n }\r\n else {\r\n multiple = true;\r\n }\r\n }\r\n }\r\n if (!multiple && found != null) {\r\n if (DEBUG) {\r\n System.err.println(\"Rule 4 match!!!\");\r\n }\r\n union(found.intValue(), num);\r\n return ant;\r\n }\r\n }\r\n // Rule #5: Unique in the current sentence\r\n ArrayList<Annotation> antes2 = new ArrayList<Annotation>();\r\n ArrayList<Integer> nums2 = new ArrayList<Integer>();\r\n counter = 0;\r\n for (Annotation np1 : antes1) {\r\n if (sentNum(np1, np2, doc) < 1) {\r\n antes2.add(np1);\r\n nums2.add(nums1.get(counter));\r\n }\r\n counter++;\r\n }\r\n if (antes2.size() == 1) {\r\n if (DEBUG) {\r\n System.err.println(\"Rule 5 match!!!\");\r\n }\r\n union(nums2.get(0).intValue(), num);\r\n return antes2.get(0);\r\n }\r\n // Extra Rule: Unique in the current clause (or parent clauses\r\n AnnotationSet parse = doc.getAnnotationSet(Constants.PARSE);\r\n Annotation clause = SyntaxUtils.getClause(np2, parse);\r\n while (clause != null) {\r\n ArrayList<Annotation> antes3 = new ArrayList<Annotation>();\r\n ArrayList<Integer> nums3 = new ArrayList<Integer>();\r\n counter = 0;\r\n for (Annotation np1 : antes2) {\r\n if (clause.covers(np1)) {\r\n antes3.add(np1);\r\n nums3.add(nums2.get(counter));\r\n }\r\n counter++;\r\n }\r\n if (DEBUG) {\r\n System.err.println(antes3.size() + \" antecedents in the clause\");\r\n }\r\n if (antes3.size() == 1) {\r\n if (DEBUG) {\r\n System.err.println(\"Clause rule match!!!\");\r\n }\r\n union(nums3.get(0).intValue(), num);\r\n return antes3.get(0);\r\n }\r\n clause = SyntaxUtils.getParentClause(clause, parse);\r\n }\r\n\r\n // Rule #6: Unique Subject\r\n\r\n // //Look for the subject in the current sentence\r\n // boolean unique = true;\r\n // Annotation subject = null;\r\n // Integer subjectNum = null;\r\n // for(int i=antes.size()-1; i>=0; i--){\r\n // Annotation np1 = antes.get(i);\r\n // if(sentNum(np1, np2, annotations, text)==0){\r\n // if(FeatureUtils.getGramRole(np1, annotations, text).equals(\"SUBJECT\")){\r\n // //&&SyntaxUtils.isMainClause(np1, parse)){\r\n // if(DEBUG)\r\n // System.err.println(\"Rule 6 match!!!\");\r\n // if(subjectNum!=null)\r\n // unique=false;\r\n // subjectNum = nums.get(i);\r\n // subject = antes.get(i);\r\n // }\r\n // }\r\n // }\r\n\r\n // if(subject!=null&&unique){\r\n // union(subjectNum.intValue(), num);\r\n // return subject;\r\n // }\r\n\r\n // Look for the subject in the previous sentence\r\n boolean unique = true;\r\n Annotation subject = null;\r\n Integer subjectNum = null;\r\n if (GramRole.getValue(np2, doc).equals(\"SUBJECT\")) {\r\n // &&SyntaxUtils.isMainClause(np2, parse)){\r\n for (int i = antes.size() - 1; i >= 0; i--) {\r\n Annotation np1 = antes.get(i);\r\n if (sentNum(np1, np2, doc) == 1) {\r\n if (GramRole.getValue(np1, doc).equals(\"SUBJECT\")) {\r\n // &&SyntaxUtils.isMainClause(np1, parse)){\r\n if (DEBUG) {\r\n System.err.println(\"Rule 6 match!!!\");\r\n }\r\n if (subjectNum != null) {\r\n unique = false;\r\n }\r\n subjectNum = nums.get(i);\r\n subject = antes.get(i);\r\n }\r\n }\r\n }\r\n }\r\n if (subject != null && unique) {\r\n union(subjectNum.intValue(), num);\r\n return subject;\r\n }\r\n subjectNum = null;\r\n subject = null;\r\n\r\n // One more Rule -- assign possessive pronouns to the last subject\r\n if (type2.equals(FeatureUtils.PRTypeEnum.POSSESSIVE)) {\r\n for (int i = antes.size() - 1; i >= 0; i--) {\r\n Annotation np1 = antes.get(i);\r\n if (sentNum(np1, np2, doc) == 0) {\r\n if (GramRole.getValue(np1, doc).equals(\"SUBJECT\")) {\r\n // &&SyntaxUtils.isMainClause(np1, parse)){\r\n if (DEBUG) {\r\n System.err.println(\"Rule 6a match!!!\");\r\n }\r\n if (subject == null) {\r\n subjectNum = nums.get(i);\r\n subject = antes.get(i);\r\n }\r\n }\r\n }\r\n }\r\n if (subject != null) {\r\n union(subjectNum.intValue(), num);\r\n return subject;\r\n }\r\n }\r\n\r\n return null;\r\n}",
"private List<Map.Entry<String, Pattern>> addPatterns (String syntax, List<Map.Entry<String, Pattern>> translations) {\n var resources = ResourceBundle.getBundle(syntax);\n for (var key : Collections.list(resources.getKeys())) {\n var regex = resources.getString(key);\n translations.add(new AbstractMap.SimpleEntry<>(key,\n Pattern.compile(regex, Pattern.CASE_INSENSITIVE)));\n }\n return translations;\n }",
"public void addAlternatives(Alternative alt) {\n\t\t alternatives.add(alt);\n\t }",
"public final void ruleAstExpressionLiteral() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:1951:2: ( ( ( rule__AstExpressionLiteral__Alternatives ) ) )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:1952:1: ( ( rule__AstExpressionLiteral__Alternatives ) )\n {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:1952:1: ( ( rule__AstExpressionLiteral__Alternatives ) )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:1953:1: ( rule__AstExpressionLiteral__Alternatives )\n {\n before(grammarAccess.getAstExpressionLiteralAccess().getAlternatives()); \n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:1954:1: ( rule__AstExpressionLiteral__Alternatives )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:1954:2: rule__AstExpressionLiteral__Alternatives\n {\n pushFollow(FOLLOW_rule__AstExpressionLiteral__Alternatives_in_ruleAstExpressionLiteral4116);\n rule__AstExpressionLiteral__Alternatives();\n\n state._fsp--;\n\n\n }\n\n after(grammarAccess.getAstExpressionLiteralAccess().getAlternatives()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__Lines__Alternatives() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalBrowser.g:956:1: ( ( ruleDeclaration ) | ( ruleAffectation ) | ( ruleFunctionCall ) | ( ruleCheckContainsLink ) | ( ruleCheckContainsText ) | ( ruleFindProperty ) | ( ruleFindFirstProperty ) | ( ruleFindSecondProperty ) | ( ruleGetTitle ) )\n int alt3=9;\n alt3 = dfa3.predict(input);\n switch (alt3) {\n case 1 :\n // InternalBrowser.g:957:2: ( ruleDeclaration )\n {\n // InternalBrowser.g:957:2: ( ruleDeclaration )\n // InternalBrowser.g:958:3: ruleDeclaration\n {\n before(grammarAccess.getLinesAccess().getDeclarationParserRuleCall_0()); \n pushFollow(FOLLOW_2);\n ruleDeclaration();\n\n state._fsp--;\n\n after(grammarAccess.getLinesAccess().getDeclarationParserRuleCall_0()); \n\n }\n\n\n }\n break;\n case 2 :\n // InternalBrowser.g:963:2: ( ruleAffectation )\n {\n // InternalBrowser.g:963:2: ( ruleAffectation )\n // InternalBrowser.g:964:3: ruleAffectation\n {\n before(grammarAccess.getLinesAccess().getAffectationParserRuleCall_1()); \n pushFollow(FOLLOW_2);\n ruleAffectation();\n\n state._fsp--;\n\n after(grammarAccess.getLinesAccess().getAffectationParserRuleCall_1()); \n\n }\n\n\n }\n break;\n case 3 :\n // InternalBrowser.g:969:2: ( ruleFunctionCall )\n {\n // InternalBrowser.g:969:2: ( ruleFunctionCall )\n // InternalBrowser.g:970:3: ruleFunctionCall\n {\n before(grammarAccess.getLinesAccess().getFunctionCallParserRuleCall_2()); \n pushFollow(FOLLOW_2);\n ruleFunctionCall();\n\n state._fsp--;\n\n after(grammarAccess.getLinesAccess().getFunctionCallParserRuleCall_2()); \n\n }\n\n\n }\n break;\n case 4 :\n // InternalBrowser.g:975:2: ( ruleCheckContainsLink )\n {\n // InternalBrowser.g:975:2: ( ruleCheckContainsLink )\n // InternalBrowser.g:976:3: ruleCheckContainsLink\n {\n before(grammarAccess.getLinesAccess().getCheckContainsLinkParserRuleCall_3()); \n pushFollow(FOLLOW_2);\n ruleCheckContainsLink();\n\n state._fsp--;\n\n after(grammarAccess.getLinesAccess().getCheckContainsLinkParserRuleCall_3()); \n\n }\n\n\n }\n break;\n case 5 :\n // InternalBrowser.g:981:2: ( ruleCheckContainsText )\n {\n // InternalBrowser.g:981:2: ( ruleCheckContainsText )\n // InternalBrowser.g:982:3: ruleCheckContainsText\n {\n before(grammarAccess.getLinesAccess().getCheckContainsTextParserRuleCall_4()); \n pushFollow(FOLLOW_2);\n ruleCheckContainsText();\n\n state._fsp--;\n\n after(grammarAccess.getLinesAccess().getCheckContainsTextParserRuleCall_4()); \n\n }\n\n\n }\n break;\n case 6 :\n // InternalBrowser.g:987:2: ( ruleFindProperty )\n {\n // InternalBrowser.g:987:2: ( ruleFindProperty )\n // InternalBrowser.g:988:3: ruleFindProperty\n {\n before(grammarAccess.getLinesAccess().getFindPropertyParserRuleCall_5()); \n pushFollow(FOLLOW_2);\n ruleFindProperty();\n\n state._fsp--;\n\n after(grammarAccess.getLinesAccess().getFindPropertyParserRuleCall_5()); \n\n }\n\n\n }\n break;\n case 7 :\n // InternalBrowser.g:993:2: ( ruleFindFirstProperty )\n {\n // InternalBrowser.g:993:2: ( ruleFindFirstProperty )\n // InternalBrowser.g:994:3: ruleFindFirstProperty\n {\n before(grammarAccess.getLinesAccess().getFindFirstPropertyParserRuleCall_6()); \n pushFollow(FOLLOW_2);\n ruleFindFirstProperty();\n\n state._fsp--;\n\n after(grammarAccess.getLinesAccess().getFindFirstPropertyParserRuleCall_6()); \n\n }\n\n\n }\n break;\n case 8 :\n // InternalBrowser.g:999:2: ( ruleFindSecondProperty )\n {\n // InternalBrowser.g:999:2: ( ruleFindSecondProperty )\n // InternalBrowser.g:1000:3: ruleFindSecondProperty\n {\n before(grammarAccess.getLinesAccess().getFindSecondPropertyParserRuleCall_7()); \n pushFollow(FOLLOW_2);\n ruleFindSecondProperty();\n\n state._fsp--;\n\n after(grammarAccess.getLinesAccess().getFindSecondPropertyParserRuleCall_7()); \n\n }\n\n\n }\n break;\n case 9 :\n // InternalBrowser.g:1005:2: ( ruleGetTitle )\n {\n // InternalBrowser.g:1005:2: ( ruleGetTitle )\n // InternalBrowser.g:1006:3: ruleGetTitle\n {\n before(grammarAccess.getLinesAccess().getGetTitleParserRuleCall_8()); \n pushFollow(FOLLOW_2);\n ruleGetTitle();\n\n state._fsp--;\n\n after(grammarAccess.getLinesAccess().getGetTitleParserRuleCall_8()); \n\n }\n\n\n }\n break;\n\n }\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rulePython() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMLRegression.g:116:2: ( ( ( rule__Python__Alternatives ) ) )\n // InternalMLRegression.g:117:2: ( ( rule__Python__Alternatives ) )\n {\n // InternalMLRegression.g:117:2: ( ( rule__Python__Alternatives ) )\n // InternalMLRegression.g:118:3: ( rule__Python__Alternatives )\n {\n before(grammarAccess.getPythonAccess().getAlternatives()); \n // InternalMLRegression.g:119:3: ( rule__Python__Alternatives )\n // InternalMLRegression.g:119:4: rule__Python__Alternatives\n {\n pushFollow(FOLLOW_2);\n rule__Python__Alternatives();\n\n state._fsp--;\n\n\n }\n\n after(grammarAccess.getPythonAccess().getAlternatives()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"@BeforeEach\n\tvoid setUpValidRE(){\n\t\tvalidRE= new String[lengthValid];\n\t\t// ab\n\t\tvalidRE[0] = \"ab\";\n\t\t// (ab)\n\t\tvalidRE[1] = \"(ab)\";\n\t\t//(ab)*\n\t\tvalidRE[2] = \"(ab)*\";\n\t\t// a???\n\t\tvalidRE[3] = \"a???\";\n\t\t// a***\n\t\tvalidRE[4] = \"a***\";\n\t\t// a+++\n\t\tvalidRE[5] = \"a+++\";\n\t\t// (((a)))\n\t\tvalidRE[6] = \"(((a)))\";\n\t\t// (a | ab | c*)*\n\t\tvalidRE[7] = \"(a | ab | c*)*\";\n\t\t// (a | ab | c*)**??\n\t\tvalidRE[8] = \"(a | ab | c*)*??\";\n\t\t// ( a | (ab | cd)+ )+\n\t\tvalidRE[9] = \"(a | (ab | cd)+)+\";\n\t\t// 0 (01 | (02) * | (03)++) | (1?01?)\n\t\tvalidRE[10] = \"0 (01 | (02) * | (03)++) | (a?01?)\";\n\t\t// a | &\n\t\tvalidRE[11] = \"a | &\";\n\t\t// &*\n\t\tvalidRE[12] = \"&*\";\n\t\t// (())* (empty language)\n\t\tvalidRE[13] = \"(())*\";\n\t\t// (a*b)*\n\t\tvalidRE[14] = \"(a*b)*\";\n\t\t// (a | & | a*b?c+)*\n\t\tvalidRE[15] = \"(a | & | a*b?c+)*\";\n\t}",
"@Test\n public void sourceTextInReferenceTest() {\n final String transcription = \"This is a test moo\";\n final String expected = \"This is a test <a class=\\\"internal-ref\\\" href=\\\"javascript:;\\\" \" +\n \"data-targetid=\\\"https://example.com/col/book/page/canvas\\\" \" +\n \"data-label=\\\"test\\\" \" +\n \"data-manifestid=\\\"https://example.com/col/book/manifest\\\">moo</a>\";\n\n String result = adapter.addInternalRefs(fakeCollection, transcription, Collections.singletonList(weirdRef()));\n assertEquals(expected, result);\n }",
"public interface LLkGrammarAnalyzer extends GrammarAnalyzer {\n\n\n public boolean deterministic(AlternativeBlock blk);\n\n public boolean deterministic(OneOrMoreBlock blk);\n\n public boolean deterministic(ZeroOrMoreBlock blk);\n\n public Lookahead FOLLOW(int k, RuleEndElement end);\n\n public Lookahead look(int k, ActionElement action);\n\n public Lookahead look(int k, AlternativeBlock blk);\n\n public Lookahead look(int k, BlockEndElement end);\n\n public Lookahead look(int k, CharLiteralElement atom);\n\n public Lookahead look(int k, CharRangeElement end);\n\n public Lookahead look(int k, GrammarAtom atom);\n\n public Lookahead look(int k, OneOrMoreBlock blk);\n\n public Lookahead look(int k, RuleBlock blk);\n\n public Lookahead look(int k, RuleEndElement end);\n\n public Lookahead look(int k, RuleRefElement rr);\n\n public Lookahead look(int k, StringLiteralElement atom);\n\n public Lookahead look(int k, SynPredBlock blk);\n\n public Lookahead look(int k, TokenRangeElement end);\n\n public Lookahead look(int k, TreeElement end);\n\n public Lookahead look(int k, WildcardElement wc);\n\n public Lookahead look(int k, ZeroOrMoreBlock blk);\n\n public Lookahead look(int k, String rule);\n\n public void setGrammar(Grammar g);\n\n public boolean subruleCanBeInverted(AlternativeBlock blk, boolean forLexer);\n}",
"private void parseDefinition(final Rule rule, final String definition, final int line) throws GrammarException\n {\n final StringExtractor stringExtractor = new StringExtractor(definition);\n stringExtractor.setCanReturnEmptyString(false);\n String element = stringExtractor.next();\n final Pattern patternReference = Pattern.compile(GrammarConstants.REGEX_REFERENCE);\n Matcher matcher;\n\n if (element != null)\n {\n final SimpleDefinition simpleDefinition = new SimpleDefinition();\n rule.addDefinition(simpleDefinition);\n\n do\n {\n matcher = patternReference.matcher(element);\n\n if (matcher.matches())\n {\n simpleDefinition.addElement(new ElementReference(matcher.group(GrammarConstants.GROUP_NAME)));\n }\n else if (GrammarConstants.REGEX_EMPTY.equals(element))\n {\n simpleDefinition.addElement(Element.EMPTY);\n }\n else\n {\n simpleDefinition.addElement(new ElementRegularExpression(element));\n }\n\n element = stringExtractor.next();\n }\n while (element != null);\n }\n }",
"public final void ruleEntry() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.eclipse.ese.android.dsl.ui/src-gen/org/eclipse/ese/ui/contentassist/antlr/internal/InternalAndroid.g:74:2: ( ( ( rule__Entry__Alternatives ) ) )\n // ../org.eclipse.ese.android.dsl.ui/src-gen/org/eclipse/ese/ui/contentassist/antlr/internal/InternalAndroid.g:75:1: ( ( rule__Entry__Alternatives ) )\n {\n // ../org.eclipse.ese.android.dsl.ui/src-gen/org/eclipse/ese/ui/contentassist/antlr/internal/InternalAndroid.g:75:1: ( ( rule__Entry__Alternatives ) )\n // ../org.eclipse.ese.android.dsl.ui/src-gen/org/eclipse/ese/ui/contentassist/antlr/internal/InternalAndroid.g:76:1: ( rule__Entry__Alternatives )\n {\n before(grammarAccess.getEntryAccess().getAlternatives()); \n // ../org.eclipse.ese.android.dsl.ui/src-gen/org/eclipse/ese/ui/contentassist/antlr/internal/InternalAndroid.g:77:1: ( rule__Entry__Alternatives )\n // ../org.eclipse.ese.android.dsl.ui/src-gen/org/eclipse/ese/ui/contentassist/antlr/internal/InternalAndroid.g:77:2: rule__Entry__Alternatives\n {\n pushFollow(FollowSets000.FOLLOW_rule__Entry__Alternatives_in_ruleEntry94);\n rule__Entry__Alternatives();\n _fsp--;\n\n\n }\n\n after(grammarAccess.getEntryAccess().getAlternatives()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"@Test\r\n public void testAddRule() throws Exception{\r\n System.out.println(\"addRule\");\r\n RuleSetImpl instance = new RuleSetImpl(\"Test\", true);\r\n instance.addRule(new RegExRule(\".*\", \"string\"));\r\n instance.addRule(new RegExRule(\"a.*\", \"aString\"));\r\n List<Rule> rules = instance.getRules();\r\n assertTrue(rules.size()==2);\r\n }",
"@Test\n public void hrefPatternTest() {\n Pattern aTeg = Pattern.compile(\"(?i)<a([^>]+)>(.+?)</a>\");\n Pattern href = Pattern.compile(\"\\\\s*(?i)href\\\\s*=\\\\s*(\\\\\\\"([^\\\"]+\\\\\\\")|'[^']+'|([^'\\\">\\\\s]+))\");\n String[] validLinkTegs = {\"<li><a href=\\\"/toolbar-creator\\\">Create a Custom Toolbar</a></li>\",\n \"<a href=\\\"http://stlpublicradio.org/programs/slota/archivedetail.php?date='2012-02-29'\\\" title=\\\"\\\" class=\\\"menu_icon menu-17197 \\\" >Грузовые перевозки</a></li>\",\n \"<li><a href='http://www.tipsntracks.com/date/2012/03' title='March 2012'>March 2012</a></li>\"};\n String[] invalidLinkTags = {\"<a href=\\\"\\\"style=\\\"\\\"><img width=\\\"148\\\" height=\\\"32\\\" src=\\\"/images/buttons/btn-www-survey.gif\\\" /></a>\"};\n String[] validLinks = new String[validLinkTegs.length];\n String[] invalidLinks = new String[invalidLinkTags.length];\n for (int i = 0; i < validLinkTegs.length; i++) {\n Matcher matcher = aTeg.matcher(validLinkTegs[i]);\n Assert.assertTrue(matcher.find());\n validLinks[i] = matcher.group(1);\n }\n for (int i = 0; i < invalidLinkTags.length; i++) {\n Matcher matcher = aTeg.matcher(invalidLinkTags[i]);\n Assert.assertTrue(matcher.find());\n invalidLinks[i] = matcher.group(1);\n }\n for (int i = 0; i < validLinkTegs.length; i++) {\n Matcher matcher = href.matcher(validLinks[i]);\n Assert.assertTrue(matcher.find());\n String s = matcher.group(1);\n System.out.println(s.substring(1, s.length() - 1));\n }\n for (int i = 0; i < invalidLinkTags.length; i++) {\n Matcher matcher = href.matcher(invalidLinks[i]);\n Assert.assertFalse(matcher.find());\n }\n }",
"public final void ruleEString() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalPantryTextual.g:116:2: ( ( ( rule__EString__Alternatives ) ) )\n // InternalPantryTextual.g:117:2: ( ( rule__EString__Alternatives ) )\n {\n // InternalPantryTextual.g:117:2: ( ( rule__EString__Alternatives ) )\n // InternalPantryTextual.g:118:3: ( rule__EString__Alternatives )\n {\n before(grammarAccess.getEStringAccess().getAlternatives()); \n // InternalPantryTextual.g:119:3: ( rule__EString__Alternatives )\n // InternalPantryTextual.g:119:4: rule__EString__Alternatives\n {\n pushFollow(FOLLOW_2);\n rule__EString__Alternatives();\n\n state._fsp--;\n\n\n }\n\n after(grammarAccess.getEStringAccess().getAlternatives()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void ruleREAL() throws RecognitionException {\n\n \t\tHiddenTokens myHiddenTokenState = ((XtextTokenStream)input).setHiddenTokens();\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:2042:2: ( ( ( rule__REAL__Alternatives ) ) )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:2043:1: ( ( rule__REAL__Alternatives ) )\n {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:2043:1: ( ( rule__REAL__Alternatives ) )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:2044:1: ( rule__REAL__Alternatives )\n {\n before(grammarAccess.getREALAccess().getAlternatives()); \n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:2045:1: ( rule__REAL__Alternatives )\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:2045:2: rule__REAL__Alternatives\n {\n pushFollow(FOLLOW_rule__REAL__Alternatives_in_ruleREAL4305);\n rule__REAL__Alternatives();\n\n state._fsp--;\n\n\n }\n\n after(grammarAccess.getREALAccess().getAlternatives()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n \tmyHiddenTokenState.restore();\n\n }\n return ;\n }",
"public final void ruleEString() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.catalogo.ui/src-gen/org/xtext/ui/contentassist/antlr/internal/InternalCatalogo.g:129:2: ( ( ( rule__EString__Alternatives ) ) )\n // ../org.xtext.catalogo.ui/src-gen/org/xtext/ui/contentassist/antlr/internal/InternalCatalogo.g:130:1: ( ( rule__EString__Alternatives ) )\n {\n // ../org.xtext.catalogo.ui/src-gen/org/xtext/ui/contentassist/antlr/internal/InternalCatalogo.g:130:1: ( ( rule__EString__Alternatives ) )\n // ../org.xtext.catalogo.ui/src-gen/org/xtext/ui/contentassist/antlr/internal/InternalCatalogo.g:131:1: ( rule__EString__Alternatives )\n {\n before(grammarAccess.getEStringAccess().getAlternatives()); \n // ../org.xtext.catalogo.ui/src-gen/org/xtext/ui/contentassist/antlr/internal/InternalCatalogo.g:132:1: ( rule__EString__Alternatives )\n // ../org.xtext.catalogo.ui/src-gen/org/xtext/ui/contentassist/antlr/internal/InternalCatalogo.g:132:2: rule__EString__Alternatives\n {\n pushFollow(FollowSets000.FOLLOW_rule__EString__Alternatives_in_ruleEString214);\n rule__EString__Alternatives();\n\n state._fsp--;\n\n\n }\n\n after(grammarAccess.getEStringAccess().getAlternatives()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__EString__Alternatives() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMyDsl.g:432:1: ( ( RULE_STRING ) | ( RULE_ID ) )\n int alt2=2;\n int LA2_0 = input.LA(1);\n\n if ( (LA2_0==RULE_STRING) ) {\n alt2=1;\n }\n else if ( (LA2_0==RULE_ID) ) {\n alt2=2;\n }\n else {\n NoViableAltException nvae =\n new NoViableAltException(\"\", 2, 0, input);\n\n throw nvae;\n }\n switch (alt2) {\n case 1 :\n // InternalMyDsl.g:433:2: ( RULE_STRING )\n {\n // InternalMyDsl.g:433:2: ( RULE_STRING )\n // InternalMyDsl.g:434:3: RULE_STRING\n {\n before(grammarAccess.getEStringAccess().getSTRINGTerminalRuleCall_0()); \n match(input,RULE_STRING,FOLLOW_2); \n after(grammarAccess.getEStringAccess().getSTRINGTerminalRuleCall_0()); \n\n }\n\n\n }\n break;\n case 2 :\n // InternalMyDsl.g:439:2: ( RULE_ID )\n {\n // InternalMyDsl.g:439:2: ( RULE_ID )\n // InternalMyDsl.g:440:3: RULE_ID\n {\n before(grammarAccess.getEStringAccess().getIDTerminalRuleCall_1()); \n match(input,RULE_ID,FOLLOW_2); \n after(grammarAccess.getEStringAccess().getIDTerminalRuleCall_1()); \n\n }\n\n\n }\n break;\n\n }\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__LanguageTarget__LanguageAlternatives_2_0() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMLRegression.g:706:1: ( ( rulePython ) | ( ruleR ) )\n int alt1=2;\n int LA1_0 = input.LA(1);\n\n if ( ((LA1_0>=17 && LA1_0<=19)) ) {\n alt1=1;\n }\n else if ( ((LA1_0>=20 && LA1_0<=21)) ) {\n alt1=2;\n }\n else {\n NoViableAltException nvae =\n new NoViableAltException(\"\", 1, 0, input);\n\n throw nvae;\n }\n switch (alt1) {\n case 1 :\n // InternalMLRegression.g:707:2: ( rulePython )\n {\n // InternalMLRegression.g:707:2: ( rulePython )\n // InternalMLRegression.g:708:3: rulePython\n {\n before(grammarAccess.getLanguageTargetAccess().getLanguagePythonParserRuleCall_2_0_0()); \n pushFollow(FOLLOW_2);\n rulePython();\n\n state._fsp--;\n\n after(grammarAccess.getLanguageTargetAccess().getLanguagePythonParserRuleCall_2_0_0()); \n\n }\n\n\n }\n break;\n case 2 :\n // InternalMLRegression.g:713:2: ( ruleR )\n {\n // InternalMLRegression.g:713:2: ( ruleR )\n // InternalMLRegression.g:714:3: ruleR\n {\n before(grammarAccess.getLanguageTargetAccess().getLanguageRParserRuleCall_2_0_1()); \n pushFollow(FOLLOW_2);\n ruleR();\n\n state._fsp--;\n\n after(grammarAccess.getLanguageTargetAccess().getLanguageRParserRuleCall_2_0_1()); \n\n }\n\n\n }\n break;\n\n }\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__EString__Alternatives() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalPantryTextual.g:181:1: ( ( RULE_STRING ) | ( RULE_ID ) )\n int alt1=2;\n int LA1_0 = input.LA(1);\n\n if ( (LA1_0==RULE_STRING) ) {\n alt1=1;\n }\n else if ( (LA1_0==RULE_ID) ) {\n alt1=2;\n }\n else {\n NoViableAltException nvae =\n new NoViableAltException(\"\", 1, 0, input);\n\n throw nvae;\n }\n switch (alt1) {\n case 1 :\n // InternalPantryTextual.g:182:2: ( RULE_STRING )\n {\n // InternalPantryTextual.g:182:2: ( RULE_STRING )\n // InternalPantryTextual.g:183:3: RULE_STRING\n {\n before(grammarAccess.getEStringAccess().getSTRINGTerminalRuleCall_0()); \n match(input,RULE_STRING,FOLLOW_2); \n after(grammarAccess.getEStringAccess().getSTRINGTerminalRuleCall_0()); \n\n }\n\n\n }\n break;\n case 2 :\n // InternalPantryTextual.g:188:2: ( RULE_ID )\n {\n // InternalPantryTextual.g:188:2: ( RULE_ID )\n // InternalPantryTextual.g:189:3: RULE_ID\n {\n before(grammarAccess.getEStringAccess().getIDTerminalRuleCall_1()); \n match(input,RULE_ID,FOLLOW_2); \n after(grammarAccess.getEStringAccess().getIDTerminalRuleCall_1()); \n\n }\n\n\n }\n break;\n\n }\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__TypeSpec__Alternatives() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalGo.g:3731:1: ( ( ruleAliasDecl ) | ( ruleTypeDef ) )\r\n int alt23=2;\r\n int LA23_0 = input.LA(1);\r\n\r\n if ( (LA23_0==RULE_ID) ) {\r\n int LA23_1 = input.LA(2);\r\n\r\n if ( (LA23_1==44) ) {\r\n alt23=1;\r\n }\r\n else if ( (LA23_1==RULE_LITERAL_TYPE||LA23_1==45||LA23_1==48||LA23_1==52||LA23_1==54||LA23_1==56||(LA23_1>=60 && LA23_1<=63)) ) {\r\n alt23=2;\r\n }\r\n else {\r\n if (state.backtracking>0) {state.failed=true; return ;}\r\n NoViableAltException nvae =\r\n new NoViableAltException(\"\", 23, 1, input);\r\n\r\n throw nvae;\r\n }\r\n }\r\n else if ( (LA23_0==46) ) {\r\n int LA23_2 = input.LA(2);\r\n\r\n if ( (LA23_2==RULE_ID) ) {\r\n int LA23_5 = input.LA(3);\r\n\r\n if ( (LA23_5==44) ) {\r\n alt23=1;\r\n }\r\n else if ( (LA23_5==RULE_LITERAL_TYPE||LA23_5==45||LA23_5==48||LA23_5==52||LA23_5==54||LA23_5==56||(LA23_5>=60 && LA23_5<=63)) ) {\r\n alt23=2;\r\n }\r\n else {\r\n if (state.backtracking>0) {state.failed=true; return ;}\r\n NoViableAltException nvae =\r\n new NoViableAltException(\"\", 23, 5, input);\r\n\r\n throw nvae;\r\n }\r\n }\r\n else {\r\n if (state.backtracking>0) {state.failed=true; return ;}\r\n NoViableAltException nvae =\r\n new NoViableAltException(\"\", 23, 2, input);\r\n\r\n throw nvae;\r\n }\r\n }\r\n else {\r\n if (state.backtracking>0) {state.failed=true; return ;}\r\n NoViableAltException nvae =\r\n new NoViableAltException(\"\", 23, 0, input);\r\n\r\n throw nvae;\r\n }\r\n switch (alt23) {\r\n case 1 :\r\n // InternalGo.g:3732:2: ( ruleAliasDecl )\r\n {\r\n // InternalGo.g:3732:2: ( ruleAliasDecl )\r\n // InternalGo.g:3733:3: ruleAliasDecl\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getTypeSpecAccess().getAliasDeclParserRuleCall_0()); \r\n }\r\n pushFollow(FOLLOW_2);\r\n ruleAliasDecl();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getTypeSpecAccess().getAliasDeclParserRuleCall_0()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n break;\r\n case 2 :\r\n // InternalGo.g:3738:2: ( ruleTypeDef )\r\n {\r\n // InternalGo.g:3738:2: ( ruleTypeDef )\r\n // InternalGo.g:3739:3: ruleTypeDef\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getTypeSpecAccess().getTypeDefParserRuleCall_1()); \r\n }\r\n pushFollow(FOLLOW_2);\r\n ruleTypeDef();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getTypeSpecAccess().getTypeDefParserRuleCall_1()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n break;\r\n\r\n }\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }",
"public final void ruleOperand() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalGo.g:2492:2: ( ( ( rule__Operand__Alternatives ) ) )\r\n // InternalGo.g:2493:2: ( ( rule__Operand__Alternatives ) )\r\n {\r\n // InternalGo.g:2493:2: ( ( rule__Operand__Alternatives ) )\r\n // InternalGo.g:2494:3: ( rule__Operand__Alternatives )\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getOperandAccess().getAlternatives()); \r\n }\r\n // InternalGo.g:2495:3: ( rule__Operand__Alternatives )\r\n // InternalGo.g:2495:4: rule__Operand__Alternatives\r\n {\r\n pushFollow(FOLLOW_2);\r\n rule__Operand__Alternatives();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getOperandAccess().getAlternatives()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }",
"static public Rule parse(OrchestraSystem catalog, String rule, \r\n\t\t\tMap<String,RelationContext> locals) throws ParseException, RelationNotFoundException {\r\n\t\tHolder<Integer> counter = new Holder<Integer>(0);\r\n\t\tPositionedString str = new PositionedString(rule);\r\n\t\tstr.skipWhitespace();\r\n\t\tUntypedAtom h = UntypedAtom.parse(str, counter);\r\n\t\tboolean negateHead = false;\r\n\t\tif (h.getName().startsWith(\"NOT_\")) {\r\n\t\t\th.setName(h.getName().substring(4));\r\n\t\t\tnegateHead = true;\r\n\t\t}\r\n\r\n\t\tstr.skipWhitespace();\r\n\t\tif (!str.skipString(\":-\")) {\r\n\t\t\tcomplain(str, \"':-'\");\r\n\t\t}\r\n\t\tstr.skipWhitespace();\r\n\t\tArrayList<Atom> body = new ArrayList<Atom>();\r\n\t\tboolean first = true;\r\n\t\tstr.skipWhitespace();\r\n\t\twhile (str.inRange()) {\r\n\t\t\tif (first) {\r\n\t\t\t\tfirst = false;\r\n\t\t\t} else {\r\n\t\t\t\tif (!str.skipString(\",\")) {\r\n\t\t\t\t\tcomplain(str, \"','\");\r\n\t\t\t\t}\r\n\t\t\t\tstr.skipWhitespace();\r\n\t\t\t}\r\n\t\t\tUntypedAtom b = UntypedAtom.parse(str, counter);\r\n\t\t\tboolean isNegated = false;\r\n\t\t\tif (b.getName().startsWith(\"NOT_\")) {\r\n\t\t\t\tisNegated = true;\r\n\t\t\t\tb.setName(b.getName().substring(4));\r\n\t\t\t}\r\n\t\t\tAtom n = b.getTyped(catalog, locals);\r\n\t\t\tn.setNeg(isNegated);\r\n\t\t\tbody.add(n);\r\n\t\t\tstr.skipWhitespace();\r\n\t\t}\r\n\t\tAtom th;\r\n\t\ttry {\r\n\t\t\tth = h.getTyped(catalog, locals);\r\n\t\t} catch (ParseException e) {\r\n\t\t\tth = h.getTyped(body);\r\n\t\t\t// Add this as a local view definition\r\n\t\t\tif (!locals.containsKey(th.getRelationContext().toString()))\r\n\t\t\t\tlocals.put(th.getRelationContext().toString(), th.getRelationContext());\r\n\t\t} catch (RelationNotFoundException e) {\r\n\t\t\tth = h.getTyped(body);\r\n\t\t\t// Add this as a local view definition\r\n\t\t\tif (!locals.containsKey(th.getRelationContext().toString()))\r\n\t\t\t\tlocals.put(th.getRelationContext().toString(), th.getRelationContext());\r\n\t\t}\r\n\t\tth.setNeg(negateHead);\r\n\r\n\t\treturn new Rule(th, body, null, catalog.getMappingDb().getBuiltInSchemas());\r\n\t}",
"@Test\n public void testPredicate2() throws Exception {\n final RuleDescr rule = ((RuleDescr) (parse(\"rule\", \"rule X when Foo(eval( $var.equals(\\\"xyz\\\") )) then end\")));\n final PatternDescr pattern = ((PatternDescr) (getDescrs().get(0)));\n final List<?> constraints = pattern.getConstraint().getDescrs();\n TestCase.assertEquals(1, constraints.size());\n final ExprConstraintDescr predicate = ((ExprConstraintDescr) (constraints.get(0)));\n TestCase.assertEquals(\"eval( $var.equals(\\\"xyz\\\") )\", predicate.getExpression());\n }",
"@Test\n public void testOrWithBinding() throws Exception {\n final PackageDescr pkg = ((PackageDescr) (parseResource(\"compilationUnit\", \"or_binding.drl\")));\n TestCase.assertEquals(1, pkg.getRules().size());\n final RuleDescr rule = ((RuleDescr) (pkg.getRules().get(0)));\n TestCase.assertEquals(2, getDescrs().size());\n final OrDescr or = ((OrDescr) (getDescrs().get(0)));\n TestCase.assertEquals(2, or.getDescrs().size());\n final PatternDescr leftPattern = ((PatternDescr) (or.getDescrs().get(0)));\n TestCase.assertEquals(\"Person\", leftPattern.getObjectType());\n TestCase.assertEquals(\"foo\", leftPattern.getIdentifier());\n final PatternDescr rightPattern = ((PatternDescr) (or.getDescrs().get(1)));\n TestCase.assertEquals(\"Person\", rightPattern.getObjectType());\n TestCase.assertEquals(\"foo\", rightPattern.getIdentifier());\n final PatternDescr cheeseDescr = ((PatternDescr) (getDescrs().get(1)));\n TestCase.assertEquals(\"Cheese\", cheeseDescr.getObjectType());\n TestCase.assertEquals(null, cheeseDescr.getIdentifier());\n assertEqualsIgnoreWhitespace(\"System.out.println( \\\"Mark and Michael\\\" + bar );\", ((String) (rule.getConsequence())));\n }",
"@Test\n\tpublic void test6()\n\t{\n\t\tassertEquals(\n\t\t\t\"$1: {<web> page}\\n\" +\n\t\t\t\"$2: (webpage|$1)\\n\" +\n\t\t\t\"$webpage: {<spacex> $2}\",\n\t\t\texplodeRulesAndCreateString(\"webpage: spacex (webpage|(web page))\")\n\t\t);\n\t}",
"public static void label (List<IcePath> foundPatterns) {\n try {\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n for (IcePath fp : foundPatterns) {\n String repr = fp.getRepr();\n if (knownRelations.contains(repr + \" YES\")) {\n fp.setChoice(IcePathChoice.YES);\n } else if (knownRelations.contains(repr + \" NO\")) {\n fp.setChoice(IcePathChoice.NO);\n } else\n while (true) {\n System.out.print (repr + \"?\");\n String response = reader.readLine();\n if (response.equals(\"Y\")) {\n fp.setChoice(IcePathChoice.YES);\n knownRelations.add(repr + \" YES\");\n break;\n } else if (response.equals(\"N\")) {\n fp.setChoice(IcePathChoice.NO);\n knownRelations.add(repr + \" NO\");\n break;\n } else {\n System.out.println(\"Type Y or N\");\n }\n }\n }\n PrintWriter writer = new PrintWriter (new FileWriter (\"newRelationOracle\"));\n for (String repr : knownRelations) {\n writer.println(repr);\n }\n writer.close();\n } catch (IOException e) {\n System.err.println(\"IOException in RelationOracle\");\n }\n }",
"public interface RuleConstruction extends SelectRule, DeleteRule, UpdateRule {\n\n /**\n * Check whether word is key-word\n *\n * @param word - word\n * @return false - word is not key-word\n * true - word is key-word\n */\n boolean isNotKeyWord(String word);\n\n /**\n * Check whether word is By-word\n *\n * @param currentIndex - word index\n * @param words - list of words\n * @return true - word is correct\n * false - word is not correct\n */\n boolean isByCorrect(int currentIndex, List<String> words);\n\n /**\n * Check whether word is And-word or Or-word\n *\n * @param currentIndex - word index\n * @param words - list of words\n * @return true - word is correct\n * false - word is not correct\n */\n boolean isAndOrCorrect(int currentIndex, List<String> words);\n\n /**\n * Check whether word is Between-word\n *\n * @param currentIndex - word index\n * @param words - list of words\n * @return true - word is correct\n * false - word is not correct\n */\n boolean isBetweenCorrect(int currentIndex, List<String> words);\n}",
"boolean exactMatch(FlowRule rule);",
"boolean references(ResourceElement<S, V> referred, ResourceElement<?, ?> refers);",
"public final void ruleDeclaration() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalGo.g:1167:2: ( ( ( rule__Declaration__Alternatives ) ) )\r\n // InternalGo.g:1168:2: ( ( rule__Declaration__Alternatives ) )\r\n {\r\n // InternalGo.g:1168:2: ( ( rule__Declaration__Alternatives ) )\r\n // InternalGo.g:1169:3: ( rule__Declaration__Alternatives )\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getDeclarationAccess().getAlternatives()); \r\n }\r\n // InternalGo.g:1170:3: ( rule__Declaration__Alternatives )\r\n // InternalGo.g:1170:4: rule__Declaration__Alternatives\r\n {\r\n pushFollow(FOLLOW_2);\r\n rule__Declaration__Alternatives();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getDeclarationAccess().getAlternatives()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }",
"public final void rule__StoreExpression__Alternatives() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:2092:1: ( ( ruleReference ) | ( ruleSelfReference ) )\n int alt1=2;\n int LA1_0 = input.LA(1);\n\n if ( (LA1_0==RULE_LOWER) ) {\n alt1=1;\n }\n else if ( (LA1_0==22) ) {\n alt1=2;\n }\n else {\n NoViableAltException nvae =\n new NoViableAltException(\"\", 1, 0, input);\n\n throw nvae;\n }\n switch (alt1) {\n case 1 :\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:2093:1: ( ruleReference )\n {\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:2093:1: ( ruleReference )\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:2094:1: ruleReference\n {\n before(grammarAccess.getStoreExpressionAccess().getReferenceParserRuleCall_0()); \n pushFollow(FOLLOW_ruleReference_in_rule__StoreExpression__Alternatives3969);\n ruleReference();\n\n state._fsp--;\n\n after(grammarAccess.getStoreExpressionAccess().getReferenceParserRuleCall_0()); \n\n }\n\n\n }\n break;\n case 2 :\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:2099:6: ( ruleSelfReference )\n {\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:2099:6: ( ruleSelfReference )\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:2100:1: ruleSelfReference\n {\n before(grammarAccess.getStoreExpressionAccess().getSelfReferenceParserRuleCall_1()); \n pushFollow(FOLLOW_ruleSelfReference_in_rule__StoreExpression__Alternatives3986);\n ruleSelfReference();\n\n state._fsp--;\n\n after(grammarAccess.getStoreExpressionAccess().getSelfReferenceParserRuleCall_1()); \n\n }\n\n\n }\n break;\n\n }\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void ruleLines() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalBrowser.g:91:2: ( ( ( rule__Lines__Alternatives ) ) )\n // InternalBrowser.g:92:2: ( ( rule__Lines__Alternatives ) )\n {\n // InternalBrowser.g:92:2: ( ( rule__Lines__Alternatives ) )\n // InternalBrowser.g:93:3: ( rule__Lines__Alternatives )\n {\n before(grammarAccess.getLinesAccess().getAlternatives()); \n // InternalBrowser.g:94:3: ( rule__Lines__Alternatives )\n // InternalBrowser.g:94:4: rule__Lines__Alternatives\n {\n pushFollow(FOLLOW_2);\n rule__Lines__Alternatives();\n\n state._fsp--;\n\n\n }\n\n after(grammarAccess.getLinesAccess().getAlternatives()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public void addRule(String pattern, RemapRuleType remapType, String opStr) {\n\t\trules.add(new RemapRule(pattern, remapType, opStr));\n\t}",
"public final void ruleEvaluationType() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMLRegression.g:291:2: ( ( ( rule__EvaluationType__Alternatives ) ) )\n // InternalMLRegression.g:292:2: ( ( rule__EvaluationType__Alternatives ) )\n {\n // InternalMLRegression.g:292:2: ( ( rule__EvaluationType__Alternatives ) )\n // InternalMLRegression.g:293:3: ( rule__EvaluationType__Alternatives )\n {\n before(grammarAccess.getEvaluationTypeAccess().getAlternatives()); \n // InternalMLRegression.g:294:3: ( rule__EvaluationType__Alternatives )\n // InternalMLRegression.g:294:4: rule__EvaluationType__Alternatives\n {\n pushFollow(FOLLOW_2);\n rule__EvaluationType__Alternatives();\n\n state._fsp--;\n\n\n }\n\n after(grammarAccess.getEvaluationTypeAccess().getAlternatives()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public void testUriMatcher() {\n UriMatcher testMatcher = RecipeProvider.buildUriMatcher();\n\n assertEquals(\"Error: The INGREDIENT URI was matched incorrectly.\",\n testMatcher.match(TEST_INGREDIENT), RecipeProvider.INGREDIENT);\n assertEquals(\"Error on all ingredient match.\", testMatcher.match(TEST_INGREDIENT_ALL), RecipeProvider.INGREDIENT_ALL);\n assertEquals(\"Error: The WEATHER WITH LOCATION URI was matched incorrectly.\",\n testMatcher.match(TEST_RECIPE), RecipeProvider.RECIPE);\n }",
"public Vector match(boolean test) {\r\n Vector matchList = new Vector() ;\r\n Enumeration enum2 = ruleList.elements() ;\r\n // System.out.println(enum2.toString());\r\n while (enum2.hasMoreElements()) {\r\n Rule testRule = (Rule)enum2.nextElement() ;\r\n if (test) testRule.check() ; // test the rule antecedents\r\n if (testRule.truth == null) continue ;\r\n // fire the rule only once for now\r\n if ((testRule.truth.booleanValue() == true) &&\r\n (testRule.fired == false)) matchList.addElement(testRule) ;\r\n }\r\n displayConflictSet(matchList) ;\r\n return matchList ;\r\n }",
"@Test\n public void testOrBindingComplex() throws Exception {\n final PackageDescr pkg = ((PackageDescr) (parseResource(\"compilationUnit\", \"or_binding_complex.drl\")));\n TestCase.assertEquals(1, pkg.getRules().size());\n final RuleDescr rule = ((RuleDescr) (pkg.getRules().get(0)));\n TestCase.assertEquals(1, getDescrs().size());\n TestCase.assertEquals(1, getDescrs().size());\n final OrDescr or = ((OrDescr) (getDescrs().get(0)));\n TestCase.assertEquals(2, or.getDescrs().size());\n // first fact\n final PatternDescr firstFact = ((PatternDescr) (or.getDescrs().get(0)));\n TestCase.assertEquals(\"Person\", firstFact.getObjectType());\n TestCase.assertEquals(\"foo\", firstFact.getIdentifier());\n // second \"option\"\n final PatternDescr secondFact = ((PatternDescr) (or.getDescrs().get(1)));\n TestCase.assertEquals(\"Person\", secondFact.getObjectType());\n TestCase.assertEquals(1, getDescrs().size());\n TestCase.assertEquals(\"foo\", secondFact.getIdentifier());\n assertEqualsIgnoreWhitespace(\"System.out.println( \\\"Mark and Michael\\\" + bar );\", ((String) (rule.getConsequence())));\n }",
"public final void rule__TypeName__Alternatives() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalGo.g:3245:1: ( ( ruleIDENTIFIER ) | ( ruleQualifiedIdent ) )\r\n int alt7=2;\r\n int LA7_0 = input.LA(1);\r\n\r\n if ( (LA7_0==RULE_ID) ) {\r\n int LA7_1 = input.LA(2);\r\n\r\n if ( (LA7_1==47) ) {\r\n alt7=2;\r\n }\r\n else if ( (LA7_1==EOF||LA7_1==RULE_ID||(LA7_1>=RULE_RAW_STRING_LIT && LA7_1<=RULE_INTERPRETED_STRING_LIT)||LA7_1==42||(LA7_1>=45 && LA7_1<=46)||(LA7_1>=57 && LA7_1<=58)) ) {\r\n alt7=1;\r\n }\r\n else {\r\n if (state.backtracking>0) {state.failed=true; return ;}\r\n NoViableAltException nvae =\r\n new NoViableAltException(\"\", 7, 1, input);\r\n\r\n throw nvae;\r\n }\r\n }\r\n else if ( (LA7_0==46) ) {\r\n int LA7_2 = input.LA(2);\r\n\r\n if ( (LA7_2==RULE_ID) ) {\r\n int LA7_5 = input.LA(3);\r\n\r\n if ( (LA7_5==EOF||LA7_5==RULE_ID||(LA7_5>=RULE_RAW_STRING_LIT && LA7_5<=RULE_INTERPRETED_STRING_LIT)||LA7_5==42||(LA7_5>=45 && LA7_5<=46)||(LA7_5>=57 && LA7_5<=58)) ) {\r\n alt7=1;\r\n }\r\n else if ( (LA7_5==47) ) {\r\n alt7=2;\r\n }\r\n else {\r\n if (state.backtracking>0) {state.failed=true; return ;}\r\n NoViableAltException nvae =\r\n new NoViableAltException(\"\", 7, 5, input);\r\n\r\n throw nvae;\r\n }\r\n }\r\n else {\r\n if (state.backtracking>0) {state.failed=true; return ;}\r\n NoViableAltException nvae =\r\n new NoViableAltException(\"\", 7, 2, input);\r\n\r\n throw nvae;\r\n }\r\n }\r\n else {\r\n if (state.backtracking>0) {state.failed=true; return ;}\r\n NoViableAltException nvae =\r\n new NoViableAltException(\"\", 7, 0, input);\r\n\r\n throw nvae;\r\n }\r\n switch (alt7) {\r\n case 1 :\r\n // InternalGo.g:3246:2: ( ruleIDENTIFIER )\r\n {\r\n // InternalGo.g:3246:2: ( ruleIDENTIFIER )\r\n // InternalGo.g:3247:3: ruleIDENTIFIER\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getTypeNameAccess().getIDENTIFIERParserRuleCall_0()); \r\n }\r\n pushFollow(FOLLOW_2);\r\n ruleIDENTIFIER();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getTypeNameAccess().getIDENTIFIERParserRuleCall_0()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n break;\r\n case 2 :\r\n // InternalGo.g:3252:2: ( ruleQualifiedIdent )\r\n {\r\n // InternalGo.g:3252:2: ( ruleQualifiedIdent )\r\n // InternalGo.g:3253:3: ruleQualifiedIdent\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getTypeNameAccess().getQualifiedIdentParserRuleCall_1()); \r\n }\r\n pushFollow(FOLLOW_2);\r\n ruleQualifiedIdent();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getTypeNameAccess().getQualifiedIdentParserRuleCall_1()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n break;\r\n\r\n }\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }",
"@Override\n\tpublic void visit(RegExpMatchOperator arg0) {\n\t\t\n\t}",
"public final void ruleEString() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMyDsl.g:116:2: ( ( ( rule__EString__Alternatives ) ) )\n // InternalMyDsl.g:117:2: ( ( rule__EString__Alternatives ) )\n {\n // InternalMyDsl.g:117:2: ( ( rule__EString__Alternatives ) )\n // InternalMyDsl.g:118:3: ( rule__EString__Alternatives )\n {\n before(grammarAccess.getEStringAccess().getAlternatives()); \n // InternalMyDsl.g:119:3: ( rule__EString__Alternatives )\n // InternalMyDsl.g:119:4: rule__EString__Alternatives\n {\n pushFollow(FOLLOW_2);\n rule__EString__Alternatives();\n\n state._fsp--;\n\n\n }\n\n after(grammarAccess.getEStringAccess().getAlternatives()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public boolean match( ListExp p ) { return false; }",
"public AuxRelations(String input, ArrayList<QueryToken> tokens)\n\t{\t\n\t\t// TODO KO@MO: This only finds one relation and then breaks, is it intended? If yes, document why, if no change please.\n\t\tfor(String str: aux_words)\n\t\t{\n\t\t\tif(input.contains(\" \"+str+\" \"))\n\t\t\t{\n\t\t\t\tlog.debug(\"found auxiliary relation \"+str+\" in input \\\"\"+input+'\"');\n\t\t\t\tthis.tokens = QueryModuleLibrary.mergeTokens(tokens, input,str, \"REL1\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\t\t\n\t\tthis.tokens=tokens;\n\t}",
"public interface RuleRefableBase extends org.semanticwb.model.Referensable\r\n{\r\n /**\r\n * Referencia a un objeto de tipo Rule \r\n */\r\n public static final org.semanticwb.platform.SemanticClass swb_RuleRef=org.semanticwb.SWBPlatform.getSemanticMgr().getVocabulary().getSemanticClass(\"http://www.semanticwebbuilder.org/swb4/ontology#RuleRef\");\r\n public static final org.semanticwb.platform.SemanticProperty swb_hasRuleRef=org.semanticwb.SWBPlatform.getSemanticMgr().getVocabulary().getSemanticProperty(\"http://www.semanticwebbuilder.org/swb4/ontology#hasRuleRef\");\r\n public static final org.semanticwb.platform.SemanticProperty swb_notInheritRuleRef=org.semanticwb.SWBPlatform.getSemanticMgr().getVocabulary().getSemanticProperty(\"http://www.semanticwebbuilder.org/swb4/ontology#notInheritRuleRef\");\r\n public static final org.semanticwb.platform.SemanticProperty swb_andEvalRuleRef=org.semanticwb.SWBPlatform.getSemanticMgr().getVocabulary().getSemanticProperty(\"http://www.semanticwebbuilder.org/swb4/ontology#andEvalRuleRef\");\r\n /**\r\n * Interfaz que define propiedades para elementos que pueden referencia a reglas \r\n */\r\n public static final org.semanticwb.platform.SemanticClass swb_RuleRefable=org.semanticwb.SWBPlatform.getSemanticMgr().getVocabulary().getSemanticClass(\"http://www.semanticwebbuilder.org/swb4/ontology#RuleRefable\");\r\n\r\n public org.semanticwb.model.GenericIterator<org.semanticwb.model.RuleRef> listRuleRefs();\r\n public boolean hasRuleRef(org.semanticwb.model.RuleRef value);\r\n public org.semanticwb.model.GenericIterator<org.semanticwb.model.RuleRef> listInheritRuleRefs();\r\n\r\n /**\r\n * Adds the RuleRef\r\n * @param value An instance of org.semanticwb.model.RuleRef\r\n */\r\n public void addRuleRef(org.semanticwb.model.RuleRef value);\r\n\r\n /**\r\n * Remove all the values for the property RuleRef\r\n */\r\n public void removeAllRuleRef();\r\n\r\n /**\r\n * Remove a value from the property RuleRef\r\n * @param value An instance of org.semanticwb.model.RuleRef\r\n */\r\n public void removeRuleRef(org.semanticwb.model.RuleRef value);\r\n\r\n/**\r\n* Gets the RuleRef\r\n* @return a instance of org.semanticwb.model.RuleRef\r\n*/\r\n public org.semanticwb.model.RuleRef getRuleRef();\r\n\r\n public boolean isNotInheritRuleRef();\r\n\r\n public void setNotInheritRuleRef(boolean value);\r\n\r\n public boolean isAndEvalRuleRef();\r\n\r\n public void setAndEvalRuleRef(boolean value);\r\n}",
"@Test\n\tvoid testValidRE() {\n\t\tRegularLanguage rl[] = new RegularLanguage[lengthValid]; \n\t\tint i = 0;\n\t\tfor (String re : validRE) {\n\t\t\trl[i++] = RegularExpression.isValidRE(re);\n\t\t}\n\t\t// Should be different than null:\n\t\tfor (RegularLanguage lr : rl) {\n\t\t\tassertNotNull(lr);\n\t\t}\n\t\t// Should return a FA without error\n\t\tfor (RegularLanguage lr : rl) {\n\t\t\tlr.getFA();\n\t\t}\n\t\t\n\t\t\n\t}",
"public static void main(String[] args) {\n RegexParser regexParser = new RegexParser(new File(args[0]));\n regexParser.parseCharClasses();\n regexParser.parseTokens();\n regexParser.buildDFATable();\n // write DFA Table to file\n try {\n BufferedWriter tableWriter = new BufferedWriter(new FileWriter(new File(args[2])));\n for (int i = 0; i < regexParser.dfaTable.tableRows.size(); i++) {\n tableWriter.write(\"State\" + i);\n tableWriter.newLine();\n for (int j = 0; j < 95; j++) {\n //if (regexParser.dfaTable.tableRows.get(i).nextStates[j] != 1) {\n tableWriter.write(\" \" + (char)(j + 32) + \" \" + regexParser.dfaTable.tableRows.get(i).nextStates[j]);\n //}\n }\n tableWriter.newLine();\n }\n tableWriter.newLine();\n tableWriter.write(\"Accept States\");\n tableWriter.newLine();\n for (int j = 0; j < regexParser.dfaTable.tableRows.size(); j++) {\n for (int i = 0; i < regexParser.dfaTable.nfa.acceptStates.size(); i++) {\n if (regexParser.dfaTable.tableRows.get(j).nfaStates.contains(regexParser.dfaTable.nfa.acceptStates.get(i))) {\n tableWriter.write(\" \" + j);\n }\n }\n }\n tableWriter.close();\n }\n catch (Exception e) {\n System.out.println(\"Could not write to table file\");\n System.exit(0);\n }\n TableWalker tw = new TableWalker(regexParser.dfaTable, new File(args[1]), new File(args[3]));\n System.out.println(\"Success! Check your output files!\");\n//Part 2, piece 1: parsing the grammar\n LL1GrammarParser parser = new LL1GrammarParser(new File(args[4]), regexParser.specReader.tokens);\n parser.parseGrammar();\n\n//piece 2/3: first and follow sets \n System.out.println(\"Creating First and Follow Sets: \");\n\n LL1FFSets sets = new LL1FFSets(parser.rules);\n\n System.out.println(\"Working on the Parsing Table\");\n//piece 4/5: LL(1) parsing table and running it. Success/reject message here.\n LL1ParsingTable table = new LL1ParsingTable(sets, regexParser.specReader.tokens,tw.parsedTokens, parser.rules);\n System.out.println(table.run());\n\n\n }",
"@Test\n public void testMultiValueAnnotationsBackwardCompatibility() throws Exception {\n final String text = \"rule X @ann1( val1, val2 ) @ann2( \\\"val1\\\", \\\"val2\\\" ) when then end\";\n RuleDescr rule = ((RuleDescr) (parse(\"rule\", text)));\n AnnotationDescr ann = rule.getAnnotation(\"ann1\");\n TestCase.assertNotNull(ann);\n TestCase.assertEquals(\"val1, val2\", ann.getValue());\n ann = rule.getAnnotation(\"ann2\");\n TestCase.assertNotNull(ann);\n TestCase.assertEquals(\"\\\"val1\\\", \\\"val2\\\"\", ann.getValue());\n }",
"public void removeAllRuleRef();",
"private static String detectAliases(String string) {\n\t\treturn string\n\t\t\t\t.replaceAll(\"\\\\W?enter\\\\W?\", \"#ret)\")\n\t\t\t\t.replaceAll(\"\\\\W?tab\\\\W?\", \"#tab)\")\n\t\t\t\t.replaceAll(\"\\\\W?backspace\\\\W?\", \"#bck)\")\n\t\t\t\t.replaceAll(\"\\\\W?delete\\\\W?\", \"#del)\")\n\t\t\t\t.replaceAll(\"\\\\W?command\\\\W?\", \"#cmd)\");\n\t}",
"public GrammarRule(String left, ArrayList<String> rhs){\n\t\tthis(left, rhs, false);\n\t}",
"public final void ruleType() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMyDsl.g:91:2: ( ( ( rule__Type__Alternatives ) ) )\n // InternalMyDsl.g:92:2: ( ( rule__Type__Alternatives ) )\n {\n // InternalMyDsl.g:92:2: ( ( rule__Type__Alternatives ) )\n // InternalMyDsl.g:93:3: ( rule__Type__Alternatives )\n {\n before(grammarAccess.getTypeAccess().getAlternatives()); \n // InternalMyDsl.g:94:3: ( rule__Type__Alternatives )\n // InternalMyDsl.g:94:4: rule__Type__Alternatives\n {\n pushFollow(FOLLOW_2);\n rule__Type__Alternatives();\n\n state._fsp--;\n\n\n }\n\n after(grammarAccess.getTypeAccess().getAlternatives()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"@SuppressWarnings({ \"rawtypes\", \"unchecked\" })\n public static void main(String[] args) throws ConfigurationException,\n RuleExecutionSetCreateException, IOException,\n RuleSessionTypeUnsupportedException, RuleSessionCreateException,\n RuleExecutionSetNotFoundException, InvalidRuleSessionException,\n ClassNotFoundException, RuleExecutionSetRegisterException {\n\n String ruleEngineServiceUri = UriConstants.RULE_ENGINE_SERVICE_URI;\n\n Class.forName(UriConstants.RULE_SERVICE_PROVIDER_CLASS_NAME);\n\n RuleServiceProvider serviceProvider = RuleServiceProviderManager\n .getRuleServiceProvider(ruleEngineServiceUri);\n\n RuleAdministrator ruleAdministrator = serviceProvider\n .getRuleAdministrator();\n\n RuleEngineLog.debug(ruleAdministrator.toString());\n\n Map params = null;\n // InputStream stream = null;\n\n String bindUri = null;\n\n LogisticsRule logisticsRule = buildLogisticsRule();\n\n FlavorRule flavorRule = buildFlavorRule();\n\n RuleSet ruleSet = new RuleSet(\"multi-logisitic--ruleset\");\n\n ruleSet.addRule(logisticsRule);\n ruleSet.addRule(flavorRule);\n // ruleSet.add(logisticsRule1);\n\n RuleExecutionSet ruleExecutionSet = ruleAdministrator\n .getLocalRuleExecutionSetProvider(params).createRuleExecutionSet(\n ruleSet, null);\n\n bindUri = ruleExecutionSet.getName();\n\n ruleAdministrator.registerRuleExecutionSet(bindUri, ruleExecutionSet, null);\n\n RuleEngineLog.debug(ruleExecutionSet);\n //\n RuleRuntime ruleRunTime = serviceProvider.getRuleRuntime();\n\n StatelessRuleSession srs = (StatelessRuleSession) ruleRunTime\n .createRuleSession(bindUri, params, RuleRuntime.STATELESS_SESSION_TYPE);\n\n List inputList = new LinkedList();\n\n String productReview1 = \"一直在你们家购买,感觉奶粉是保真的。就是发货速度稍微再快一些就好了。先谢谢了\";\n\n String productReview2 = \"说什么原装进口的 但是和我原本进口的奶粉还是有区别 奶很甜 宝宝吃了这个奶粉后胃口很差 都不爱吃其他东西 本来每天定时有吃两顿饭的 现在吃了这个奶粉后 饭也不要吃了 现在一个没有开 另一罐开了放着没有喝\";\n\n ProductReview pr1 = new ProductReview(\"uid1\", productReview1);\n\n ProductReview pr2 = new ProductReview(\"uid2\", productReview2);\n\n inputList.add(pr1);\n inputList.add(pr2);\n\n // inputList.add(new String(\"Bar\"));\n // inputList.add(new Integer(5));\n // inputList.add(new Float(6));\n List resultList = srs.executeRules(inputList);\n\n // release the session\n srs.release();\n\n // System.out.println(\"executeRules: \" + resultList);\n for (Object o : resultList) {\n System.out.println(o);\n }\n\n }",
"public interface RMLMappingValidator {\n RMLValidatorResult validationResult = new RMLValidatorResult();\n\n /**\n *\n * @param triplesMapResources\n */\n public void checkTriplesMapResources(\n Map<Resource, TriplesMap> triplesMapResources);\n \n /**\n *\n * @param subjMap\n */\n public void checkSubjectMap(SubjectMap subjMap);\n\n /**\n *\n * @param triplesMap\n * @param statements\n * @param p\n * @param resource\n */\n public void checkEmptyStatements(TriplesMap triplesMap, \n List<Statement> statements, URI p, Resource resource);\n\n /**\n *\n * @param triplesMap\n * @param statements\n * @param p\n * @param termType\n */\n public void checkMultipleStatements(TriplesMap triplesMap, \n List<Statement> statements, URI p, String termType);\n\n /**\n *\n * @param constantValue\n * @param stringTemplate\n * @param referenceValue\n * @param stringValue\n * @param term\n */\n public void checkTermMap(\n Value constantValue, String stringTemplate, \n ReferenceMap referenceValue, Resource stringValue, Term term);\n\n /**\n *\n * @param resource\n * @param statements\n * @param p\n */\n public void checkStatements(\n Resource resource, List<Statement> statements, Term p);\n\n /**\n *\n * @param triplesMapSubject\n * @param iterators\n * @param referenceFormulation\n */\n public void checkIterator(\n Resource triplesMapSubject, List<Statement> iterators, \n QLVocabulary.QLTerm referenceFormulation);\n\n /**\n *\n * @param triplesMapSubject\n * @param sourceStatements\n */\n public void checkSource(\n Resource triplesMapSubject, List<Statement> sourceStatements);\n\n /**\n *\n * @param triplesMapSubject\n * @param logicalSourceStatements\n * @param triplesMap\n */\n public void checkLogicalSource(\n Resource triplesMapSubject, List<Statement> logicalSourceStatements, \n TriplesMap triplesMap);\n\n /**\n *\n * @param triplesMapSubject\n * @param statements\n */\n public void checkReferenceFormulation(Resource triplesMapSubject, \n List<Statement> statements);\n}",
"protected void compareGroundRules(List<String> expected, List<GroundRule> actual) {\n compareGroundRules(expected, actual, true);\n }",
"@Test\n public void testGetMonitorRegexPatternMap() {\n String system0 = \"system0\", system1 = \"system1\";\n String system0Rewriter0 = \"system-0-rewriter-0\", system0Rewriter1 = \"system-0-rewriter-1\", system1Rewriter =\n \"system-1-rewriter\", systemOnlyRewriter = \"system-only-rewriter\";\n String system0Rewriter0Streams = \"system-0-rewriter-0-.*\", system0Rewriter1Streams = \"system-0-rewriter-1-.*\",\n system1RewriterStreams = \"system-1-rewriter-.*\";\n JobConfig jobConfig = new JobConfig(new MapConfig(\n new ImmutableMap.Builder<String, String>().put(String.format(JobConfig.REGEX_RESOLVED_SYSTEM, system0Rewriter0),\n system0)\n .put(String.format(JobConfig.REGEX_RESOLVED_STREAMS, system0Rewriter0), system0Rewriter0Streams)\n .put(String.format(JobConfig.REGEX_RESOLVED_SYSTEM, system0Rewriter1), system0)\n .put(String.format(JobConfig.REGEX_RESOLVED_STREAMS, system0Rewriter1), system0Rewriter1Streams)\n .put(String.format(JobConfig.REGEX_RESOLVED_SYSTEM, system1Rewriter), system1)\n .put(String.format(JobConfig.REGEX_RESOLVED_STREAMS, system1Rewriter), system1RewriterStreams)\n // not passed in as a rewriter when calling getMonitorRegexPatternMap\n .put(String.format(JobConfig.REGEX_RESOLVED_SYSTEM, \"unused-rewriter\"), system0)\n .put(String.format(JobConfig.REGEX_RESOLVED_STREAMS, \"unused-rewriter\"), \"unused-rewriter-.*\")\n // should not be included since there is no regex\n .put(String.format(JobConfig.REGEX_RESOLVED_SYSTEM, systemOnlyRewriter), system0)\n .build()));\n // Pattern.equals only checks that the references are the same, so can't compare maps directly\n Map<String, Pattern> actual = jobConfig.getMonitorRegexPatternMap(String.join(\",\",\n ImmutableList.of(system0Rewriter0, system0Rewriter1, system1Rewriter, systemOnlyRewriter,\n \"not-a-regex-rewriter\")));\n // only should have rewriters for system0 and system1\n assertEquals(2, actual.size());\n assertEquals(system0Rewriter0Streams + \"|\" + system0Rewriter1Streams, actual.get(system0).pattern());\n assertEquals(system1RewriterStreams, actual.get(system1).pattern());\n\n // empty configs should produce an empty map\n jobConfig = new JobConfig(new MapConfig());\n assertEquals(Collections.<String, Pattern>emptyMap(), jobConfig.getMonitorRegexPatternMap(system0Rewriter0));\n assertEquals(Collections.<String, Pattern>emptyMap(), jobConfig.getMonitorRegexPatternMap(\"\"));\n }",
"public final void ruleUpdate() throws RecognitionException {\n\n \t\tHiddenTokens myHiddenTokenState = ((XtextTokenStream)input).setHiddenTokens(\"RULE_ML_COMMENT\", \"RULE_SL_COMMENT\", \"RULE_WS\");\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:1052:2: ( ( ( rule__Update__Alternatives ) ) )\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:1053:1: ( ( rule__Update__Alternatives ) )\n {\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:1053:1: ( ( rule__Update__Alternatives ) )\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:1054:1: ( rule__Update__Alternatives )\n {\n before(grammarAccess.getUpdateAccess().getAlternatives()); \n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:1055:1: ( rule__Update__Alternatives )\n // ../eu.quanticol.caspa.ui/src-gen/eu/quanticol/ui/contentassist/antlr/internal/InternalCASPA.g:1055:2: rule__Update__Alternatives\n {\n pushFollow(FOLLOW_rule__Update__Alternatives_in_ruleUpdate1962);\n rule__Update__Alternatives();\n\n state._fsp--;\n\n\n }\n\n after(grammarAccess.getUpdateAccess().getAlternatives()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n \tmyHiddenTokenState.restore();\n\n }\n return ;\n }",
"public static void main(String[] args) {\n\t\tString s = \"aab\";//\"aab\";//\"aaaaaa\";//\"mississpp\";//\"aaabbbccc\";\r\n\t\tString p = \"c*a*b\";//\"c*a*b\";//\"a*\";//\"mis*is*p*.\";//\"a*bb.cc*\"\r\n\r\n\t\tSystem.out.println(\"Match ? \" + isMatchLC(s, p));\r\n\r\n\t}",
"public void testUrlsWithPrefixes() throws Exception {\n SubTreeArticleIterator artIter = createSubTreeIter();\n Pattern pat = getPattern(artIter);\n\n assertNotMatchesRE(pat, \"http://www.wrong.com/2012/STUFF_07-26-12.zip!/JOU=2/VOL=2012.3/ISU=3/ART=2012_53/BodyRef/PDF/article.pdf\");\n // the RE is more permissive now to handle three different flavors of plugin - SourcePlugin, DirSourcePlugin and DeliveredSourcePlugin\n assertMatchesRE(pat, \"http://www.example.com/1066/STUFF_07-26-12.zip!/JOU=2/VOL=2012.3/ISU=3/ART=2012_53/BodyRef/PDF/article.pdf\");\n assertNotMatchesRE(pat, \"http://www.example.com/2012/STUFF_07-26-12.wrong!/JOU=2/VOL=2012.3/ISU=3/ART=2012_53/BodyRef/PDF/article.pdf\");\n assertNotMatchesRE(pat, \"http://www.example.com/2012/HDX_Y/more/JOU=2/VOL=2012.3/ISU=3/ART=2012_53/BodyRef/PDF/article.pdf\");\n assertNotMatchesRE(pat, \"http://www.example.com/2012/STUFF_07-26-12.zip!/JOU=2/VOL=2012.3/ISU=3/ART=2012_53/PDF/article.pdf\");\n assertNotMatchesRE(pat, \"http://www.example.com/2012/STUFF_07-26-12.zip!/JOU=2/VOL=2012.3/ISU=3/ART=2012_53/BodyRef/article.pdf\");\n assertNotMatchesRE(pat, \"http://www.example.com/2012/STUFF_07-26-12.zip!/JOU=2/VOL=2012.3/ISU=3/ART=2012_53/BodyRef/PDF/article.wrong\");\n assertNotMatchesRE(pat, \"http://www.example.com/2012/STUFF_07-26-12.zip!/JOU=2/VOL=2012.3/ISU=3/ART=2012_53/BodyRef/wrong/article.pdf\");\n assertNotMatchesRE(pat, \"http://www.example.com/2012/STUFF_07-26-12.zip!/JOU=2/VOL=2012.3/ISU=3/ART=2012_53/wrong/PDF/article.pdf\");\n assertMatchesRE(pat, \"http://www.example.com/2012/STUFF_07-26-12.zip!/JOU=2/VOL=2012.3/ISU=3/ART=2012_53/BodyRef/PDF/article.pdf\");\n assertMatchesRE(pat, \"http://www.example.com/2012/DIFF-STUFF_07-26-12.zip!/JOU=2/VOL=2012.3/ISU=3/ART=2012_53/BodyRef/PDF/article.pdf\");\n assertMatchesRE(pat, \"http://www.example.com/2012/STUFF_07-26-12.zip!/JOU=23/VOL=2012.2/ISU=8/ART=2012_23/BodyRef/PDF/article.pdf\");\n // DirSourcePlugin\n assertMatchesRE(pat, \"http://www.example.com/2012_1/STUFF_07-26-12.zip!/JOU=23/VOL=2012.2/ISU=8/ART=2012_23/BodyRef/PDF/article.pdf\");\n // DeliveredSourcePlugin\n assertMatchesRE(pat, \"http://www.example.com/2012/HD1_3/JOU=23.zip!/JOU=23/VOL=2012.2/ISU=8/ART=2012_23/BodyRef/PDF/article.pdf\");\n assertMatchesRE(pat, \"http://www.example.com/2012/STUFF_07-26-12.zip!/JOU=23/VOL=2012.2/ISU=8/ART=2012_23/BodyRef/PDF/article.pdf\");\n assertMatchesRE(pat, \"http://www.example.com/2012/STUFF_07-26-12.zip!/JOU=2/VOL=2012.3/ISU=2-3/ART=2012_53/BodyRef/PDF/random_article.pdf\");\n \n assertMatchesRE(pat, \"http://www.example.com/2012/STUFF_07-26-12.zip!/BSE=0304/BOK=978-3-540-35043-9/CHP=10_10.1007BFb0103161/BodyRef/PDF/978-3-540-35043-9_Chapter_10.pdf\");\n assertMatchesRE(pat, \"http://www.example.com/2012/STUFF_07-26-12.zip!/BSE=8913/BOK=978-94-6265-114-2/PRT=1/CHP=7_10.1007978-94-6265-114-2_7/BodyRef/PDF/978-94-6265-114-2_Chapter_7.pdf\");\n assertMatchesRE(pat, \"http://www.example.com/2012/STUFF_07-26-12.zip!/BOK=978-981-10-0886-3/PRT=4/CHP=12_10.1007978-981-10-0886-3_12/BodyRef/PDF/978-981-10-0886-3_Chapter_12.pdf\");\n assertMatchesRE(pat, \"http://www.example.com/2012/STUFF_07-26-12.zip!/BOK=978-981-10-0886-3/CHP=1_10.1007978-981-10-0886-3_1/BodyRef/PDF/978-981-10-0886-3_Chapter_1.pdf\");\n // but not other pdfs\n assertNotMatchesRE(pat, \"http://www.example.com/2012/STUFF_07-26-12.zip!/JOU=40273/VOL=2016.34/ISU=9/ART=430/MediaObjects/40273_2016_430_MOESM2_ESM.pdf\");\n assertNotMatchesRE(pat, \"http://www.example.com/2012/STUFF_07-26-12.zip!/JOU=12919/VOL=2016.10/ISU=S6/ART=6/12919_2016_6_CTS.pdf\");\n }",
"@Test\n public void testLHSMapping() {\n StringConcatenation _builder = new StringConcatenation();\n _builder.append(\"ePackageImport testmodel\");\n _builder.newLine();\n _builder.newLine();\n _builder.append(\"rule rulename() {\");\n _builder.newLine();\n _builder.append(\"\\t\");\n _builder.append(\"graph {\");\n _builder.newLine();\n _builder.append(\"\\t\\t\");\n _builder.append(\"node a:testmodel.type\");\n _builder.newLine();\n _builder.append(\"\\t\\t\");\n _builder.append(\"node b:testmodel.type\");\n _builder.newLine();\n _builder.append(\"\\t\\t\");\n _builder.append(\"node c:testmodel.type\");\n _builder.newLine();\n _builder.append(\"\\t\\t\");\n _builder.append(\"matchingFormula {\");\n _builder.newLine();\n _builder.append(\"\\t\\t\\t\");\n _builder.append(\"formula !conGraph\");\n _builder.newLine();\n _builder.append(\"\\t\\t\\t\");\n _builder.append(\"conditionGraph conGraph {\");\n _builder.newLine();\n _builder.append(\"\\t\\t\\t\\t\");\n _builder.append(\"node d:testmodel.type\");\n _builder.newLine();\n _builder.append(\"\\t\\t\\t\\t\");\n _builder.append(\"reuse a {\");\n _builder.newLine();\n _builder.append(\"\\t\\t\\t\\t\\t\");\n _builder.append(\"attribute=\\\"test\\\"\");\n _builder.newLine();\n _builder.append(\"\\t\\t\\t\\t\");\n _builder.append(\"}\");\n _builder.newLine();\n _builder.append(\"\\t\\t\\t\\t\");\n _builder.append(\"edges [(d->b:testmodel.type)]\");\n _builder.newLine();\n _builder.append(\"\\t\\t\\t\");\n _builder.append(\"}\");\n _builder.newLine();\n _builder.append(\"\\t\\t\");\n _builder.append(\"}\");\n _builder.newLine();\n _builder.append(\"\\t\");\n _builder.append(\"}\");\n _builder.newLine();\n _builder.append(\"}\");\n _builder.newLine();\n _builder.newLine();\n final String model = _builder.toString();\n final Procedure1<FormatterTestRequest> _function = new Procedure1<FormatterTestRequest>() {\n public void apply(final FormatterTestRequest it) {\n it.setToBeFormatted(model.replace(\"\\n\", \"\").replace(\"\\t\", \"\"));\n it.setExpectation(model);\n }\n };\n this.assertFormatted(_function);\n }",
"public Alternative() {\r\n \t\tsuper();\r\n \t\tstatus = AlternativeStatus.ATISSUE;\r\n \t\targumentsAgainst = new Vector<Argument>();\r\n \t\targumentsFor = new Vector<Argument>();\r\n \t\trelationships = new Vector<Argument>();\r\n \t\tsubDecisions = new Vector<Decision>();\r\n \t\tquestions = new Vector<Question>();\r\n \t\tartifacts = new Vector<String>();\r\n \t\targuments = new Vector<Argument>();\r\n \t\tpatternID = -1;\r\n \t}",
"private String substituteAlias(String referencedAlias,\n String referencedFunc, String aFunc) {\n\n String returnedFunc = aFunc;\n /*\n * Process single word functions first\n */\n if (!returnedFunc.contains(\"(\")) {\n if (returnedFunc.trim().equalsIgnoreCase(referencedAlias)) {\n return returnedFunc.replace(referencedAlias, referencedFunc);\n }\n return returnedFunc;\n }\n\n /*\n * Need to make sure that the number of closing and opening parenthesis\n * is the same.\n */\n int openParenthesisNumber = 0;\n int closeParenthesisNumber = 0;\n\n for (char c : returnedFunc.toCharArray()) {\n if (c == '(') {\n openParenthesisNumber++;\n } else if (c == ')') {\n closeParenthesisNumber++;\n }\n }\n\n /*\n * If the some closing parenthesis are missing add them at the end of\n * returnedFunc\n */\n if (openParenthesisNumber != closeParenthesisNumber) {\n int parenthesisDeficit = openParenthesisNumber\n - closeParenthesisNumber;\n for (int idef = 0; idef < parenthesisDeficit; idef++) {\n returnedFunc = returnedFunc + \")\";\n }\n }\n\n /*\n * Find all the words that make up our returnedFunc\n */\n String delims = \"[ (),]+\";\n String[] returnedFuncWords = returnedFunc.split(delims);\n\n /*\n * Go over each returnedFunc word and replaced each referencedAlias with\n * referencedFunc\n */\n for (String component : returnedFuncWords) {\n if (component.equalsIgnoreCase(referencedAlias)) {\n /*\n * Word that potentially needs de-aliasing found.\n */\n boolean doneDealiasing = false;\n int startInd = 0;\n while (!doneDealiasing) {\n int componentBeforePosition = returnedFunc\n .indexOf(component, startInd) - 1;\n int componentAfterPosition = componentBeforePosition\n + component.length() + 1;\n boolean isRoundedBefore = Character\n .toString(returnedFunc\n .charAt(componentBeforePosition))\n .equalsIgnoreCase(\"(\")\n || Character\n .toString(returnedFunc\n .charAt(componentBeforePosition))\n .equalsIgnoreCase(\")\")\n || Character\n .toString(returnedFunc\n .charAt(componentBeforePosition))\n .equalsIgnoreCase(\",\");\n boolean isRroundedAfter = Character\n .toString(\n returnedFunc.charAt(componentAfterPosition))\n .equalsIgnoreCase(\"(\")\n || Character\n .toString(returnedFunc\n .charAt(componentAfterPosition))\n .equalsIgnoreCase(\")\")\n || Character\n .toString(returnedFunc\n .charAt(componentAfterPosition))\n .equalsIgnoreCase(\",\");\n if (isRoundedBefore && isRroundedAfter) {\n /*\n * De-alias word since surrounded by '(', ')', or ','\n */\n StringBuilder strb = new StringBuilder();\n int startIndx = componentBeforePosition + 1;\n int endIndx = startIndx + component.length();\n int returnedFuncLen = returnedFunc.length();\n strb.append(returnedFunc, 0, startIndx);\n strb.append(referencedFunc);\n strb.append(returnedFunc, endIndx, returnedFuncLen);\n returnedFunc = strb.toString();\n doneDealiasing = true;\n } else {\n startInd = componentAfterPosition;\n }\n }\n }\n }\n\n logger.debug(\"returnedFunc=\" + returnedFunc);\n\n return returnedFunc;\n }",
"private boolean loadOtherPattern() {\n\t\tArrayList<String> listOfAlternativePatterns = new ArrayList<String>();\n\t\tArrayList<Integer> listOfValue = new ArrayList<Integer>();\n\t\t// Open otherPatterns to load\n\t\tString txtFile = \"res/otherPatterns.txt\";\n\t\tString lineRead = \"\";\n\t\tString separator = \"\\\\s*;\\\\s*\";\n\t\tStringBuilder pattern = null;\n\t\ttry (BufferedReader br = new BufferedReader(\n\t\t\t\tnew InputStreamReader(this.getClass().getClassLoader().getResourceAsStream(txtFile), \"UTF-8\"))) {\n\t\t\twhile ((lineRead = br.readLine()) != null) {\n\t\t\t\tpattern = null;\n\t\t\t\t// use comma as separator\n\t\t\t\t// constructing pattern\n\t\t\t\tif (lineRead.indexOf(\";\") >= 0) {\n\t\t\t\t\tString[] mixedTable = lineRead.split(separator);\n\t\t\t\t\t// the first value stands for representative value of the\n\t\t\t\t\t// line\n\t\t\t\t\ttry {\n\t\t\t\t\t\tlistOfValue.add(new Integer(Integer.parseInt(mixedTable[0])));\n\t\t\t\t\t} catch (NumberFormatException e) {\n\t\t\t\t\t\t// TODO: handle exception\n\t\t\t\t\t\tlistOfValue.add(null);\n\t\t\t\t\t}\n\t\t\t\t\t// the followings are possible cases\n\t\t\t\t\tpattern = new StringBuilder(\"\");\n\t\t\t\t\tfor (int i = 1; i < mixedTable.length; i++) {\n\t\t\t\t\t\tpattern.append(mixedTable[i]);\n\t\t\t\t\t\tif (i < mixedTable.length - 1) {\n\t\t\t\t\t\t\tpattern.append(\"|\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tlistOfAlternativePatterns.add(pattern.toString());\n\t\t\t\t}\n\t\t\t}\n\t\t\tbr.close();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\treturn false;\n\t\t}\n\t\tOTHER_PATTERNS = listOfAlternativePatterns.toArray(new String[listOfAlternativePatterns.size()]);\n\t\tVALUE_OF_OTHER_PATTERNS = listOfValue.toArray(new Integer[listOfValue.size()]);\n\t\treturn true;\n\t}",
"@Test\n public void testAndOrRules() throws Exception {\n final PackageDescr pkg = ((PackageDescr) (parseResource(\"compilationUnit\", \"and_or_rule.drl\")));\n TestCase.assertNotNull(pkg);\n TestCase.assertEquals(1, pkg.getRules().size());\n final RuleDescr rule = ((RuleDescr) (pkg.getRules().get(0)));\n TestCase.assertEquals(\"simple_rule\", rule.getName());\n // we will have 3 children under the main And node\n final AndDescr and = rule.getLhs();\n TestCase.assertEquals(3, and.getDescrs().size());\n PatternDescr left = ((PatternDescr) (and.getDescrs().get(0)));\n PatternDescr right = ((PatternDescr) (and.getDescrs().get(1)));\n TestCase.assertEquals(\"Person\", left.getObjectType());\n TestCase.assertEquals(\"Cheese\", right.getObjectType());\n TestCase.assertEquals(1, getDescrs().size());\n ExprConstraintDescr fld = ((ExprConstraintDescr) (getDescrs().get(0)));\n TestCase.assertEquals(\"name == \\\"mark\\\"\", fld.getExpression());\n TestCase.assertEquals(1, getDescrs().size());\n fld = ((ExprConstraintDescr) (getDescrs().get(0)));\n TestCase.assertEquals(\"type == \\\"stilton\\\"\", fld.getExpression());\n // now the \"||\" part\n final OrDescr or = ((OrDescr) (and.getDescrs().get(2)));\n TestCase.assertEquals(2, or.getDescrs().size());\n left = ((PatternDescr) (or.getDescrs().get(0)));\n right = ((PatternDescr) (or.getDescrs().get(1)));\n TestCase.assertEquals(\"Person\", left.getObjectType());\n TestCase.assertEquals(\"Cheese\", right.getObjectType());\n TestCase.assertEquals(1, getDescrs().size());\n fld = ((ExprConstraintDescr) (getDescrs().get(0)));\n TestCase.assertEquals(\"name == \\\"mark\\\"\", fld.getExpression());\n TestCase.assertEquals(1, getDescrs().size());\n fld = ((ExprConstraintDescr) (getDescrs().get(0)));\n TestCase.assertEquals(\"type == \\\"stilton\\\"\", fld.getExpression());\n assertEqualsIgnoreWhitespace(\"System.out.println( \\\"Mark and Michael\\\" );\", ((String) (rule.getConsequence())));\n }",
"public void addRule(String rulename, Rule rule, SpriteGroup[] obedients)\r\n\t{\r\n\t\tmyRuleBook.put(rulename, rule);\r\n\t\tmyRuleMap.put(rule, obedients);\r\n\t}",
"@Test\n\tpublic void test7()\n\t{\n\t\tassertEquals(\n\t\t\t\"$1: {<web> page}\\n\" +\n\t\t\t\"$2: (webpage|$1)\\n\" +\n\t\t\t\"$webpage: {<spacex> $2}\\n\" +\n\t\t\t\"$webpage: {<slashdot>}\",\n\t\t\texplodeRulesAndCreateString(\"webpage:\\n\\tspacex (webpage|(web page))\\n\\tslashdot\")\n\t\t);\n\t}",
"boolean matchDecomp(String str, String pat, String lines[]) {\n if (! EString.match(pat, \"*@* *\", lines)) {\n // no synonyms in decomp pattern\n return EString.match(str, pat, lines);\n }\n // Decomp pattern has synonym -- isolate the synonym\n String first = lines[0];\n String synWord = lines[1];\n String theRest = \" \" + lines[2];\n // Look up the synonym\n WordList syn = find(synWord);\n if (syn == null) {\n System.out.println(\"Could not fnd syn list for \" + synWord);\n return false;\n }\n for (String word : syn) {\n // Make a modified pattern\n pat = first + word + theRest;\n if (EString.match(str, pat, lines)) {\n int n = EString.count(first, '*');\n // Make room for the synonym in the match list.\n for (int j = lines.length-2; j >= n; j--)\n lines[j+1] = lines[j];\n // The synonym goes in the match list.\n lines[n] = word;\n return true;\n }\n }\n return false;\n }",
"private void addPatterns(Expression exp,\n PatternExpression p, boolean def, List<Condition> cond)\n {\n for (Condition c: cond)\n {\n List<PatternExpression> ps = new ArrayList<PatternExpression>();\n PatternExpression p0 = patternExpression(p, c.exp);\n ps.add(p0);\n if (def && !(p0 instanceof PatternExpression.DefaultPatternExp)) \n ps.add(new PatternExpression.DefaultPatternExp(new TrueExp()));\n conditions.add(c.clone(new MatchExp(transform(exp), ps)));\n }\n }",
"private void checkAndCorrectLabelReferences() {\n\t\t\n\t\tboolean madeChange;\n\t\tCodeItem codeItem = getCodeItem();\n\t\tList<Label> labels = codeItem.getLabels();\n\n\t\t// Parses all the Labels, and all the OffsetInstructions inside the Labels.\n\t\t// We stop the parsing whenever a change of instruction has been made, to restart the parsing\n\t\t// once again till everything is valid.\n\t\tdo {\n\t\t\tmadeChange = false;\n\t\t\tIterator<Label> labelIterator = labels.iterator();\n\t\t\twhile (!madeChange && labelIterator.hasNext()) {\n\t\t\t\tLabel label = labelIterator.next();\n\t\t\t\tArrayList<Instruction> instructions = label.getReferringInstructions();\n\t\n\t\t\t\tint insnIndex = 0;\n\t\t\t\tint nbInsn = instructions.size();\n\t\t\t\twhile (!madeChange && (insnIndex < nbInsn)) {\n\t\t\t\t\tInstruction insn = instructions.get(insnIndex);\n\t\t\t\t\t\n\t\t\t\t\tIOffsetInstruction offsetInsn = (IOffsetInstruction)insn;\n\t\t\t\t\tint instructionOffset = offsetInsn.getInstructionOffset();\n\t\t\t\t\t// The offset have to be divided by two, because the encoded offset is word based.\n\t\t\t\t\t// The relativeOffset is the offset for the Instruction to reach the Label.\n\t\t\t\t\t// It is negative if the Label is before the Instruction.\n\t\t\t\t\tint relativeOffset = (label.getOffset() - instructionOffset) / 2;\n\t\t\t\t\t\n\t\t\t\t\tint opcode = insn.getOpcodeByte();\n\t\t\t\t\tint maximumOffset = 0;\n\t\t\t\t\t// Check if the relative offset is valid for the instruction range. \n\t\t\t\t\tswitch (opcode) {\n\t\t\t\t\tcase 0x28: // Goto 8 bits.\n\t\t\t\t\t\tmaximumOffset = MAXIMUM_SIGNED_VALUE_8_BITS;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 0x29: // Goto 16 bits.\n\t\t\t\t\tcase 0x32: // If-test.\n\t\t\t\t\tcase 0x33:\n\t\t\t\t\tcase 0x34:\n\t\t\t\t\tcase 0x35:\n\t\t\t\t\tcase 0x36:\n\t\t\t\t\tcase 0x37:\n\t\t\t\t\tcase 0x38: // If-testz.\n\t\t\t\t\tcase 0x39:\n\t\t\t\t\tcase 0x3a:\n\t\t\t\t\tcase 0x3b:\n\t\t\t\t\tcase 0x3c:\n\t\t\t\t\tcase 0x3d:\n\t\t\t\t\t\tmaximumOffset = MAXIMUM_SIGNED_VALUE_16_BITS;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 0x2a: // Goto 32 bits.\n\t\t\t\t\tcase 0x2b: // Packed Switch.\n\t\t\t\t\tcase 0x2c: // Sparse Switch.\n\t\t\t\t\t\tmaximumOffset = MAXIMUM_SIGNED_VALUE_32_BITS;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\ttry { throw new Exception(\"Opcode error : 0x\" + Integer.toHexString(opcode)); } catch (Exception e) { e.printStackTrace(); }\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tint minimumOffset = -maximumOffset - 1;\n\t\t\t\t\t\n\t\t\t\t\tif ((relativeOffset < minimumOffset) || (relativeOffset > maximumOffset)) {\n\t\t\t\t\t\t// Must change to an Instruction with a bigger range. This is only possible for\n\t\t\t\t\t\t// the GOTO 8/16 bits.\n\t\t\t\t\t\tif ((opcode == Opcodes.INSN_GOTO) || (opcode == Opcodes.INSN_GOTO_16)) {\n\t\t\t\t\t\t\tInstruction newInsn;\n\t\t\t\t\t\t\t// Change to 16 or 32 bits ?\n\t\t\t\t\t\t\tif ((relativeOffset > MAXIMUM_SIGNED_VALUE_16_BITS) || (relativeOffset < MINIMUM_SIGNED_VALUE_16_BITS)) {\n\t\t\t\t\t\t\t\t// 32 bits.\n\t\t\t\t\t\t\t\tnewInsn = new InstructionFormat30T(Opcodes.INSN_GOTO_32, label, instructionOffset);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// 16 bits.\n\t\t\t\t\t\t\t\tnewInsn = new InstructionFormat20T(Opcodes.INSN_GOTO_16, label, instructionOffset);\n\t\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\t\t// Removes the instruction from the codeItem and replaces it with the new one.\n\t\t\t\t\t\t\tcodeItem.replaceInstructions(insn, newInsn);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Replaces the old instruction with the new one in the Label Instructions list.\n\t\t\t\t\t\t\tinstructions.remove(insnIndex);\n\t\t\t\t\t\t\tinstructions.add(insnIndex, newInsn);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Shifts all the Jump related instructions and the labels AFTER this instruction.\n\t\t\t\t\t\t\tshiftOffsetInstructionsAndLabels(instructionOffset, newInsn.getSize() - insn.getSize());\n\t\t\t\t\t\t\tmadeChange = true;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttry { throw new IllegalArgumentException(\"Instruction Range extension unhandled. Opcode : 0x\" + Integer.toHexString(opcode)); } catch (Exception e) { e.printStackTrace(); }\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tinsnIndex++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t} while (madeChange);\n\t}",
"private void analyzeLiterals() {\n\t\t\n\t\tint lastLength = 0;\n\t\tfor(int i = 0; i < literalsList.size(); ++i) {\n\t\t\t// Update lengths of literals array with indexes\n\t\t\tif(lastLength != literalsList.get(i).length() - 5) {\n\t\t\t\tindexes.add(i);\n\t\t\t\tlengths.add(literalsList.get(i).length() - 5); // -5 for \"\"@en\n\t\t\t}\n\t\t\tlastLength = literalsList.get(i).length() - 5;\n\t\t\t\n\t\t}\n\t\t\n\t}",
"@Test\n public void testOptimise_6() throws InvalidRegexpException {\n BasicRegexp re1 = BasicRegexp.parseRegexp(\"a|a|b\");\n BasicRegexp re2 = BasicRegexp.parseRegexp(\"b|a|a\");\n BasicRegexp re3 = BasicRegexp.parseRegexp(\"(b|b)*|(a|a)*|a*\");\n BasicRegexp re4 = BasicRegexp.parseRegexp(\"(c|b|b)*|(a|a)*|a*\");\n BasicRegexp re5 = BasicRegexp.parseRegexp(\"a*b*|a*b*\");\n\n assertEquals(re1.optimise(BasicRegexp.OPTIMISE_ALL, -1).toString(),\n \"a|b\");\n assertEquals(re2.optimise(BasicRegexp.OPTIMISE_ALL, -1).toString(),\n \"b|a\");\n assertEquals(re3.optimise(BasicRegexp.OPTIMISE_ALL, -1).toString(),\n \"b*|a*\");\n assertEquals(re4.optimise(BasicRegexp.OPTIMISE_ALL, -1).toString(),\n \"(c|b)*|a*\");\n assertEquals(re5.optimise(BasicRegexp.OPTIMISE_ALL, -1).toString(),\n \"a*b*\");\n }",
"private void explore(RuleContext ctx) {\n if (ctx.getChildCount() != 1) {\n String ruleName = Python3Parser.ruleNames[ctx.getRuleIndex()];\n astRepresenation.append(ruleName);\n astRepresenation.append(\": \");\n astRepresenation.append(ctx.getText());\n astRepresenation.append(\"\\n\");\n }\n for (int i = 0; i < ctx.getChildCount(); i++) {\n ParseTree element = ctx.getChild(i);\n if (element instanceof RuleContext) {\n explore((RuleContext) element);\n }\n }\n }",
"private Suggestion buildSuggestion(String linearization,\n Interpretation interpretation,\n Map<String, WordType> originalWords, boolean matchAllWords) {\n String[] words = linearization.split(\"\\\\s+\");\n\n Map<String, Integer> namesMissing = new HashMap(\n interpretation.getNameTypeCounts().counts);\n\n int additionalNamesCount = 0;\n\n Set<String> wordsNotMatched = new HashSet<>(originalWords.keySet());\n for (Entry<String, WordType> entry : originalWords.entrySet()) {\n if (entry.getValue() == WordType.Name) {\n wordsNotMatched.remove(entry.getKey());\n }\n }\n int additionalGrammarWordsCount = 0;\n\n\n for (String word : words) {\n\n //name word\n if (defTempl.isVariable(word)) {\n String nameType = word.substring(2, word.length() - 2);\n if (namesMissing.containsKey(nameType)) {\n Integer missingCount = namesMissing.get(nameType);\n if (missingCount > 1) {\n namesMissing.put(nameType, missingCount - 1);\n }\n else {\n namesMissing.remove(nameType);\n }\n }\n else {\n additionalNamesCount++;\n }\n }\n //grammar word\n else {\n String lowerCaseWord = word.toLowerCase();\n\n if (wordsNotMatched.contains(lowerCaseWord)) {\n wordsNotMatched.remove(lowerCaseWord);\n }\n else {\n additionalGrammarWordsCount++;\n }\n }\n }\n\n //if removing words from query is not allowed\n if (matchAllWords && !wordsNotMatched.isEmpty()) {\n return null;\n }\n\n int grammarWordsAltered = wordsNotMatched.size();\n int grammarWordsAdded = additionalGrammarWordsCount - grammarWordsAltered;\n\n return new Suggestion(linearization, false,\n additionalNamesCount, grammarWordsAdded, grammarWordsAltered);\n }",
"@Override\n public String getDescription() {\n return \"Alias assignment\";\n }",
"public static void main(String[] args) {\r\n\r\n\tAlternation a = new Alternation();\r\n\t\r\n\ta.add(new Literal(\"steaming\"));\r\n\ta.add(new Literal(\"hot\"));\r\n\r\n\tRepetition adjectives = new Repetition(a);\r\n\r\n\tTokenAssembly ta = \r\n\t\tnew TokenAssembly(\"hot hot steaming hot coffee\");\r\n\t\r\n\tSystem.out.println(adjectives.bestMatch(ta));\r\n}",
"public final void rule__Widget__Alternatives() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.eclipse.ese.android.dsl.ui/src-gen/org/eclipse/ese/ui/contentassist/antlr/internal/InternalAndroid.g:311:1: ( ( ruleText ) | ( ruleSpinner ) | ( ruleLink ) )\n int alt2=3;\n switch ( input.LA(1) ) {\n case 15:\n {\n alt2=1;\n }\n break;\n case 16:\n {\n alt2=2;\n }\n break;\n case 17:\n {\n alt2=3;\n }\n break;\n default:\n NoViableAltException nvae =\n new NoViableAltException(\"307:1: rule__Widget__Alternatives : ( ( ruleText ) | ( ruleSpinner ) | ( ruleLink ) );\", 2, 0, input);\n\n throw nvae;\n }\n\n switch (alt2) {\n case 1 :\n // ../org.eclipse.ese.android.dsl.ui/src-gen/org/eclipse/ese/ui/contentassist/antlr/internal/InternalAndroid.g:312:1: ( ruleText )\n {\n // ../org.eclipse.ese.android.dsl.ui/src-gen/org/eclipse/ese/ui/contentassist/antlr/internal/InternalAndroid.g:312:1: ( ruleText )\n // ../org.eclipse.ese.android.dsl.ui/src-gen/org/eclipse/ese/ui/contentassist/antlr/internal/InternalAndroid.g:313:1: ruleText\n {\n before(grammarAccess.getWidgetAccess().getTextParserRuleCall_0()); \n pushFollow(FollowSets000.FOLLOW_ruleText_in_rule__Widget__Alternatives599);\n ruleText();\n _fsp--;\n\n after(grammarAccess.getWidgetAccess().getTextParserRuleCall_0()); \n\n }\n\n\n }\n break;\n case 2 :\n // ../org.eclipse.ese.android.dsl.ui/src-gen/org/eclipse/ese/ui/contentassist/antlr/internal/InternalAndroid.g:318:6: ( ruleSpinner )\n {\n // ../org.eclipse.ese.android.dsl.ui/src-gen/org/eclipse/ese/ui/contentassist/antlr/internal/InternalAndroid.g:318:6: ( ruleSpinner )\n // ../org.eclipse.ese.android.dsl.ui/src-gen/org/eclipse/ese/ui/contentassist/antlr/internal/InternalAndroid.g:319:1: ruleSpinner\n {\n before(grammarAccess.getWidgetAccess().getSpinnerParserRuleCall_1()); \n pushFollow(FollowSets000.FOLLOW_ruleSpinner_in_rule__Widget__Alternatives616);\n ruleSpinner();\n _fsp--;\n\n after(grammarAccess.getWidgetAccess().getSpinnerParserRuleCall_1()); \n\n }\n\n\n }\n break;\n case 3 :\n // ../org.eclipse.ese.android.dsl.ui/src-gen/org/eclipse/ese/ui/contentassist/antlr/internal/InternalAndroid.g:324:6: ( ruleLink )\n {\n // ../org.eclipse.ese.android.dsl.ui/src-gen/org/eclipse/ese/ui/contentassist/antlr/internal/InternalAndroid.g:324:6: ( ruleLink )\n // ../org.eclipse.ese.android.dsl.ui/src-gen/org/eclipse/ese/ui/contentassist/antlr/internal/InternalAndroid.g:325:1: ruleLink\n {\n before(grammarAccess.getWidgetAccess().getLinkParserRuleCall_2()); \n pushFollow(FollowSets000.FOLLOW_ruleLink_in_rule__Widget__Alternatives633);\n ruleLink();\n _fsp--;\n\n after(grammarAccess.getWidgetAccess().getLinkParserRuleCall_2()); \n\n }\n\n\n }\n break;\n\n }\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public final void rule__AlgoType__Alternatives() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMLRegression.g:796:1: ( ( ruleLineRegress ) | ( ruleSVR ) | ( ruleDecisionTreeRegressor ) )\n int alt5=3;\n switch ( input.LA(1) ) {\n case 11:\n {\n alt5=1;\n }\n break;\n case 13:\n {\n alt5=2;\n }\n break;\n case 12:\n {\n alt5=3;\n }\n break;\n default:\n NoViableAltException nvae =\n new NoViableAltException(\"\", 5, 0, input);\n\n throw nvae;\n }\n\n switch (alt5) {\n case 1 :\n // InternalMLRegression.g:797:2: ( ruleLineRegress )\n {\n // InternalMLRegression.g:797:2: ( ruleLineRegress )\n // InternalMLRegression.g:798:3: ruleLineRegress\n {\n before(grammarAccess.getAlgoTypeAccess().getLineRegressParserRuleCall_0()); \n pushFollow(FOLLOW_2);\n ruleLineRegress();\n\n state._fsp--;\n\n after(grammarAccess.getAlgoTypeAccess().getLineRegressParserRuleCall_0()); \n\n }\n\n\n }\n break;\n case 2 :\n // InternalMLRegression.g:803:2: ( ruleSVR )\n {\n // InternalMLRegression.g:803:2: ( ruleSVR )\n // InternalMLRegression.g:804:3: ruleSVR\n {\n before(grammarAccess.getAlgoTypeAccess().getSVRParserRuleCall_1()); \n pushFollow(FOLLOW_2);\n ruleSVR();\n\n state._fsp--;\n\n after(grammarAccess.getAlgoTypeAccess().getSVRParserRuleCall_1()); \n\n }\n\n\n }\n break;\n case 3 :\n // InternalMLRegression.g:809:2: ( ruleDecisionTreeRegressor )\n {\n // InternalMLRegression.g:809:2: ( ruleDecisionTreeRegressor )\n // InternalMLRegression.g:810:3: ruleDecisionTreeRegressor\n {\n before(grammarAccess.getAlgoTypeAccess().getDecisionTreeRegressorParserRuleCall_2()); \n pushFollow(FOLLOW_2);\n ruleDecisionTreeRegressor();\n\n state._fsp--;\n\n after(grammarAccess.getAlgoTypeAccess().getDecisionTreeRegressorParserRuleCall_2()); \n\n }\n\n\n }\n break;\n\n }\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"private void extractRelatedTriples(Formula context, N3Element.Object ref) {\n\t\tif (ref instanceof Exvar) {\n\t\t\tRDFResource sub = context.get(ref.toString());\n\t\t\tif (sub != null) {\n\t\t\t\trelated.add(sub);\n\t\t\t\tfor (VerbObject obj : sub.verbObjects) {\n\t\t\t\t\textractRelatedTriples(context, obj.object);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (ref instanceof List) {\n\t\t\tfor (Object o : (List<?>) ref) {\n\t\t\t\tif (o instanceof N3Element.Object) {\n\t\t\t\t\textractRelatedTriples(context, (N3Element.Object) o);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public GrammarRule(String left, ArrayList<String> rhs, double weight){\n\t\tthis.lhs = left;\n\t\tthis.rhs = rhs;\n\t\tthis.weight = weight;\n\t}",
"@SuppressWarnings(\"unchecked\")\r\npublic static void ruleResolvePronouns(AnnotationSet basenp, Document doc)\r\n{\n Annotation[] basenpArray = basenp.toArray();\r\n\r\n // Initialize coreference clusters\r\n int maxID = basenpArray.length;\r\n\r\n // Create an array of pointers\r\n // clust = new UnionFind(maxID);\r\n fvm = new RuleResolvers.FeatureVectorMap();\r\n ptrs = new int[maxID];\r\n clusters = new HashSet[maxID];\r\n for (int i = 0; i < clusters.length; i++) {\r\n ptrs[i] = i;\r\n HashSet<Annotation> cluster = new HashSet<Annotation>();\r\n cluster.add(basenpArray[i]);\r\n clusters[i] = cluster;\r\n }\r\n Annotation zero = new Annotation(-1, -1, -1, \"zero\");\r\n\r\n for (int i = 1; i < basenpArray.length; i++) {\r\n Annotation np2 = basenpArray[i];\r\n if (FeatureUtils.isPronoun(np2, doc)) {\r\n Annotation ant = ruleResolvePronoun(basenpArray, i, doc);\r\n if (ant != null) {\r\n np2.setProperty(Property.PRO_ANTES, ant);\r\n }\r\n else {\r\n np2.setProperty(Property.PRO_ANTES, zero);\r\n }\r\n }\r\n }\r\n}",
"@Test\n public void testOptimise_8() throws InvalidRegexpException {\n BasicRegexp re1 = BasicRegexp.parseRegexp(\"(a|b)*(b|a)*\");\n BasicRegexp re2 = BasicRegexp.parseRegexp(\"(c|d)*|(d|c)*\");\n\n assertEquals(re1.optimise(BasicRegexp.OPTIMISE_ALL, -1).toString(),\n \"(a|b)*\");\n assertEquals(re2.optimise(BasicRegexp.OPTIMISE_ALL, -1).toString(),\n \"(c|d)*\");\n\n }",
"public final void rule__Element__Alternatives() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalGo.g:4250:1: ( ( ruleExpression ) | ( ruleLiteralValue ) )\r\n int alt44=2;\r\n int LA44_0 = input.LA(1);\r\n\r\n if ( ((LA44_0>=RULE_STRING && LA44_0<=RULE_FLOAT_LIT)||(LA44_0>=RULE_UNARY_OP && LA44_0<=RULE_BOOLEAN_LIT)||(LA44_0>=45 && LA44_0<=46)||LA44_0==48||(LA44_0>=51 && LA44_0<=52)||LA44_0==54||LA44_0==56||(LA44_0>=60 && LA44_0<=63)) ) {\r\n alt44=1;\r\n }\r\n else if ( (LA44_0==57) ) {\r\n alt44=2;\r\n }\r\n else {\r\n if (state.backtracking>0) {state.failed=true; return ;}\r\n NoViableAltException nvae =\r\n new NoViableAltException(\"\", 44, 0, input);\r\n\r\n throw nvae;\r\n }\r\n switch (alt44) {\r\n case 1 :\r\n // InternalGo.g:4251:2: ( ruleExpression )\r\n {\r\n // InternalGo.g:4251:2: ( ruleExpression )\r\n // InternalGo.g:4252:3: ruleExpression\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getElementAccess().getExpressionParserRuleCall_0()); \r\n }\r\n pushFollow(FOLLOW_2);\r\n ruleExpression();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getElementAccess().getExpressionParserRuleCall_0()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n break;\r\n case 2 :\r\n // InternalGo.g:4257:2: ( ruleLiteralValue )\r\n {\r\n // InternalGo.g:4257:2: ( ruleLiteralValue )\r\n // InternalGo.g:4258:3: ruleLiteralValue\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getElementAccess().getLiteralValueParserRuleCall_1()); \r\n }\r\n pushFollow(FOLLOW_2);\r\n ruleLiteralValue();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getElementAccess().getLiteralValueParserRuleCall_1()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n break;\r\n\r\n }\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }",
"private Suggestion getBestLinearization(List<String> linearizations,\n Interpretation interpretation,\n Map<String, WordType> originalWords, boolean matchAllWords) {\n\n Suggestion best = null;\n\n for (String current : linearizations) {\n Suggestion suggestion = buildSuggestion(\n current, interpretation,\n originalWords, matchAllWords);\n\n if (suggestion != null) {\n if (best == null) {\n best = suggestion;\n }\n else {\n if (suggestionComparator.compare(best, suggestion) > 0) {\n best = suggestion;\n }\n }\n }\n }\n\n return best;\n }",
"@ExtractionRegistration(mimeType = ANTLR_MIME_TYPE,\n entryPoint = ANTLRv4Parser.GrammarFileContext.class)\n public static void populateBuilder(ExtractorBuilder<? super ANTLRv4Parser.GrammarFileContext> bldr) {\n bldr.wrappingExtractionWith(runner -> {\n try {\n // Set up the cache before each extraction\n ALT_CACHE.set(new HashMap<>(32));\n SET_CACHE.set(new HashMap<>(32));\n SCANNED.set(Bool.create());\n return runner.get();\n } finally {\n // And tear it down\n ALT_CACHE.remove();\n SET_CACHE.remove();\n SCANNED.remove();\n }\n }).extractingRegionsUnder(OUTER_ALTERNATIVES_WITH_SIBLINGS)\n .whenRuleType(ParserRuleDefinitionContext.class)\n .extractingKeyAndBoundsWith((ParserRuleDefinitionContext alt, BiPredicate<AlternativeKey, int[]> bip) -> {\n\n Bool scanned = SCANNED.get();\n assert scanned != null : \"Wrapper not called\";\n Map<ParserRuleDefinitionContext, AlternativeKeyWithOffsets> altsForRules = SET_CACHE.get();\n if (!scanned.getAsBoolean()) {\n // if the first run, shoot off our visitors and collect\n // what we need to know\n try {\n Map<ParserRuleAlternativeContext, AlternativeKeyWithOffsets> altsForAlts = ALT_CACHE.get();\n assert altsForAlts != null : \"Wrapper not called\";\n GrammarFileContext top = TreeUtils.ancestor(alt, ANTLRv4Parser.GrammarFileContext.class);\n SetFinder setFinder = new SetFinder();\n Map<ParserRuleDefinitionContext, AlternativeKeyWithOffsets> overarchingAlts = top.accept(setFinder);\n AlternativeFinder v = new AlternativeFinder(overarchingAlts);\n Map<ParserRuleAlternativeContext, AlternativeStub> keys = top.accept(v);\n altsForAlts.putAll(toKeys(keys));\n altsForRules.putAll(overarchingAlts);\n } finally {\n scanned.set();\n }\n }\n // Get the item for this *entire* rule - our grammar treats\n // as alternatives some elements that Antlr treats as a single\n // unit - specifically, a rule which contains only or-separated\n // token rules is a SET, not a collection of individual alternatives.\n // So these get a single item for the entire rule, and nothing for\n // any ParserRuleAlternativeContexts they contain\n AlternativeKeyWithOffsets ak = altsForRules.get(alt);\n if (ak != null) {\n return bip.test(ak.key, new int[]{ak.start, ak.stop + 1});\n }\n return false;\n })\n .whenRuleType(ParserRuleAlternativeContext.class)\n .extractingKeyAndBoundsWith((ParserRuleAlternativeContext alt, BiPredicate<AlternativeKey, int[]> bip) -> {\n // Get the item for an alternative down inside a rule\n ParserRuleLabeledAlternativeContext lab = TreeUtils.ancestor(alt, ParserRuleLabeledAlternativeContext.class);\n Map<ParserRuleAlternativeContext, AlternativeKeyWithOffsets> info = ALT_CACHE.get();\n assert info != null : \"Wrapper not called\";\n AlternativeKeyWithOffsets altern = info.get(alt);\n if (altern != null) {\n return bip.test(altern.key, new int[]{altern.start, altern.stop});\n }\n return false;\n }).finishRegionExtractor();\n }"
] | [
"0.5104273",
"0.5093072",
"0.50929695",
"0.5089387",
"0.50639516",
"0.5034386",
"0.5023303",
"0.50076985",
"0.499085",
"0.49775252",
"0.49746248",
"0.49659657",
"0.49533522",
"0.49226502",
"0.4866332",
"0.48659715",
"0.48341024",
"0.48291928",
"0.48272493",
"0.4813535",
"0.48071784",
"0.48018214",
"0.4794098",
"0.4766378",
"0.47638375",
"0.47637674",
"0.47472584",
"0.47449842",
"0.47217336",
"0.47211525",
"0.4693929",
"0.4689946",
"0.4687783",
"0.46559092",
"0.4654709",
"0.46518162",
"0.46478367",
"0.4647807",
"0.4645296",
"0.46392536",
"0.46322682",
"0.46298277",
"0.4625085",
"0.46225888",
"0.46180305",
"0.4615391",
"0.46111387",
"0.4603644",
"0.45867237",
"0.4579314",
"0.4577758",
"0.45770672",
"0.45759207",
"0.45660686",
"0.4565899",
"0.4558263",
"0.45571858",
"0.4553402",
"0.45493156",
"0.45492527",
"0.45433486",
"0.45385575",
"0.4528919",
"0.45283473",
"0.45267996",
"0.4522582",
"0.45225286",
"0.4522192",
"0.4520973",
"0.45199233",
"0.4505296",
"0.45008808",
"0.449999",
"0.44980794",
"0.44856042",
"0.4481145",
"0.4479725",
"0.44783455",
"0.4473901",
"0.44618955",
"0.4461226",
"0.4457717",
"0.4456749",
"0.44498992",
"0.44469845",
"0.44448727",
"0.44407892",
"0.44296876",
"0.44260737",
"0.44225633",
"0.44171378",
"0.44152182",
"0.4413693",
"0.43972683",
"0.43967402",
"0.43928763",
"0.4389745",
"0.43857026",
"0.43764398",
"0.43744925"
] | 0.60948676 | 0 |
Flattens rule into a regex or string literal. When a cyclic rule is detected (references itself), an exception is raised. | private static FlatLexerRule flattenLexerRule(Rule rule, Map<String, Rule> rules) {
// Because some rules were resolved as a dependency of another rule,
// it might happen that it is already flattened.
if (rule instanceof FlatLexerRule) {
return (FlatLexerRule) rule;
}
if (rule instanceof UnresolvedLexerRule) {
throw new IngridParserException(
"Rule '" + rule.name + "' must be resolved before flattening");
}
LexerRule lexerRule = (LexerRule) rule;
// If we have only one element, we might be looking at a literal rule..
// We count all elements of all alternatives:
if (lexerRule.alternatives.size() == 1 && lexerRule.alternatives.get(0).size() == 1) {
Rule only = lexerRule.alternatives.get(0).get(0);
if (only instanceof LiteralRule) {
return new LiteralRule(rule.name, ((LiteralRule) only).value);
}
}
// We can construct one big regex out of sub rules
List<List<String>> regexs = new ArrayList<>();
// Gather all sub rule contents (or resolve them, if wasn't resolved before)
for (List<Rule> alternative : lexerRule.alternatives) {
List<String> subRegex = new ArrayList<>();
for (Rule element : alternative) {
// Is each sub element already resolved?
if (!(element instanceof FlatLexerRule)) {
if (element instanceof QuantifierRule) {
int lastIndex = subRegex.size() - 1;
if (lastIndex < 0) {
throw new IngridParserException("Quantifier suffix found with no prefix regex");
}
// If more characters, we might need braces
// There are cases where we might not, such as [A-Z] or (foo), so might be improved a little
// It's tricky though, because of cases such as [A-Z][a-z], so simple heuristics is not enough
String prevRegex = subRegex.get(lastIndex);
if (prevRegex.length() > 1) {
prevRegex = '(' + prevRegex + ')';
}
// We append it to the previous rule
String quantifier = ((QuantifierRule) element).quantity.toString();
subRegex.set(lastIndex, prevRegex + quantifier);
} else if(element instanceof BlockStartRule) {
subRegex.add("(");
} else if(element instanceof BlockEndRule) {
subRegex.add(")");
} else if(element instanceof BlockAltRule) {
subRegex.add("|");
} else if (element instanceof UnresolvedLexerRule) {
if (!rules.containsKey(element.name)) {
throw new UnresolvableRuleException("Failed to resolve lexer rule '" + element.name + "'");
}
try {
FlatLexerRule flatRule = flattenLexerRule(rules.get(element.name), rules);
rules.put(element.name, flatRule);
subRegex.add(flatRule.getContent());
} catch (StackOverflowError t) {
throw new IngridParserException(
"Lexer rule '" + rule.name + "' or some of its subrules is recursive! " +
"Ingrid cannot handle cyclic rules :(");
}
} else {
throw new IngridParserException(
"Rule '" + element.name + "' (" + element.getClass().getSimpleName() + ") failed to be flattened");
}
} else {
// We need to escape literal rule
// e.g. <?xml to <\?xml
String regex;
if (element instanceof LiteralRule) {
regex = escapeLiteral((LiteralRule) element);
} else {
regex = ((FlatLexerRule) element).getContent();
}
subRegex.add(regex);
}
}
regexs.add(subRegex);
}
// Build regex from gathered strings
return new RegexRule(rule.name, buildLexerRegex(regexs));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public java.lang.String getRule() {\n java.lang.Object ref = rule_;\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 rule_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"public java.lang.String getRule() {\n java.lang.Object ref = rule_;\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 rule_ = s;\n return s;\n }\n }",
"static String escapeLiteral(LiteralRule rule) {\n String specialChars = \".[]{}()*+-?^$|\";\n StringBuilder sb = new StringBuilder();\n\n for (int i = 0; i < rule.value.length(); ++i) {\n char c = rule.value.charAt(i);\n if (specialChars.indexOf(c) != -1) {\n sb.append(\"\\\\\");\n }\n\n sb.append(c);\n }\n\n return sb.toString();\n }",
"java.lang.String getRule();",
"private String regex(Edge e) {\n return EdgeWriter.toRegex(e, false /* use dot match */);\n }",
"public com.google.protobuf.ByteString\n getRuleBytes() {\n java.lang.Object ref = rule_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n rule_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public com.google.protobuf.ByteString\n getRuleBytes() {\n java.lang.Object ref = rule_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n rule_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public final String toXML(PatternRule rule) {\n final StringBuilder sb = new StringBuilder();\n sb.append(\"<rule id=\\\"\");\n sb.append(StringTools.escapeXML(rule.getId()));\n sb.append(\"\\\" name=\\\"\");\n sb.append(StringTools.escapeXML(rule.getDescription()));\n sb.append(\"\\\">\\n\");\n sb.append(\"<pattern mark_from=\\\"\");\n sb.append(rule.startPositionCorrection);\n sb.append(\"\\\" mark_to=\\\"\");\n sb.append(rule.endPositionCorrection);\n sb.append('\"');\n // for now, case sensitivity is per pattern, not per element,\n // so just use the setting of the first element:\n if (!rule.patternElements.isEmpty() && rule.patternElements.get(0).getCaseSensitive()) {\n sb.append(\" case_sensitive=\\\"yes\\\"\");\n }\n sb.append(\">\\n\");\n for (Element patternElement : rule.patternElements) {\n sb.append(\"<token\");\n if (patternElement.getNegation()) {\n sb.append(\" negate=\\\"yes\\\"\");\n }\n if (patternElement.isRegularExpression()) {\n sb.append(\" regexp=\\\"yes\\\"\");\n }\n if (patternElement.getPOStag() != null) {\n sb.append(\" postag=\\\"\");\n sb.append(patternElement.getPOStag());\n sb.append('\"');\n }\n if (patternElement.getPOSNegation()) {\n sb.append(\" negate_pos=\\\"yes\\\"\");\n }\n if (patternElement.isInflected()) {\n sb.append(\" inflected=\\\"yes\\\"\");\n }\n sb.append('>');\n if (patternElement.getString() != null) {\n sb.append(StringTools.escapeXML(patternElement.getString()));\n } else {\n // TODO\n }\n sb.append(\"</token>\\n\");\n }\n sb.append(\"</pattern>\\n\");\n sb.append(\"<message>\");\n sb.append(StringTools.escapeXML(rule.getMessage()));\n sb.append(\"</message>\\n\");\n if (rule.getIncorrectExamples() != null) {\n for (IncorrectExample example : rule.getIncorrectExamples()) {\n sb.append(\"<example type=\\\"incorrect\\\">\");\n sb.append(StringTools.escapeXML(example.getExample()));\n sb.append(\"</example>\\n\");\n }\n }\n if (rule.getCorrectExamples() != null) {\n for (String example : rule.getCorrectExamples()) {\n sb.append(\"<example type=\\\"correct\\\">\");\n sb.append(StringTools.escapeXML(example));\n sb.append(\"</example>\\n\");\n }\n }\n sb.append(\"</rule>\");\n return sb.toString();\n }",
"private static String adaptRegEx(Mode mode, String regex, int flagMask, boolean removeWhitespace)\n throws QueryException {\n StringBuilder sb = new StringBuilder();\n boolean escaped = false;\n boolean groupStart = false;\n int completeGroups = 0;\n int backRef = 0;\n int charClassDepth = 0;\n int groupDepth = 0;\n\n for (char c : regex.toCharArray()) {\n if (escaped) {\n if (backRef == 0 && c == '0') {\n throw new QueryException(ErrorCode.ERR_INVALID_REGULAR_EXPRESSION, \"Reference to group 0 not allowed\");\n } else if (c >= '0' && c <= '9') {\n if (charClassDepth > 0) {\n throw new QueryException(ErrorCode.ERR_INVALID_REGULAR_EXPRESSION,\n \"Back references in character class expressions\" + \" are disallowed.\");\n }\n backRef = backRef * 10 + Integer.parseInt(Character.toString(c));\n continue;\n }\n }\n\n if (backRef > 0) {\n // Check back reference that just ended\n if (backRef > completeGroups) {\n throw new QueryException(ErrorCode.ERR_INVALID_REGULAR_EXPRESSION,\n \"Back reference to nonexisting or unfinished group.\");\n } else {\n backRef = 0;\n escaped = false;\n }\n }\n\n if (c == '\\\\' && !escaped) {\n // Not preceded by backslash\n escaped = true;\n groupStart = false;\n continue;\n }\n\n if (c == '(' && !escaped) {\n groupStart = true;\n groupDepth++;\n escaped = false;\n continue;\n }\n\n if (c == '?' && !escaped && groupStart) {\n throw new QueryException(ErrorCode.ERR_INVALID_REGULAR_EXPRESSION,\n \"Pure groups are not supported in XQuery regular expressions.\");\n } else if (c == ')' && !escaped) {\n if (--groupDepth < 0) {\n throw new QueryException(ErrorCode.ERR_INVALID_REGULAR_EXPRESSION, \"Invalid sequence of brackets.\");\n }\n completeGroups++;\n } else if (c == '[' && !escaped) {\n charClassDepth++;\n } else if (c == ']' && !escaped) {\n if (--charClassDepth < 0) {\n throw new QueryException(ErrorCode.ERR_INVALID_REGULAR_EXPRESSION, \"Invalid sequence of brackets.\");\n }\n } else if (removeWhitespace) {\n // Remove whitespace outside of character classes\n if (charClassDepth == 0 && WHITESPACE.contains(c)) {\n // Don't touch boolean flags\n continue;\n }\n\n sb.append(c);\n }\n\n groupStart = false;\n escaped = false;\n }\n\n // Check for trailing '\\' (only valid with subsequent characters)\n if (escaped && backRef == 0) {\n throw new QueryException(ErrorCode.ERR_INVALID_REGULAR_EXPRESSION, \"Trailing backslash character in pattern.\");\n }\n\n // Check back reference if that was last token in pattern\n if (backRef > 0 && backRef > completeGroups) {\n throw new QueryException(ErrorCode.ERR_INVALID_REGULAR_EXPRESSION,\n \"Back reference to nonexisting or unfinished group.\");\n }\n\n // Check for dangling brackets\n if (charClassDepth != 0 || groupDepth != 0) {\n throw new QueryException(ErrorCode.ERR_INVALID_REGULAR_EXPRESSION, \"Pattern contains dangling brackets.\");\n }\n\n if (!removeWhitespace) {\n sb.append(regex);\n }\n\n if (mode == Mode.MATCH) {\n // Adapt for XQuery substring matching by extending pattern\n if (sb.charAt(0) != '^' || ((flagMask & Pattern.MULTILINE) == Pattern.MULTILINE)) {\n if ((flagMask & Pattern.DOTALL) == Pattern.DOTALL) {\n sb.insert(0, \".*\");\n } else {\n sb.insert(0, \"(?s:.*)\");\n }\n }\n\n if (sb.charAt(sb.length() - 1) != '$' || ((flagMask & Pattern.MULTILINE) == Pattern.MULTILINE)) {\n if ((flagMask & Pattern.DOTALL) == Pattern.DOTALL) {\n sb.append(\".*\");\n } else {\n sb.append(\"(?s:.*)\");\n }\n }\n }\n\n return sb.toString();\n }",
"private void fixStringConcats(Element element) throws LookupException {\n for (InfixOperatorInvocation ioi : element.descendants(InfixOperatorInvocation.class)) {\n // args == right\n // target == left\n Type rightType = ioi.getActualParameters().get(0).getType();\n if (ioi.name().equals(\"+\") &&\n subtypeOf(rightType, TEXT) | subtypeOf(rightType, STRING)) {\n if (ioi.getTarget() instanceof Literal) {\n Literal lit = (Literal) ioi.getTarget();\n if (lit.text().isEmpty()) {\n ioi.replaceWith(ioi.getActualParameters().get(0));\n }\n }\n }\n }\n }",
"String rulesAsText();",
"public String toString(){\n\t\tStringBuffer buffer = new StringBuffer();\n\t\t\n\t\tbuffer.append(lhs);\n\t\tbuffer.append(\" -> \");\n\t\t\n\t\t// if this is a lexical rule, prefix it with the lexical symbol\n\t\tif( lexical ){\n\t\t\tbuffer.append(LEXICAL_PREFIX);\n\t\t}\n\t\t\n\t\tfor( String s: rhs ){\n\t\t\tbuffer.append(s + \" \");\n\t\t}\n\t\t\n\t\t// delete the trailing whitespace\n\t\tbuffer.deleteCharAt(buffer.length()-1);\n\t\t\n\t\tbuffer.append(\"\\t\\t\" + weight);\n\t\t\n\t\treturn buffer.toString();\n\t}",
"public String toPattern() {\n return toPattern(false);\n }",
"private SchematronRule convertRuleToSchematronix(@NonNull final SchematronDefinition definition,\n @NonNull final SchematronRule rule) {\n final SchematronRule schematronixRule = rule.clone();\n // Remove children that are 'extends' elements and replace them by their own list of children\n schematronixRule.setChildren(resolveExtendedChildren(definition, rule));\n return schematronixRule;\n }",
"public static String explodeRulesAndCreateString(String rules)\n\t{\n\t\tGrammar grammar = new Grammar();\n\t\tList<IPattern> patterns = explodeRules(grammar, rules);\n\t\tStringBuilder str = new StringBuilder(100);\n\n\t\tboolean first = true;\n\t\tfor (IPattern pattern : patterns)\n\t\t{\n\t\t\tif (!first)\n\t\t\t{\n\t\t\t\tstr.append(\"\\n\");\n\t\t\t}\n\t\t\tstr.append(pattern.toString2(grammar));\n\t\t\tfirst = false;\n\t\t}\n\t\t\n\t\tif (debugFlag)\n\t\t{\n\t\t\tOut.print(str.toString());\n\t\t}\n\n\t\treturn str.toString();\n\t}",
"Rule getRule();",
"public URI getAllowedConnector(Rule rule) {\n Constraint constraint = rule.getConstraint().get(0);\n String allowedConnectorAsString = constraint.getRightOperand().getValue();\n return URI.create(allowedConnectorAsString);\n }",
"Rule createRule();",
"Rule createRule();",
"Rule createRule();",
"public static String getLexicalForm(RDFNode value) {\n if (value.isLiteral()) {\n return ((Literal) value).getLexicalForm();\n } else if (value.isURIResource()) {\n return ((Resource) value).getURI();\n } else {\n return value.toString();\n }\n }",
"public void visit(BinStringConcatenationExpression x){\n if (resultType == null || resultType.equals(BinPrimitiveType.CHAR_REF)){\r\n return;\r\n }\r\n\r\n // make sure after cast the same toString() method will be invoked\r\n if (sourceType.isReferenceType() && resultType.isReferenceType()){\r\n BinCIType context = this.castExpr.getParentType();\r\n\r\n BinMethod srcMethod\r\n = MethodInvocationRules.getMethodDeclaration(context,\r\n sourceType, \"toString\", BinTypeRef.NO_TYPEREFS);\r\n\r\n BinMethod resMethod\r\n = MethodInvocationRules.getMethodDeclaration(context,\r\n resultType, \"toString\", BinTypeRef.NO_TYPEREFS);\r\n\r\n if (srcMethod == resMethod){\r\n addViolation(new RedundantCast(castExpr, sourceType, resultType));\r\n }\r\n }\r\n\r\n }",
"public TerminalRule getSTRINGRule() {\r\n\t\treturn gaXtype.getSTRINGRule();\r\n\t}",
"public TerminalRule getSTRINGRule() {\n\t\treturn gaXtype.getSTRINGRule();\n\t}",
"public TerminalRule getSTRINGRule() {\n\t\treturn gaXtype.getSTRINGRule();\n\t}",
"ExprRule createExprRule();",
"public RuleCall getSTRINGTerminalRuleCall() { return cSTRINGTerminalRuleCall; }",
"public RuleCall getSTRINGTerminalRuleCall() { return cSTRINGTerminalRuleCall; }",
"public RuleCall getSTRINGTerminalRuleCall() { return cSTRINGTerminalRuleCall; }",
"public RuleCall getSTRINGTerminalRuleCall() { return cSTRINGTerminalRuleCall; }",
"public RuleCall getSTRINGTerminalRuleCall() { return cSTRINGTerminalRuleCall; }",
"public RuleCall getSTRINGTerminalRuleCall() { return cSTRINGTerminalRuleCall; }",
"public RuleCall getSTRINGTerminalRuleCall() { return cSTRINGTerminalRuleCall; }",
"public RuleCall getSTRINGTerminalRuleCall() { return cSTRINGTerminalRuleCall; }",
"public RuleCall getSTRINGTerminalRuleCall() { return cSTRINGTerminalRuleCall; }",
"public T caseRegexValidationRuleDeclaration(RegexValidationRuleDeclaration object)\n {\n return null;\n }",
"static List<Rule> parseRule(String rule) {\r\n ArrayList<Rule> list = new ArrayList<>();\r\n\r\n int splitIndex = rule.indexOf(\":\");\r\n String lhs = rule.substring(0, splitIndex).trim();\r\n String rhs = rule.substring(splitIndex + 1).trim();\r\n\r\n String[] split = rhs.split(\"[|]\");\r\n for (String part : split) {\r\n list.add(new Rule(lhs, part.trim()));\r\n }\r\n\r\n return list;\r\n }",
"public Builder setRule(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n rule_ = value;\n onChanged();\n return this;\n }",
"public RuleCall getQualifiedNameParserRuleCall() { return cQualifiedNameParserRuleCall; }",
"public RuleCall getQualifiedNameParserRuleCall() { return cQualifiedNameParserRuleCall; }",
"public RuleCall getQualifiedNameParserRuleCall() { return cQualifiedNameParserRuleCall; }",
"private String toRules(){\n\n if (numInstances() == 0)\n\treturn \"No Rules (Empty Exemplar)\";\n\n String s = \"\", sep = \"\";\n\t\n for(int i = 0; i < numAttributes(); i++){\n\t \n\tif(i == classIndex())\n\t continue;\n\t \n\tif(attribute(i).isNumeric()){\n\t if(m_MaxBorder[i] != m_MinBorder[i]){\n\t s += sep + m_MinBorder[i] + \"<=\" + attribute(i).name() + \"<=\" + m_MaxBorder[i];\n\t } else {\n\t s += sep + attribute(i).name() + \"=\" + m_MaxBorder[i];\n\t }\n\t sep = \" ^ \";\n\t \n\t} else {\n\t s += sep + attribute(i).name() + \" in {\";\n\t String virg = \"\";\n\t for(int j = 0; j < attribute(i).numValues() + 1; j++){\n\t if(m_Range[i][j]){\n\t s+= virg;\n\t if(j == attribute(i).numValues())\n\t\ts += \"?\";\n\t else\n\t\ts += attribute(i).value(j);\n\t virg = \",\";\n\t }\n\t }\n\t s+=\"}\";\n\t sep = \" ^ \";\n\t}\t \n }\n s += \" (\"+numInstances() +\")\";\n return s;\n }",
"public abstract String unrewrite(String absoluteIRI);",
"com.google.protobuf.ByteString\n getRuleBytes();",
"public String getRule() {\r\n return rule;\r\n }",
"public static String fromSableCCRegexp(ARegExp regexp, final Map<String, ARegExp> helpers)\n {\n String basic = asSimpleString(regexp);\n if (basic != null) return basic;\n\n final StringBuilder buffer = new StringBuilder();\n\n // handle regexp nodes using SableCC's tree traversal API\n regexp.apply(new AnalysisAdapter() {\n public void caseARegExp(ARegExp node)\n {\n // there must be at least one PConcat node\n Iterator<PConcat> iter = node.getConcats().iterator();\n iter.next().apply(this);\n\n // further PConcat nodes are unioned (| operator) together\n while (iter.hasNext()) {\n buffer.append('|');\n iter.next().apply(this);\n }\n }\n\n public void caseAConcat(AConcat node)\n {\n // AConcat child nodes are concatenated together\n for (PUnExp child : node.getUnExps())\n child.apply(this);\n }\n\n public void caseAUnExp(AUnExp node)\n {\n char op = '\\0';\n\n // check out which unary operator is present\n if (node.getUnOp() instanceof AQMarkUnOp)\n op = '?';\n\n else if (node.getUnOp() instanceof APlusUnOp)\n op = '+';\n\n else if (node.getUnOp() instanceof AStarUnOp)\n op = '*';\n\n // if there no operator present, just output the basic node as-is\n if (op == '\\0') {\n node.getBasic().apply(this);\n\n // otherwise, wrap the basic node in parens and add the operator\n } else {\n buffer.append('(');\n node.getBasic().apply(this);\n buffer.append(')').append(op);\n }\n }\n\n public void casePChar(PChar node)\n {\n // determine what kind of character encoding\n // (text, dec or hex) is in use\n char chr = '\\0';\n\n // as a single character in single quotes\n if (node instanceof ACharChar)\n chr = ((ACharChar)(node)).getChar().getText().charAt(1);\n\n // as a hexadecimal number\n else if (node instanceof AHexChar)\n chr = (char)(Integer.parseInt(\n ((AHexChar)(node)).getHexChar().getText().substring(2)\n ));\n\n // as a regular decimal number\n else if (node instanceof ADecChar)\n chr = (char)(Integer.parseInt(\n ((ADecChar)(node)).getDecChar().getText()\n ));\n\n // escape if reserved\n if (RESERVED_CHARS.contains(chr))\n buffer.append('\\\\');\n\n buffer.append(chr);\n }\n\n public void caseAStringBasic(AStringBasic node)\n {\n // a simple string in single quotes\n String str = node.getString().getText();\n str = str.substring(1, str.length() - 1);\n\n // split the string on double quotes and individually\n // quote each piece to avoid quoting issues\n for (String chk : str.split(\"\\\"\"))\n buffer.append('\"').append(chk).append('\"');\n }\n\n public void caseAIdBasic(AIdBasic node)\n {\n // resolve the id and re-invoke this handler\n String id = node.getId().getText();\n\n ARegExp resolved = helpers.get(id);\n if (resolved == null)\n throw new RuntimeException(\"Unknown helper '\" + id + \"'\");\n\n resolved.apply(this);\n }\n\n public void caseARegExpBasic(ARegExpBasic node)\n {\n // add parens and recurse over sub-regexps\n buffer.append('(');\n node.getRegExp().apply(this);\n buffer.append(')');\n }\n\n public void caseAOperationSet(AOperationSet node)\n {\n String op = null;\n\n // '+' operator corresponds to union\n if (node.getBinOp() instanceof APlusBinOp)\n op = \"|\";\n\n // '-' operator corresponds to subtraction,\n // which is in turn intersection with complement\n else if (node.getBinOp() instanceof AMinusBinOp)\n op = \"&~\";\n\n // stitch everything together and wrap with parens to avoid\n // interactions with other operators\n buffer.append('(');\n node.getLeft().apply(this);\n\n buffer.append(op);\n\n node.getRight().apply(this);\n buffer.append(')');\n }\n\n public void caseAIntervalSet(AIntervalSet node)\n {\n // corresponds directly to a character class;\n // just add brackets and set both ends of the range\n buffer.append('[');\n casePChar(node.getLeft());\n\n buffer.append('-');\n\n casePChar(node.getRight());\n buffer.append(']');\n }\n\n public void caseACharBasic(ACharBasic node)\n {\n casePChar(node.getChar());\n }\n\n public void caseASetBasic(ASetBasic node)\n {\n node.getSet().apply(this);\n }\n });\n\n return buffer.toString();\n }",
"private Pattern ConvertToPattern(String configEntry)\n {\n String finalResult = configEntry;\n int regexFlags = 0;\n\n finalResult = finalResult.replace(\", \",\"|\");\n\n finalResult = finalResult.substring(1,finalResult.length()-1);\n\n regexFlags = ConvertRegExOptions(finalResult);\n\n return(Pattern.compile(finalResult, regexFlags));\n }",
"public IPredicateRule getStringRule2(IToken tok) {\n\t\treturn null;\r\n\t}",
"String getErrorLinePattern();",
"public String getBREExpressionAsString(Expressionobject expression) throws ApiException {\n Object localVarPostBody = expression;\n \n // create path and map variables\n String localVarPath = \"/bre/rules/expression-as-string\";\n\n // query params\n List<Pair> localVarQueryParams = new ArrayList<Pair>();\n Map<String, String> localVarHeaderParams = new HashMap<String, String>();\n Map<String, Object> localVarFormParams = new HashMap<String, Object>();\n\n\n \n \n final String[] localVarAccepts = {\n \"application/json\"\n };\n final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);\n\n final String[] localVarContentTypes = {\n \"application/json\"\n };\n final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);\n\n String[] localVarAuthNames = new String[] { \"oauth2_client_credentials_grant\", \"oauth2_password_grant\" };\n\n GenericType<String> localVarReturnType = new GenericType<String>() {};\n return apiClient.invokeAPI(localVarPath, \"POST\", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);\n }",
"static public Rule parse(OrchestraSystem catalog, String rule, \r\n\t\t\tMap<String,RelationContext> locals) throws ParseException, RelationNotFoundException {\r\n\t\tHolder<Integer> counter = new Holder<Integer>(0);\r\n\t\tPositionedString str = new PositionedString(rule);\r\n\t\tstr.skipWhitespace();\r\n\t\tUntypedAtom h = UntypedAtom.parse(str, counter);\r\n\t\tboolean negateHead = false;\r\n\t\tif (h.getName().startsWith(\"NOT_\")) {\r\n\t\t\th.setName(h.getName().substring(4));\r\n\t\t\tnegateHead = true;\r\n\t\t}\r\n\r\n\t\tstr.skipWhitespace();\r\n\t\tif (!str.skipString(\":-\")) {\r\n\t\t\tcomplain(str, \"':-'\");\r\n\t\t}\r\n\t\tstr.skipWhitespace();\r\n\t\tArrayList<Atom> body = new ArrayList<Atom>();\r\n\t\tboolean first = true;\r\n\t\tstr.skipWhitespace();\r\n\t\twhile (str.inRange()) {\r\n\t\t\tif (first) {\r\n\t\t\t\tfirst = false;\r\n\t\t\t} else {\r\n\t\t\t\tif (!str.skipString(\",\")) {\r\n\t\t\t\t\tcomplain(str, \"','\");\r\n\t\t\t\t}\r\n\t\t\t\tstr.skipWhitespace();\r\n\t\t\t}\r\n\t\t\tUntypedAtom b = UntypedAtom.parse(str, counter);\r\n\t\t\tboolean isNegated = false;\r\n\t\t\tif (b.getName().startsWith(\"NOT_\")) {\r\n\t\t\t\tisNegated = true;\r\n\t\t\t\tb.setName(b.getName().substring(4));\r\n\t\t\t}\r\n\t\t\tAtom n = b.getTyped(catalog, locals);\r\n\t\t\tn.setNeg(isNegated);\r\n\t\t\tbody.add(n);\r\n\t\t\tstr.skipWhitespace();\r\n\t\t}\r\n\t\tAtom th;\r\n\t\ttry {\r\n\t\t\tth = h.getTyped(catalog, locals);\r\n\t\t} catch (ParseException e) {\r\n\t\t\tth = h.getTyped(body);\r\n\t\t\t// Add this as a local view definition\r\n\t\t\tif (!locals.containsKey(th.getRelationContext().toString()))\r\n\t\t\t\tlocals.put(th.getRelationContext().toString(), th.getRelationContext());\r\n\t\t} catch (RelationNotFoundException e) {\r\n\t\t\tth = h.getTyped(body);\r\n\t\t\t// Add this as a local view definition\r\n\t\t\tif (!locals.containsKey(th.getRelationContext().toString()))\r\n\t\t\t\tlocals.put(th.getRelationContext().toString(), th.getRelationContext());\r\n\t\t}\r\n\t\tth.setNeg(negateHead);\r\n\r\n\t\treturn new Rule(th, body, null, catalog.getMappingDb().getBuiltInSchemas());\r\n\t}",
"public String getShortenedPath(String ruleFilePath) {\n String[] splitFilePath = ruleFilePath.split(\"/\");\n String str = \"\";\n if (splitFilePath.length > 2) {\n int index = splitFilePath.length - 2;\n for (int i = index; i < splitFilePath.length; i++) {\n str += \"/\" + splitFilePath[i];\n }\n System.out.println(\"Using shortened file path.\");\n return str;\n } else {\n System.out.println(\"Using full file path.\");\n return ruleFilePath;\n } \n }",
"public String compressStringifiedRules() {\n StringBuilder ruleBuilder = new StringBuilder();\n for (SecurityGroupRulesCmd.IpPortAndProto ipPandP : getIngressRuleSet()) {\n ruleBuilder.append(\"I:\").append(ipPandP.getProto()).append(\":\").append(ipPandP.getStartPort()).append(\":\").append(ipPandP.getEndPort()).append(\":\");\n for (String cidr : ipPandP.getAllowedCidrs()) {\n ruleBuilder.append(cidr).append(\",\");\n }\n ruleBuilder.append(\"NEXT\");\n ruleBuilder.append(\" \");\n }\n for (SecurityGroupRulesCmd.IpPortAndProto ipPandP : getEgressRuleSet()) {\n ruleBuilder.append(\"E:\").append(ipPandP.getProto()).append(\":\").append(ipPandP.getStartPort()).append(\":\").append(ipPandP.getEndPort()).append(\":\");\n for (String cidr : ipPandP.getAllowedCidrs()) {\n ruleBuilder.append(cidr).append(\",\");\n }\n ruleBuilder.append(\"NEXT\");\n ruleBuilder.append(\" \");\n }\n String stringified = ruleBuilder.toString();\n ByteArrayOutputStream out = new ByteArrayOutputStream();\n try {\n //Note : not using GZipOutputStream since that is for files\n //GZipOutputStream gives a different header, although the compression is the same\n DeflaterOutputStream dzip = new DeflaterOutputStream(out);\n dzip.write(stringified.getBytes());\n dzip.close();\n } catch (IOException e) {\n s_logger.warn(\"Exception while compressing security group rules\");\n return null;\n }\n return Base64.encodeBase64String(out.toByteArray());\n }",
"private static String formatRegEx(String regex) {\n String res = new String();\n List<Character> allOperators = Arrays.asList('|', '?', '+', '*', '^');\n List<Character> binaryOperators = Arrays.asList('^', '|');\n\n for (int i = 0; i < regex.length(); i++) {\n Character c1 = regex.charAt(i);\n\n if (i + 1 < regex.length()) {\n Character c2 = regex.charAt(i + 1);\n\n res += c1;\n\n if (!c1.equals('(') && !c2.equals(')') && !allOperators.contains(c2) && !binaryOperators.contains(c1)) {\n res += '.';\n }\n }\n }\n res += regex.charAt(regex.length() - 1);\n\n return res;\n }",
"public java.lang.String getRule() {\n return rule;\n }",
"public String toReference(Object text) { String t=toString(text); if(t==null || t.length()==0) {return null;} return \"<<\"+t+\">>\"; }",
"public String getRule() {\n\t\treturn this.rule;\n\t}",
"private void parseDefinition(final Rule rule, final String definition, final int line) throws GrammarException\n {\n final StringExtractor stringExtractor = new StringExtractor(definition);\n stringExtractor.setCanReturnEmptyString(false);\n String element = stringExtractor.next();\n final Pattern patternReference = Pattern.compile(GrammarConstants.REGEX_REFERENCE);\n Matcher matcher;\n\n if (element != null)\n {\n final SimpleDefinition simpleDefinition = new SimpleDefinition();\n rule.addDefinition(simpleDefinition);\n\n do\n {\n matcher = patternReference.matcher(element);\n\n if (matcher.matches())\n {\n simpleDefinition.addElement(new ElementReference(matcher.group(GrammarConstants.GROUP_NAME)));\n }\n else if (GrammarConstants.REGEX_EMPTY.equals(element))\n {\n simpleDefinition.addElement(Element.EMPTY);\n }\n else\n {\n simpleDefinition.addElement(new ElementRegularExpression(element));\n }\n\n element = stringExtractor.next();\n }\n while (element != null);\n }\n }",
"public static String createRegularExpression(AutomatonSpecification automaton) {\n String regexp = \"\";\n State initial = automaton.getInitialState();\n List<State> finalStates = new LinkedList<State>();\n\n for (State state : automaton.allStates()) {\n transitionLabels.put(hashOf(state, state), \"\");\n }\n\n String label;\n List<State> next; //lista tymczasowa.\n List<State> previous; //lista tymczasowa.\n for (State state : automaton.allStates()) {\n next = new LinkedList<State>();\n for (OutgoingTransition out : automaton.allOutgoingTransitions(state)) {\n State target = out.getTargetState();\n if (!next.contains(target)) {\n next.add(target);\n if (previousStates.containsKey(target)) {\n previous = previousStates.get(target);\n previous.add(state);\n previousStates.put(target, previous);\n } else {\n previous = new LinkedList<State>();\n previous.add(state);\n previousStates.put(target, previous);\n }\n label = out.getTransitionLabel().toString();\n for (char character : SPECIAL_CHARACTERS)\n if (label.charAt(0) == character)\n label = QUOTE + label;\n } else {\n label = transitionLabels.get(hashOf(state, target)) + '|';\n StringBuffer buf = new StringBuffer();\n for (char character : SPECIAL_CHARACTERS)\n if (out.getTransitionLabel().toString().charAt(0) == character) {\n buf.append(QUOTE);\n break;\n }\n label = label + buf.toString() + out.getTransitionLabel().toString();\n }\n transitionLabels.put(hashOf(state, target), label);\n }\n nextStates.put(state, next);\n if (automaton.isFinal(state))\n finalStates.add(state);\n }\n\n for (State state : automaton.allStates()) {\n if (!automaton.isFinal(state) && state != initial) {\n remove(state);\n }\n }\n\n String r, s, u, t, reg;\n for (State state : finalStates) {\n transitionLabelsBackup = new HashMap<String, String>(transitionLabels);\n previousBackup = new HashMap<State, List<State>>();\n for (State prevState : previousStates.keySet()) {\n previous = new LinkedList<State>();\n for (State st : previousStates.get(prevState))\n previous.add(st);\n previousBackup.put(prevState, previous);\n }\n nextBackup = new HashMap<State, List<State>>();\n for (State prevState : nextStates.keySet()) {\n next = new LinkedList<State>();\n for (State st : nextStates.get(prevState))\n next.add(st);\n nextBackup.put(prevState, next);\n }\n\n for (State toRemove : finalStates) {\n if (state != toRemove && toRemove != initial)\n remove(toRemove);\n }\n if (state == initial) {\n if (regexp.equals(\"\")) {\n if (transitionLabels.get(hashOf(state, state)).equals(\"\"))\n regexp = \"(\\u03B5)\";\n else\n regexp = \"(\" + transitionLabels.get(hashOf(state, state)) + \")*\";\n } else\n regexp = regexp + \"|\" + \"(\" + transitionLabels.get(hashOf(state, state)) + \")*\";\n } else {\n r = getLabel(initial, initial);\n s = getLabel(initial, state);\n u = getLabel(state, state);\n t = getLabel(state, initial);\n if (r.length() > 0) {\n if (t.length() > 0)\n reg = \"(\" + r + \"|\" + \"(\" + s + \")\" + \"(\" + u + \")*\" + \"(\" + t + \")\" + \")*\"\n + \"(\" + s + \")\" + \"(\" + u + \")*\";\n else\n reg = \"(\" + r + \")*\" + \"(\" + s + \")\" + \"(\" + u + \")*\";\n } else {\n if (t.length() > 0)\n reg = \"((\" + s + \")\" + \"(\" + u + \")*\" + \"(\" + t + \")\" + \")*\" + \"(\" + s + \")\"\n + \"(\" + u + \")*\";\n else\n reg = \"(\" + s + \")\" + \"(\" + u + \")*\";\n }\n if (regexp.equals(\"\"))\n regexp = reg;\n else\n regexp = regexp + \"|\" + reg;\n }\n previousStates.clear();\n previousStates.putAll(previousBackup);\n nextStates.clear();\n nextStates.putAll(nextBackup);\n transitionLabels.clear();\n transitionLabels.putAll(transitionLabelsBackup);\n }\n\n regexp = fixKleene(fixBrackets(regexp));\n\n return regexp.replace(String.valueOf(QUOTE), \"\\\\\");\n }",
"private String toReversePolishNotation(String expr) {\n\t\tString output = \"\";\n\t\tStack<String> operatorStack = new Stack<String>();\n\n\t\tfor(String token : expr.split(\"\\\\s+\")) {\n\t\t\tif(isNumber(token)) {\n\t\t\t\toutput += token + \" \";\n\t\t\t}\n\t\t\telse if(isMatrix(token)) {\n\t\t\t\toutput += token + \" \";\n\t\t\t}\n\t\t\telse if(isOperator(token)) {\n\t\t\t\tint precidenceToken = getPrecidence(token);\n\t\t\t\tint precidenceNext;\n\t\t\t\twhile(!operatorStack.isEmpty()) {\n\t\t\t\t\tprecidenceNext = getPrecidence(operatorStack.peek());\n\t\t\t\t\tif(precidenceNext >= precidenceToken) output += operatorStack.pop() + \" \";\n\t\t\t\t\telse break;\n\t\t\t\t}\n\t\t\t\toperatorStack.push(token);\n\t\t\t}\n\t\t\telse if(token.equals(\"(\")) {\n\t\t\t\toperatorStack.push(token);\n\t\t\t}\n\t\t\telse if(token.equals(\")\")) {\n\t\t\t\twhile(!operatorStack.peek().equals(\"(\")) output += operatorStack.pop() + \" \";\n\t\t\t\toperatorStack.pop();\n\t\t\t}\n\t\t\telse throw new IllegalArgumentException(INVALID_CHARACTER_MESSAGE);\n\t\t}\n\t\twhile(!operatorStack.isEmpty()) output += operatorStack.pop() + \" \";\n\n\t\treturn output;\n\t}",
"private static void resolveParserRule(ParserRule rule, Map<String, Rule> rules) throws IngridParserException {\n // For each alternative line..\n for (Alternative alternative : rule.alternatives) {\n // For each element on the line..\n for (int i = 0; i < alternative.elements.size(); ++i) {\n RuleReference ref = alternative.elements.get(i);\n\n // Rule referenced in this alternative element\n Rule element = ref.rule;\n\n if (element instanceof UnresolvedRule) {\n // Lexer rules were resolved first, so they are ready to be referenced\n if (rules.containsKey(element.name)) {\n Rule lookedUpRule = rules.get(element.name);\n alternative.elements.set(i, new RuleReference(lookedUpRule, ref.quantity));\n } else {\n // Special EOF token might not be defined, but is a valid reference\n if (element.name.equals(\"EOF\")) {\n // We can ignore this rule\n alternative.elements.remove(i);\n --i;\n continue;\n }\n\n throw new IngridParserException(\n \"Couldn't resolve rule '\" + element.name + \"' (inside \" + rule.name + \")\");\n }\n } else if (element instanceof QuantifierRule) {\n if (i == 0) {\n throw new IngridParserException(\n \"Quantifier suffix found with no previous reference\");\n }\n\n // Apply quantifier to previous element of alternative\n alternative.elements.get(i - 1).quantity = ((QuantifierRule) element).quantity;\n // Remove quantifier itself\n alternative.elements.remove(i);\n --i;\n }\n }\n }\n }",
"Rule Literal() {\n // Push 1 LiteralNode onto the value stack\n return Sequence(\n FirstOf(\n SingleQuotedLiteral(),\n DoubleQuotedLiteral()),\n actions.pushLiteralNode());\n }",
"SWRLRule getOWLRepresentation(RuleForPrinego rule);",
"@Override\n public String toString(int depth) {\n if (depth <= 0) return \"\";\n String sEO = \"\" ;\n if (this.subExpressionOf != null) {\n sEO = Strings.indent(2,\n \"\\nsubExpressionOf: \" +\n Strings.indent(2, this.subExpressionOf.toString(1))) ;} ;\n return \"\\n*OpApplNode: \" + operator.getName() + \" \" + super.toString(depth+1)\n + \" errors: \" + (errors != null ? \"non-null\" : \"null\")\n + toStringBody(depth) + sEO ;\n }",
"public TerminalRule getSTRINGRule() {\n\t\treturn gaTerminals.getSTRINGRule();\n\t}",
"public TerminalRule getSTRINGRule() {\n\t\treturn gaTerminals.getSTRINGRule();\n\t}",
"public TerminalRule getSTRINGRule() {\n\t\treturn gaTerminals.getSTRINGRule();\n\t}",
"public TerminalRule getSTRINGRule() {\n\t\treturn gaTerminals.getSTRINGRule();\n\t}",
"public TerminalRule getSTRINGRule() {\n\t\treturn gaTerminals.getSTRINGRule();\n\t}",
"public TerminalRule getSTRINGRule() {\n\t\treturn gaTerminals.getSTRINGRule();\n\t}",
"public TerminalRule getSTRINGRule() {\n\t\treturn gaTerminals.getSTRINGRule();\n\t}",
"public TerminalRule getSTRINGRule() {\n\t\treturn gaTerminals.getSTRINGRule();\n\t}",
"public TerminalRule getSTRINGRule() {\n\t\treturn gaTerminals.getSTRINGRule();\n\t}",
"public TerminalRule getSTRINGRule() {\n\t\treturn gaTerminals.getSTRINGRule();\n\t}",
"public TerminalRule getSTRINGRule() {\n\t\treturn gaTerminals.getSTRINGRule();\n\t}",
"public TerminalRule getSTRINGRule() {\n\t\treturn gaTerminals.getSTRINGRule();\n\t}",
"public TerminalRule getSTRINGRule() {\n\t\treturn gaTerminals.getSTRINGRule();\n\t}",
"public TerminalRule getSTRINGRule() {\n\t\treturn gaTerminals.getSTRINGRule();\n\t}",
"static public Rule parse(OrchestraSystem catalog, String rule) throws ParseException, RelationNotFoundException {\r\n\t\treturn parse(catalog, rule, null);\r\n\t}",
"public void setRule(java.lang.String rule) {\n this.rule = rule;\n }",
"public static MarketRuleFlatted getMarketRuleFlatted(WrapperRuleJAXB wrapperRuleJAXB, String xmlOrJson) {\r\n\t\tMarketRuleFlattedJAXB marketRuleFlattedJAXB = null;\r\n\t\tif (xmlOrJson.equals(\"xml\")) {\r\n\t\t\tmarketRuleFlattedJAXB = XmlJsonObjectConvertor.getMarketRuleFFromXML(wrapperRuleJAXB.getJsonORxml());\r\n\t\t} else if (xmlOrJson.equals(\"json\")) {\r\n\t\t\tmarketRuleFlattedJAXB = XmlJsonObjectConvertor.getMarketRuleFlattedFromJSON(wrapperRuleJAXB.getJsonORxml());\r\n\t\t}\r\n\r\n\t\tMarketRuleFlatted marketRuleFlatted = new MarketRuleFlatted();\r\n\t\ttry {\r\n\t\t\tBeanUtils.copyProperties(marketRuleFlatted, marketRuleFlattedJAXB);\r\n\t\t} catch (IllegalAccessException | InvocationTargetException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn marketRuleFlatted;\r\n\t}",
"public TerminalRule getSTRINGRule() {\r\n\t\treturn gaTerminals.getSTRINGRule();\r\n\t}",
"public TerminalRule getSTRINGRule() {\r\n\t\treturn gaTerminals.getSTRINGRule();\r\n\t}",
"public TerminalRule getSTRINGRule() {\r\n\t\treturn gaTerminals.getSTRINGRule();\r\n\t}",
"public TerminalRule getSTRINGRule() {\r\n\t\treturn gaTerminals.getSTRINGRule();\r\n\t}",
"public Pattern buildPattern ()\n {\n int flags = 0;\n if ( this.canonicalEquivalence ) flags += Pattern.CANON_EQ;\n if ( this.caseInsensitive ) flags += Pattern.CASE_INSENSITIVE;\n if ( this.comments ) flags += Pattern.COMMENTS;\n if ( this.dotall ) flags += Pattern.DOTALL;\n if ( this.multiline ) flags += Pattern.MULTILINE;\n if ( this.unicodeCase ) flags += Pattern.UNICODE_CASE;\n if ( this.unixLines ) flags += Pattern.UNIX_LINES;\n return Pattern.compile(this.regex, flags);\n }",
"@Test\n public void testFromWithTernaryFollowedByQuery() throws Exception {\n final String text = \"rule X when Cheese() from (isFull ? $cheesery : $market) ?person( \\\"Mark\\\", 42; ) then end\";\n RuleDescr rule = ((RuleDescr) (parse(\"rule\", text)));\n TestCase.assertFalse(parser.getErrors().toString(), parser.hasErrors());\n PatternDescr pattern = ((PatternDescr) (getDescrs().get(0)));\n TestCase.assertEquals(\"Cheese\", pattern.getObjectType());\n TestCase.assertEquals(\"from (isFull ? $cheesery : $market)\", pattern.getSource().getText());\n TestCase.assertFalse(pattern.isQuery());\n pattern = ((PatternDescr) (getDescrs().get(1)));\n TestCase.assertEquals(\"person\", pattern.getObjectType());\n TestCase.assertTrue(pattern.isQuery());\n }",
"StringExpression createStringExpression();",
"Rule SingleQuotedLiteral() {\n return Sequence(\n \"'\",\n ZeroOrMore(NoneOf(\"'\")),\n \"'\");\n }",
"public void setRule(final String rule) {\r\n this.rule = rule;\r\n }",
"public RegexNode Reduce()\n\t{\n\t\tRegexNode n;\n\n\t\tswitch (Type())\n\t\t{\n\t\t\tcase Alternate:\n\t\t\t\tn = ReduceAlternation();\n\t\t\t\tbreak;\n\n\t\t\tcase Concatenate:\n\t\t\t\tn = ReduceConcatenation();\n\t\t\t\tbreak;\n\n\t\t\tcase Loop:\n\t\t\tcase Lazyloop:\n\t\t\t\tn = ReduceRep();\n\t\t\t\tbreak;\n\n\t\t\tcase Group:\n\t\t\t\tn = ReduceGroup();\n\t\t\t\tbreak;\n\n\t\t\tcase Set:\n\t\t\tcase Setloop:\n\t\t\t\tn = ReduceSet();\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tn = this;\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn n;\n\t}",
"public static Object pregexpReadPattern(Object s, Object i, Object n) {\n if (Scheme.numGEq.apply2(i, n) != Boolean.FALSE) {\n return LList.list2(LList.list2(Lit4, LList.list1(Lit5)), i);\n }\n Object obj = LList.Empty;\n while (true) {\n Object apply2 = Scheme.numGEq.apply2(i, n);\n try {\n boolean x = ((Boolean) apply2).booleanValue();\n if (x) {\n if (x) {\n break;\n }\n try {\n try {\n if (!characters.isChar$Eq(Char.make(strings.stringRef((CharSequence) s, ((Number) i).intValue())), Lit7)) {\n i = AddOp.$Pl.apply2(i, Lit8);\n }\n Object vv = pregexpReadBranch(s, i, n);\n obj = lists.cons(lists.car.apply1(vv), obj);\n i = lists.cadr.apply1(vv);\n } catch (ClassCastException e) {\n throw new WrongType(e, \"string-ref\", 2, i);\n }\n } catch (ClassCastException e2) {\n throw new WrongType(e2, \"string-ref\", 1, s);\n }\n } else {\n try {\n try {\n if (characters.isChar$Eq(Char.make(strings.stringRef((CharSequence) s, ((Number) i).intValue())), Lit6)) {\n break;\n }\n if (!characters.isChar$Eq(Char.make(strings.stringRef((CharSequence) s, ((Number) i).intValue())), Lit7)) {\n }\n Object vv2 = pregexpReadBranch(s, i, n);\n obj = lists.cons(lists.car.apply1(vv2), obj);\n i = lists.cadr.apply1(vv2);\n } catch (ClassCastException e3) {\n throw new WrongType(e3, \"string-ref\", 2, i);\n }\n } catch (ClassCastException e4) {\n throw new WrongType(e4, \"string-ref\", 1, s);\n }\n }\n } catch (ClassCastException e5) {\n throw new WrongType(e5, \"x\", -2, apply2);\n }\n }\n return LList.list2(lists.cons(Lit4, pregexpReverse$Ex(obj)), i);\n }",
"private void createRules(List<PatternToken> elemList,\n List<PatternToken> tmpPatternTokens, int numElement) {\n String shortMessage = \"\";\n if (this.shortMessage != null && this.shortMessage.length() > 0) {\n shortMessage = this.shortMessage.toString();\n } else if (shortMessageForRuleGroup != null && shortMessageForRuleGroup.length() > 0) {\n shortMessage = this.shortMessageForRuleGroup.toString();\n }\n if (numElement >= elemList.size()) {\n AbstractPatternRule rule;\n if (tmpPatternTokens.size() > 0) {\n rule = new PatternRule(id, language, tmpPatternTokens, name,\n message.toString(), shortMessage,\n suggestionsOutMsg.toString(), phrasePatternTokens.size() > 1, interpretPosTagsPreDisambiguation);\n rule.addTags(ruleTags);\n rule.addTags(ruleGroupTags);\n rule.addTags(categoryTags);\n rule.setSourceFile(sourceFile);\n } else if (regex.length() > 0) {\n int flags = regexCaseSensitive ? 0 : Pattern.CASE_INSENSITIVE|Pattern.UNICODE_CASE;\n String regexStr = regex.toString();\n if (regexMode == RegexpMode.SMART) {\n // Note: it's not that easy to add \\b because the regex might look like '(foo)' or '\\d' so we cannot just look at the last character\n regexStr = replaceSpacesInRegex(regexStr);\n }\n if (ruleAntiPatterns.size() > 0 || rulegroupAntiPatterns.size() > 0) {\n throw new RuntimeException(\"<regexp> rules currently cannot be used together with <antipattern>. Rule id: \" + id + \"[\" + subId + \"]\");\n }\n rule = new RegexPatternRule(id, name, message.toString(), shortMessage, suggestionsOutMsg.toString(), language, Pattern.compile(regexStr, flags), regexpMark);\n rule.setSourceFile(sourceFile);\n } else {\n throw new IllegalStateException(\"Neither '<pattern>' tokens nor '<regex>' is set in rule '\" + id + \"'\");\n }\n setRuleFilter(filterClassName, filterArgs, rule);\n prepareRule(rule);\n rules.add(rule);\n } else {\n PatternToken patternToken = elemList.get(numElement);\n if (patternToken.hasOrGroup()) {\n // When creating a new rule, we finally clear the backed-up variables. All the elements in\n // the OR group should share the values of backed-up variables. That's why these variables\n // are backed-up.\n List<Match> suggestionMatchesBackup = new ArrayList<>(suggestionMatches);\n List<Match> suggestionMatchesOutMsgBackup = new ArrayList<>(suggestionMatchesOutMsg);\n int startPosBackup = startPos;\n int endPosBackup = endPos;\n List<DisambiguationPatternRule> ruleAntiPatternsBackup = new ArrayList<>(ruleAntiPatterns);\n for (PatternToken patternTokenOfOrGroup : patternToken.getOrGroup()) {\n List<PatternToken> tmpElements2 = new ArrayList<>();\n tmpElements2.addAll(tmpPatternTokens);\n tmpElements2.add(ObjectUtils.clone(patternTokenOfOrGroup));\n createRules(elemList, tmpElements2, numElement + 1);\n startPos = startPosBackup;\n endPos = endPosBackup;\n suggestionMatches = suggestionMatchesBackup;\n suggestionMatchesOutMsg = suggestionMatchesOutMsgBackup;\n ruleAntiPatterns.addAll(ruleAntiPatternsBackup);\n }\n }\n tmpPatternTokens.add(ObjectUtils.clone(patternToken));\n createRules(elemList, tmpPatternTokens, numElement + 1);\n }\n }",
"void checkRule(String rule) throws IOException;",
"java.lang.String getSearchRecurrenceRule();",
"@Test\n\tvoid testFormattedRE() {\n\t\tRegularLanguage rl[] = new RegularLanguage[lengthToFormatRE]; \n\t\tint i = 0;\n\t\tfor (String re : toFormatRE) {\n\t\t\trl[i++] = RegularExpression.isValidRE(re);\n\t\t}\n\t\t// Verify if all objects were created\n\t\tfor (RegularLanguage re : rl) {\n\t\t\tif (re.equals(null)) {\n\t\t\t\tfail(); // object couldn't be created\n\t\t\t}\n\t\t}\n\n\t\t// a***** -> a*\n\t\tassertEquals(\"a*\", rl[0].getRE().getFormattedRegex());\n\t\t// aa????? -> a?\n\t\tassertEquals(\"a?\", rl[1].getRE().getFormattedRegex());\n\t\t// a+++++ -> a+\n\t\tassertEquals(\"a+\", rl[2].getRE().getFormattedRegex());\n\t\t// a?*?*?***???* -> a*\n\t\tassertEquals(\"a*\", rl[3].getRE().getFormattedRegex());\n\t\t// a?+?+?+++???+ -> a*\n\t\tassertEquals(\"a*\", rl[4].getRE().getFormattedRegex());\n\t\t// a*+*+*++++***+* -> a*\n\t\tassertEquals(\"a*\", rl[5].getRE().getFormattedRegex());\n\t\t// a?+*?+?***???+++***?+?*+* -> a*\n\t\tassertEquals(\"a*\", rl[6].getRE().getFormattedRegex());\n\t\t\t\n\t}",
"java.lang.String getRegex();",
"java.lang.String getRegex();",
"public String toString() {\n/* 664 */ return this.pattern;\n/* */ }",
"public static List ruleToList(String [] rule)\t{\n\t\treturn appendToRule(rule, new ArrayList(rule.length));\n\t}"
] | [
"0.53263515",
"0.53021723",
"0.52125424",
"0.51019555",
"0.508634",
"0.5000025",
"0.48952648",
"0.4864069",
"0.4802196",
"0.47023913",
"0.46961042",
"0.45796868",
"0.45460057",
"0.45444405",
"0.45362538",
"0.4528123",
"0.45258725",
"0.45154226",
"0.45154226",
"0.45154226",
"0.44807348",
"0.44791222",
"0.44759107",
"0.4475035",
"0.4475035",
"0.44680864",
"0.4468025",
"0.4468025",
"0.4468025",
"0.4468025",
"0.4468025",
"0.4468025",
"0.4468025",
"0.4468025",
"0.4468025",
"0.44602683",
"0.44331443",
"0.44158125",
"0.44077566",
"0.44077566",
"0.44077566",
"0.43749627",
"0.4372455",
"0.43580788",
"0.4352553",
"0.4345007",
"0.43253285",
"0.42829356",
"0.4278045",
"0.4276217",
"0.42400602",
"0.4230884",
"0.4207917",
"0.42024392",
"0.41885465",
"0.41793764",
"0.41699386",
"0.41662598",
"0.4160671",
"0.41536397",
"0.4150236",
"0.4147004",
"0.41413543",
"0.41396135",
"0.4124998",
"0.4124998",
"0.4124998",
"0.4124998",
"0.4124998",
"0.4124998",
"0.4124998",
"0.4124998",
"0.4124998",
"0.4124998",
"0.4124998",
"0.4124998",
"0.4124998",
"0.4124998",
"0.41210246",
"0.41108054",
"0.4106992",
"0.41020048",
"0.41020048",
"0.41020048",
"0.41020048",
"0.40928566",
"0.4087159",
"0.40866396",
"0.40788132",
"0.40699464",
"0.40674302",
"0.40658066",
"0.40578872",
"0.40574282",
"0.40493193",
"0.40481856",
"0.4045696",
"0.4045696",
"0.40388012",
"0.4037749"
] | 0.6589889 | 0 |
Escapes special regex characters inside of a literal, so it can be used as regex. | static String escapeLiteral(LiteralRule rule) {
String specialChars = ".[]{}()*+-?^$|";
StringBuilder sb = new StringBuilder();
for (int i = 0; i < rule.value.length(); ++i) {
char c = rule.value.charAt(i);
if (specialChars.indexOf(c) != -1) {
sb.append("\\");
}
sb.append(c);
}
return sb.toString();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected String escape( String text )\n {\n return text.replaceAll( \"([`\\\\|*_])\", \"\\\\\\\\$1\" );\n }",
"private static String escape(String in) {\n // After regexp escaping \\\\\\\\ = 1 slash, \\\\\\\\\\\\\\\\ = 2 slashes.\n\n // Also, the second args of replaceAll are neither strings nor regexps, and\n // are instead a special DSL used by Matcher. Therefore, we need to double\n // escape slashes (4 slashes) and quotes (3 slashes + \") in those strings.\n // Since we need to write \\\\ and \\\", we end up with 8 and 7 slashes,\n // respectively.\n return in.replaceAll(\"\\\\\\\\\", \"\\\\\\\\\\\\\\\\\").replaceAll(\"\\\"\", \"\\\\\\\\\\\\\\\"\");\n }",
"public static String escapeRegexReservedCharacters(String stringWithReservedCharacters) {\n String reservedSymbols = \"{([*+^?<>$.|])}\";\n StringBuilder escapedStringBuilder = new StringBuilder();\n\n for (char character : stringWithReservedCharacters.toCharArray()) {\n if (reservedSymbols.contains(String.valueOf(character)))\n escapedStringBuilder.append(\"\\\\\");\n\n escapedStringBuilder.append(character);\n }\n\n return escapedStringBuilder.toString();\n }",
"public static String escapeRegexChar(char c) {\n return (META_CHARS.contains(c) ? \"\\\\\" : \"\") + c;\n }",
"CharSequence escape(char c);",
"private String escapeValue(String value) {\n Matcher match = escapePattern.matcher(value);\n String ret = match.replaceAll(\"\\\\\\\\\\\\\\\\\");\n return ret.replace(\"\\\"\", \"\\\\\\\"\").replace(\"\\n\", \" \").replace(\"\\t\", \" \");\n }",
"private static String escape(String arg) {\n int max;\n StringBuilder result;\n char c;\n\n max = arg.length();\n result = new StringBuilder(max);\n for (int i = 0; i < max; i++) {\n c = arg.charAt(i);\n switch (c) {\n case '\\'':\n case '\"':\n case ' ':\n case '\\t':\n case '&':\n case '|':\n case '(':\n case ')':\n case '\\n':\n result.append('\\\\');\n result.append(c);\n break;\n default:\n result.append(c);\n break;\n }\n }\n return result.toString();\n }",
"private static String wildcardAsRegex( String wildcard ) {\n\t\tStringBuilder sb = new StringBuilder( wildcard.length() * 110 / 100 );\n\t\tfor ( int i = 0; i < wildcard.length(); i++ ) {\n\t\t\tfinal char c = wildcard.charAt( i );\n\t\t\tswitch (c) {\n\t\t\tcase '*':\n\t\t\t\tsb.append( \".*?\" );\n\t\t\t\tbreak;\n\n\t\t\tcase '?':\n\t\t\t\tsb.append( \".\" );\n\t\t\t\tbreak;\n\n\t\t\t// chars that have magic regex meaning. They need quoting to be taken\n\t\t\t// literally\n\t\t\tcase '$':\n\t\t\tcase '(':\n\t\t\tcase ')':\n\t\t\tcase '+':\n\t\t\tcase '-':\n\t\t\tcase '.':\n\t\t\tcase '[':\n\t\t\tcase '\\\\':\n\t\t\tcase ']':\n\t\t\tcase '^':\n\t\t\tcase '{':\n\t\t\tcase '|':\n\t\t\tcase '}':\n\t\t\t\tsb.append( '\\\\' );\n\t\t\t\tsb.append( c );\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tsb.append( c );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn sb.toString();\n\t}",
"public static String escapeSpecialChars(String value) {\r\n if (value != null) {\r\n for (int c = 0; c < SPECIAL_CHARS.length; c++) {\r\n value = value.replaceAll(\"\" + SPECIAL_CHARS[c], SPECIAL_CHAR_NAME[c]);\r\n }\r\n }\r\n return value;\r\n }",
"private static String adqlCharLiteral( String txt ) {\n return \"'\" + txt.replaceAll( \"'\", \"''\" ) + \"'\";\n }",
"public static String escapeRegex(String str) {\n return str.chars().boxed()\n .map(i -> escapeRegexChar((char) i.intValue()))\n .collect(Collectors.joining());\n }",
"protected String escape(String replacement) {\n return replacement.replace(\"\\\\\", \"\\\\\\\\\").replace(\"$\", \"\\\\$\");\n }",
"private static String escape(String value, String chars) {\n\t\treturn escape(value, chars, \"\\\\\\\\\");\n\t}",
"private String literal(String str) {\n StringBuffer buffer = new StringBuffer();\n \n buffer.append(\"'\");\n for (int i = 0; i < str.length(); i++) {\n switch (str.charAt(i)) {\n case '\\'':\n buffer.append(\"''\");\n break;\n default:\n buffer.append(str.charAt(i));\n break;\n }\n }\n buffer.append(\"'\");\n return buffer.toString();\n }",
"Rule DoubleQuotedLiteral() {\n return Sequence(\n \"\\\"\",\n ZeroOrMore(NoneOf(\"\\\"\")),\n \"\\\"\");\n }",
"private String escape(String name) {\n return name.replaceAll(\"[^a-zA-Z0-9.-]\", \"_\");\n }",
"public static String replaceEscapeChars(final String input) {\n if (input == null) return null;\n\n String retValue = LEFT_SQUARE_BRACKET_PATTERN.matcher(input).replaceAll(\"[\");\n retValue = RIGHT_SQUARE_BRACKET_PATTERN.matcher(retValue).replaceAll(\"]\");\n retValue = LEFT_BRACKET_PATTERN.matcher(retValue).replaceAll(\"(\");\n retValue = RIGHT_BRACKET_PATTERN.matcher(retValue).replaceAll(\")\");\n retValue = COLON_PATTERN.matcher(retValue).replaceAll(\":\");\n retValue = COMMA_PATTERN.matcher(retValue).replaceAll(\",\");\n retValue = EQUALS_PATTERN.matcher(retValue).replaceAll(\"=\");\n retValue = PLUS_PATTERN.matcher(retValue).replaceAll(\"+\");\n return MINUS_PATTERN.matcher(retValue).replaceAll(\"-\");\n }",
"public static String encodeEscapes(@Nullable String inString)\n {\n if(inString == null)\n return \"\";\n\n // replace all special characters with some equivalent\n StringBuilder result = new StringBuilder();\n for(int i = 0; i < inString.length(); i++)\n {\n char c = inString.charAt(i);\n int pos = s_escapes.indexOf(c);\n\n if(pos >= 0)\n result.append(s_marker + pos + s_marker);\n else\n result.append(c);\n }\n\n return result.toString();\n }",
"private static String handleEscapes(String s) {\n final String UNLIKELY_STRING = \"___~~~~$$$$___\";\n return s.replace(\"\\\\\\\\\", UNLIKELY_STRING).replace(\"\\\\\", \"\").replace(UNLIKELY_STRING, \"\\\\\");\n }",
"public static String maskQuoteAndBackslash(String s)\t{\n\t\tStringBuffer sb = new StringBuffer(s.length());\n\t\tfor (int i = 0; i < s.length(); i++)\t{\n\t\t\tchar c = s.charAt(i);\n\t\t\tswitch (c)\t{\n\t\t\t\tcase '\"':\n\t\t\t\tcase '\\\\':\n\t\t\t\t\tsb.append('\\\\');\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tsb.append(c);\n\t\t}\n\t\treturn sb.toString();\n\t}",
"public static String escape(String value, String escape) {\n String result = value.replace(\"_\", \"_\" + escape);\n result = result.replace(\"%\", \"%\" + escape);\n result = result.replace(escape, escape + escape);\n return result;\n }",
"default Escaper escaping(char c) {\n return and((char c1) -> {\n if (c1 == c) {\n return \"\\\\\" + c;\n }\n return null;\n });\n }",
"@Test\n public void testEscapeCurlyBraces() {\n assertEquals(\"\\\\{\", HtmlUnitRegExpProxy.escapeJSCurly(\"{\"));\n assertEquals(\"\\\\{\", HtmlUnitRegExpProxy.escapeJSCurly(\"\\\\{\"));\n assertEquals(\"\\\\}\", HtmlUnitRegExpProxy.escapeJSCurly(\"}\"));\n assertEquals(\"\\\\}\", HtmlUnitRegExpProxy.escapeJSCurly(\"\\\\}\"));\n assertEquals(\"(^|\\\\{)#([^\\\\}]+)(\\\\}|$)\", HtmlUnitRegExpProxy.escapeJSCurly(\"(^|{)#([^}]+)(}|$)\"));\n\n assertEquals(\"a{5}\", HtmlUnitRegExpProxy.escapeJSCurly(\"a{5}\"));\n assertEquals(\"a{5,}\", HtmlUnitRegExpProxy.escapeJSCurly(\"a{5,}\"));\n assertEquals(\"a{5,10}\", HtmlUnitRegExpProxy.escapeJSCurly(\"a{5,10}\"));\n }",
"private static String escape(String value, String chars, String escapeSequence) {\n\t\tString escaped = value;\n\t\t\n\t\tif (escaped == null) {\n\t\t\treturn \"\";\n\t\t}\n\t\t\n\t\tfor (char ch : chars.toCharArray()) {\n\t\t\tescaped = escaped.replaceAll(String.valueOf(ch), escapeSequence + ch);\n\t\t}\n\t\n\t\treturn escaped;\n\t}",
"@Override\n protected void compileRegex(String regex) {\n }",
"public static String toRegex(String param) \r\n\t{\r\n\t\tStringBuffer regex = new StringBuffer();\r\n\t\tfor( int i=0; i < param.length(); i++ ) \r\n\t\t{\r\n\t\t\tchar next = param.charAt( i );\r\n\t\t\t if ('*' == next) regex.append( \".+\" ); // -> multi-character match wild card\r\n\t\t\telse if ('?' == next) regex.append( \".\" ); // -> single-character match wild card\r\n\t\t\telse if ('.' == next) regex.append( \"\\\\.\" ); // all of these are special regex characters we are quoting\r\n\t\t\telse if ('+' == next) regex.append( \"\\\\+\" ); \r\n\t\t\telse if ('$' == next) regex.append( \"\\\\$\" ); \r\n\t\t\telse if ('\\\\' == next) regex.append( \"\\\\\\\\\" ); \r\n\t\t\telse if ('[' == next) regex.append( \"\\\\[\" ); \r\n\t\t\telse if (']' == next) regex.append( \"\\\\]\" ); \r\n\t\t\telse if ('{' == next) regex.append( \"\\\\{\" ); \r\n\t\t\telse if ('}' == next) regex.append( \"\\\\}\" ); \r\n\t\t\telse if ('(' == next) regex.append( \"\\\\(\" ); \r\n\t\t\telse if (')' == next) regex.append( \"\\\\)\" ); \r\n\t\t\telse if ('&' == next) regex.append( \"\\\\&\" ); \r\n\t\t\telse if ('^' == next) regex.append( \"\\\\^\" ); \r\n\t\t\telse if ('-' == next) regex.append( \"\\\\-\" ); \r\n\t\t\telse if ('|' == next) regex.append( \"\\\\|\" ); \r\n\t\t\telse regex.append( next );\r\n\t\t}\r\n\t\t\r\n\t\treturn regex.toString();\r\n\t}",
"default String escape(CharSequence input) {\n return Strings.escape(input, this);\n }",
"@Test\n public void testStringLiteralEscapedTick() throws Exception {\n String sql = \"SELECT 'O''Leary' FROM a.g1\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n Node constantNode = verifyExpressionSymbol(selectNode, Select.SYMBOLS_REF_NAME, 1, Constant.ID);\n verifyProperty(constantNode, Constant.VALUE_PROP_NAME, \"O'Leary\");\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n verifyUnaryFromClauseGroup(fromNode, From.CLAUSES_REF_NAME, 1, \"a.g1\");\n \n verifySql(sql, fileNode);\n }",
"public static String literalReplaceAll(String pattern, String replacement, String in) {\n return literalReplaceAll(pattern, replacement, in, false).toString();\n }",
"private static void escape(CharSequence s, Appendable out) throws IOException {\n for (int i = 0; i < s.length(); i++) {\n char ch = s.charAt(i);\n switch (ch) {\n case '\"':\n out.append(\"\\\\\\\"\");\n break;\n case '\\\\':\n out.append(\"\\\\\\\\\");\n break;\n case '\\b':\n out.append(\"\\\\b\");\n break;\n case '\\f':\n out.append(\"\\\\f\");\n break;\n case '\\n':\n out.append(\"\\\\n\");\n break;\n case '\\r':\n out.append(\"\\\\r\");\n break;\n case '\\t':\n out.append(\"\\\\t\");\n break;\n case '/':\n out.append(\"\\\\/\");\n break;\n default:\n // Reference: http://www.unicode.org/versions/Unicode5.1.0/\n if ((ch >= '\\u0000' && ch <= '\\u001F')\n || (ch >= '\\u007F' && ch <= '\\u009F')\n || (ch >= '\\u2000' && ch <= '\\u20FF')) {\n String ss = Ascii.toUpperCase(Integer.toHexString(ch));\n out.append(\"\\\\u\");\n out.append(Strings.padStart(ss, 4, '0'));\n } else {\n out.append(ch);\n }\n }\n }\n }",
"@Test\n public void testLikeWithEscape() throws Exception {\n String sql = \"SELECT a from db.g where b like '#String' escape '#'\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n verifyElementSymbol(selectNode, Select.SYMBOLS_REF_NAME, \"a\");\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n verifyUnaryFromClauseGroup(fromNode, From.CLAUSES_REF_NAME, \"db.g\");\n\n Node criteriaNode = verify(queryNode, Query.CRITERIA_REF_NAME, MatchCriteria.ID);\n verifyProperty(criteriaNode, MatchCriteria.ESCAPE_CHAR_PROP_NAME, \"#\");\n verifyElementSymbol(criteriaNode, MatchCriteria.LEFT_EXPRESSION_REF_NAME, \"b\");\n verifyConstant(criteriaNode, MatchCriteria.RIGHT_EXPRESSION_REF_NAME, \"#String\");\n \n verifySql(\"SELECT a FROM db.g WHERE b LIKE '#String' ESCAPE '#'\", fileNode);\n }",
"static public String escapeCommand(String command) {\n String res = command.replaceAll(\"'\", \"'\\\\\\\\''\");\n return \"'\" + res + \"'\";\n }",
"@Test\n public void testRegexWithNonEscapedCurlyBraces() throws Exception {\n final String html = \"<html><head><title>foo</title><script>\\n\"\n + \" function test() {\\n\"\n + \" var regexp = /(^|{)#([^}]+)(}|$)/;\\n\"\n + \" var str = '|{#abcd}|';\\n\"\n + \" alert(str.match(regexp))\\n\"\n + \" }\\n\"\n + \"</script></head><body onload='test()'>\\n\"\n + \"</body></html>\";\n \n final String[] expectedAlerts = {\"{#abcd},{,abcd,}\"};\n final List<String> collectedAlerts = new ArrayList<String>();\n createTestPageForRealBrowserIfNeeded(html, expectedAlerts);\n loadPage(html, collectedAlerts);\n assertEquals(expectedAlerts, collectedAlerts);\n }",
"private String constructEscapedSolrQuery(String query, boolean literal_query) {\n StringBuilder highlightQuery = new StringBuilder();\n String highLightField;\n if (literal_query) {\n highLightField = LuceneQuery.HIGHLIGHT_FIELD_LITERAL;\n } else {\n highLightField = LuceneQuery.HIGHLIGHT_FIELD_REGEX;\n }\n highlightQuery.append(highLightField).append(\":\").append(\"\\\"\").append(KeywordSearchUtil.escapeLuceneQuery(query)).append(\"\\\"\");\n return highlightQuery.toString();\n }",
"private LiteralToken nextRegularExpressionLiteralToken() {\n LiteralToken token = scanner.nextRegularExpressionLiteralToken();\n lastSourcePosition = token.location.end;\n return token;\n }",
"public static String customEscapeQueryChars(String s) {\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < s.length(); i++) {\n char c = s.charAt(i);\n // These characters are part of the query syntax and must be escaped\n if (c == '\\\\' || c == '+' || c == '-' || c == '!' || c == '(' || c == ')' || c == ':'\n || c == '^' || c == '[' || c == ']' || c == '\\\"' || c == '{' || c == '}'\n || c == '~' || c == '?' || c == '|' || c == '&' || c == ';' || c == '/'\n || Character.isWhitespace(c)) {\n sb.append('\\\\');\n }\n sb.append(c);\n }\n return sb.toString();\n }",
"private String escapeString(String value, String queryLanguage) {\n String escaped = null;\n if (value != null) {\n if (queryLanguage.equals(Query.XPATH) || queryLanguage.equals(Query.SQL)) {\n // See JSR-170 spec v1.0, Sec. 6.6.4.9 and 6.6.5.2\n escaped = value.replaceAll(\"\\\\\\\\(?![-\\\"])\", \"\\\\\\\\\\\\\\\\\").replaceAll(\"'\", \"\\\\\\\\'\")\n .replaceAll(\"'\", \"''\");\n }\n }\n return escaped;\n }",
"public static String escapeJS(String inText)\n {\n return inText\n .replaceAll(\"(?<!\\\\\\\\)'\", \"\\\\\\\\'\")\n .replaceAll(\"(?<!\\\\\\\\)\\\"\", \"\\\\\\\\\\\"\")\n .replaceAll(\"\\n\", \"\\\\\\\\n\");\n }",
"public static String wildcardToRegex(String wildcard){\r\n StringBuffer s = new StringBuffer(wildcard.length());\r\n s.append('^');\r\n for (int i = 0, is = wildcard.length(); i < is; i++) {\r\n char c = wildcard.charAt(i);\r\n switch(c) {\r\n case '*':\r\n s.append(\".*\");\r\n break;\r\n case '?':\r\n s.append(\".\");\r\n break;\r\n // escape special regexp-characters\r\n case '(': case ')': case '[': case ']': case '$':\r\n case '^': case '.': case '{': case '}': case '|':\r\n case '\\\\':\r\n s.append(\"\\\\\");\r\n s.append(c);\r\n break;\r\n default:\r\n s.append(c);\r\n break;\r\n }\r\n }\r\n s.append('$');\r\n return(s.toString());\r\n }",
"private static String escapeString(final String input) {\n switch (input) {\n case \"\\\\n\":\n return \"\\n\";\n case \"\\\\r\":\n return \"\\r\";\n case \"\\\\t\":\n return \"\\t\";\n case \"\\\\_\":\n return \" \";\n default:\n return input;\n }\n }",
"public String escapeSpetialCharecters(String string)\r\n {\r\n return string.replaceAll(\"(?=[]\\\\[+&|!(){}^\\\"~*?:\\\\\\\\-])\", \"\\\\\\\\\");\r\n }",
"public Literal setLiteralString(String literalData);",
"private static String addEscapes(String text, char[] escapedChars, String escapeDelimiter) {\n\t\tfor (int i = 0; i < text.length(); i++) {\n\t\t\tif (inArray(text.charAt(i), escapedChars)) {\n\t\t\t\ttext = text.substring(0, i) + escapeDelimiter + text.charAt(i) + text.substring(i + 1, text.length());\n\t\t\t\ti += escapeDelimiter.length();\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn text;\n\t}",
"private boolean escape() {\r\n return backslash() && (\r\n (digits() && (CHAR(';') || true)) || SET(\"rnqdgb\"));\r\n }",
"Rule SingleQuotedLiteral() {\n return Sequence(\n \"'\",\n ZeroOrMore(NoneOf(\"'\")),\n \"'\");\n }",
"private String escape(String s) {\r\n StringBuilder sb = new StringBuilder();\r\n for (int i = 0; i < s.length(); ) {\r\n int ch = s.codePointAt(i);\r\n i += Character.charCount(ch);\r\n if (' ' <= ch && ch <= '~') sb.append((char)ch);\r\n else {\r\n sb.append(\"\\\\\");\r\n sb.append(ch);\r\n if (i < s.length()) {\r\n ch = s.charAt(i);\r\n if (ch == ';' || ('0' <= ch && ch <= '9')) sb.append(';');\r\n }\r\n }\r\n }\r\n return sb.toString();\r\n }",
"public static String escapeGlob(String path) {\n\t\treturn GLOB_META.matcher(path).replaceAll(\"\\\\\\\\$1\");\n\t}",
"InvalidLiteralExp createInvalidLiteralExp();",
"public interface Escaper {\n\n /**\n * Escape one character, returning an escaped version of it if one is\n * needed, and otherwise returning null.\n *\n * @param c A character\n * @return A character sequence to replace the character with, or null if no\n * escaping is needed\n */\n CharSequence escape(char c);\n\n /**\n * Returns an escaped version of the input character sequence using this\n * Escaper.\n *\n * @param input The input\n * @return The escaped version of it\n */\n default String escape(CharSequence input) {\n return Strings.escape(input, this);\n }\n\n /**\n * Escape a character with contextual information about the current position\n * and the preceding character (will be 0 on the first character); a few\n * escapers that respond to things like delimiters and camel casing make use\n * of this; the default is simply to call <code>escape(c)</code>\n *\n * @param c The character to escape\n * @param index The index of the character within the string\n * @param of The total number of characters in this string\n * @param prev The preceding character\n * @return A CharSequence if the character cannot be used as-is, or null if\n * it can\n */\n default CharSequence escape(char c, int index, int of, char prev) {\n return escape(c);\n }\n\n /**\n * For use when logging a badly encoded string. Converts unencodable\n * characters to hex and ISO control characters to hex or their standard\n * escaped Java string representation if there is one (e.g. 0x05 ->\n * \"<0x05>\" but \\n -> \"\\n\").\n *\n * @param cs The character set.\n * @return A string representation that does not include raw unencodable or\n * control characters.\n */\n static Escaper escapeUnencodableAndControlCharacters(Charset cs) {\n CharsetEncoder enc = cs.newEncoder();\n return c -> {\n switch (c) {\n case '\\t':\n return \"\\\\t\";\n case '\\r':\n return \"\\\\r\";\n case '\\n':\n return \"\\\\n\";\n }\n if (!enc.canEncode(c) || Character.isISOControl(c)) {\n return \"<0x\" + Strings.toHex(c) + \">\";\n }\n return null;\n };\n }\n\n /**\n * Returns an escaper which does not escape the specified character, but\n * otherwise behaves the same as its parent.\n *\n * @param c A character\n * @return a new escaper\n */\n default Escaper ignoring(char c) {\n return c1 -> {\n if (c1 == c) {\n return null;\n }\n return this.escape(c);\n };\n }\n\n /**\n * Combine this escaper with another, such that the passed escaper is used\n * only on characters this escaper did not escape.\n *\n * @param other Another escaper\n * @return A new escaper\n */\n default Escaper and(Escaper other) {\n return new Escaper() {\n @Override\n public CharSequence escape(char c) {\n CharSequence result = Escaper.this.escape(c);\n return result == null ? other.escape(c) : result;\n }\n\n @Override\n public CharSequence escape(char c, int index, int of, char prev) {\n CharSequence result = Escaper.this.escape(c, index, of, prev);\n return result == null ? other.escape(c, index, of, prev) : result;\n }\n };\n }\n\n /**\n * Returns a new escaper which will also escape the passed character by\n * prefixing it with \\ in output.\n *\n * @param c A character\n * @return A new escaper\n */\n default Escaper escaping(char c) {\n return and((char c1) -> {\n if (c1 == c) {\n return \"\\\\\" + c;\n }\n return null;\n });\n }\n\n /**\n * Adds the behavior of escaping \" characters.\n *\n * @return A new escaper\n */\n default Escaper escapeDoubleQuotes() {\n return and((char c) -> {\n if (c == '\"') {\n return \"\\\\\\\"\";\n }\n return null;\n });\n }\n\n /**\n * Adds the behavior of escaping ' characters.\n *\n * @return A new escaper\n */\n default Escaper escapeSingleQuotes() {\n return and((char c) -> {\n if (c == '\"') {\n return \"\\\\\\\"\";\n }\n return null;\n });\n }\n\n /**\n * Converts some text incorporating symbols into a legal Java identifier,\n * separating symbol names and spaces in unicode character names with\n * underscores. Uses programmer-friendly character names for commonly used\n * characters (e.g. \\ is \"Backslash\" instead of the unicode name \"reverse\n * solidus\" (!). Useful when you have some text that needs to be converted\n * into a variable name in generated code and be recognizable as what it\n * refers to.\n */\n public static Escaper JAVA_IDENTIFIER_DELIMITED = new SymbolEscaper(true);\n\n /**\n * Converts some text incorporating symbols into a legal Java identifier,\n * separating symbol names and spaces using casing. Uses programmer-friendly\n * character names for commonly used characters (e.g. \\ is \"Backslash\"\n * instead of the unicode name \"reverse solidus\" (!). Useful when you have\n * some text that needs to be converted into a variable name in generated\n * code and be recognizable as what it refers to.\n */\n public static Escaper JAVA_IDENTIFIER_CAMEL_CASE = new SymbolEscaper(false);\n\n /**\n * Escapes double quotes, ampersands, less-than and greater-than to their\n * SGML entities.\n */\n public static Escaper BASIC_HTML = c -> {\n switch (c) {\n case '\"':\n return \""\";\n case '\\'':\n return \"'\";\n case '&':\n return \"&\";\n case '<':\n return \"<\";\n case '>':\n return \">\";\n case '©':\n return \"©\";\n case '®':\n return \"®\";\n case '\\u2122':\n return \"™\";\n case '¢':\n return \"¢\";\n case '£':\n return \"£\";\n case '¥':\n return \"¥\";\n case '€':\n return \"€\";\n default:\n return null;\n }\n };\n\n /**\n * Escapes the usual HTML to SGML entities, plus escaping @, { and }, which\n * can otherwise result in javadoc build failures if they appear in code\n * samples.\n */\n public static Escaper JAVADOC_CODE_SAMPLE = c -> {\n switch (c) {\n case '@':\n return \"@\";\n case '{':\n return \"{\";\n case '}':\n return \"}\";\n case '\"':\n return \""\";\n case '\\'':\n return \"'\";\n case '&':\n return \"&\";\n case '<':\n return \"<\";\n case '>':\n return \">\";\n case '©':\n return \"©\";\n case '®':\n return \"®\";\n case '\\u2122':\n return \"™\";\n case '¢':\n return \"¢\";\n case '£':\n return \"£\";\n case '¥':\n return \"¥\";\n case '€':\n return \"€\";\n default:\n return null;\n }\n };\n\n /**\n * Escapes double quotes, ampersands, less-than and greater-than to their\n * SGML entities, and replaces \\n with <br>.\n */\n public static Escaper HTML_WITH_LINE_BREAKS = c -> {\n CharSequence result = BASIC_HTML.escape(c);\n if (result == null) {\n switch (c) {\n case '\\r':\n result = \"\";\n break;\n case '\\n':\n result = \"<br>\";\n }\n }\n return result;\n };\n\n /**\n * Replaces \\n, \\r, \\t and \\b with literal strings starting with \\.\n */\n public static Escaper NEWLINES_AND_OTHER_WHITESPACE = c -> {\n switch (c) {\n case '\\n':\n return \"\\\\n\";\n case '\\t':\n return \"\\\\t\";\n case '\\r':\n return \"\\\\r\";\n case '\\b':\n return \"\\\\b\";\n default:\n return null;\n }\n };\n\n /**\n * Escapes the standard characters which must be escaped for generating\n * valid lines of code in Java or Javascript - \\n, \\r, \\t, \\b, \\f and \\.\n * Does <i>not</i> escape quote characters (this may differ based on the\n * target language) - call escapeSingleQuotes() or escapeDoubleQuotes() to\n * create a wrapper around this escaper which does that.\n */\n public static Escaper CONTROL_CHARACTERS = c -> {\n switch (c) {\n case '\\n':\n return \"\\\\n\";\n case '\\r':\n return \"\\\\r\";\n case '\\t':\n return \"\\\\t\";\n case '\\b':\n return \"\\\\b\";\n case '\\f':\n return \"\\\\f\";\n case '\\\\':\n return \"\\\\\\\\\";\n default:\n return null;\n }\n };\n\n /**\n * Omits characters which are neither letters nor digits - useful for\n * hash-matching text that may have varying amounts of whitespace or other\n * non-semantic formatting differences.\n */\n public static Escaper OMIT_NON_WORD_CHARACTERS = c -> {\n return !Character.isDigit(c) && !Character.isLetter(c) ? \"\"\n : Character.toString(c);\n };\n}",
"public String escape(final String input) {\n\t\tStringBuilder builder = new StringBuilder(input);\n\t\tescape(builder);\n\t\treturn builder.toString();\n\t}",
"private String sanitizeSpecialChars(String value) {\n return value.replaceAll(\"[^a-zA-Z0-9_]\", \"_\");\n }",
"public String escapeForVideoFilter(String input) {\n\t\t//return input.replace(\"\\\\\", \"\\\\\\\\\").replace(\",\", \"\\\\,\").replace(\";\", \"\\\\;\").replace(\":\", \"\\\\:\")\n\t\t//\t\t.replace(\"'\", \"\\\\'\").replace(\"[\", \"\\\\[\").replace(\"]\", \"\\\\]\").replace(\"=\", \"\\\\=\");\n\t\treturn \"'\" + input.replace(\"'\", \"'\\\\''\") + \"'\";\n\t}",
"private String translatePattern(String pattern) {\r\n StringBuffer sb = new StringBuffer();\r\n boolean escaped = false;\r\n for (int i = 0; i < pattern.length(); i++) {\r\n char c = pattern.charAt(i);\r\n if (c == '\\\\') {\r\n sb.append('\\\\');\r\n escaped = true;\r\n continue;\r\n }\r\n if (escaped) {\r\n sb.append(c);\r\n }\r\n else if (c == '*') {\r\n sb.append('%');\r\n }\r\n else if (c == '?') {\r\n sb.append('_');\r\n }\r\n else {\r\n if ((c == '%') || (c == '_')) {\r\n sb.append('\\\\');\r\n }\r\n sb.append(c);\r\n }\r\n\r\n escaped = false;\r\n }\r\n return sb.toString();\r\n }",
"public final native void setRegex(String regex) /*-{\n\t\tthis.regex = regex;\n\t}-*/;",
"static String escapePathName(String path) {\n if (path == null || path.length() == 0) {\n throw new RuntimeException(\"Path should not be null or empty: \" + path);\n }\n\n StringBuilder sb = null;\n for (int i = 0; i < path.length(); i++) {\n char c = path.charAt(i);\n if (needsEscaping(c)) {\n if (sb == null) {\n sb = new StringBuilder(path.length() + 2);\n for (int j = 0; j < i; j++) {\n sb.append(path.charAt(j));\n }\n }\n escapeChar(c, sb);\n } else if (sb != null) {\n sb.append(c);\n }\n }\n if (sb == null) {\n return path;\n }\n return sb.toString();\n }",
"static String escape(String str,char quote) {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(quote);\n\t\tsb.append(str.replaceAll(Character.toString(quote), \"\\\\\"+quote));\n\t\tsb.append(quote);\n\t\treturn sb.toString();\n\t}",
"String escapeReservedWords(String query);",
"RealLiteralExp createRealLiteralExp();",
"public static void escapeLikeValue(StringBuilder sb, String value, char escapeChar) {\n for (int i = 0; i < value.length(); i++) {\n char ch = value.charAt(i);\n if (ch == '%' || ch == '_') {\n sb.append(escapeChar);\n }\n sb.append(ch);\n }\n }",
"EscapeStatement createEscapeStatement();",
"@Test //TEST FIVE\n void testSpecialCharactersRabbitName()\n {\n Rabbit_RegEx rabbit_Name = new Rabbit_RegEx();\n rabbit_Name.setRabbitName(\"Pot!at!*\"); //potat or potato w/out an o\n assertFalse(rabbit_Name.getRabbitName().matches(\"[A-Za-z-]*\"));\n }",
"default Escaper escapeDoubleQuotes() {\n return and((char c) -> {\n if (c == '\"') {\n return \"\\\\\\\"\";\n }\n return null;\n });\n }",
"private static String adaptRegEx(Mode mode, String regex, int flagMask, boolean removeWhitespace)\n throws QueryException {\n StringBuilder sb = new StringBuilder();\n boolean escaped = false;\n boolean groupStart = false;\n int completeGroups = 0;\n int backRef = 0;\n int charClassDepth = 0;\n int groupDepth = 0;\n\n for (char c : regex.toCharArray()) {\n if (escaped) {\n if (backRef == 0 && c == '0') {\n throw new QueryException(ErrorCode.ERR_INVALID_REGULAR_EXPRESSION, \"Reference to group 0 not allowed\");\n } else if (c >= '0' && c <= '9') {\n if (charClassDepth > 0) {\n throw new QueryException(ErrorCode.ERR_INVALID_REGULAR_EXPRESSION,\n \"Back references in character class expressions\" + \" are disallowed.\");\n }\n backRef = backRef * 10 + Integer.parseInt(Character.toString(c));\n continue;\n }\n }\n\n if (backRef > 0) {\n // Check back reference that just ended\n if (backRef > completeGroups) {\n throw new QueryException(ErrorCode.ERR_INVALID_REGULAR_EXPRESSION,\n \"Back reference to nonexisting or unfinished group.\");\n } else {\n backRef = 0;\n escaped = false;\n }\n }\n\n if (c == '\\\\' && !escaped) {\n // Not preceded by backslash\n escaped = true;\n groupStart = false;\n continue;\n }\n\n if (c == '(' && !escaped) {\n groupStart = true;\n groupDepth++;\n escaped = false;\n continue;\n }\n\n if (c == '?' && !escaped && groupStart) {\n throw new QueryException(ErrorCode.ERR_INVALID_REGULAR_EXPRESSION,\n \"Pure groups are not supported in XQuery regular expressions.\");\n } else if (c == ')' && !escaped) {\n if (--groupDepth < 0) {\n throw new QueryException(ErrorCode.ERR_INVALID_REGULAR_EXPRESSION, \"Invalid sequence of brackets.\");\n }\n completeGroups++;\n } else if (c == '[' && !escaped) {\n charClassDepth++;\n } else if (c == ']' && !escaped) {\n if (--charClassDepth < 0) {\n throw new QueryException(ErrorCode.ERR_INVALID_REGULAR_EXPRESSION, \"Invalid sequence of brackets.\");\n }\n } else if (removeWhitespace) {\n // Remove whitespace outside of character classes\n if (charClassDepth == 0 && WHITESPACE.contains(c)) {\n // Don't touch boolean flags\n continue;\n }\n\n sb.append(c);\n }\n\n groupStart = false;\n escaped = false;\n }\n\n // Check for trailing '\\' (only valid with subsequent characters)\n if (escaped && backRef == 0) {\n throw new QueryException(ErrorCode.ERR_INVALID_REGULAR_EXPRESSION, \"Trailing backslash character in pattern.\");\n }\n\n // Check back reference if that was last token in pattern\n if (backRef > 0 && backRef > completeGroups) {\n throw new QueryException(ErrorCode.ERR_INVALID_REGULAR_EXPRESSION,\n \"Back reference to nonexisting or unfinished group.\");\n }\n\n // Check for dangling brackets\n if (charClassDepth != 0 || groupDepth != 0) {\n throw new QueryException(ErrorCode.ERR_INVALID_REGULAR_EXPRESSION, \"Pattern contains dangling brackets.\");\n }\n\n if (!removeWhitespace) {\n sb.append(regex);\n }\n\n if (mode == Mode.MATCH) {\n // Adapt for XQuery substring matching by extending pattern\n if (sb.charAt(0) != '^' || ((flagMask & Pattern.MULTILINE) == Pattern.MULTILINE)) {\n if ((flagMask & Pattern.DOTALL) == Pattern.DOTALL) {\n sb.insert(0, \".*\");\n } else {\n sb.insert(0, \"(?s:.*)\");\n }\n }\n\n if (sb.charAt(sb.length() - 1) != '$' || ((flagMask & Pattern.MULTILINE) == Pattern.MULTILINE)) {\n if ((flagMask & Pattern.DOTALL) == Pattern.DOTALL) {\n sb.append(\".*\");\n } else {\n sb.append(\"(?s:.*)\");\n }\n }\n }\n\n return sb.toString();\n }",
"Rule Literal() {\n // Push 1 LiteralNode onto the value stack\n return Sequence(\n FirstOf(\n SingleQuotedLiteral(),\n DoubleQuotedLiteral()),\n actions.pushLiteralNode());\n }",
"@Override\n public boolean isRegex() {\n return false;\n }",
"StringLiteralExp createStringLiteralExp();",
"@Test\n public void testStringLiteralEscapedTick3() throws Exception {\n String sql = \"SELECT 'a''b''c' FROM a.g1\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n Node constantNode = verifyExpressionSymbol(selectNode, Select.SYMBOLS_REF_NAME, 1, Constant.ID);\n verifyProperty(constantNode, Constant.VALUE_PROP_NAME, \"a'b'c\");\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n verifyUnaryFromClauseGroup(fromNode, From.CLAUSES_REF_NAME, 1, \"a.g1\");\n \n verifySql(sql, fileNode);\n }",
"protected String add_escapes(String str) {\n StringBuffer retval = new StringBuffer();\n char ch;\n for (int i = 0; i < str.length(); i++) {\n switch (str.charAt(i)) {\n case 0:\n continue;\n case '\\b':\n retval.append(\"\\\\b\");\n continue;\n case '\\t':\n retval.append(\"\\\\t\");\n continue;\n case '\\n':\n retval.append(\"\\\\n\");\n continue;\n case '\\f':\n retval.append(\"\\\\f\");\n continue;\n case '\\r':\n retval.append(\"\\\\r\");\n continue;\n case '\\\"':\n retval.append(\"\\\\\\\"\");\n continue;\n case '\\'':\n retval.append(\"\\\\\\'\");\n continue;\n case '\\\\':\n retval.append(\"\\\\\\\\\");\n continue;\n default:\n if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {\n String s = \"0000\" + Integer.toString(ch, 16);\n retval.append(\"\\\\u\" + s.substring(s.length() - 4, s.length()));\n } else {\n retval.append(ch);\n }\n continue;\n }\n }\n return retval.toString();\n }",
"private String escapeName(String name) {\n return (name != null && name.indexOf('\"') > 0) ?\n name.replaceAll(\"\\\"\", \"\\\\\\\\\\\"\") : name;\n }",
"private static String encodeSegment(final String segment) {\r\n\t\tfinal Matcher matcher = SPECIAL_CHARACTERS_PATTERN.matcher(segment);\r\n\t\treturn matcher.replaceAll(\"\\\\\\\\$1\");\r\n\t}",
"private String escape(String token) {\n return token.replace(\",\" , \"\");\n }",
"public interface EscapeMarker {}",
"default Escaper escapeSingleQuotes() {\n return and((char c) -> {\n if (c == '\"') {\n return \"\\\\\\\"\";\n }\n return null;\n });\n }",
"public void setRegex (String regex)\n {\n this.regex = regex;\n }",
"public static String escape(String input) {\n\t\tboolean insidequote = false;\n\t\tString output = \"\";\n\t\tfor (int i = 0; i < input.length(); i++) {\n\t\t\tchar current = input.charAt(i);\n\t\t\tif (current == '\\'') {\n\t\t\t\tinsidequote = !insidequote;\n\t\t\t\toutput += current;\n\t\t\t} else if (insidequote) {\n\t\t\t\tif (current == ' ') {\n\t\t\t\t\toutput += \"\\\\s\";\n\t\t\t\t} else if (current == '\\t') {\n\t\t\t\t\toutput += \"\\\\t\";\n\t\t\t\t} else if (current == ',') {\n\t\t\t\t\toutput += \"\\\\c\";\n\t\t\t\t} else if (current == '\\\\') {\n\t\t\t\t\toutput += \"\\\\b\";\n\t\t\t\t} else if (current == ';') {\n\t\t\t\t\toutput += \"\\\\p\";\n\t\t\t\t} else if (current == ':') {\n\t\t\t\t\toutput += \"\\\\d\";\n\t\t\t\t} else {\n\t\t\t\t\toutput += current;\n\t\t\t\t} // no uppercase inside quoted strings!\n\t\t\t} else {\n\t\t\t\tif (current == ',') {\n\t\t\t\t\toutput += \" , \"; // add spaces around every comma\n\t\t\t\t} else {\n\t\t\t\t\toutput += current;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn output;\n\t}",
"public static String escape(String string) throws UnsupportedEncodingException {\n\t\t\n fill();\n \n StringBuilder bufOutput = new StringBuilder(string);\n for (int i = 0; i < bufOutput.length(); i++) {\n //String replacement = (String) SPARQL_ESCAPE_SEARCH_REPLACEMENTS.get(\"\" + bufOutput.charAt(i));\n // if(replacement!=null) {\n if( SPARQL_ESCAPE_SEARCH_REPLACEMENTS.contains(bufOutput.charAt(i))) {\n String replacement = URLEncoder.encode( Character.toString(bufOutput.charAt(i)), \"UTF-8\");\n bufOutput.deleteCharAt(i);\n bufOutput.insert(i, replacement);\n // advance past the replacement\n i += (replacement.length() - 1);\n }\n }\n return bufOutput.toString();\n\t}",
"private String escapeFragment(String pathFragment) {\n\t\treturn pathFragment.replaceAll(\"~\", \"~0\").replaceAll(\"\\\\/\", \"~1\");\n\t}",
"@Test\n public void testMethod() {\n Engine e = new Engine( \"[[\", \"]]\", (int) '@', new HashMap<String, String>() );\n assertThat( e.isEscape( '@' ) ).isTrue();\n assertThat( e.isEscape( '\\\\' ) ).isFalse();\n }",
"@Test void testHexCharLiteralOutsideRangeFails() {\n final String sql = \"^_unicode'cg'^XCF\";\n final String expected = \"Unknown character set 'unicode'\";\n expr(sql).fails(expected);\n }",
"private void writeEscaped(String in)\n\t\tthrows IOException\n\t{\n\t\tfor(int i=0, n=in.length(); i<n; i++)\n\t\t{\n\t\t\tchar c = in.charAt(i);\n\t\t\tif(c == '\"' || c == '\\\\')\n\t\t\t{\n\t\t\t\twriter.write('\\\\');\n\t\t\t\twriter.write(c);\n\t\t\t}\n\t\t\telse if(c == '\\r')\n\t\t\t{\n\t\t\t\twriter.write('\\\\');\n\t\t\t\twriter.write('r');\n\t\t\t}\n\t\t\telse if(c == '\\n')\n\t\t\t{\n\t\t\t\twriter.write('\\\\');\n\t\t\t\twriter.write('n');\n\t\t\t}\n\t\t\telse if(c == '\\t')\n\t\t\t{\n\t\t\t\twriter.write('\\\\');\n\t\t\t\twriter.write('t');\n\t\t\t}\n\t\t\telse if(c == '\\b')\n\t\t\t{\n\t\t\t\twriter.write('\\\\');\n\t\t\t\twriter.write('b');\n\t\t\t}\n\t\t\telse if(c == '\\f')\n\t\t\t{\n\t\t\t\twriter.write('\\\\');\n\t\t\t\twriter.write('f');\n\t\t\t}\n\t\t\telse if(c <= 0x1F)\n\t\t\t{\n\t\t\t\twriter.write('\\\\');\n\t\t\t\twriter.write('u');\n\n\t\t\t\tint v = c;\n\t\t\t\tint pos = 4;\n\t\t\t\tdo\n\t\t\t\t{\n\t\t\t\t\tencoded[--pos] = DIGITS[v & HEX_MASK];\n\t\t\t\t\tv >>>= 4;\n\t\t\t\t}\n\t\t\t\twhile (v != 0);\n\n\t\t\t\tfor(int j=0; j<pos; j++) writer.write('0');\n\t\t\t\twriter.write(encoded, pos, 4 - pos);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\twriter.write(c);\n\t\t\t}\n\t\t}\n\t}",
"@Test\n public void testStringLiteralEscapedTick2() throws Exception {\n String sql = \"SELECT '''abc''' FROM a.g1\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n Node constantNode = verifyExpressionSymbol(selectNode, Select.SYMBOLS_REF_NAME, 1, Constant.ID);\n verifyProperty(constantNode, Constant.VALUE_PROP_NAME, \"'abc'\");\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n verifyUnaryFromClauseGroup(fromNode, From.CLAUSES_REF_NAME, 1, \"a.g1\");\n \n verifySql(sql, fileNode);\n }",
"protected String escapeBrackets(String input) {\n\t\tString replacement = \"\\\\\\\\[{group1}\\\\\\\\]\";\n\t\treturn RegexUtil.loopRegex(input, doubleBrackets, replacement);\n\t}",
"public String escapeIdentifier(String identifierName);",
"static String uriEscapeString(String unescaped) {\n try {\n return URLEncoder.encode(unescaped, \"UTF-8\");\n } catch (UnsupportedEncodingException e) {\n // This is fatal.\n throw new RuntimeException(e);\n }\n }",
"public StringEscape(final Map<Character, Character> mapping) {\n\t\tthis(mapping, '\\\\');\n\t}",
"private boolean hasSpecialCharacters(String s) {\r\n\t\t\tif (s != s.replaceAll(\"([^A-Za-z0-9.,!?~`'\\\"% _-]+)\", \"\")) return true;\r\n\t\t\treturn false;\r\n\t}",
"public final void mRULE_LITERAL_CHAR() throws RecognitionException {\n try {\n // InternalUniMapperGenerator.g:5117:28: ( ( RULE_ESC | ~ ( ( '\\\\'' | '\\\\\\\\' ) ) ) )\n // InternalUniMapperGenerator.g:5117:30: ( RULE_ESC | ~ ( ( '\\\\'' | '\\\\\\\\' ) ) )\n {\n // InternalUniMapperGenerator.g:5117:30: ( RULE_ESC | ~ ( ( '\\\\'' | '\\\\\\\\' ) ) )\n int alt7=2;\n int LA7_0 = input.LA(1);\n\n if ( (LA7_0=='\\\\') ) {\n alt7=1;\n }\n else if ( ((LA7_0>='\\u0000' && LA7_0<='&')||(LA7_0>='(' && LA7_0<='[')||(LA7_0>=']' && LA7_0<='\\uFFFF')) ) {\n alt7=2;\n }\n else {\n NoViableAltException nvae =\n new NoViableAltException(\"\", 7, 0, input);\n\n throw nvae;\n }\n switch (alt7) {\n case 1 :\n // InternalUniMapperGenerator.g:5117:31: RULE_ESC\n {\n mRULE_ESC(); \n\n }\n break;\n case 2 :\n // InternalUniMapperGenerator.g:5117:40: ~ ( ( '\\\\'' | '\\\\\\\\' ) )\n {\n if ( (input.LA(1)>='\\u0000' && input.LA(1)<='&')||(input.LA(1)>='(' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\\uFFFF') ) {\n input.consume();\n\n }\n else {\n MismatchedSetException mse = new MismatchedSetException(null,input);\n recover(mse);\n throw mse;}\n\n\n }\n break;\n\n }\n\n\n }\n\n }\n finally {\n }\n }",
"private String doubleQuote( String raw ) { return '\"' + raw + '\"'; }",
"public String htmlSpecialChar(String string){\n String res = string.replaceAll(\"&\",\"&\");\n res = res.replace(\"'\",\"'\");\n res = res.replace(\"\\\"\",\"&qout;\");\n res = res.replace(\"$\",\"$\");\n res = res.replace(\"%\",\"%\");\n res = res.replace(\"<\",\"<\");\n res = res.replace(\">\",\">\");\n res = res.replace(\"\\n\",\"\\\\n\");\n return res;\n }",
"public RegexPatternBuilder (String regex)\n {\n this.regex = regex;\n }",
"private static String escape(String s) {\r\n\t\tif (s == null)\r\n\t\t\treturn null;\r\n\t\tStringBuilder sb = new StringBuilder();\r\n\t\tescape(s, sb);\r\n\t\treturn sb.toString();\r\n\t}",
"private String escapeLdapNameForFilter(LdapName ldn) {\n\n if (ldn == null) {\n if (log.isDebugEnabled()) {\n log.debug(\"Received null value to escape special characters. Returning null\");\n }\n return null;\n }\n\n boolean replaceEscapeCharacters = true;\n\n String replaceEscapeCharactersAtUserLoginString = userStoreProperties\n .get(CommonConstants.PROPERTY_REPLACE_ESCAPE_CHARACTERS_AT_USER_LOGIN);\n\n if (replaceEscapeCharactersAtUserLoginString != null) {\n replaceEscapeCharacters = Boolean\n .parseBoolean(replaceEscapeCharactersAtUserLoginString);\n if (log.isDebugEnabled()) {\n log.debug(\"Replace escape characters configured to: \"\n + replaceEscapeCharactersAtUserLoginString);\n }\n }\n\n if (replaceEscapeCharacters) {\n StringBuilder escapedDN = new StringBuilder();\n for (int i = ldn.size() - 1; i > -1; i--) { //escaping the rdns separately and re-constructing the DN\n escapedDN = escapedDN.append(escapeSpecialCharactersForFilterWithStarAsRegex(ldn.get(i)));\n if (i != 0) {\n escapedDN.append(\",\");\n }\n }\n if (log.isDebugEnabled()) {\n log.debug(\"Escaped DN value for filter : \" + escapedDN);\n }\n return escapedDN.toString();\n } else {\n return ldn.toString();\n }\n }",
"public static String escape(String source) {\n return escape(source, -1, true);\n }",
"private String escapedValue(String value) {\n \t\tStringBuffer buf = new StringBuffer(value.length() * 2); // assume expansion by less than factor of 2\n \t\tfor (int i = 0; i < value.length(); i++) {\n \t\t\tchar character = value.charAt(i);\n \t\t\tif (character == '\\\\' || character == '\\t' || character == '\\r' || character == '\\n' || character == '\\f') {\n \t\t\t\t// handle characters requiring leading \\\n \t\t\t\tbuf.append('\\\\');\n \t\t\t\tbuf.append(character);\n \t\t\t} else if ((character < 0x0020) || (character > 0x007e)) {\n \t\t\t\t// handle characters outside base range (encoded)\n \t\t\t\tbuf.append('\\\\');\n \t\t\t\tbuf.append('u');\n \t\t\t\tbuf.append(HEX[(character >> 12) & 0xF]); // first nibble\n \t\t\t\tbuf.append(HEX[(character >> 8) & 0xF]); // second nibble\n \t\t\t\tbuf.append(HEX[(character >> 4) & 0xF]); // third nibble\n \t\t\t\tbuf.append(HEX[character & 0xF]); // fourth nibble\n \t\t\t} else {\n \t\t\t\t// handle base characters\n \t\t\t\tbuf.append(character);\n \t\t\t}\n \t\t}\n \t\treturn buf.toString();\n \t}",
"public static boolean isLiteral (char c) {\n if (c != '*' && c != '?' && c != '(' && c != '[' && c != '\\\\' && c!= '|' && c!='^' && c!='.' && c!=')' && c!=']') return true;\n else return false;\n }",
"public boolean checkSpecialChars(String password) {\n return password.matches(\".*[()#$?!%/@].*\");\n //why does this not work? return password.matches(\"[()#$?!%/@]+\");\n }",
"private static String globToRegex(final String glob) {\n return \"^\" + glob.replace(\".\", \"\\\\.\").replace(\"*\", \".*\") + \"$\";\n }",
"public static Regex compile(String pattern, int cflags) throws RegexException {\n return new Regex(pattern, REG_EXTENDED | cflags);\n }",
"<C> StringLiteralExp<C> createStringLiteralExp();",
"private String escape(String str) {\n String result = null; // replace(str, \"&\", \"&\");\n\n while (str.indexOf(\"&\") != -1) {\n str = replace(str, \"&\", \"&\");\n }\n result = str;\n while (result.indexOf(\"-\") != -1) {\n result = replace(result, \"-\", \"\");\n }\n return result;\n }"
] | [
"0.6808365",
"0.6651394",
"0.6446605",
"0.63687414",
"0.6174805",
"0.6047816",
"0.60052127",
"0.59896576",
"0.587684",
"0.58372474",
"0.5805006",
"0.57633704",
"0.5760116",
"0.5751699",
"0.5665114",
"0.56476784",
"0.5644022",
"0.55825686",
"0.5548741",
"0.5542327",
"0.5526127",
"0.5522339",
"0.5520403",
"0.54950905",
"0.5492684",
"0.54732203",
"0.5471697",
"0.5464264",
"0.54594004",
"0.54580885",
"0.54566777",
"0.54213744",
"0.5410126",
"0.54032373",
"0.53998977",
"0.53731054",
"0.536934",
"0.5367924",
"0.53549623",
"0.53543365",
"0.5333728",
"0.53323126",
"0.5330318",
"0.53174454",
"0.53073454",
"0.5304768",
"0.5274214",
"0.5267393",
"0.5256887",
"0.52439433",
"0.5238216",
"0.5232187",
"0.5224096",
"0.52159995",
"0.5209949",
"0.51935565",
"0.5191452",
"0.51797354",
"0.51534146",
"0.51441115",
"0.5131366",
"0.51241827",
"0.51104975",
"0.5106049",
"0.5102093",
"0.5097617",
"0.50919175",
"0.5085509",
"0.5084524",
"0.50713176",
"0.50632393",
"0.50623524",
"0.50537753",
"0.5046829",
"0.50429875",
"0.5041746",
"0.50415033",
"0.50376517",
"0.5033183",
"0.50257504",
"0.50232565",
"0.5014718",
"0.5012721",
"0.5003484",
"0.5002825",
"0.4990386",
"0.49887836",
"0.4987499",
"0.49803627",
"0.49802375",
"0.49756908",
"0.4966167",
"0.49637836",
"0.495473",
"0.49513176",
"0.49366322",
"0.49327755",
"0.49257106",
"0.49214184",
"0.49102595"
] | 0.7635412 | 0 |
System.out.println(getClass() + " finalize"); close(); | protected void finalize() throws Throwable {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void finalize() {\n close();\n }",
"protected void finalize() {\n\t\tclose();\n\t}",
"public void finalize() {\n\n System.out.println( \"This is finalize method\" );\n }",
"public void finalize()\r\n\t{\n\t}",
"@Override// opcional\n public void finalize(){\n\n }",
"@Override\n\tprotected void finalize() throws Throwable {\n\t\tSystem.out.println(\"finalize\");\n\t}",
"public void finalize();",
"protected void finalize()\n {\n dispose();\n }",
"@Override\r\n\tprotected void finalize() throws Throwable {\n\t\tclose();\r\n\t\tsuper.finalize();\r\n\t}",
"@Override\n\tprotected void finalize() throws Throwable {\n\t\tclose();\n\t\tsuper.finalize();\n\t}",
"@Override\n\tpublic void finalize() {\n\t\t\n\t}",
"@Override\n\tpublic void finalize() throws TrippiException {\n close();\n }",
"public void finalize() throws Throwable {\n close();\n }",
"public abstract void finalize();",
"@Override\n public void finalize() throws Throwable {\n this.close();\n super.finalize();\n }",
"@Override()\r\n protected void finalize() {\r\n destroy();\r\n }",
"public void finalize() throws Throwable {\n close();\n super.finalize();\n }",
"protected void finalize() throws Throwable {\n super.finalize();\n close();\n }",
"public void close() {\n finalize0();\n }",
"public void finalize() {\r\n super.finalize();\r\n }",
"protected void finalize() { \n \tstopSelf(); \n }",
"protected void finalize() throws Throwable{ \n //------------------------------------------------------------------------- \n super.finalize(); \n }",
"@Override\r\n protected void finalize() throws Throwable {\r\n super.finalize();\r\n dispose();\r\n }",
"@Override\r\n protected void finalize() throws Throwable {\r\n super.finalize();\r\n RefNative.destroyNativeClassLoader(this);\r\n System.out.println(this + \" finalized\");\r\n }",
"@Override\r\n\tprotected void finalize() throws Throwable {\n\t\tsuper.finalize();\r\n\t}",
"@Override\n\tprotected void finalize() throws Throwable {\n\t\tsuper.finalize();\n\t}",
"@Override\n\tprotected void finalize() throws Throwable {\n\t\tsuper.finalize();\n\t}",
"@Override\n\tprotected void finalize() throws Throwable {\n\t\tsuper.finalize();\n\t}",
"public abstract void finalizeIt();",
"public void finalize() {\n delete();\n }",
"public void finalize() {\n delete();\n }",
"public void finalize() {\n delete();\n }",
"public void finalize() {\n delete();\n }",
"public void finalize() {\n delete();\n }",
"public void finalize() {\n delete();\n }",
"public void finalize() {\n delete();\n }",
"public void finalize() {\n delete();\n }",
"public void finalize() {\n delete();\n }",
"public void finalize() {\n delete();\n }",
"public void finalize() {\n delete();\n }",
"public void finalize() {\n delete();\n }",
"public void finalize() {\n delete();\n }",
"public void finalize() {\n delete();\n }",
"public void finalize() {\n delete();\n }",
"public void finalize() {\n delete();\n }",
"@Override //sobre-escritura del destructor.\n protected void finalize() throws Throwable {\n super.finalize(); \n System.err.println(\"Chau objeto.\"); //serr y ...\n }",
"public void finalize() throws Throwable {\n finish();\n super.finalize();\n }",
"protected void finalize() throws Throwable {\n/* 479 */ this.delegate.dispose();\n/* */ }",
"protected void finalize() throws Throwable\n\t{\n\t\tsuper.finalize();\n\t\tfinaliseHandle();\n\t\tfinaliseLoggerReference();\n\t}",
"protected void finalize() throws Throwable\n {\n super.finalize();\n \n }",
"protected void finalize() throws Throwable\n {\n super.finalize();\n \n }",
"protected void finalize() throws Throwable\n {\n super.finalize();\n \n }",
"@Override\n protected void finalize() throws Throwable\n {\n finalize(pointer);\n super.finalize();\n }",
"@Override\r\n\tprotected void finalize() throws Exception\r\n\t{\r\n\t\tif(!this.cleanUpDone )\r\n\t\t\tthis.terminate();\r\n\t}",
"public void finalize() throws Throwable {\n try {\n shutdown();\n } finally {\n super.finalize();\n }\n }",
"public void finalize() throws Throwable {\n try {\n shutdown();\n } finally {\n super.finalize();\n }\n }",
"protected void finalize() throws Throwable {\n\t\tSystem.out.println(\">> Student Object Finalized\");\n\t}",
"protected void finalize()throws Throwable{\t\t\n //---------------------------------------------------------------------------\n super.finalize();\n\t}",
"protected void finalize()throws Throwable{\t\t\n //---------------------------------------------------------------------------\n super.finalize();\n\t}",
"@Override\n\tprotected void finalize() throws Throwable {\n\t\tctx.close();\n\t\tctx=null;\n\t\tsuper.finalize();\n\t}",
"@Override\n\tprotected void finalize() throws Throwable {\n\t\tsuper.finalize();\n\t\tSystem.out.println(\"destroyed B\");\n\t}",
"public void finalize()\n throws Throwable\n {\n pythonDecRef();\n }",
"protected void finalize() throws Throwable\n {\n // your code here\n \tthis.si.getServerConnection().logout();\n \tsuper.finalize();\n }",
"protected final void finalize() {\n if (native_lock != null) {\n synchronized(native_lock) {\n String error = native_finalize(); // may be called more than once\n if (error != null)\n debug(error + \" in native_finalize\");\n }\n }\n }",
"protected void finalize() throws Throwable\n\t{\n\t\tsuper.finalize();\n\t\tfinaliseLoggerReference();\n\t}",
"protected void finalize() {\n\t\tdestroyImages();\n\t}",
"@Override\n protected void finalize() throws Throwable {\n super.finalize();\n t.stop();\n }",
"@Override\n\tprotected void finalize() throws Throwable {\n\t\tsuper.finalize();\n\t\tclearData();\n\t}",
"protected void finalize() throws Throwable {\n clear();\n }",
"@Override\r\n\t\tpublic void finalize() {\r\n\t try {\r\n\t if (con != null) {\r\n\t con.close();\r\n\t }\r\n\t } catch (SQLException sqlex) {\r\n\t System.out.println(sqlex);\r\n\t }\r\n\t }",
"@Override\n\tprotected void finalize() throws Throwable {\n\t\t\n\t\tif (this.connection != null) {\n\t\t\tthis.connection.close();\t\t\n\t\t}\n\t\tsuper.finalize();\n\t}",
"protected void finalize(){\n \ttry {\n\t\t\tdatabase.doDisconnect();\n\t\t} catch (SQLException e) {\n\t\t}\n }",
"public void finalize() {\n acquire.release();\n }",
"public void finalize() {\n acquire.release();\n }",
"@Override\n public void close() {\n this.destructorHandler.close();\n }",
"@Override\n\tprotected void finalize() throws Throwable {\n\t\ttry {\n\t\t\tif (this.pMapSubjects != null) {\n\t\t\t\tthis.pMapSubjects.close();\n\t\t\t}\n\t\t\tif (this.mapDB != null && !this.mapDB.isClosed()) {\n\t\t\t\tthis.mapDB.close();\n\t\t\t}\n\t\t} catch (Throwable ex) {\n\t\t\tlogger.warn(\"Persistent HashMap or backing database could not be closed\", ex);\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tsuper.finalize();\n\t\t\t} catch (Throwable ex) {\n\t\t\t\tlogger.warn(\"Persistent HashMap or backing database could not be closed\", ex);\n\t\t\t}\n\t\t}\n\t}",
"public void finalize() throws Throwable {\n OppomodemService.super.finalize();\n }",
"public void finalize()\n\t{\n\t\ttry {\n\t\t\tlogout();\n\t\t\tWebiceLogger.info(\"in Client::finalize\");\n\t\t} catch (Exception e) {\n\t\t\tWebiceLogger.error(\"Client::finalize : \" + this.toString()\n\t\t\t\t\t\t\t+ \" \" + new Date().toString()\n\t\t\t\t\t\t\t+ \": \" + e.getMessage(), e);\n\t\t}\n\t}",
"protected void finalize() {\n this.asClient.close();\n this.asClient = null;\n }",
"public void finalize() {\n AppMethodBeat.i(66593);\n if (this.mJitterBuffer != 0) {\n nativeDestoryJitterBuffer(this.mJitterBuffer);\n this.mJitterBuffer = 0;\n }\n AppMethodBeat.o(66593);\n }",
"public void finalize()\n\t{\n\t\tif (!isClosed) {\n\t\t\t// System.out.println(\"SimWriter: finalize() - writing closing bracket to file...\");\n\t\t\twList.writeToFile(\"\\n ]\", 0);\n\t\t\tisClosed = true;\n\t\t}\n\t\t//System.out.println(\"SimWriter: finalize() done\");\n\t}",
"public void dispose()\r\n\t{\r\n\t\t// System.out.println(\"dispose\");\r\n\t}",
"public void finalize(){\r\n\t\tthis.userInputs.close();\r\n\t}",
"void dispose() {}",
"@Override protected void finalize() throws Throwable {\r\n\t\tsuper.finalize();\r\n\t\tif (flusher != null) {\r\n\t\t\tflusher.stop();\r\n\t\t}\r\n\t\tflush();\r\n\t}",
"public void finish() {\n System.out.println(name + \": Call explicit destroy()\");\n }",
"public void finalize() {\r\n\tif (this.taskGroup!=null) this.taskGroup.interruptAll();\r\n}",
"public void close() {}",
"public void close() {\n\t\t\n\t}",
"public void close() {\n\t\t\n\t}",
"public void close() {\n\t\t\n\t}",
"public void finalize() {\n if (SinkHolder.sink != null || SinkHolder.finalize_count <= 0) {\n SinkHolder.access$008();\n return;\n }\n throw new AssertionError((Object) \"Can't get here\");\n }",
"public void close() {\n\t}",
"@Override\r\n public void close()\r\n {\n\r\n }",
"public final void finalize() {\n if (!this.f5341c) {\n mo12514a(\"Request on the loose\");\n C1264ee.m6818c(\"Marker log finalized without finish() - uncaught exit point for request\", new Object[0]);\n }\n }",
"public void close() {\n }",
"public void close() {\n }",
"public void close() {\n }",
"@Override\r\n\tpublic void close() {\n\t}",
"@Override\r\n\tpublic void close() {\n\t}"
] | [
"0.8782881",
"0.87678754",
"0.8759473",
"0.86637706",
"0.85920227",
"0.8583973",
"0.85626835",
"0.8556679",
"0.8498356",
"0.8464813",
"0.8364283",
"0.83553576",
"0.83337593",
"0.8293439",
"0.8258801",
"0.82078385",
"0.81810695",
"0.80952275",
"0.8083417",
"0.8073131",
"0.7928016",
"0.7862165",
"0.7816145",
"0.7803523",
"0.77889085",
"0.7765999",
"0.7765999",
"0.7765999",
"0.7712246",
"0.77113855",
"0.77113855",
"0.77113855",
"0.77113855",
"0.77113855",
"0.77113855",
"0.77113855",
"0.77113855",
"0.77113855",
"0.77113855",
"0.77113855",
"0.77113855",
"0.77113855",
"0.77113855",
"0.77113855",
"0.77113855",
"0.76925343",
"0.7678792",
"0.76602423",
"0.7638458",
"0.76297307",
"0.76297307",
"0.76297307",
"0.7617326",
"0.7599513",
"0.7582862",
"0.7582862",
"0.757549",
"0.7556202",
"0.7556202",
"0.7527263",
"0.74741596",
"0.74567455",
"0.7430628",
"0.7422614",
"0.7411492",
"0.73703015",
"0.7308181",
"0.729605",
"0.7230421",
"0.72238773",
"0.721768",
"0.7211641",
"0.71913594",
"0.71913594",
"0.71745336",
"0.7170883",
"0.71698356",
"0.71672887",
"0.71600574",
"0.7144333",
"0.71356416",
"0.71327347",
"0.7115919",
"0.71099967",
"0.7094607",
"0.70924425",
"0.7044163",
"0.70422524",
"0.70421916",
"0.70421916",
"0.70421916",
"0.7038456",
"0.7028932",
"0.70095575",
"0.70091057",
"0.7008781",
"0.7008781",
"0.7008781",
"0.7003716",
"0.7003716"
] | 0.79294616 | 20 |
Create an ArrayAdapter using the string array and a default spinner layout | private void loadSpinnerProvincias() {
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(
this, R.array.provincias, android.R.layout.simple_spinner_item);
// Specify the layout to use when the list of choices appears
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
// Apply the adapter to the spinner
spProvincias.setAdapter(adapter);
// This activity implements the AdapterView.OnItemSelectedListener
this.spProvincias.setOnItemSelectedListener(this);
this.spLocalidades.setOnItemSelectedListener(this);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private ArrayAdapter<String> getAdapter(ArrayList<String> arr) {\n ArrayAdapter<String> adapter = new ArrayAdapter<String>(\n this, R.layout.support_simple_spinner_dropdown_item, arr);\n adapter.setDropDownViewResource(R.layout.support_simple_spinner_dropdown_item);\n\n return adapter;\n }",
"private void createSpinner(Spinner spinner, int array) {\n //create an array adapter using the pre-defined spinner layout in android\n ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this,\n array,\n android.R.layout.simple_spinner_item);\n //init\n adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n spinner.setAdapter(adapter);\n }",
"private void setDataToAdapter(ArrayList<String> arrayList)\n {\n ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(mContext, android.R.layout.simple_spinner_item, arrayList);\n // Specify layout to be used when list of choices appears\n arrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n // Applying the adapter to our spinner\n spinner.setAdapter(arrayAdapter);\n spinner.setOnItemSelectedListener(this);\n }",
"public void initSpinner(Spinner spinner, String[] stringArray) {\n ArrayAdapter<String> aAdapter = new ArrayAdapter<>(this,\n android.R.layout.simple_spinner_item, stringArray);\n aAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n spinner.setAdapter(aAdapter);\n spinner.setOnItemSelectedListener(this);\n }",
"void loadSpinner(Spinner sp){\n List<String> spinnerArray = new ArrayList<>();\n spinnerArray.add(\"Oui\");\n spinnerArray.add(\"Non\");\n\n// (3) create an adapter from the list\n ArrayAdapter<String> adapter = new ArrayAdapter<String>(\n this,\n android.R.layout.simple_spinner_item,\n spinnerArray\n );\n\n//adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n\n// (4) set the adapter on the spinner\n sp.setAdapter(adapter);\n\n }",
"public void bindSpinner() {\n // Create an ArrayAdapter using the string array and a spinner layout\n ArrayAdapter<CharSequence> adapter;\n adapter = ArrayAdapter.createFromResource(getActivity(), R.array.kind_of_reaction, R.layout.item_spinner_healthbook);\n // Specify the layout to use when the list of choices appears\n adapter.setDropDownViewResource(R.layout.item_spinner_healthbook_dropdown);\n // Apply the adapter to the spinner\n kindOfReactionSpinner.setAdapter(adapter);\n }",
"public void addItemsOnSpinner() {\n Data dataset = new Data(getApplicationContext());\n List<String> list = new ArrayList<String>();\n list = dataset.getClasses();\n ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, list);\n dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n spinner.setAdapter(dataAdapter);\n }",
"private void createArrayAdapter(String gameName, Spinner spinner) {\n ArrayAdapter<String> arrayAdapter = new ArrayAdapter<>(SavedGamesActivity.this,\n android.R.layout.simple_spinner_dropdown_item,\n savedGamesManager.constructNameArray(gameName, currentUser));\n arrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n spinner.setAdapter(arrayAdapter);\n }",
"private ArrayAdapter<String> adapterForSpinner(List<String> list)\n {\n ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, list)\n {\n @Override\n public boolean isEnabled(int position) {\n return position != 0;\n }\n\n @Override\n public View getDropDownView(int position, View convertView, ViewGroup parent) {\n View view = super.getDropDownView(position, convertView, parent);\n TextView tv = (TextView) view;\n if(position == 0){\n // Set the hint text color gray\n tv.setTextColor(Color.GRAY);\n }\n else {\n tv.setTextColor(Color.BLACK);\n }\n return view;\n }\n };\n\n // Drop down layout style - list view with radio button\n dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n\n return dataAdapter;\n }",
"private void startSpinnerValues(Spinner spinner, ArrayList<String> valores, ArrayAdapter<String> adapter)\n {\n //Inicializamos el adaptador y lo agregamos al Spinner\n adapter=new ArrayAdapter<String>(this, R.layout.support_simple_spinner_dropdown_item,valores);\n spinner.setAdapter(adapter);\n }",
"public ArrayAdapter<T> getSpinnerAdapter(Iterable<T> items, Context context) {\n\t\tArrayAdapter<T> adapter = new ArrayAdapter<T>(context.getApplicationContext(), R.layout.spinner_item);\n\t\tadapter.setDropDownViewResource(R.layout.spinner_dropdown_item);\n\n\t\tif (items != null && items.iterator().hasNext()) {\n\t\t\tIterator<T> it = items.iterator();\n\t\t\twhile (it.hasNext()) {\n\t\t\t\tadapter.add(it.next());\n\t\t\t}\n\t\t}\n\n\t\treturn adapter;\n\t}",
"public void addItemsOnSpinner() {\r\n\r\n\tspinner = (Spinner) findViewById(R.id.spinner);\r\n\tList<String> list = new ArrayList<String>();\r\n\tlist.add(\"Food\");\r\n\tlist.add(\"RentHouse\");\r\n\tlist.add(\"Closing\");\r\n\tlist.add(\"Party\");\r\n\tlist.add(\"Material\");\r\n\tArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item, list);\r\n\tdataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\r\n\tspinner.setAdapter(dataAdapter);\r\n }",
"public void spn_adaptor(){\n final String[] sem = getResources().getStringArray(R.array.Semester);\n\n //Creating an instance of ArrayAdaptor\n ArrayAdapter<String> adapter = new ArrayAdapter<>(\n this, android.R.layout.simple_spinner_item, sem);\n\n //Setting the view which will be used in the spinner\n adapter.setDropDownViewResource(\n simple_spinner_dropdown_item\n );\n\n //Assigning the adaptor1 to the spinner\n spn_semester.setAdapter(adapter);\n }",
"private void assignSpinner(int i, String s) {\n switch (s) {\n case \"Bitters\":\n ArrayAdapter<String> bittersAdapter;\n bittersAdapter = new ArrayAdapter<>(this, R.layout.support_simple_spinner_dropdown_item, bitters);\n bittersAdapter.setDropDownViewResource(R.layout.support_simple_spinner_dropdown_item);\n spinnerArrayList.get(i-1).setAdapter(bittersAdapter);\n spinnerArrayList.get(i-1).setVisibility(View.VISIBLE);\n break;\n case \"Gin\":\n ArrayAdapter<String> ginAdapter;\n ginAdapter = new ArrayAdapter<>(this, R.layout.support_simple_spinner_dropdown_item, gin);\n ginAdapter.setDropDownViewResource(R.layout.support_simple_spinner_dropdown_item);\n spinnerArrayList.get(i-1).setAdapter(ginAdapter);\n spinnerArrayList.get(i-1).setVisibility(View.VISIBLE);\n break;\n case \"Rum\":\n ArrayAdapter<String> rumAdapter;\n rumAdapter = new ArrayAdapter<>(this, R.layout.support_simple_spinner_dropdown_item, rum);\n rumAdapter.setDropDownViewResource(R.layout.support_simple_spinner_dropdown_item);\n spinnerArrayList.get(i-1).setAdapter(rumAdapter);\n spinnerArrayList.get(i-1).setVisibility(View.VISIBLE);\n break;\n case \"Tequila\":\n ArrayAdapter<String> tequilaAdapter;\n tequilaAdapter = new ArrayAdapter<>(this, R.layout.support_simple_spinner_dropdown_item, tequila);\n tequilaAdapter.setDropDownViewResource(R.layout.support_simple_spinner_dropdown_item);\n spinnerArrayList.get(i-1).setAdapter(tequilaAdapter);\n spinnerArrayList.get(i-1).setVisibility(View.VISIBLE);\n break;\n case \"Vodka\":\n ArrayAdapter<String> vodkaAdapter;\n vodkaAdapter = new ArrayAdapter<>(this, R.layout.support_simple_spinner_dropdown_item, vodka);\n vodkaAdapter.setDropDownViewResource(R.layout.support_simple_spinner_dropdown_item);\n spinnerArrayList.get(i-1).setAdapter(vodkaAdapter);\n spinnerArrayList.get(i-1).setVisibility(View.VISIBLE);\n break;\n case \"Vermouth\":\n ArrayAdapter<String> vermouthAdapter;\n vermouthAdapter = new ArrayAdapter<>(this, R.layout.support_simple_spinner_dropdown_item, vodka);\n vermouthAdapter.setDropDownViewResource(R.layout.support_simple_spinner_dropdown_item);\n spinnerArrayList.get(i-1).setAdapter(vermouthAdapter);\n spinnerArrayList.get(i-1).setVisibility(View.VISIBLE);\n break;\n case \"Whiskey\":\n ArrayAdapter<String> whiskeyAdapter;\n whiskeyAdapter = new ArrayAdapter<>(this, R.layout.support_simple_spinner_dropdown_item, whiskey);\n whiskeyAdapter.setDropDownViewResource(R.layout.support_simple_spinner_dropdown_item);\n spinnerArrayList.get(i-1).setAdapter(whiskeyAdapter);\n spinnerArrayList.get(i-1).setVisibility(View.VISIBLE);\n break;\n }\n }",
"private void setUpSpinners(){\n spinners = new Spinner[spinnerId.length];\n for(int i = 0; i < spinners.length; i++){\n spinners[i] = (Spinner) findViewById(spinnerId[i]);\n ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this,\n R.array.instruction_qty, R.layout.spinner_item_inst);\n adapter.setDropDownViewResource(R.layout.spinner_list_dropdown_inst);\n spinners[i].setAdapter(adapter);\n spinners[i].setBackgroundColor(Color.WHITE);\n }\n }",
"public void populateSpinner() {\r\n ArrayList<String> ary = new ArrayList<>();\r\n\r\n ary.add(\"Male\");\r\n ary.add(\"Female\");\r\n\r\n ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.support_simple_spinner_dropdown_item, ary);\r\n\r\n adapter.setDropDownViewResource(R.layout.support_simple_spinner_dropdown_item);\r\n Gender.setAdapter(adapter);\r\n }",
"void setupSpinner() {\n\n Spinner spinner = (Spinner) findViewById(R.id.language_spinner);\n\n ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.language_array, android.R.layout.simple_spinner_item);\n adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n spinner.setAdapter(adapter);\n\n }",
"private void setAdapters() \n\t{\n\t\tArrayAdapter<CharSequence> adapter =\n\t\tArrayAdapter.createFromResource(\n\t\tthis, R.array.languages,\n\t\tandroid.R.layout.simple_spinner_item);\n\t\tadapter.setDropDownViewResource(\n\t\tandroid.R.layout.simple_spinner_dropdown_item);\n\t\tfromSpinner.setAdapter(adapter);\n\t\ttoSpinner.setAdapter(adapter);\n\t\t// Automatically select two spinner items\n\t\tfromSpinner.setSelection(8); // English (en)\n\t\ttoSpinner.setSelection(11); // French (fr)\n\t\torigText.setText(data);\n\t}",
"public void addItemsToSpinner(){\n spinner = (Spinner) findViewById(R.id.newEvent_spinner_notification);\n spinner.setOnItemSelectedListener(new SpinnerActivity());\n ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this,\n R.array.arrray_notification, android.R.layout.simple_spinner_item);\n adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n spinner.setAdapter(adapter);\n }",
"@Override\n public View getDropDownView(int position, View convertView, ViewGroup parent)\n {\n View row = convertView;\n if(row == null)\n {\n LayoutInflater inflater = ((Activity) MainActivity.context).getLayoutInflater();\n row = inflater.inflate(R.layout.spinner_item_layout, parent, false);\n }\n \n ((TextView)row).setTypeface(MainActivity.pixelFont);\n ((TextView)row).setText(objectsData[position]);\n \n return row;\n }",
"public SpinnerAdapter(Context mContext) {\n this.mContext = mContext;\n Resources res = mContext.getResources();\n this.values = res.getStringArray(R.array.checklist_values);\n\n }",
"private void initSpinners() {\n mColourArray = Constants.colours.keySet().toArray(new String[Constants.colours.keySet().size()]);\n mPositonArray = Constants.gravity.keySet().toArray(new String[Constants.gravity.keySet().size()]);\n mScaleArray = Constants.scale.keySet().toArray(new String[Constants.scale.keySet().size()]);\n\n // Init Adapters\n ArrayAdapter<String> colourAdapter = new ArrayAdapter<>(\n this,\n R.layout.adapter_dropdown_menu_item,\n mColourArray);\n\n ArrayAdapter<String> positionAdapter = new ArrayAdapter<>(\n this,\n R.layout.adapter_dropdown_menu_item,\n mPositonArray);\n\n ArrayAdapter<String> scaleAdapter = new ArrayAdapter<>(\n this,\n R.layout.adapter_dropdown_menu_item,\n mScaleArray);\n\n // Set Adapter\n mDataBinding.textColor.setAdapter(colourAdapter);\n mDataBinding.backgroundColor.setAdapter(colourAdapter);\n mDataBinding.position.setAdapter(positionAdapter);\n mDataBinding.imageScale.setAdapter(scaleAdapter);\n\n // Set Listeners\n mDataBinding.textColor.setOnItemClickListener((adapterView, view, i, l) -> {\n String selectedItemKey = (String) adapterView.getItemAtPosition(i);\n mTextColour = Constants.colours.get(selectedItemKey);\n });\n\n mDataBinding.backgroundColor.setOnItemClickListener((adapterView, view, i, l) -> {\n String selectedItemKey = (String) adapterView.getItemAtPosition(i);\n mBackgroundColour = Constants.colours.get(selectedItemKey);\n });\n\n mDataBinding.position.setOnItemClickListener((adapterView, view, i, l) -> {\n String selectedItemKey = (String) adapterView.getItemAtPosition(i);\n mPosition = Constants.gravity.get(selectedItemKey);\n });\n\n mDataBinding.imageScale.setOnItemClickListener((adapterView, view, i, l) -> {\n String selectedItemKey = (String) adapterView.getItemAtPosition(i);\n mScale = Constants.scale.get(selectedItemKey);\n });\n\n // Set defaults\n mDataBinding.textColor.setText(colourAdapter.getItem(1), false);\n mDataBinding.backgroundColor.setText(colourAdapter.getItem(0), false);\n mDataBinding.position.setText(positionAdapter.getItem(0), false);\n mDataBinding.imageScale.setText(scaleAdapter.getItem(0), false);\n mTextColour = colourAdapter.getItem(1);\n mBackgroundColour = colourAdapter.getItem(0);\n mPosition = positionAdapter.getItem(0);\n mScale = scaleAdapter.getItem(0);\n }",
"private void loadSpinnerData() {\n rows = db.getPumpDetails();\n\n // Creating adapter for spinner\n dataAdapter = new ArrayAdapter<String>(this,\n android.R.layout.simple_spinner_item, rows);\n\n // Drop down layout style - list view with radio button\n dataAdapter\n .setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n\n // attaching data adapter to spinner\n spinner.setAdapter(dataAdapter);\n }",
"private void applySpinner(final String[] taglist, Spinner sp_name, String tag_string) {\n AddContactActivity.spinnerAdapter adapterRepeateDaily = new AddContactActivity.spinnerAdapter(getActivity(), android.R.layout.simple_list_item_1);\r\n adapterRepeateDaily.add(tag_string);\r\n adapterRepeateDaily.addAll(taglist);\r\n adapterRepeateDaily.add(tag_string);\r\n sp_name.setAdapter(adapterRepeateDaily);\r\n sp_name.setSelection(adapterRepeateDaily.getCount());\r\n sp_name.setEnabled(true);\r\n }",
"private void loadSpinnerData() {\n List<String> patientList = db.getAllPatient();\n\n // Creating adapter for spinner\n ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this,\n android.R.layout.simple_spinner_item, patientList);\n\n // Drop down layout style - list view with radio button\n dataAdapter\n .setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n\n // attaching data adapter to spinner\n patientIdSpn.setAdapter(dataAdapter);\n }",
"private void makeSpinner(Spinner spinner, Cursor mndJaar) {\n String[] mndJaarArray = new String[mndJaar.getCount()];\n Log.d(\"first\",\"\" + mndJaar.getCount());\n\n for(int i=0; mndJaar.moveToNext(); i++) {\n mndJaarArray[i] = MONTHS[mndJaar.getInt(0) - 1] + \" \" + mndJaar.getString(1);\n Log.d(\"mndjaar\",mndJaar.getString(0) + \",\" + mndJaar.getString(1));\n }\n\n ArrayAdapter<String> spinnerArrayAdapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, mndJaarArray);\n spinnerArrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n spinner.setAdapter(spinnerArrayAdapter);\n spinner.setOnItemSelectedListener(this);\n }",
"public AdaptadorSpinnerPerfiles(Context context, int textViewResourceId,ArrayList<String> datos) {\n //llamada al constructor padre. (extends).\n super(context, textViewResourceId, datos);\n this.context = context;\n this.datos = datos;\n }",
"private void setCategorySpinner(List<String> categoryArray) {\n ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(DoctorSearchActivity.this, android.R.layout.simple_spinner_item, categoryArray);\n arrayAdapter.setDropDownViewResource(android.R.layout.simple_list_item_single_choice);\n mCategorySpinner.setAdapter(arrayAdapter);\n }",
"private void carregarDadosSpinner() {\n String[] categorias = getResources().getStringArray(R.array.categorias);\n //adicionar valores do spinner\n ArrayAdapter<String> adapterCategorias = new ArrayAdapter<String>(\n getApplicationContext(), android.R.layout.simple_spinner_item,\n categorias\n );\n adapterCategorias.setDropDownViewResource(android.R.layout\n .simple_spinner_dropdown_item);\n campoCategorias.setAdapter(adapterCategorias);\n\n }",
"private void ShowSpinner(String[] items, Spinner spinner)\n {\n String[] list = items;\n\n final List<String> plantsList = new ArrayList<>(Arrays.asList(list));\n\n // Initializing an ArrayAdapter\n final ArrayAdapter<String> spinnerArrayAdapter = new ArrayAdapter<String>(\n this, R.layout.support_simple_spinner_dropdown_item, plantsList) {\n @Override\n public boolean isEnabled(int position) {\n if (position == 0) {\n // Disable the first item from Spinner\n // First item will be use for hint\n return false;\n } else {\n return true;\n }\n }\n\n @Override\n public View getDropDownView(int position, View convertView,\n ViewGroup parent) {\n View view = super.getDropDownView(position, convertView, parent);\n TextView tv = (TextView) view;\n if (position == 0) {\n // Set the hint text color gray\n tv.setTextColor(Color.parseColor(\"#C1C1C1\"));\n } else {\n tv.setTextColor(Color.BLACK);\n }\n return view;\n }\n };\n spinnerArrayAdapter.setDropDownViewResource(R.layout.support_simple_spinner_dropdown_item);\n spinner.setAdapter(spinnerArrayAdapter);\n spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n topicname = (String) parent.getItemAtPosition(position);\n // If user change the default selection\n // First item is disable and it is used for hint\n if (position > 0) {\n // Notify the selected item text\n Toast.makeText\n (getApplicationContext(), \"Topic \" + topicname+\" selected\", Toast.LENGTH_SHORT)\n .show();\n }\n }\n\n @Override\n public void onNothingSelected(AdapterView<?> parent) {\n\n }\n });\n }",
"@Override\n public View getView(int position, View convertView, ViewGroup parent)\n {\n // get the view\n View v = convertView;\n\n // if view is null inflate it with correct layout\n if (v == null)\n {\n LayoutInflater vi;\n vi = LayoutInflater.from(getContext());\n v = vi.inflate(R.layout.spinner_text_view, null);\n } // end if\n\n // set new ListData item to ListData at current position\n ListData p = values.get(position);\n\n // if p is not empty\n if (p != null)\n {\n // find spinner item\n TextView label = (TextView) v.findViewById(R.id.textViewSpinnerItem);\n\n // if spinner item found\n if (label != null)\n {\n // set spinner to selected item\n label.setText(p.getName());\n } // end if\n } // end if\n\n // return the view\n return v;\n }",
"protected ListAdapter makeAdapterArray(Intent data, Context activity, int layout, int[] ids){\n\n alertList = new ArrayList<>();\n //Key values for the mapping\n String[] keyNames = new String[]{AppCSTR.NAME, AppCSTR.EXTRA};\n //A row with array values in table\n String[] item = data.getStringArrayExtra(AppCSTR.DB_FIRST_ROW);\n //Take off brackets of string array from database, what is to be displayed in list view.\n String[] names = arrayParser(item[AppCSTR.FIRST_ELEMENT]);\n int count = names.length;\n String[] extras = getExtraInfo(item, count, (item.length - 1));\n\n //checkEmptyArray(names[AppCSTR.FIRST_ELEMENT]);\n for(int i = 0; i < count; i++){\n // creating new HashMap\n HashMap<String, String> map = new HashMap<>();\n map.put(AppCSTR.NAME, names[i]);\n map.put(AppCSTR.EXTRA, extras[i]);\n alertList.add(map);\n }\n /**\n * Details of how the adapter will be laid out.\n */\n return new SimpleAdapter(\n activity, alertList,\n layout, keyNames, ids);\n }",
"public ConfigureSpinnerAdapter(Context context, Spinner spinner, String[] buildKeys) {\n super(context, 0, buildKeys);\n mContext = context;\n mSpinner = spinner;\n mBuildKeys = buildKeys;\n }",
"public void setupSpinner()\n {\n if (spinnerAdapter == null)\n {\n spinnerAdapter = new StringSpinnerAdapter(spinner, R.array.graph_period_spinner_values);\n }\n\n spinner.setOnItemSelectedListener(this);\n spinner.setAdapter(spinnerAdapter);\n }",
"private void UpdateDataForSpinner(Spinner spinner){\n // Create an ArrayAdapter using the string array and a default spinner layout\n ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this,\n R.array.serviceQuantity, android.R.layout.simple_spinner_item);\n // Specify the layout to use when the list of choices appears\n adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n // Apply the adapter to the spinner\n spinner.setAdapter(adapter);\n }",
"private void loadSpinnerData() {\n\n // Spinner Drop down elements\n areas = dbHendler.getAllAreas();\n for (Area area : areas) {\n String singleitem = area.get_areaName();\n items.add(singleitem);\n }\n\n // Creating adapter for spinnerArea\n ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, items);\n\n // Drop down layout style - list view with radio button\n dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n\n // attaching data adapter to spinnerArea\n spinner.setAdapter(dataAdapter);\n }",
"private void classes() {\n List<String> list = new ArrayList<>();\n list.add(\"Mont.\");\n list.add(\"Nur\");\n list.add(\"KG 1\");\n list.add(\"KG 2\");\n list.add(\"Class 1\");\n list.add(\"Class 2\");\n list.add(\"Class 3\");\n list.add(\"Class 4\");\n list.add(\"Class 5\");\n list.add(\"Class 6\");\n list.add(\"Class 7\");\n list.add(\"Class 8\");\n list.add(\"Class 9\");\n list.add(\"Class 10\");\n\n\n ArrayAdapter<String> dataAdapter = new ArrayAdapter<>(this,\n android.R.layout.simple_spinner_item, list);\n dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n\n cls.setAdapter(dataAdapter);\n }",
"private void initSpinnerTypeExam()\n {\n Spinner spinner = findViewById(R.id.iTypeExam);\n\n // Adapt\n final ArrayAdapter<String> adapter = new ArrayAdapter<>(\n this,\n R.layout.support_simple_spinner_dropdown_item\n );\n spinner.setAdapter(adapter);\n\n // ajout des types d'examens\n for(TypeExamen t : TypeExamen.values())\n {\n adapter.add(t.toString());\n }\n }",
"private void addAccountsToSpinner(){\n ArrayAdapter<String> dataAdaptor = new ArrayAdapter<String>(this,\n android.R.layout.simple_spinner_item, customer.getAccountNameList());\n dataAdaptor.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n acctSpinner.setAdapter(dataAdaptor);\n }",
"public void initProjectSpinner(){\n projectSpinner = findViewById(R.id.spinner_project);\n projectList = Arrays.asList(gson.fromJson(myRequestHandler.getJsonStringProjects(), Project[].class)); //The jsonString with Projects is already initialized to prevent null pointers\n ArrayAdapter<Project> projectAdapter = new ArrayAdapter<Project>(this,\n android.R.layout.simple_spinner_item, projectList);\n projectAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n projectSpinner.setAdapter(projectAdapter);\n projectSpinner.setOnItemSelectedListener(this);\n\n }",
"@Override\n protected void onPostExecute(ArrayList<String> teams){\n ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(reference, R.layout.spinner_item, teams);\n // Drop down layout style – list view with radio button\n dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n // attaching data adapter to spinner\n spinner.setAdapter(dataAdapter);\n }",
"private void spinner() {\n ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this,\n R.array.planets_array, R.layout.simple_spinner_item_new);\n// Specify the layout to use when the list of choices appears\n adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n// Apply the adapter to the spinner\n// dropDownViewTheme.\n planetsSpinner.setAdapter(adapter);\n planetsSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n Object itemAtPosition = parent.getItemAtPosition(position);\n Log.d(TAG, \"onItemSelected: \" + itemAtPosition);\n\n String[] stringArray = getResources().getStringArray(R.array.planets_array);\n Toast.makeText(DialogListActivity.this, \"选择 \" + stringArray[position], Toast.LENGTH_SHORT).show();\n }\n\n @Override\n public void onNothingSelected(AdapterView<?> parent) {\n Toast.makeText(DialogListActivity.this, \"未选择\", Toast.LENGTH_SHORT).show();\n }\n });\n }",
"private void setupSpinner() {\n // Create adapter for spinner. The list options are from the String array it will use\n // the spinner will use the default layout\n ArrayAdapter supplierSpinnerAdapter = ArrayAdapter.createFromResource(this,\n R.array.array_supplier_options, android.R.layout.simple_spinner_item);\n\n // Specify dropdown layout style - simple list view with 1 item per line\n supplierSpinnerAdapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);\n\n // Apply the adapter to the spinner\n mSupplierSpinner.setAdapter(supplierSpinnerAdapter);\n\n // Set the integer mSelected to the constant values\n mSupplierSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n String selection = (String) parent.getItemAtPosition(position);\n if (!TextUtils.isEmpty(selection)) {\n if (selection.equals(getString(R.string.supplier_one))) {\n mSupplier = BookEntry.SUPPLIER_ONE;\n } else if (selection.equals(getString(R.string.supplier_two))) {\n mSupplier = BookEntry.SUPPLIER_TWO;\n } else {\n mSupplier = BookEntry.SUPPLIER_UNKNOWN;\n }\n }\n }\n\n // Because AdapterView is an abstract class, onNothingSelected must be defined\n @Override\n public void onNothingSelected(AdapterView<?> parent) {\n mSupplier = BookEntry.SUPPLIER_UNKNOWN;\n }\n });\n }",
"private void fillSpinners()\r\n {\r\n ArrayList<String> monthList = new ArrayList<String>(12);\r\n ArrayList<String> yearList = new ArrayList<String>(4);\r\n\r\n // Create strings\r\n monthList.add(\"JAN\");\r\n monthList.add(\"FEB\");\r\n monthList.add(\"MAR\");\r\n monthList.add(\"APR\");\r\n monthList.add(\"MAY\");\r\n monthList.add(\"JUN\");\r\n monthList.add(\"JUL\");\r\n monthList.add(\"AUG\");\r\n monthList.add(\"SEP\");\r\n monthList.add(\"OCT\");\r\n monthList.add(\"NOV\");\r\n monthList.add(\"DEC\");\r\n\r\n yearList.add(\"2019\");\r\n yearList.add(\"2020\");\r\n yearList.add(\"2021\");\r\n\r\n // Create adapters\r\n ArrayAdapter<String> monAd = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, monthList);\r\n ArrayAdapter<String> yearAd = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, yearList);\r\n\r\n // Set adapters\r\n Spinner spinMonth = ((Spinner) findViewById(R.id.spinMonth));\r\n Spinner spinYear = ((Spinner) findViewById(R.id.spinYear));\r\n spinMonth.setAdapter(monAd);\r\n spinYear.setAdapter(yearAd);\r\n }",
"private void setupSpinners() {\n\n ArrayAdapter<String> statesAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, states);\n\n // Specify dropdown layout style - simple list view with 1 item per line\n statesAdapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);\n // Apply the adapter to the spinner\n statesAdapter.notifyDataSetChanged();\n mStateSpinner.setAdapter(statesAdapter);\n\n // Set the integer mSelected to the constant values\n mStateSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n mState = (String) parent.getItemAtPosition(position);\n setUpStatesSpinner(position);\n }\n\n // Because AdapterView is an abstract class, onNothingSelected must be defined\n @Override\n public void onNothingSelected(AdapterView<?> parent) {\n // Unknown\n }\n });\n }",
"public void listadaptor1(){\n final String[] sem = getResources().getStringArray(R.array.Sem1);\n\n //Creating an instance of ArrayAdaptor\n ArrayAdapter<String> adapter = new ArrayAdapter<>(\n this, android.R.layout.simple_list_item_1, sem);\n\n //Assigning the adapter to the listview\n lst_course.setAdapter(adapter);\n }",
"@Override\n protected void onPostExecute(String result) {\n super.onPostExecute(result);\n\n ArrayAdapter<String> adapter_state1 = new ArrayAdapter<String>(MainActivity.this, R.layout.simple_list_item_2, arrayListtype){\n\n @Override\n public boolean isEnabled(int position){\n if(position == 0)\n {\n // Disable the first item from Spinner\n // First item will be use for hint\n return false;\n }\n else\n {\n return true;\n }\n }\n @Override\n public View getDropDownView(int position, View convertView,\n ViewGroup parent) {\n View view = super.getDropDownView(position, convertView, parent);\n TextView tv = (TextView) view;\n if(position == 0){\n // Set the hint text color gray\n tv.setTextColor(getResources().getColor(R.color.grey));\n }\n else {\n tv.setTextColor(getResources().getColor(R.color.textcolour));\n }\n return view;\n }\n };\n\n adapter_state1\n .setDropDownViewResource(R.layout.simple_list_item_1);\n\n sp1.setAdapter(adapter_state1);\n pdia.dismiss();\n\n }",
"private void setUpSpinner(){\n ArrayAdapter paymentSpinnerAdapter =ArrayAdapter.createFromResource(this,R.array.array_gender_option,android.R.layout.simple_spinner_item);\n\n // Specify dropdown layout style - simple list view with 1 item per line, then apply adapter to the spinner\n paymentSpinnerAdapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);\n mPaymentSpinner.setAdapter(paymentSpinnerAdapter);\n\n // To set the spinner to the selected payment method by the user when clicked from cursor adapter.\n if (payMode != null) {\n if (payMode.equalsIgnoreCase(\"COD\")) {\n mPaymentSpinner.setSelection(0);\n } else {\n mPaymentSpinner.setSelection(1);\n }\n mPaymentSpinner.setOnTouchListener(mTouchListener);\n }\n\n mPaymentSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n String selectedPayment = (String)parent.getItemAtPosition(position);\n if(!selectedPayment.isEmpty()){\n if(selectedPayment.equals(getString(R.string.payment_cod))){\n mPaymentMode = clientContract.ClientInfo.PAYMENT_COD; // COD = 1\n }else{\n\n mPaymentMode = clientContract.ClientInfo.PAYMENT_ONLINE; // ONLINE = 0\n }\n }\n }\n\n @Override\n public void onNothingSelected(AdapterView<?> parent) {\n\n }\n });\n\n }",
"@Override\n protected void onPostExecute(String result) {\n super.onPostExecute(result);\n ArrayAdapter<String> adapter_state2 = new ArrayAdapter<String>(MainActivity.this, R.layout.simple_list_item_3, arrayListsize){\n\n @Override\n public boolean isEnabled(int position){\n if(position == 0)\n {\n // Disable the first item from Spinner\n // First item will be use for hint\n return false;\n }\n else\n {\n return true;\n }\n }\n @Override\n public View getDropDownView(int position, View convertView,\n ViewGroup parent) {\n View view = super.getDropDownView(position, convertView, parent);\n TextView tv = (TextView) view;\n if(position == 0){\n // Set the hint text color gray\n tv.setTextColor(getResources().getColor(R.color.grey));\n }\n else {\n tv.setTextColor(getResources().getColor(R.color.textcolour));\n }\n return view;\n }\n };\n\n adapter_state2\n .setDropDownViewResource(R.layout.simple_list_item_1);\n\n sp2.setAdapter(adapter_state2);\n pdia.dismiss();\n\n\n }",
"private void povoarSpinners() {\n List<String> lista = new ArrayList<>();\n lista.add(UsuarioNivelConstantes.VETOR_DESCRICOES[0]);\n lista.add(UsuarioNivelConstantes.VETOR_DESCRICOES[1]);\n lista.add(UsuarioNivelConstantes.VETOR_DESCRICOES[2]);\n ArrayAdapter<String> arrayAdapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_dropdown_item, lista);\n arrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_item);\n spnNivel.setAdapter(arrayAdapter);\n lista = new ArrayList<>();\n lista.add(UsuarioEstadoConstantes.VETOR_DESCRICOES[0]);\n lista.add(UsuarioEstadoConstantes.VETOR_DESCRICOES[1]);\n arrayAdapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_dropdown_item, lista);\n arrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_item);\n spnEstado.setAdapter(arrayAdapter);\n }",
"private View getCustomView(int position, View convertView, ViewGroup parent) {\n\n /********** Inflate spinner_rows.xml file for each row ( Defined below ) ************/\n View row = inflater.inflate(R.layout.spinner_item_white, parent, false);\n\n TextView tv_item_name = (TextView) row.findViewById(R.id.tv_item_name);\n// ImageView iv_spinner_icon = (ImageView) row.findViewById(R.id.iv_spinner_icon);\n\n tv_item_name.setText(arrayList.get(position));\n// iv_spinner_icon.setImageResource(arrayIcons.getResourceId(position, -1));\n return row;\n }",
"public View setupSpinners(View v){\n // Assign Spinners\n spinnerCollect = (Spinner) v.findViewById(R.id.eSpinner_CollectWhat);\n\n // Create an ArrayAdapter using the string array and a default spinner layout\n ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this.getActivity(),\n R.array.eCollectWhat_array, android.R.layout.simple_spinner_item);\n // Specify the layout to use when the list of choices appears\n adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n spinnerCollect.setAdapter(adapter); // Apply the adapter to the spinner\n\n spinnerCollect.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n ((ScoutFormActivity) getActivity()).getScoutForm().setEHPCOLLECT_COLUMN(spinnerCollect.getSelectedItem().toString());\n }\n\n @Override\n public void onNothingSelected(AdapterView<?> arg0) {\n }\n });\n\n return v;\n }",
"public DropDownAdapter(SpinnerAdapter adapter) {\n this.adapter = adapter;\n }",
"private void spinnerAction() {\n Spinner spinnerphonetype = (Spinner) findViewById(R.id.activity_one_phonetype_spinner);//phonetype spinner declaration\n ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this,\n R.array.phone_spinner, android.R.layout.simple_spinner_item); //create the spinner array\n adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); //set the drop down function\n spinnerphonetype.setAdapter(adapter); //set the spinner array\n }",
"private void setupSpinner() {\n // Create adapter for spinner. The list options are from the String array it will use\n // the spinner will use the default layout\n ArrayAdapter fruitSpinnerAdapter = ArrayAdapter.createFromResource(this,\n R.array.array_fruit_options, android.R.layout.simple_spinner_item);\n\n // Specify dropdown layout style - simple list view with 1 item per line\n fruitSpinnerAdapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);\n\n // Apply the adapter to the spinner\n mTypeSpinner.setAdapter(fruitSpinnerAdapter);\n\n // Set the integer mSelected to the constant values\n mTypeSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n String selection = (String) parent.getItemAtPosition(position);\n if (!TextUtils.isEmpty(selection)) {\n if (selection.equals(getString(R.string.apple))) {\n mFruit = FruitEntry.TYPE_APPLE;\n } else if (selection.equals(getString(R.string.banana))) {\n mFruit = FruitEntry.TYPE_BANANA;\n } else if (selection.equals(getString(R.string.peach))) {\n mFruit = FruitEntry.TYPE_PEACH;\n } else if (selection.equals(getString(R.string.pineapple))) {\n mFruit = FruitEntry.TYPE_PINEAPPLE;\n } else if (selection.equals(getString(R.string.strawberry))) {\n mFruit = FruitEntry.TYPE_STRAWBERRY;\n } else if (selection.equals(getString(R.string.watermelon))) {\n mFruit = FruitEntry.TYPE_WATERMELON;\n } else {\n mFruit = FruitEntry.TYPE_NOTSELECTED;\n }\n }\n }\n\n // Because AdapterView is an abstract class, onNothingSelected must be defined\n @Override\n public void onNothingSelected(AdapterView<?> parent) {\n mFruit = FruitEntry.TYPE_NOTSELECTED;\n }\n });\n }",
"@Override\n public void onCreate(Bundle icicle) {\n super.onCreate(icicle);\n\n Intent intent = getIntent();\n mDrugName = intent.getStringExtra(Constants.DRUG_NAME);\n\n ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, Constants.LOREM_ARRAY);\n mSpinner.setAdapter(adapter);\n }",
"public void listadaptor3(){\n final String[] sem = getResources().getStringArray(R.array.Sem3);\n\n //Creating an instance of ArrayAdaptor\n ArrayAdapter<String> adapter = new ArrayAdapter<>(\n this, android.R.layout.simple_list_item_1, sem);\n\n //Assigning the adapter to the listview\n lst_course.setAdapter(adapter);\n }",
"public MyAdapter(ArrayList<String> myDataset) {\n mDataset = myDataset;\n }",
"public RowAdapter(Activity a, ArrayList pc_no_array, ArrayList lab_no_array,ArrayList status_array,ArrayList date_array,ArrayList desc_array) {\n activity = a;\n this.pc_no_array = pc_no_array;\n this.lab_no_array = lab_no_array;\n RowAdapter.status_array = status_array;\n this.date_array = date_array;\n this.desc_array = desc_array;\n inflater = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n\n }",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_deporte_actualizar);\n helper = new ControlBD(this);\n idNombre = (EditText) findViewById(R.id.nombreDeporte);\n sDeporte = (Spinner) findViewById(R.id.selectDeporte);\n\n lista1 =new ArrayList<>();\n lista1=helper.consultaDeporte();\n ArrayAdapter<String> adaptador1 =new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item,lista1);\n adaptador1.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n sDeporte.setAdapter(adaptador1);\n }",
"private void spinnerFunctions() {\n mTranportSectionAdapter = ArrayAdapter.createFromResource(getContext(), R.array.transport_titles, R.layout.drop_down_spinner_item);\n mTransportSectionSpinner.setAdapter(mTranportSectionAdapter);\n mFuelTypeAdapter = ArrayAdapter.createFromResource(getContext(), R.array.fuel_types, R.layout.drop_down_spinner_item);\n mFuelTypeSpinner.setAdapter(mFuelTypeAdapter);\n mBoxAdapter = ArrayAdapter.createFromResource(getContext(), R.array.box_types, R.layout.drop_down_spinner_item);\n mBoxSpinner.setAdapter(mBoxAdapter);\n }",
"@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n if (convertView == null) {\n convertView = LayoutInflater.from(parent.getContext()).\n inflate(android.R.layout.simple_spinner_dropdown_item, parent, false);\n }\n\n TextView textView= (TextView) convertView;\n textView.setText(position==0?R.string.weight_unit_kilo:R.string.weight_unit_lbs);\n return convertView;\n }",
"private void setSpinner() {\n class spinna extends AsyncTask<Void, Void, ArrayList<String>> {\n\n @Override\n protected void onPreExecute() {\n super.onPreExecute();\n }\n\n @Override\n protected ArrayList<String> doInBackground(Void... voids) {\n ArrayList<String> items = new ArrayList<>();\n for (Season season : series.getSeasons()) {\n int i = season.getSeasonNumber();\n items.add(String.valueOf(i));\n }\n\n return items;\n\n }\n\n @Override\n protected void onPostExecute(ArrayList<String> items) {\n super.onPostExecute(items);\n ArrayAdapter<String> adapter = new ArrayAdapter<String>(SeriesActivity.this, android.R.layout.simple_spinner_dropdown_item, items);\n adapter.setDropDownViewResource(R.layout.support_simple_spinner_dropdown_item);\n dropdown.setAdapter(adapter);\n adapter.notifyDataSetChanged();\n adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n }\n }\n spinna kkkk = new spinna();\n kkkk.execute();\n\n\n }",
"@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n // I created a dynamic TextView here, but you can reference your own custom layout for each spinner item\n TextView label = new TextView(context);\n label.setTextColor(Color.BLACK);\n // Then you can get the current item using the values array (Users array) and the current position\n // You can NOW reference each method you has created in your bean object (User class)\n label.setText(values[position].get_projeadi());\n\n // And finally return your dynamic (or custom) view for each spinner item\n return label;\n }",
"private void initSpinnerSelectionChamps() {\n\n //preparation de l'URL, recuperation de tous les champs dispo. dans la BDD\n final String url = WebService.buildUrlForRequest(Metier.DOMAIN, Metier.NOM_MODELE_CATEGORIES, WebService.ACTION_LIST, null);\n\n //preparation et execution de la requete en asynchrone\n asyncHttpClient.get(getActivity(), url, new AsyncHttpResponseHandler() {\n @Override\n public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) {\n //recuperation des donnees et parsing en JSONArray\n String response = null;\n try {\n response = new String(responseBody, ENCODING);\n JSONArray jsonArray = new JSONArray(response);\n Log.e(\"JSONARRAY\", jsonArray.toString(1));\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n } catch (JSONException e) {\n e.printStackTrace();\n }\n\n }\n\n @Override\n public void onFailure(int statusCode, Header[] headers, byte[] responseBody, Throwable error) {\n new AlertDialog.Builder(getActivity()).setMessage(getString(R.string.error_msg_fail_retrieve_data) + statusCode).show();\n }\n });\n/*\n try {\n JSONObject json = JsonUtils.loadJSONFromResources(getActivity(), R.raw.champs);\n this.spinnerChampAdapter = new ChampAdapter(getActivity(), JsonUtils.getJsonObjects(json, new ArrayList<JSONObject>()));\n } catch (IOException e) {\n e.printStackTrace();\n }*/\n }",
"public void addVotersToSpinner() {\n\n\t\tvoterSpinner = (Spinner) findViewById(R.id.voterSpinner);\n\t\t\n\t\tvoterList = new ArrayList<String>();\n\t\tvoterList.add(\"Andy Adams\");\n\t\tvoterList.add(\"Billy Barnacle\");\n\t\tvoterList.add(\"Charlie Carbuncle\");\n\t\tArrayAdapter<String> voterAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item,voterList);\n\t\tvoterAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n\t\tvoterSpinner.setAdapter(voterAdapter);\n\t}",
"private void setUpSocialSpinner() {\n socialSpinner = mView.findViewById(R.id.social_spinner);\n\n // Get list of social conditions setup in strings.xml\n conditionsArray = new ArrayList<>(Arrays.asList(getResources().getStringArray(R.array.social_conditions)));\n conditionsArray.add(getResources().getString(R.string.spinner_empty)); //filter_empty is \"None\"\n\n // Convert ArrayList to array, so that it can be passed to SocialArrayAdapter\n String[] spinnerObject = new String[conditionsArray.size()];\n spinnerObject = conditionsArray.toArray(spinnerObject);\n\n // Create string ArrayAdapter that will be used for filterSpinner\n ArrayAdapter<String> spinnerAdapter = new SocialArrayAdapter(mActivity,\n R.layout.spinner_item, spinnerObject);\n socialSpinner.setAdapter(spinnerAdapter);\n\n // Set default selection to None\n int defaultIndex = conditionsArray.indexOf(getResources().getString(R.string.spinner_empty));\n socialSpinner.setSelection(defaultIndex);\n }",
"private void setUpLgaSpinner(List<String> lgas) {\n\n ArrayAdapter lgaAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, lgas);\n lgaAdapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);\n lgaAdapter.notifyDataSetChanged();\n mLgaSpinner.setAdapter(lgaAdapter);\n\n mLgaSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long l) {\n mLga = (String) parent.getItemAtPosition(position);\n// Toast.makeText(ProductsActivity.this, \"state: \" + mState + \" lga: \" + mLga, Toast.LENGTH_LONG).show();\n }\n\n @Override\n public void onNothingSelected(AdapterView<?> adapterView) {\n }\n });\n }",
"public SpinnerItemProvider(AdapterFactory adapterFactory) {\r\n\t\tsuper(adapterFactory);\r\n\t}",
"@Override\n\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\n\t\tLayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n\t\tView spinnerView = inflater.inflate(R.layout.list_item_profile, parent, false);\n\t\tTextView spinnerText = (TextView) spinnerView.findViewById(R.id.textView1);\n\t\tspinnerText.setText(items.get(position).getValue());\n\n\t\treturn spinnerView;\n\t}",
"public void listadaptor2(){\n final String[] sem = getResources().getStringArray(R.array.Sem2);\n\n //Creating an instance of ArrayAdaptor\n ArrayAdapter<String> adapter = new ArrayAdapter<>(\n this, android.R.layout.simple_list_item_1, sem);\n\n //Assigning the adapter to the listview\n lst_course.setAdapter(adapter);\n }",
"private void setupSpinner() {\n // Create adapter for spinner. The list options are from the String array it will use\n // the spinner will use the default layout\n ArrayAdapter genderSpinnerAdapter = ArrayAdapter.createFromResource(this,\n R.array.array_gender_options, android.R.layout.simple_spinner_item);\n\n // Specify dropdown layout style - simple list view with 1 item per line\n genderSpinnerAdapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);\n\n // Apply the adapter to the spinner\n mGenderSpinner.setAdapter(genderSpinnerAdapter);\n\n // Set the integer mSelected to the constant values\n mGenderSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n String selection = (String) parent.getItemAtPosition(position);\n if (!TextUtils.isEmpty(selection)) {\n if (selection.equals(getString(R.string.gender_male))) {\n mGender = PetContract.PetEntry.GENDER_MALE;\n } else if (selection.equals(getString(R.string.gender_female))) {\n mGender = PetContract.PetEntry.GENDER_FEMALE;\n } else {\n mGender = PetContract.PetEntry.GENDER_UNKNOWN;\n }\n }\n }\n\n // Because AdapterView is an abstract class, onNothingSelected must be defined\n @Override\n public void onNothingSelected(AdapterView<?> parent) {\n mGender = PetContract.PetEntry.GENDER_UNKNOWN;\n }\n });\n }",
"private void initSpinnerCours()\n {\n Spinner spinner = findViewById(R.id.iCours);\n\n // Adapt\n final ArrayAdapter<Cours> adapter = new ArrayAdapter<>(\n this,\n R.layout.support_simple_spinner_dropdown_item\n );\n spinner.setAdapter(adapter);\n\n final ExamDB db = new ExamDB(this);\n\n ArrayList<Cours> listCours = db.getAllCours();\n adapter.addAll(listCours);\n }",
"public MyAdapter(Context context, int resource, String []objects) //string ki parenthoti hai object\n {\n super(context, resource, objects);\n }",
"private void preencheSpinner(){\n List<String> listaParentes = new ArrayList<String>();\n\n listaParentes.add(getString(R.string.selecioneParentesco));\n\n listaParentes.add(getString(R.string.pai));\n listaParentes.add(getString(R.string.mae));\n listaParentes.add(getString(R.string.esposoa));\n listaParentes.add(getString(R.string.filhoa));\n\n listaParentes.add(getString(R.string.neto));\n listaParentes.add(getString(R.string.genro));\n listaParentes.add(getString(R.string.nora));\n listaParentes.add(getString(R.string.tioa));\n listaParentes.add(getString(R.string.sobrinhoa));\n listaParentes.add(getString(R.string.amigo));\n\n ArrayAdapter<String> adapteSpinner = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, listaParentes);\n adapteSpinner.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n spinnerParentesco.setAdapter(adapteSpinner);\n }",
"private void setSpinner(){\n for (String id : activity.getCollectedIDs()){\n if (activity.getCoinsCollection().containsKey(id)) {\n Coin tempCoin = activity.getCoinsCollection().get(id);\n assert tempCoin != null;\n if(!tempCoin.isBanked() && !tempCoin.isTransferred()) {\n spinnerItems.add(tempCoin);\n }\n }\n }\n\n //sort coins on gold value descending\n spinnerItems.sort((a, b) ->\n a.getValue() * activity.getExchangeRates().get(a.getCurrency())\n < b.getValue() * activity.getExchangeRates().get(b.getCurrency()) ? 1 : -1);\n\n ArrayAdapter<Coin> spinnerArrayAdapter = new ArrayAdapter<>(Objects.requireNonNull(getActivity()), R.layout.spinner_item, spinnerItems);\n spinnerArrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n\n spinner.setAdapter(spinnerArrayAdapter);\n }",
"private void buildSpinners() {\n // assign spinner with resource id\n liquor1 = (Spinner)findViewById(R.id.liquor1);\n liquor2 = (Spinner)findViewById(R.id.liquor2);\n liquor3 = (Spinner)findViewById(R.id.liquor3);\n liquor4 = (Spinner)findViewById(R.id.liquor4);\n liquor5 = (Spinner)findViewById(R.id.liquor5);\n\n // create array of spinners to facilitate associations\n spinnerArrayList.add(liquor1);\n spinnerArrayList.add(liquor2);\n spinnerArrayList.add(liquor3);\n spinnerArrayList.add(liquor4);\n spinnerArrayList.add(liquor5);\n\n // build specific spinners for each type of liquor\n for (int i = 0; i < numLiquors; i++) {\n liquorString[i] = liquorList.get(i);\n assignSpinner(i + 1, liquorString[i]);\n }\n }",
"private void createSpinners() {\n\t\tsuper.addSpinner(myResources.getString(\"FishReproduce\"));\n\t\tsuper.addSpinner(myResources.getString(\"SharkDeath\"));\n\t\tsuper.addSpinner(myResources.getString(\"SharkReproduce\"));\n\t}",
"public void addItemsOnSpinner2() {\n\n spinner2 = (Spinner) findViewById(R.id.spinner2);\n List<String> list = new ArrayList<String>();\n list.add(\"list 1\");\n list.add(\"list 2\");\n list.add(\"list 3\");\n ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this,\n android.R.layout.simple_spinner_item, list);\n dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n spinner2.setAdapter(dataAdapter);\n }",
"@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n TextView closedSpinnerTextView = (TextView) super.getView(position, convertView, parent);\n closedSpinnerTextView.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);\n if(tf!=null){\n closedSpinnerTextView.setTypeface(tf);\n }\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {\n closedSpinnerTextView.setAllCaps(true);\n }\n return closedSpinnerTextView;\n }",
"private void SpinnerInitialize() {\n try{\n Spinner dropdownto = findViewById(R.id.tonumbercountrycode);\n\n//create an adapter to describe how the items are displayed, adapters are used in several places in android.\n//There are multiple variations of this, but this is the basic variant.\n ArrayAdapter<String> adapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_dropdown_item, countrycodes);\n//set the spinners adapter to the previously created one.\n\n dropdownto.setAdapter(adapter);\n dropdownto.setSelection(0,true);\n\n Spinner dropdownfrom = findViewById(R.id.fromnumbercountrycode);\n\n//create an adapter to describe how the items are displayed, adapters are used in several places in android.\n//There are multiple variations of this, but this is the basic variant.\n // ArrayAdapter<String> adapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_dropdown_item, countrycodes);\n//set the spinners adapter to the previously created one.\n\n dropdownfrom.setAdapter(adapter);\n dropdownfrom.setSelection(0,true);\n }\n catch (Exception ex){\n Toast.makeText(InsertDb.this, ex.getMessage().toString(), Toast.LENGTH_SHORT).show();\n\n }\n\n\n }",
"public void setupPrioritySpinner() {\n ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(getActivity(),\n R.array.prirority_level_list, android.R.layout.simple_spinner_item);\n adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n mPriority.setAdapter(adapter);\n mPriority.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n removeFocusFromEditText();\n }\n\n @Override\n public void onNothingSelected(AdapterView<?> parent) {\n }\n });\n }",
"private void addItemsOnSpinner() {\n final Spinner spinner = (Spinner) findViewById(R.id.spinner);\n final List<Activity> activities = new ArrayList<>();\n\n final ArrayAdapter<Activity> activityAdapter = new ArrayAdapter<Activity>(this, android.R.layout.simple_spinner_item, activities);\n\n ActivityFetcher.getActivitiesAsync().enqueue(new Callback<List<Activity>>() {\n @Override\n public void onResponse(Call<List<Activity>> call, Response<List<Activity>> response) {\n if (!response.isSuccessful()) {\n // TODO: error message\n return;\n }\n List<Activity> body = response.body();\n Collections.sort(body, new Comparator<Activity>() {\n @Override\n public int compare(Activity o1, Activity o2) {\n if (o1.getCategoryName() == o2.getCategoryName()) {\n return String.CASE_INSENSITIVE_ORDER.compare(o1.getName(), o2.getName());\n }\n\n return String.CASE_INSENSITIVE_ORDER.compare(o1.getCategoryName(), o2.getCategoryName());\n }\n });\n activities.addAll(body);\n activityAdapter.notifyDataSetChanged();\n\n spinner.setSelection(activityAdapter.getPosition(mEntry.getActivity()));\n }\n\n @Override\n public void onFailure(Call<List<Activity>> call, Throwable t) {\n // TODO: Error message\n }\n });\n\n activityAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n spinner.setAdapter(activityAdapter);\n\n spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n mEntry.setActivity((Activity) parent.getItemAtPosition(position));\n }\n\n @Override\n public void onNothingSelected(AdapterView<?> parent) {\n mEntry.setActivity(null);\n }\n });\n }",
"private void setupSpinner() {\n ArrayAdapter genderSpinnerAdapter = ArrayAdapter.createFromResource(this,\n R.array.array_gender_options, android.R.layout.simple_spinner_item);\n\n // Specify dropdown layout style - simple list view with 1 item per line\n genderSpinnerAdapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);\n\n // Apply the adapter to the spinner\n mGenderSpinner.setAdapter(genderSpinnerAdapter);\n\n // Set the integer mSelected to the constant values\n mGenderSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n String selection = (String) parent.getItemAtPosition(position);\n if (!TextUtils.isEmpty(selection)) {\n if (selection.equals(getString(R.string.gender_male))) {\n mGender = 1; // Male\n } else if (selection.equals(getString(R.string.gender_female))) {\n mGender = 2; // Female\n } else {\n mGender = 0; // Unknown\n }\n }\n }\n\n // Because AdapterView is an abstract class, onNothingSelected must be defined\n @Override\n public void onNothingSelected(AdapterView<?> parent) {\n mGender = 0; // Unknown\n }\n });\n }",
"private void loadSpinner() {\n // Chargement du spinner de la liste des widgets\n widgetAdapter = (WidgetAdapter) DomoUtils.createAdapter(context, VOCAL);\n spinnerWidgets.setAdapter(widgetAdapter);\n\n // Chargement du spinner Box\n BoxAdapter boxAdapter = (BoxAdapter) DomoUtils.createAdapter(context, BOX);\n spinnerBox.setAdapter(boxAdapter);\n }",
"private void loadSpinner(View view) {\n\n ArrayAdapter<String> adapter = new ArrayAdapter<>(\n view.getContext(), android.R.layout.simple_spinner_item, getCategories());\n adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n categorySpinner.setAdapter(adapter);\n\n\n }",
"private void cargarSpinner() {\n\n admin = new AdminSQLiteOpenHelper(this, \"activo_fijo\", null, 1);\n BaseDeDatos = admin.getReadableDatabase();\n\n List<String> opciones = new ArrayList<String>();\n opciones.add(\"Selecciona una opción\");\n\n String selectQuery = \"SELECT * FROM sucursales\" ;\n Cursor cursor = BaseDeDatos.rawQuery(selectQuery, null);\n\n // looping through all rows and adding to list\n if (cursor.moveToFirst()) {\n do {\n // adding to tags list\n opciones.add(cursor.getString(cursor.getColumnIndex(\"local\")));\n } while (cursor.moveToNext());\n }\n\n BaseDeDatos.close();\n\n //spiner personalizado\n ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, opciones);\n spinner.setAdapter(adapter);\n\n }",
"public void setList(Context context, CustomSpinner customSpinner, String[] list, String selectedValue) {\n ArrayAdapter<String> aa = new ArrayAdapter<>(context, android.R.layout.simple_spinner_item, list);\n aa.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n //Setting the ArrayAdapter data on the Spinner\n customSpinner.setAdapter(aa);\n if (selectedValue != null && !selectedValue.equalsIgnoreCase(\"\")) {\n int spinnerPosition = aa.getPosition(selectedValue);\n customSpinner.setSelection(spinnerPosition);\n }\n }",
"private void setupSpinner() {\n // Create adapter for spinner. The list options are from the String array it will use\n // the spinner will use the default layout\n ArrayAdapter colourSpinnerAdapter = ArrayAdapter.createFromResource(this,\n R.array.phone_colour_array, android.R.layout.simple_spinner_item);\n\n // Specify dropdown layout style - simple list view with 1 item per line\n colourSpinnerAdapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);\n\n // Apply the adapter to the spinner\n mColourSpinner.setAdapter(colourSpinnerAdapter);\n\n // Set the integer mSelected to the constant values\n mColourSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n String selection = (String) parent.getItemAtPosition(position);\n if (!TextUtils.isEmpty(selection)) {\n if (selection.equals(getString(R.string.phone_colour_black))) {\n mColour = PhoneEntry.COLOUR_BLACK;\n } else if (selection.equals(getString(R.string.phone_colour_white))) {\n mColour = PhoneEntry.COLOUR_WHITE;\n } else if (selection.equals(getString(R.string.phone_colour_grey))){\n mColour = PhoneEntry.COLOUR_GREY;\n }\n else {\n mColour = PhoneEntry.COLOUR_UNKNOWN;\n }\n }\n }\n\n // Because AdapterView is an abstract class, onNothingSelected must be defined\n @Override\n public void onNothingSelected(AdapterView<?> parent) {\n mColour = PhoneEntry.COLOUR_UNKNOWN;\n }\n });\n\n }",
"private String setupselectSpinner1(){\n String ret = \"unknown\";\n try{\n PartnerDB db = new PartnerDB((Context)this);\n SQLiteDatabase plcDB = db.openDB();\n Cursor cur = plcDB.rawQuery(\"select name from partner;\", new String[]{});\n ArrayList<String> al = new ArrayList<String>();\n while(cur.moveToNext()){\n try{\n al.add(cur.getString(0));\n }catch(Exception ex){\n android.util.Log.w(this.getClass().getSimpleName(),\"exception stepping thru cursor\"+ex.getMessage());\n }\n }\n partners = (String[]) al.toArray(new String[al.size()]);\n ret = (partners.length>0 ? partners[0] : \"unknown\");\n partnerAdapter = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_dropdown_item, partners);\n selectSpinner1.setAdapter(partnerAdapter);\n selectSpinner1.setOnItemSelectedListener(this);\n }catch(Exception ex){\n android.util.Log.w(this.getClass().getSimpleName(),\"unable to setup partner spinner\");\n }\n return ret;\n }",
"private void addNewSpinnerItem4() \n\t{\n\t\tmscust=ecust.getText().toString();\n\t\tCharSequence textHolder = \"\" +mscust; \n\t\tadapterpah.insert(textHolder, 0);\n\t\tspah.setAdapter(adapterpah);\n\t}",
"protected ListAdapter makeAdapter(Intent data, String[] dataNeeded, Context activity,\n int layout, int[] ids){\n //Get items that where returned\n int count = Integer.parseInt(data.getStringExtra(AppCSTR.DB_ROW_COUNT));\n //holds rows from database\n String[] row;\n //Log.e(\"Count: \", \"\" + count);\n alertList = new ArrayList<>();\n\n for(int j = 0; j < count; j++){\n row = data.getStringArrayExtra(AppCSTR.DB_ROW + j);\n // creating new HashMap\n HashMap<String, String> map = new HashMap<>();\n for(int i = 0; i < dataNeeded.length; i++){\n map.put(dataNeeded[i], row[i]);\n //Log.e(\"NAME: \", dataNeeded[i]);\n //Log.e(\"VALUE: \",items[i]);\n }\n alertList.add(map);\n }\n\n /**\n * Details of how the adapter will be laid out.\n */\n return new SimpleAdapter(\n activity, alertList,\n layout, dataNeeded, ids);\n }",
"private void loadAutoCompleteData() {\n List<String> labelsItemName = db.getAllItemsNames();\n // Creating adapter for spinner\n ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,\n labelsItemName);\n\n // Drop down layout style - list view with radio button\n dataAdapter.setDropDownViewResource(android.R.layout.simple_list_item_1);\n\n // attaching data adapter to spinner\n autoCompleteTextViewSearchItem.setAdapter(dataAdapter);\n\n // List - Get Menu Code\n List<String> labelsMenuCode = db.getAllMenuCodes();\n // Creating adapter for spinner\n ArrayAdapter<String> dataAdapter1 = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,\n labelsMenuCode);\n\n // Drop down layout style - list view with radio button\n dataAdapter1.setDropDownViewResource(android.R.layout.simple_list_item_1);\n\n // attaching data adapter to spinner\n autoCompleteTextViewSearchMenuCode.setAdapter(dataAdapter1);\n\n POS_LIST = ArrayAdapter.createFromResource(this, R.array.poscode, android.R.layout.simple_spinner_item);\n spnr_pos.setAdapter(POS_LIST);\n\n // barcode\n List<String> labelsBarCode = db.getAllBarCodes();\n ArrayAdapter<String> dataAdapter11 = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,\n labelsBarCode);\n dataAdapter11.setDropDownViewResource(android.R.layout.simple_list_item_1);\n autoCompleteTextViewSearchItemBarcode.setAdapter(dataAdapter11);\n\n }",
"public void makeFrequencyLists() {\n\n //times spinner\n Spinner spinner_times = (Spinner) findViewById(R.id.times_id);\n// Create an ArrayAdapter using the string array and a default spinner layout\n ArrayAdapter<CharSequence> adapter_times = ArrayAdapter.createFromResource(this,\n R.array.times_array, android.R.layout.simple_spinner_item);\n// Specify the layout to use when the list of choices appears\n adapter_times.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n// Apply the adapter to the spinner\n spinner_times.setAdapter(adapter_times);\n\n //over time spinner\n Spinner spinner_over_time = (Spinner) findViewById(R.id.over_time_id);\n// Create an ArrayAdapter using the string array and a default spinner layout\n ArrayAdapter<CharSequence> adapter_over_time = ArrayAdapter.createFromResource(this,\n R.array.over_time_array, android.R.layout.simple_spinner_item);\n// Specify the layout to use when the list of choices appears\n adapter_over_time.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n// Apply the adapter to the spinner\n spinner_over_time.setAdapter(adapter_over_time);\n }",
"private void populatePhone() {\n dataBaseHelper = new DataBaseHelper(this);\n List<String> lables = dataBaseHelper.getPN();\n ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this,\n android.R.layout.simple_spinner_item, lables);\n dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n phoneNum.setAdapter(dataAdapter);\n\n }",
"private void initSpinner() {\n\t\tdata1 = new ArrayList<HashMap<String, String>>();\n\t\tdata2 = new ArrayList<HashMap<String, String>>();\n\t\tdata3 = new ArrayList<HashMap<String, String>>();\n\n\t\tadapter1 = new SimpleAdapter(this, data1,\n\t\t\t\tandroid.R.layout.simple_spinner_dropdown_item, from, to);\n\t\tadapter2 = new SimpleAdapter(this, data2,\n\t\t\t\tandroid.R.layout.simple_spinner_dropdown_item, from, to);\n\t\tadapter3 = new SimpleAdapter(this, data3,\n\t\t\t\tandroid.R.layout.simple_spinner_dropdown_item, from, to);\n\n\t\tsp1.setAdapter(adapter1);\n\t\tsp2.setAdapter(adapter2);\n\t\tsp3.setAdapter(adapter3);\n\n\t\tAjaxParams params = new AjaxParams();\n\t\tparams.put(\"op\", \"GetCity\");\n\t\tparams.put(\"levelID\", \"1\");\n\t\tparams.put(\"parentCode\", \"\");\n\t\thttp.get(GlobalVars.url, params, new AjaxCallBack<String>() {\n\t\t\t@Override\n\t\t\tpublic void onSuccess(String t) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tsuper.onSuccess(t);\n\t\t\t\ttry {\n\t\t\t\t\tJSONObject jsonObject = new JSONObject(t);\n\t\t\t\t\tif (jsonObject.getInt(\"result\") == 1) {\n\t\t\t\t\t\tJSONArray array = jsonObject.getJSONArray(\"list\");\n\t\t\t\t\t\tfor (int i = 0; i < array.length(); i++) {\n\t\t\t\t\t\t\tHashMap<String, String> map = new HashMap<String, String>();\n\t\t\t\t\t\t\tmap.put(\"name\",\n\t\t\t\t\t\t\t\t\tarray.getJSONObject(i).getString(\"name\"));\n\t\t\t\t\t\t\tmap.put(\"code\",\n\t\t\t\t\t\t\t\t\tarray.getJSONObject(i).getString(\"code\"));\n\t\t\t\t\t\t\tdata1.add(map);\n\t\t\t\t\t\t\tif (userInfoPreferences.getString(\"provinceId\", \"\")\n\t\t\t\t\t\t\t\t\t.equals(array.getJSONObject(i).getString(\n\t\t\t\t\t\t\t\t\t\t\t\"code\"))) {\n\t\t\t\t\t\t\t\tdefaultSheng = i;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tadapter1.notifyDataSetChanged();\n\t\t\t\t\t\tsp1.setSelection(defaultSheng, true);\n\t\t\t\t\t}\n\t\t\t\t} catch (JSONException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onFailure(Throwable t, int errorNo, String strMsg) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tsuper.onFailure(t, errorNo, strMsg);\n\t\t\t\tTools.showTextToast(context, \"获取省份列表失败,可能是网络问题\");\n\t\t\t}\n\t\t});\n\n\t}",
"private void setUpSpinner(){\n //instantiates a new CategoryAdapter with the categories from the database\n CategorySpinnerAdapter mCategorySpinnerAdapter = new CategorySpinnerAdapter(this, mCategories);\n mCategorySpinner.setAdapter(mCategorySpinnerAdapter);\n //callback for when an item is selected\n mCategorySpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n\n }\n @Override\n public void onNothingSelected(AdapterView<?> parent) {\n\n }\n });\n }",
"private void loadSpinnerFromDB(){\n\n try {\n MyDBHandler dbHandler = new MyDBHandler(this);\n servicesFromSP.clear();\n ArrayList<String> myServices = new ArrayList<String>();\n\n servicesFromSP.addAll(dbHandler.getAllServiceTypeOfServiceProvider(companyID));\n\n for(ServiceType serviceType: servicesFromSP)\n myServices.add(serviceType.getServiceName() + \" / \" + serviceType.getHourlyRate() + \" $/H\");\n\n if(myServices.size()==0)\n Toast.makeText(this,\"Cannot load the DB or DB empty\",Toast.LENGTH_LONG).show();\n if (myServices.size()>0) {\n ArrayAdapter<String> data = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, myServices);\n data.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n spin_service.setAdapter(data);\n }\n\n\n }catch(Exception ex){\n Toast.makeText(this,ex.getMessage(),Toast.LENGTH_LONG).show();\n }\n }",
"void addToSpinnerCity()\n {\n Collections.sort(listSpinner);\n Spinner spinner=(Spinner)findViewById(R.id.gSpinnerCity);\n // Adapter for spinner\n ArrayAdapter<String> adapter=new ArrayAdapter<String>(this,R.layout.custom_blood_spinner,R.id.textSpinner,listSpinner);\n spinner.setAdapter(adapter);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view1 = inflater.inflate(R.layout.fragment_fragment1, container, false);\n\n String[] cityString = new String[]{\"CHENGDU\",\"CHONGQING\",\"BEIJING\",\"SHANGHAI\" };\n\n Spinner citySpinner = view1.findViewById(R.id.spinner_city);\n citySpinner.setOnItemSelectedListener(this);\n //create an adapter using the string array and a default spinner_layout\n\n // Creating adapter for spinner\n ArrayAdapter<String> adapter = new ArrayAdapter<>\n (this.getActivity(), android.R.layout.simple_spinner_dropdown_item, cityString);\n\n citySpinner.setAdapter(adapter);\n\n return view1;\n }",
"private void getTaskSpinner() {\n\n StringRequest stringRequest = new StringRequest(\"https://cardtest10.000webhostapp.com/Sync_Spinner_T.php\", new Response.Listener<String>() {\n @Override\n public void onResponse(String response) {\n\n try{\n\n JSONObject jsonResponse = new JSONObject(response);\n JSONArray jsonArraytask = jsonResponse.getJSONArray(\"task\");\n\n for(int i=0; i < jsonArraytask.length(); i++)\n {\n JSONObject jsonObjecttask = jsonArraytask.getJSONObject(i);\n String task = jsonObjecttask.optString(\"Type\");\n arrayTask.add(task);\n }\n\n }catch (JSONException e){\n e.printStackTrace();\n }\n\n // Applying the adapter to our spinner\n spTaskType.setAdapter(new ArrayAdapter <>(UserAreaActivity.this, android.R.layout.simple_spinner_dropdown_item, arrayTask));\n }\n },\n new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n Toast.makeText(UserAreaActivity.this, error + \"\", Toast.LENGTH_SHORT).show();\n }\n });\n\n RequestQueue requestQueue = Volley.newRequestQueue(this);\n requestQueue.add(stringRequest);\n\n }"
] | [
"0.77827036",
"0.7167751",
"0.707887",
"0.70464206",
"0.7031589",
"0.69442147",
"0.6892288",
"0.68842876",
"0.6843304",
"0.6666929",
"0.6629984",
"0.65953",
"0.6584477",
"0.65602857",
"0.6542307",
"0.653414",
"0.65294194",
"0.64857537",
"0.63057846",
"0.62820894",
"0.6261547",
"0.6236169",
"0.6227513",
"0.6221378",
"0.6207496",
"0.6198878",
"0.6183491",
"0.6181766",
"0.6177231",
"0.61767256",
"0.6163139",
"0.61575246",
"0.61520857",
"0.6140302",
"0.61240125",
"0.6117361",
"0.60940146",
"0.60913175",
"0.60837567",
"0.60680115",
"0.6057166",
"0.6049615",
"0.6033381",
"0.6022371",
"0.59704864",
"0.5968123",
"0.59650296",
"0.5952074",
"0.5945241",
"0.59067297",
"0.58875877",
"0.588643",
"0.58824503",
"0.58764714",
"0.58758783",
"0.5875002",
"0.5868272",
"0.58614993",
"0.5856349",
"0.5851061",
"0.5844711",
"0.58434683",
"0.5823928",
"0.58207613",
"0.58070374",
"0.5804947",
"0.5773128",
"0.57673806",
"0.57388717",
"0.57364476",
"0.572468",
"0.5706977",
"0.57012624",
"0.56949943",
"0.5693442",
"0.5680155",
"0.56795067",
"0.56718993",
"0.5664879",
"0.56602573",
"0.56426215",
"0.56394607",
"0.56373394",
"0.56362927",
"0.56243205",
"0.5623488",
"0.56175536",
"0.561153",
"0.5606602",
"0.560573",
"0.5601552",
"0.5600307",
"0.5599832",
"0.5598917",
"0.55965674",
"0.5589375",
"0.5584789",
"0.55837196",
"0.557438",
"0.5572161",
"0.5570159"
] | 0.0 | -1 |
Instantiates a new Sensor log. | public SensorLog() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public SensorLog(Date when, Float temperature) {\n this.when = when;\n this.temperature = temperature;\n }",
"public MyLogs() {\n }",
"public Log()\n {\n filePath = String.format(\"log-%d.sl\", System.currentTimeMillis());\n\n open();\n }",
"public SensorLog(String id, Date when, Float temperature) {\n this.id = id;\n this.when = when;\n this.temperature = temperature;\n }",
"public RegistroSensor() \n {\n\n }",
"public SensorData() {\n\n\t}",
"public Log() { //Null constructor is adequate as all values start at zero\n\t}",
"public BasicSensor() {}",
"public SystemLog () {\r\n\t\tsuper();\r\n\t}",
"public SensorReader() {\n\t\tinit();\n\t}",
"public TRIP_Sensor () {\n super();\n }",
"public LogX() {\n\n }",
"public Sensor() {\n if(this.rawData == null)\n this.rawData = new Vector<SensorData>();\n }",
"public LogEntry () {\n }",
"DeviceSensor createDeviceSensor();",
"public void logSensorData () {\n\t}",
"private void initLog() {\n _logsList = (ListView) findViewById(R.id.lv_log);\n setupLogger();\n }",
"abstract void initiateLog();",
"private static Log getLog() {\n if (log == null) {\n log = new SystemStreamLog();\n }\n\n return log;\n }",
"public SensorStation(){\n\n }",
"public RedpacketActivityOperationLog() {\n this(\"redpacket_activity_operation_log\", null);\n }",
"public Auditor () {\n\n\t\t// Create a new log file without deleting existing logs. Use the current time. \n\t\ttry {\n\t\t\tlog = new File( \"log: \" + Double.toString( new Date().getTime()) + \".txt\" );\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}",
"public Logs() {\n initComponents();\n }",
"public LogPoster() {\n\t\t\n\t}",
"public void onCreate() {\r\n\r\n\t\tLog.d(TAG, \"Called onCreate\");\r\n\r\n\t\tsuper.onCreate();\r\n\r\n\t\tmeter = Pedometer.getInstance();\r\n\r\n\t\tinitializeSensors();\r\n\r\n\t\tIntentFilter filter = new IntentFilter(Application.SENSORSWITCHID);\r\n\t\tsensorSwitch = new SensorSwitchReceiver();\r\n\t\tregisterReceiver(sensorSwitch, filter);\r\n\r\n\t\tsensorUpdateIntent = new Intent(Application.SENSORSUPDATEID);\r\n\r\n\t}",
"private void initSensor(){\n sensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);\n\n registerListeners();\n }",
"private Log() {\r\n\t}",
"public DNSLog() {}",
"private Log() {\n }",
"public Logger() {\n map = new LinkedHashMap<>();\n }",
"public Log(Logger logger) {\n this.logger = logger;\n }",
"public Slf4jLogService() {\n this(System.getProperties());\n }",
"public static Log instantiate(List<XmlDoc.Element> les) throws Throwable {\n if (les != null && !les.isEmpty()) {\n return new Log(les);\n } else {\n return new Log();\n }\n }",
"private void init(){\n \tgl = new GeradorLog(getTAG_LOG(),getTIPO_LOG());\n // cria os devidos parametros da tela\n campoResposta = (EditText) findViewById(R.id.campoResposta);\n msg_usr = (TextView) findViewById(R.id.resposta);\n }",
"private TypicalLogEntries() {}",
"private void startLoggerService() {\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\r\n\t\tlocationListener = new MyLocationListener();\r\n\r\n\t\tdevNaam = android.os.Build.MODEL;\r\n\t\tdevNaam = devNaam.replaceAll(\" \", \"\");\r\n\t\t\r\n\t\tnew dbSchrijf(\"project78\", \"sommelsdijk\", extern).execute(\"table\", devNaam);\r\n\r\n\t\tlm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 5000,\r\n\t\t\t\tminDistanceMeters, locationListener);\r\n\r\n\t\tToast.makeText(getBaseContext(),\r\n\t\t\t\t\"Service gemaakt met interval : \\n\" + minTimeMillis,\r\n\t\t\t\tToast.LENGTH_LONG).show();\r\n\r\n\t}",
"public LogAnalyzer()\n { \n // Create the array object to hold the hourly\n // access counts.\n hourCounts = new int[24];\n // Create the reader to obtain the data.\n reader = new LogfileReader();\n }",
"public Log newInstance(String str) {\n Log log;\n try {\n if (this.logConstructor == null) {\n log = discoverLogImplementation(str);\n } else {\n log = (Log) this.logConstructor.newInstance(new Object[]{str});\n }\n if (this.logMethod != null) {\n this.logMethod.invoke(log, new Object[]{this});\n }\n return log;\n } catch (LogConfigurationException e) {\n throw e;\n } catch (InvocationTargetException e2) {\n Throwable targetException = e2.getTargetException();\n if (targetException != null) {\n throw new LogConfigurationException(targetException);\n }\n throw new LogConfigurationException((Throwable) e2);\n } catch (Throwable th) {\n throw new LogConfigurationException(th);\n }\n }",
"ExternalSensor createExternalSensor();",
"public ServicioLogger() {\n }",
"public Sensor(int threadNumber) {\n\t\tdeviceNumber = threadNumber;\n\t}",
"public Logger (){}",
"public MyLogger () {}",
"@Override\n public void init() {\n /* Initialize the hardware variables.\n * The init() method of the hardware class does all the work here\n */\n robot.init(hardwareMap);\n\n //ColorSensor colorSensor;\n //colorSensor = hardwareMap.get(ColorSensor.class, \"Sensor_Color\");\n\n // Send telemetry message to signify robot waiting;\n telemetry.addData(\"Say\", \"Hello Driver\"); //\n }",
"public void init(){\n int myValue = this.getArguments().getInt(\"sensor\");\r\n\r\n //Creates a sensor from the sensorID\r\n sensorM = (SensorManager) getActivity().getSystemService(Context.SENSOR_SERVICE);\r\n sensor = sensorM.getDefaultSensor(myValue);\r\n\r\n //Creates new sensor listener\r\n sensorListener = new SensorListener(getActivity(), myView, sensor);\r\n\r\n //Stores all sensor information in variables\r\n String name = sensor.getName();\r\n String vendor = sensor.getVendor();\r\n int version = sensor.getVersion();\r\n int minDelay = sensor.getMinDelay();\r\n int maxDelay = sensor.getMaxDelay();\r\n float range = sensor.getMaximumRange();\r\n float power = sensor.getPower();\r\n boolean isWakeUpSensor = sensor.isWakeUpSensor();\r\n float resolution = sensor.getResolution();\r\n\r\n //set text in all text views\r\n tvSensorName.setText(name);\r\n tvSensorVendor.setText(\"Vendor: \" + vendor);\r\n tvSensorVersion.setText(\"Version: \" + version);\r\n tvSensorMinDelay.setText(\"Minimum delay: \" + minDelay);\r\n tvSensorMaxDelay.setText(\"Maximum delay: \" + maxDelay);\r\n tvSensorRange.setText(\"Maximum range: \" + range);\r\n tvSensorPower.setText(\"Power consumption: \" + power);\r\n tvSensorWakeUp.setText(\"Is wake up sensor: \" + isWakeUpSensor);\r\n tvSensorResolution.setText(\"Resolution: \" + resolution);\r\n }",
"public void startOnNewTread() {\n stop();\n\n mReadLogsHandler = new ReadLogsHandler();\n\n mReadLogThread = new ReadLogsThread();\n mReadLogThread.start();\n }",
"public PerforceSensor() {\r\n //nothing yet.\r\n }",
"public Log() {\n cadenas = new Vector<String>();\n }",
"public IRSensorSubsystem() {\n\n }",
"public ZLogRecord() {\n super(ZLog.Z_LOG);\n }",
"RegisterSensor() {\n }",
"private void init() {\r\n this.log = this.getLog(LOGGER_MAIN);\r\n\r\n if (!(this.log instanceof org.apache.commons.logging.impl.Log4JLogger)) {\r\n throw new IllegalStateException(\r\n \"LogUtil : apache Log4J library or log4j.xml file are not present in classpath !\");\r\n }\r\n\r\n // TODO : check if logger has an appender (use parent hierarchy if needed)\r\n if (this.log.isWarnEnabled()) {\r\n this.log.warn(\"LogUtil : logging enabled now.\");\r\n }\r\n\r\n this.logBase = this.getLog(LOGGER_BASE);\r\n this.logDev = this.getLog(LOGGER_DEV);\r\n }",
"public Sensor(String id_, String buildingID_, String sensorType_){\n\t\tsuper(id_,buildingID_);\n\t\tsensorType = sensorType_;\t\n\t}",
"public Catelog() {\n super();\n }",
"public LogMessageController() {\n\t}",
"MonitoredSensor(Sensor sensor) {\n mSensor = sensor;\n mEnabledByUser = true;\n\n // Set appropriate sensor name depending on the type. Unfortunately,\n // we can't really use sensor.getName() here, since the value it\n // returns (although resembles the purpose) is a bit vaguer than it\n // should be. Also choose an appropriate format for the strings that\n // display sensor's value.\n switch (sensor.getType()) {\n case Sensor.TYPE_ACCELEROMETER:\n mUiName = \"Accelerometer\";\n mTextFmt = \"%+.2f %+.2f %+.2f\";\n mEmulatorFriendlyName = \"acceleration\";\n break;\n case 9: // Sensor.TYPE_GRAVITY is missing in API 7\n mUiName = \"Gravity\";\n mTextFmt = \"%+.2f %+.2f %+.2f\";\n mEmulatorFriendlyName = \"gravity\";\n break;\n case Sensor.TYPE_GYROSCOPE:\n mUiName = \"Gyroscope\";\n mTextFmt = \"%+.2f %+.2f %+.2f\";\n mEmulatorFriendlyName = \"gyroscope\";\n break;\n case Sensor.TYPE_LIGHT:\n mUiName = \"Light\";\n mTextFmt = \"%.0f\";\n mEmulatorFriendlyName = \"light\";\n break;\n case 10: // Sensor.TYPE_LINEAR_ACCELERATION is missing in API 7\n mUiName = \"Linear acceleration\";\n mTextFmt = \"%+.2f %+.2f %+.2f\";\n mEmulatorFriendlyName = \"linear-acceleration\";\n break;\n case Sensor.TYPE_MAGNETIC_FIELD:\n mUiName = \"Magnetic field\";\n mTextFmt = \"%+.2f %+.2f %+.2f\";\n mEmulatorFriendlyName = \"magnetic-field\";\n break;\n case Sensor.TYPE_ORIENTATION:\n mUiName = \"Orientation\";\n mTextFmt = \"%+03.0f %+03.0f %+03.0f\";\n mEmulatorFriendlyName = \"orientation\";\n break;\n case Sensor.TYPE_PRESSURE:\n mUiName = \"Pressure\";\n mTextFmt = \"%.0f\";\n mEmulatorFriendlyName = \"pressure\";\n break;\n case Sensor.TYPE_PROXIMITY:\n mUiName = \"Proximity\";\n mTextFmt = \"%.0f\";\n mEmulatorFriendlyName = \"proximity\";\n break;\n case 11: // Sensor.TYPE_ROTATION_VECTOR is missing in API 7\n mUiName = \"Rotation\";\n mTextFmt = \"%+.2f %+.2f %+.2f\";\n mEmulatorFriendlyName = \"rotation\";\n break;\n case Sensor.TYPE_TEMPERATURE:\n mUiName = \"Temperature\";\n mTextFmt = \"%.0f\";\n mEmulatorFriendlyName = \"temperature\";\n break;\n default:\n mUiName = \"<Unknown>\";\n mTextFmt = \"N/A\";\n mEmulatorFriendlyName = \"unknown\";\n if (DEBUG) Loge(\"Unknown sensor type \" + mSensor.getType() +\n \" for sensor \" + mSensor.getName());\n break;\n }\n }",
"private LogEvent()\n\t{\n\t\tsuper();\n\t}",
"public LogEntry(String logData) {\n\n this.logData = logData;\n }",
"public SignalCollector(File log) {\r\n this.log = log;\r\n }",
"public LogEvent newInstance()\n {\n return new LogEvent();\n }",
"public Log(String fp)\n {\n this.filePath = fp;\n\n open();\n }",
"public LogWatch() {\n\t\tsuper();\n\t\tthis.start();\n\t}",
"public HeadTiltProcessingService(Sensor sensor, int timeInterval){\n this(sensor);\n this.timeInterval=timeInterval;\n }",
"protected SuperSensor createNewSensor(SensorMessage message)\n {\n return ModuleInstanceProvider.getSensorInstanceByType(message.getType());\n }",
"SensorDescription(){\n\n }",
"public MonitoredData() {}",
"public NGATAstro()\n\t{\n\t\tsuper();\n\t\tlogger = LogManager.getLogger(this);\n\t\tinitialiseLoggerReference(logger);\n\t}",
"public ETLLogDAOImpl() {\r\n this(new Configuration());\r\n }",
"private TicketLog createLog() throws SQLException {\n\t\t\t\t\treturn new TicketLog(rs.getLong(1), rs.getString(2),\n\t\t\t\t\t\t\trs.getLong(3),\n\t\t\t\t\t\t\tTicketLog.Action.valueOf(rs.getString(4)),\n\t\t\t\t\t\t\trs.getInt(5));\n\t\t\t\t}",
"public OrderLogRecord() {\n super(OrderLog.ORDER_LOG);\n }",
"public static Log getInstance() {\r\n if (firstInstance == null) {\r\n firstInstance = new Log();\r\n }\r\n return firstInstance;\r\n }",
"public static synchronized Logging initialize()\n {\n if (instance == null) {\n instance = new Logging();\n }\n\n return instance;\n }",
"public Logger(int loglv) {\r\n LOGLV = loglv;\r\n }",
"public AddSensor() {\n initComponents();\n }",
"@Override\n\tprotected void initial() throws SiDCException, Exception {\n\t\tLogAction.getInstance().initial(logger, this.getClass().getCanonicalName());\n\t}",
"static void init(LoggerManager manager) {\n setLogDir(manager.getLogDirFullPath());\n setLogLevel(manager.getLevel());\n sLogcatEnabled = manager.enableLogcat();\n logGenerator = manager.logExecutor;\n\n if (logWriterThread != null) {\n logWriterThread.quit();\n }\n\n logWriterThread = new LogWriterThread(manager);\n logWriterThread.start();\n\n android.util.Log.i(TAG, \"initialized... level=\" + sLogLvlName + \",lvl=\"\n + sLogLvl + \",Logcat Enabled=\" + sLogcatEnabled + \",dir=\" + manager\n .getLogDirFullPath());\n }",
"public PersistentLogEventListener() {\n\t\tthis(new EventDAO());\n\t}",
"public TOpLogs() {\n this(DSL.name(\"t_op_logs\"), null);\n }",
"private ExtentLogger() {}",
"public abstract void createSensors() throws Exception;",
"public SearchLogs() {\n this(\"search_logs\", null);\n }",
"public Systemlog (java.lang.Integer rowid) {\n\t\tsuper(rowid);\n\t}",
"private HostessState(String logRepresentation){\n this.logRepresentation = logRepresentation;\n }",
"public ActuatorData()\n\t{\n\t\tsuper(); \n\t}",
"public void init() {\n log.info(\"initialization\");\n }",
"public ScreeningLogger() {\n int defaultMaxRetries = DEFAULT_MAX_RETRIES;\n int defaultRetrySleepTime = DEFAULT_RETRY_SLEEP_TIME;\n\n try {\n ConfigManager cm = ConfigManager.getInstance();\n\n String maxRetriesString = cm.getString(SCREENING_LOGGER_NAMESPACE, MAX_RETRIES_PROPERTY_NAME);\n if (maxRetriesString != null) {\n try {\n defaultMaxRetries = Integer.parseInt(maxRetriesString);\n } catch (NumberFormatException nfe) {\n // uses default\n }\n }\n\n String retrySleepTimeString = cm.getString(SCREENING_LOGGER_NAMESPACE, RETRY_SLEEP_TIME_PROPERTY_NAME);\n if (retrySleepTimeString != null) {\n try {\n defaultRetrySleepTime = Integer.parseInt(retrySleepTimeString);\n } catch (NumberFormatException nfe) {\n // uses default\n }\n }\n } catch (Exception e) {\n // uses default\n }\n\n maxRetries = defaultMaxRetries;\n retrySleepTime = defaultRetrySleepTime;\n\n initializeIdGen();\n }",
"private Logger() {\n\n }",
"private LogService()\n {\n logWriter = new CleanSweepLogWriterImpl();\n\n Calendar date = Calendar.getInstance();\n int year = date.get(Calendar.YEAR);\n int month = date.get(Calendar.MONTH)+1;\n int day = date.get(Calendar.DAY_OF_MONTH);\n\n todaysDate=\"\";\n if(day<10) {\n todaysDate += year + \"\" + month + \"0\" + day;\n }\n else\n {\n todaysDate += year + \"\" + month + \"\" + day;\n }\n\n }",
"public RAlarmLogDAOImpl() {\r\n super();\r\n }",
"void initializeLogging(String loggingProperties);",
"public void setUp() {\n instance = new LogMessage(type, id, operator, message, error);\n }",
"public LogsV3() {\n nodeidx = \"\";\n name = \"\";\n log = \"\";\n _excludeFields = \"\";\n }",
"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 }",
"public TPMTransportLog( int tpmManufacturer )\r\n {\r\n super();\r\n this.tpmManufacturer = tpmManufacturer;\r\n }",
"public Log createLog(TopicAndPartition topicAndPartition, LogConfig config) {\n synchronized (logCreationLock) {\n Log log = logs.get(topicAndPartition);\n\n // check if the log has already been created in another thread\n if (log != null)\n return log;\n\n // if not, create it\n File dataDir = nextLogDir();\n File dir = new File(dataDir, topicAndPartition.topic + \"-\" + topicAndPartition.partition);\n dir.mkdirs();\n log = new Log(dir, config, /*recoveryPoint = */0L, scheduler, time);\n logs.put(topicAndPartition, log);\n logger.info(\"Created log for partition [{},{}] in {} with properties {{}}.\", topicAndPartition.topic, topicAndPartition.partition, dataDir.getAbsolutePath(), config.toProps());\n return log;\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 }",
"private Log()\n {\n //Hides implicit constructor.\n }",
"private void initLogger() {\n\t\ttry {\n\t\t\tjava.util.logging.Logger rootLogger = java.util.logging.Logger.getLogger(\"\");\n\t\t\trootLogger.setUseParentHandlers(false);\n\t\t\tHandler csvFileHandler = new FileHandler(\"logger/log.csv\", 100000, 1, true);\n\t\t\tlogformater = new LogFormatter();\n\t\t\trootLogger.addHandler(csvFileHandler);\n\t\t\tcsvFileHandler.setFormatter(logformater);\n\t\t\tlogger.setLevel(Level.ALL);\n\t\t} catch (IOException ie) {\n\t\t\tSystem.out.println(\"Logger initialization failed\");\n\t\t\tie.printStackTrace();\n\t\t}\n\t}",
"private void initLogConfig() {\n\t\t logConfigurator = new LogConfigurator();\n\t\t// Setting append log coudn't cover by a new log.\n\t\tlogConfigurator.setUseFileAppender(true);\n\t\t// Define a file path for output log.\n\t\tString filename = StorageUtils.getLogFile();\n\t\tLog.i(\"info\", filename);\n\t\t// Setting log output\n\t\tlogConfigurator.setFileName(filename);\n\t\t// Setting log's level\n\t\tlogConfigurator.setRootLevel(Level.DEBUG);\n\t\tlogConfigurator.setLevel(\"org.apache\", Level.ERROR);\n\t\tlogConfigurator.setFilePattern(\"%d %-5p [%c{2}]-[%L] %m%n\");\n\t\tlogConfigurator.setMaxFileSize(1024 * 1024 * 5);\n\t\t// Set up to use the cache first and then output to a file for a period\n\t\t// of time\n\t\tlogConfigurator.setImmediateFlush(false);\n\t\tlogConfigurator.setUseLogCatAppender(true);\n\t\t// logConfigurator.setResetConfiguration(true);\n\t\tlogConfigurator.configure();\n\t}",
"public WriteLogger( )\n {\n this.logfilename = null;\n\n this.logfile = null;\n this.out = null;\n }"
] | [
"0.65701777",
"0.65532696",
"0.6528035",
"0.65199256",
"0.6503362",
"0.6447434",
"0.6312588",
"0.6292965",
"0.6268334",
"0.62568516",
"0.6243232",
"0.62306905",
"0.61649275",
"0.60164285",
"0.6007314",
"0.60033995",
"0.59988004",
"0.5981224",
"0.5963795",
"0.5961021",
"0.5949289",
"0.5890426",
"0.58694375",
"0.5850193",
"0.5830457",
"0.57955813",
"0.5795413",
"0.5791563",
"0.5789862",
"0.57891726",
"0.57827854",
"0.5763067",
"0.57489544",
"0.57380545",
"0.57181835",
"0.57134044",
"0.57104105",
"0.5710032",
"0.5702623",
"0.5683017",
"0.5680005",
"0.56657964",
"0.56623024",
"0.5647917",
"0.56477904",
"0.56271225",
"0.56212914",
"0.5619509",
"0.56102026",
"0.55950665",
"0.5591215",
"0.5588605",
"0.5582045",
"0.5578492",
"0.55759495",
"0.5573819",
"0.5573337",
"0.5551555",
"0.5549429",
"0.55333114",
"0.551996",
"0.5519533",
"0.55111307",
"0.55097884",
"0.55076146",
"0.549553",
"0.5491318",
"0.5487789",
"0.5485144",
"0.5479456",
"0.54763573",
"0.54706484",
"0.54605544",
"0.54563135",
"0.543961",
"0.5427359",
"0.5423602",
"0.54233193",
"0.54198956",
"0.541868",
"0.54085726",
"0.540409",
"0.53960675",
"0.5390739",
"0.5389331",
"0.53678614",
"0.5358775",
"0.5349764",
"0.53460497",
"0.53266484",
"0.53241456",
"0.5323218",
"0.5321277",
"0.53138006",
"0.53098357",
"0.52998763",
"0.52988386",
"0.5297835",
"0.5297161",
"0.5293242"
] | 0.8172945 | 0 |
Instantiates a new Sensor log. | public SensorLog(Date when, Float temperature) {
this.when = when;
this.temperature = temperature;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public SensorLog() {\n }",
"public MyLogs() {\n }",
"public Log()\n {\n filePath = String.format(\"log-%d.sl\", System.currentTimeMillis());\n\n open();\n }",
"public SensorLog(String id, Date when, Float temperature) {\n this.id = id;\n this.when = when;\n this.temperature = temperature;\n }",
"public RegistroSensor() \n {\n\n }",
"public SensorData() {\n\n\t}",
"public Log() { //Null constructor is adequate as all values start at zero\n\t}",
"public BasicSensor() {}",
"public SystemLog () {\r\n\t\tsuper();\r\n\t}",
"public SensorReader() {\n\t\tinit();\n\t}",
"public TRIP_Sensor () {\n super();\n }",
"public LogX() {\n\n }",
"public Sensor() {\n if(this.rawData == null)\n this.rawData = new Vector<SensorData>();\n }",
"public LogEntry () {\n }",
"DeviceSensor createDeviceSensor();",
"public void logSensorData () {\n\t}",
"private void initLog() {\n _logsList = (ListView) findViewById(R.id.lv_log);\n setupLogger();\n }",
"abstract void initiateLog();",
"private static Log getLog() {\n if (log == null) {\n log = new SystemStreamLog();\n }\n\n return log;\n }",
"public SensorStation(){\n\n }",
"public RedpacketActivityOperationLog() {\n this(\"redpacket_activity_operation_log\", null);\n }",
"public Auditor () {\n\n\t\t// Create a new log file without deleting existing logs. Use the current time. \n\t\ttry {\n\t\t\tlog = new File( \"log: \" + Double.toString( new Date().getTime()) + \".txt\" );\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}",
"public Logs() {\n initComponents();\n }",
"public LogPoster() {\n\t\t\n\t}",
"public void onCreate() {\r\n\r\n\t\tLog.d(TAG, \"Called onCreate\");\r\n\r\n\t\tsuper.onCreate();\r\n\r\n\t\tmeter = Pedometer.getInstance();\r\n\r\n\t\tinitializeSensors();\r\n\r\n\t\tIntentFilter filter = new IntentFilter(Application.SENSORSWITCHID);\r\n\t\tsensorSwitch = new SensorSwitchReceiver();\r\n\t\tregisterReceiver(sensorSwitch, filter);\r\n\r\n\t\tsensorUpdateIntent = new Intent(Application.SENSORSUPDATEID);\r\n\r\n\t}",
"private void initSensor(){\n sensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);\n\n registerListeners();\n }",
"private Log() {\r\n\t}",
"public DNSLog() {}",
"private Log() {\n }",
"public Logger() {\n map = new LinkedHashMap<>();\n }",
"public Log(Logger logger) {\n this.logger = logger;\n }",
"public Slf4jLogService() {\n this(System.getProperties());\n }",
"public static Log instantiate(List<XmlDoc.Element> les) throws Throwable {\n if (les != null && !les.isEmpty()) {\n return new Log(les);\n } else {\n return new Log();\n }\n }",
"private void init(){\n \tgl = new GeradorLog(getTAG_LOG(),getTIPO_LOG());\n // cria os devidos parametros da tela\n campoResposta = (EditText) findViewById(R.id.campoResposta);\n msg_usr = (TextView) findViewById(R.id.resposta);\n }",
"private TypicalLogEntries() {}",
"private void startLoggerService() {\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\r\n\t\tlocationListener = new MyLocationListener();\r\n\r\n\t\tdevNaam = android.os.Build.MODEL;\r\n\t\tdevNaam = devNaam.replaceAll(\" \", \"\");\r\n\t\t\r\n\t\tnew dbSchrijf(\"project78\", \"sommelsdijk\", extern).execute(\"table\", devNaam);\r\n\r\n\t\tlm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 5000,\r\n\t\t\t\tminDistanceMeters, locationListener);\r\n\r\n\t\tToast.makeText(getBaseContext(),\r\n\t\t\t\t\"Service gemaakt met interval : \\n\" + minTimeMillis,\r\n\t\t\t\tToast.LENGTH_LONG).show();\r\n\r\n\t}",
"public LogAnalyzer()\n { \n // Create the array object to hold the hourly\n // access counts.\n hourCounts = new int[24];\n // Create the reader to obtain the data.\n reader = new LogfileReader();\n }",
"public Log newInstance(String str) {\n Log log;\n try {\n if (this.logConstructor == null) {\n log = discoverLogImplementation(str);\n } else {\n log = (Log) this.logConstructor.newInstance(new Object[]{str});\n }\n if (this.logMethod != null) {\n this.logMethod.invoke(log, new Object[]{this});\n }\n return log;\n } catch (LogConfigurationException e) {\n throw e;\n } catch (InvocationTargetException e2) {\n Throwable targetException = e2.getTargetException();\n if (targetException != null) {\n throw new LogConfigurationException(targetException);\n }\n throw new LogConfigurationException((Throwable) e2);\n } catch (Throwable th) {\n throw new LogConfigurationException(th);\n }\n }",
"ExternalSensor createExternalSensor();",
"public ServicioLogger() {\n }",
"public Sensor(int threadNumber) {\n\t\tdeviceNumber = threadNumber;\n\t}",
"public Logger (){}",
"public MyLogger () {}",
"@Override\n public void init() {\n /* Initialize the hardware variables.\n * The init() method of the hardware class does all the work here\n */\n robot.init(hardwareMap);\n\n //ColorSensor colorSensor;\n //colorSensor = hardwareMap.get(ColorSensor.class, \"Sensor_Color\");\n\n // Send telemetry message to signify robot waiting;\n telemetry.addData(\"Say\", \"Hello Driver\"); //\n }",
"public void init(){\n int myValue = this.getArguments().getInt(\"sensor\");\r\n\r\n //Creates a sensor from the sensorID\r\n sensorM = (SensorManager) getActivity().getSystemService(Context.SENSOR_SERVICE);\r\n sensor = sensorM.getDefaultSensor(myValue);\r\n\r\n //Creates new sensor listener\r\n sensorListener = new SensorListener(getActivity(), myView, sensor);\r\n\r\n //Stores all sensor information in variables\r\n String name = sensor.getName();\r\n String vendor = sensor.getVendor();\r\n int version = sensor.getVersion();\r\n int minDelay = sensor.getMinDelay();\r\n int maxDelay = sensor.getMaxDelay();\r\n float range = sensor.getMaximumRange();\r\n float power = sensor.getPower();\r\n boolean isWakeUpSensor = sensor.isWakeUpSensor();\r\n float resolution = sensor.getResolution();\r\n\r\n //set text in all text views\r\n tvSensorName.setText(name);\r\n tvSensorVendor.setText(\"Vendor: \" + vendor);\r\n tvSensorVersion.setText(\"Version: \" + version);\r\n tvSensorMinDelay.setText(\"Minimum delay: \" + minDelay);\r\n tvSensorMaxDelay.setText(\"Maximum delay: \" + maxDelay);\r\n tvSensorRange.setText(\"Maximum range: \" + range);\r\n tvSensorPower.setText(\"Power consumption: \" + power);\r\n tvSensorWakeUp.setText(\"Is wake up sensor: \" + isWakeUpSensor);\r\n tvSensorResolution.setText(\"Resolution: \" + resolution);\r\n }",
"public void startOnNewTread() {\n stop();\n\n mReadLogsHandler = new ReadLogsHandler();\n\n mReadLogThread = new ReadLogsThread();\n mReadLogThread.start();\n }",
"public PerforceSensor() {\r\n //nothing yet.\r\n }",
"public Log() {\n cadenas = new Vector<String>();\n }",
"public IRSensorSubsystem() {\n\n }",
"public ZLogRecord() {\n super(ZLog.Z_LOG);\n }",
"RegisterSensor() {\n }",
"private void init() {\r\n this.log = this.getLog(LOGGER_MAIN);\r\n\r\n if (!(this.log instanceof org.apache.commons.logging.impl.Log4JLogger)) {\r\n throw new IllegalStateException(\r\n \"LogUtil : apache Log4J library or log4j.xml file are not present in classpath !\");\r\n }\r\n\r\n // TODO : check if logger has an appender (use parent hierarchy if needed)\r\n if (this.log.isWarnEnabled()) {\r\n this.log.warn(\"LogUtil : logging enabled now.\");\r\n }\r\n\r\n this.logBase = this.getLog(LOGGER_BASE);\r\n this.logDev = this.getLog(LOGGER_DEV);\r\n }",
"public Sensor(String id_, String buildingID_, String sensorType_){\n\t\tsuper(id_,buildingID_);\n\t\tsensorType = sensorType_;\t\n\t}",
"public Catelog() {\n super();\n }",
"public LogMessageController() {\n\t}",
"MonitoredSensor(Sensor sensor) {\n mSensor = sensor;\n mEnabledByUser = true;\n\n // Set appropriate sensor name depending on the type. Unfortunately,\n // we can't really use sensor.getName() here, since the value it\n // returns (although resembles the purpose) is a bit vaguer than it\n // should be. Also choose an appropriate format for the strings that\n // display sensor's value.\n switch (sensor.getType()) {\n case Sensor.TYPE_ACCELEROMETER:\n mUiName = \"Accelerometer\";\n mTextFmt = \"%+.2f %+.2f %+.2f\";\n mEmulatorFriendlyName = \"acceleration\";\n break;\n case 9: // Sensor.TYPE_GRAVITY is missing in API 7\n mUiName = \"Gravity\";\n mTextFmt = \"%+.2f %+.2f %+.2f\";\n mEmulatorFriendlyName = \"gravity\";\n break;\n case Sensor.TYPE_GYROSCOPE:\n mUiName = \"Gyroscope\";\n mTextFmt = \"%+.2f %+.2f %+.2f\";\n mEmulatorFriendlyName = \"gyroscope\";\n break;\n case Sensor.TYPE_LIGHT:\n mUiName = \"Light\";\n mTextFmt = \"%.0f\";\n mEmulatorFriendlyName = \"light\";\n break;\n case 10: // Sensor.TYPE_LINEAR_ACCELERATION is missing in API 7\n mUiName = \"Linear acceleration\";\n mTextFmt = \"%+.2f %+.2f %+.2f\";\n mEmulatorFriendlyName = \"linear-acceleration\";\n break;\n case Sensor.TYPE_MAGNETIC_FIELD:\n mUiName = \"Magnetic field\";\n mTextFmt = \"%+.2f %+.2f %+.2f\";\n mEmulatorFriendlyName = \"magnetic-field\";\n break;\n case Sensor.TYPE_ORIENTATION:\n mUiName = \"Orientation\";\n mTextFmt = \"%+03.0f %+03.0f %+03.0f\";\n mEmulatorFriendlyName = \"orientation\";\n break;\n case Sensor.TYPE_PRESSURE:\n mUiName = \"Pressure\";\n mTextFmt = \"%.0f\";\n mEmulatorFriendlyName = \"pressure\";\n break;\n case Sensor.TYPE_PROXIMITY:\n mUiName = \"Proximity\";\n mTextFmt = \"%.0f\";\n mEmulatorFriendlyName = \"proximity\";\n break;\n case 11: // Sensor.TYPE_ROTATION_VECTOR is missing in API 7\n mUiName = \"Rotation\";\n mTextFmt = \"%+.2f %+.2f %+.2f\";\n mEmulatorFriendlyName = \"rotation\";\n break;\n case Sensor.TYPE_TEMPERATURE:\n mUiName = \"Temperature\";\n mTextFmt = \"%.0f\";\n mEmulatorFriendlyName = \"temperature\";\n break;\n default:\n mUiName = \"<Unknown>\";\n mTextFmt = \"N/A\";\n mEmulatorFriendlyName = \"unknown\";\n if (DEBUG) Loge(\"Unknown sensor type \" + mSensor.getType() +\n \" for sensor \" + mSensor.getName());\n break;\n }\n }",
"private LogEvent()\n\t{\n\t\tsuper();\n\t}",
"public LogEntry(String logData) {\n\n this.logData = logData;\n }",
"public SignalCollector(File log) {\r\n this.log = log;\r\n }",
"public LogEvent newInstance()\n {\n return new LogEvent();\n }",
"public Log(String fp)\n {\n this.filePath = fp;\n\n open();\n }",
"public LogWatch() {\n\t\tsuper();\n\t\tthis.start();\n\t}",
"public HeadTiltProcessingService(Sensor sensor, int timeInterval){\n this(sensor);\n this.timeInterval=timeInterval;\n }",
"protected SuperSensor createNewSensor(SensorMessage message)\n {\n return ModuleInstanceProvider.getSensorInstanceByType(message.getType());\n }",
"SensorDescription(){\n\n }",
"public MonitoredData() {}",
"public NGATAstro()\n\t{\n\t\tsuper();\n\t\tlogger = LogManager.getLogger(this);\n\t\tinitialiseLoggerReference(logger);\n\t}",
"public ETLLogDAOImpl() {\r\n this(new Configuration());\r\n }",
"private TicketLog createLog() throws SQLException {\n\t\t\t\t\treturn new TicketLog(rs.getLong(1), rs.getString(2),\n\t\t\t\t\t\t\trs.getLong(3),\n\t\t\t\t\t\t\tTicketLog.Action.valueOf(rs.getString(4)),\n\t\t\t\t\t\t\trs.getInt(5));\n\t\t\t\t}",
"public OrderLogRecord() {\n super(OrderLog.ORDER_LOG);\n }",
"public static Log getInstance() {\r\n if (firstInstance == null) {\r\n firstInstance = new Log();\r\n }\r\n return firstInstance;\r\n }",
"public static synchronized Logging initialize()\n {\n if (instance == null) {\n instance = new Logging();\n }\n\n return instance;\n }",
"public Logger(int loglv) {\r\n LOGLV = loglv;\r\n }",
"public AddSensor() {\n initComponents();\n }",
"@Override\n\tprotected void initial() throws SiDCException, Exception {\n\t\tLogAction.getInstance().initial(logger, this.getClass().getCanonicalName());\n\t}",
"static void init(LoggerManager manager) {\n setLogDir(manager.getLogDirFullPath());\n setLogLevel(manager.getLevel());\n sLogcatEnabled = manager.enableLogcat();\n logGenerator = manager.logExecutor;\n\n if (logWriterThread != null) {\n logWriterThread.quit();\n }\n\n logWriterThread = new LogWriterThread(manager);\n logWriterThread.start();\n\n android.util.Log.i(TAG, \"initialized... level=\" + sLogLvlName + \",lvl=\"\n + sLogLvl + \",Logcat Enabled=\" + sLogcatEnabled + \",dir=\" + manager\n .getLogDirFullPath());\n }",
"public PersistentLogEventListener() {\n\t\tthis(new EventDAO());\n\t}",
"public TOpLogs() {\n this(DSL.name(\"t_op_logs\"), null);\n }",
"private ExtentLogger() {}",
"public abstract void createSensors() throws Exception;",
"public SearchLogs() {\n this(\"search_logs\", null);\n }",
"public Systemlog (java.lang.Integer rowid) {\n\t\tsuper(rowid);\n\t}",
"private HostessState(String logRepresentation){\n this.logRepresentation = logRepresentation;\n }",
"public ActuatorData()\n\t{\n\t\tsuper(); \n\t}",
"public void init() {\n log.info(\"initialization\");\n }",
"public ScreeningLogger() {\n int defaultMaxRetries = DEFAULT_MAX_RETRIES;\n int defaultRetrySleepTime = DEFAULT_RETRY_SLEEP_TIME;\n\n try {\n ConfigManager cm = ConfigManager.getInstance();\n\n String maxRetriesString = cm.getString(SCREENING_LOGGER_NAMESPACE, MAX_RETRIES_PROPERTY_NAME);\n if (maxRetriesString != null) {\n try {\n defaultMaxRetries = Integer.parseInt(maxRetriesString);\n } catch (NumberFormatException nfe) {\n // uses default\n }\n }\n\n String retrySleepTimeString = cm.getString(SCREENING_LOGGER_NAMESPACE, RETRY_SLEEP_TIME_PROPERTY_NAME);\n if (retrySleepTimeString != null) {\n try {\n defaultRetrySleepTime = Integer.parseInt(retrySleepTimeString);\n } catch (NumberFormatException nfe) {\n // uses default\n }\n }\n } catch (Exception e) {\n // uses default\n }\n\n maxRetries = defaultMaxRetries;\n retrySleepTime = defaultRetrySleepTime;\n\n initializeIdGen();\n }",
"private Logger() {\n\n }",
"private LogService()\n {\n logWriter = new CleanSweepLogWriterImpl();\n\n Calendar date = Calendar.getInstance();\n int year = date.get(Calendar.YEAR);\n int month = date.get(Calendar.MONTH)+1;\n int day = date.get(Calendar.DAY_OF_MONTH);\n\n todaysDate=\"\";\n if(day<10) {\n todaysDate += year + \"\" + month + \"0\" + day;\n }\n else\n {\n todaysDate += year + \"\" + month + \"\" + day;\n }\n\n }",
"public RAlarmLogDAOImpl() {\r\n super();\r\n }",
"void initializeLogging(String loggingProperties);",
"public void setUp() {\n instance = new LogMessage(type, id, operator, message, error);\n }",
"public LogsV3() {\n nodeidx = \"\";\n name = \"\";\n log = \"\";\n _excludeFields = \"\";\n }",
"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 }",
"public TPMTransportLog( int tpmManufacturer )\r\n {\r\n super();\r\n this.tpmManufacturer = tpmManufacturer;\r\n }",
"public Log createLog(TopicAndPartition topicAndPartition, LogConfig config) {\n synchronized (logCreationLock) {\n Log log = logs.get(topicAndPartition);\n\n // check if the log has already been created in another thread\n if (log != null)\n return log;\n\n // if not, create it\n File dataDir = nextLogDir();\n File dir = new File(dataDir, topicAndPartition.topic + \"-\" + topicAndPartition.partition);\n dir.mkdirs();\n log = new Log(dir, config, /*recoveryPoint = */0L, scheduler, time);\n logs.put(topicAndPartition, log);\n logger.info(\"Created log for partition [{},{}] in {} with properties {{}}.\", topicAndPartition.topic, topicAndPartition.partition, dataDir.getAbsolutePath(), config.toProps());\n return log;\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 }",
"private Log()\n {\n //Hides implicit constructor.\n }",
"private void initLogger() {\n\t\ttry {\n\t\t\tjava.util.logging.Logger rootLogger = java.util.logging.Logger.getLogger(\"\");\n\t\t\trootLogger.setUseParentHandlers(false);\n\t\t\tHandler csvFileHandler = new FileHandler(\"logger/log.csv\", 100000, 1, true);\n\t\t\tlogformater = new LogFormatter();\n\t\t\trootLogger.addHandler(csvFileHandler);\n\t\t\tcsvFileHandler.setFormatter(logformater);\n\t\t\tlogger.setLevel(Level.ALL);\n\t\t} catch (IOException ie) {\n\t\t\tSystem.out.println(\"Logger initialization failed\");\n\t\t\tie.printStackTrace();\n\t\t}\n\t}",
"private void initLogConfig() {\n\t\t logConfigurator = new LogConfigurator();\n\t\t// Setting append log coudn't cover by a new log.\n\t\tlogConfigurator.setUseFileAppender(true);\n\t\t// Define a file path for output log.\n\t\tString filename = StorageUtils.getLogFile();\n\t\tLog.i(\"info\", filename);\n\t\t// Setting log output\n\t\tlogConfigurator.setFileName(filename);\n\t\t// Setting log's level\n\t\tlogConfigurator.setRootLevel(Level.DEBUG);\n\t\tlogConfigurator.setLevel(\"org.apache\", Level.ERROR);\n\t\tlogConfigurator.setFilePattern(\"%d %-5p [%c{2}]-[%L] %m%n\");\n\t\tlogConfigurator.setMaxFileSize(1024 * 1024 * 5);\n\t\t// Set up to use the cache first and then output to a file for a period\n\t\t// of time\n\t\tlogConfigurator.setImmediateFlush(false);\n\t\tlogConfigurator.setUseLogCatAppender(true);\n\t\t// logConfigurator.setResetConfiguration(true);\n\t\tlogConfigurator.configure();\n\t}",
"public WriteLogger( )\n {\n this.logfilename = null;\n\n this.logfile = null;\n this.out = null;\n }"
] | [
"0.8172945",
"0.65532696",
"0.6528035",
"0.65199256",
"0.6503362",
"0.6447434",
"0.6312588",
"0.6292965",
"0.6268334",
"0.62568516",
"0.6243232",
"0.62306905",
"0.61649275",
"0.60164285",
"0.6007314",
"0.60033995",
"0.59988004",
"0.5981224",
"0.5963795",
"0.5961021",
"0.5949289",
"0.5890426",
"0.58694375",
"0.5850193",
"0.5830457",
"0.57955813",
"0.5795413",
"0.5791563",
"0.5789862",
"0.57891726",
"0.57827854",
"0.5763067",
"0.57489544",
"0.57380545",
"0.57181835",
"0.57134044",
"0.57104105",
"0.5710032",
"0.5702623",
"0.5683017",
"0.5680005",
"0.56657964",
"0.56623024",
"0.5647917",
"0.56477904",
"0.56271225",
"0.56212914",
"0.5619509",
"0.56102026",
"0.55950665",
"0.5591215",
"0.5588605",
"0.5582045",
"0.5578492",
"0.55759495",
"0.5573819",
"0.5573337",
"0.5551555",
"0.5549429",
"0.55333114",
"0.551996",
"0.5519533",
"0.55111307",
"0.55097884",
"0.55076146",
"0.549553",
"0.5491318",
"0.5487789",
"0.5485144",
"0.5479456",
"0.54763573",
"0.54706484",
"0.54605544",
"0.54563135",
"0.543961",
"0.5427359",
"0.5423602",
"0.54233193",
"0.54198956",
"0.541868",
"0.54085726",
"0.540409",
"0.53960675",
"0.5390739",
"0.5389331",
"0.53678614",
"0.5358775",
"0.5349764",
"0.53460497",
"0.53266484",
"0.53241456",
"0.5323218",
"0.5321277",
"0.53138006",
"0.53098357",
"0.52998763",
"0.52988386",
"0.5297835",
"0.5297161",
"0.5293242"
] | 0.65701777 | 1 |
Instantiates a new Sensor log. | public SensorLog(String id, Date when, Float temperature) {
this.id = id;
this.when = when;
this.temperature = temperature;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public SensorLog() {\n }",
"public SensorLog(Date when, Float temperature) {\n this.when = when;\n this.temperature = temperature;\n }",
"public MyLogs() {\n }",
"public Log()\n {\n filePath = String.format(\"log-%d.sl\", System.currentTimeMillis());\n\n open();\n }",
"public RegistroSensor() \n {\n\n }",
"public SensorData() {\n\n\t}",
"public Log() { //Null constructor is adequate as all values start at zero\n\t}",
"public BasicSensor() {}",
"public SystemLog () {\r\n\t\tsuper();\r\n\t}",
"public SensorReader() {\n\t\tinit();\n\t}",
"public TRIP_Sensor () {\n super();\n }",
"public LogX() {\n\n }",
"public Sensor() {\n if(this.rawData == null)\n this.rawData = new Vector<SensorData>();\n }",
"public LogEntry () {\n }",
"DeviceSensor createDeviceSensor();",
"public void logSensorData () {\n\t}",
"private void initLog() {\n _logsList = (ListView) findViewById(R.id.lv_log);\n setupLogger();\n }",
"abstract void initiateLog();",
"private static Log getLog() {\n if (log == null) {\n log = new SystemStreamLog();\n }\n\n return log;\n }",
"public SensorStation(){\n\n }",
"public RedpacketActivityOperationLog() {\n this(\"redpacket_activity_operation_log\", null);\n }",
"public Auditor () {\n\n\t\t// Create a new log file without deleting existing logs. Use the current time. \n\t\ttry {\n\t\t\tlog = new File( \"log: \" + Double.toString( new Date().getTime()) + \".txt\" );\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}",
"public Logs() {\n initComponents();\n }",
"public LogPoster() {\n\t\t\n\t}",
"public void onCreate() {\r\n\r\n\t\tLog.d(TAG, \"Called onCreate\");\r\n\r\n\t\tsuper.onCreate();\r\n\r\n\t\tmeter = Pedometer.getInstance();\r\n\r\n\t\tinitializeSensors();\r\n\r\n\t\tIntentFilter filter = new IntentFilter(Application.SENSORSWITCHID);\r\n\t\tsensorSwitch = new SensorSwitchReceiver();\r\n\t\tregisterReceiver(sensorSwitch, filter);\r\n\r\n\t\tsensorUpdateIntent = new Intent(Application.SENSORSUPDATEID);\r\n\r\n\t}",
"private void initSensor(){\n sensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);\n\n registerListeners();\n }",
"private Log() {\r\n\t}",
"public DNSLog() {}",
"private Log() {\n }",
"public Logger() {\n map = new LinkedHashMap<>();\n }",
"public Log(Logger logger) {\n this.logger = logger;\n }",
"public Slf4jLogService() {\n this(System.getProperties());\n }",
"public static Log instantiate(List<XmlDoc.Element> les) throws Throwable {\n if (les != null && !les.isEmpty()) {\n return new Log(les);\n } else {\n return new Log();\n }\n }",
"private void init(){\n \tgl = new GeradorLog(getTAG_LOG(),getTIPO_LOG());\n // cria os devidos parametros da tela\n campoResposta = (EditText) findViewById(R.id.campoResposta);\n msg_usr = (TextView) findViewById(R.id.resposta);\n }",
"private TypicalLogEntries() {}",
"private void startLoggerService() {\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\r\n\t\tlocationListener = new MyLocationListener();\r\n\r\n\t\tdevNaam = android.os.Build.MODEL;\r\n\t\tdevNaam = devNaam.replaceAll(\" \", \"\");\r\n\t\t\r\n\t\tnew dbSchrijf(\"project78\", \"sommelsdijk\", extern).execute(\"table\", devNaam);\r\n\r\n\t\tlm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 5000,\r\n\t\t\t\tminDistanceMeters, locationListener);\r\n\r\n\t\tToast.makeText(getBaseContext(),\r\n\t\t\t\t\"Service gemaakt met interval : \\n\" + minTimeMillis,\r\n\t\t\t\tToast.LENGTH_LONG).show();\r\n\r\n\t}",
"public LogAnalyzer()\n { \n // Create the array object to hold the hourly\n // access counts.\n hourCounts = new int[24];\n // Create the reader to obtain the data.\n reader = new LogfileReader();\n }",
"public Log newInstance(String str) {\n Log log;\n try {\n if (this.logConstructor == null) {\n log = discoverLogImplementation(str);\n } else {\n log = (Log) this.logConstructor.newInstance(new Object[]{str});\n }\n if (this.logMethod != null) {\n this.logMethod.invoke(log, new Object[]{this});\n }\n return log;\n } catch (LogConfigurationException e) {\n throw e;\n } catch (InvocationTargetException e2) {\n Throwable targetException = e2.getTargetException();\n if (targetException != null) {\n throw new LogConfigurationException(targetException);\n }\n throw new LogConfigurationException((Throwable) e2);\n } catch (Throwable th) {\n throw new LogConfigurationException(th);\n }\n }",
"ExternalSensor createExternalSensor();",
"public ServicioLogger() {\n }",
"public Sensor(int threadNumber) {\n\t\tdeviceNumber = threadNumber;\n\t}",
"public Logger (){}",
"public MyLogger () {}",
"@Override\n public void init() {\n /* Initialize the hardware variables.\n * The init() method of the hardware class does all the work here\n */\n robot.init(hardwareMap);\n\n //ColorSensor colorSensor;\n //colorSensor = hardwareMap.get(ColorSensor.class, \"Sensor_Color\");\n\n // Send telemetry message to signify robot waiting;\n telemetry.addData(\"Say\", \"Hello Driver\"); //\n }",
"public void init(){\n int myValue = this.getArguments().getInt(\"sensor\");\r\n\r\n //Creates a sensor from the sensorID\r\n sensorM = (SensorManager) getActivity().getSystemService(Context.SENSOR_SERVICE);\r\n sensor = sensorM.getDefaultSensor(myValue);\r\n\r\n //Creates new sensor listener\r\n sensorListener = new SensorListener(getActivity(), myView, sensor);\r\n\r\n //Stores all sensor information in variables\r\n String name = sensor.getName();\r\n String vendor = sensor.getVendor();\r\n int version = sensor.getVersion();\r\n int minDelay = sensor.getMinDelay();\r\n int maxDelay = sensor.getMaxDelay();\r\n float range = sensor.getMaximumRange();\r\n float power = sensor.getPower();\r\n boolean isWakeUpSensor = sensor.isWakeUpSensor();\r\n float resolution = sensor.getResolution();\r\n\r\n //set text in all text views\r\n tvSensorName.setText(name);\r\n tvSensorVendor.setText(\"Vendor: \" + vendor);\r\n tvSensorVersion.setText(\"Version: \" + version);\r\n tvSensorMinDelay.setText(\"Minimum delay: \" + minDelay);\r\n tvSensorMaxDelay.setText(\"Maximum delay: \" + maxDelay);\r\n tvSensorRange.setText(\"Maximum range: \" + range);\r\n tvSensorPower.setText(\"Power consumption: \" + power);\r\n tvSensorWakeUp.setText(\"Is wake up sensor: \" + isWakeUpSensor);\r\n tvSensorResolution.setText(\"Resolution: \" + resolution);\r\n }",
"public void startOnNewTread() {\n stop();\n\n mReadLogsHandler = new ReadLogsHandler();\n\n mReadLogThread = new ReadLogsThread();\n mReadLogThread.start();\n }",
"public PerforceSensor() {\r\n //nothing yet.\r\n }",
"public Log() {\n cadenas = new Vector<String>();\n }",
"public IRSensorSubsystem() {\n\n }",
"public ZLogRecord() {\n super(ZLog.Z_LOG);\n }",
"RegisterSensor() {\n }",
"private void init() {\r\n this.log = this.getLog(LOGGER_MAIN);\r\n\r\n if (!(this.log instanceof org.apache.commons.logging.impl.Log4JLogger)) {\r\n throw new IllegalStateException(\r\n \"LogUtil : apache Log4J library or log4j.xml file are not present in classpath !\");\r\n }\r\n\r\n // TODO : check if logger has an appender (use parent hierarchy if needed)\r\n if (this.log.isWarnEnabled()) {\r\n this.log.warn(\"LogUtil : logging enabled now.\");\r\n }\r\n\r\n this.logBase = this.getLog(LOGGER_BASE);\r\n this.logDev = this.getLog(LOGGER_DEV);\r\n }",
"public Sensor(String id_, String buildingID_, String sensorType_){\n\t\tsuper(id_,buildingID_);\n\t\tsensorType = sensorType_;\t\n\t}",
"public Catelog() {\n super();\n }",
"public LogMessageController() {\n\t}",
"MonitoredSensor(Sensor sensor) {\n mSensor = sensor;\n mEnabledByUser = true;\n\n // Set appropriate sensor name depending on the type. Unfortunately,\n // we can't really use sensor.getName() here, since the value it\n // returns (although resembles the purpose) is a bit vaguer than it\n // should be. Also choose an appropriate format for the strings that\n // display sensor's value.\n switch (sensor.getType()) {\n case Sensor.TYPE_ACCELEROMETER:\n mUiName = \"Accelerometer\";\n mTextFmt = \"%+.2f %+.2f %+.2f\";\n mEmulatorFriendlyName = \"acceleration\";\n break;\n case 9: // Sensor.TYPE_GRAVITY is missing in API 7\n mUiName = \"Gravity\";\n mTextFmt = \"%+.2f %+.2f %+.2f\";\n mEmulatorFriendlyName = \"gravity\";\n break;\n case Sensor.TYPE_GYROSCOPE:\n mUiName = \"Gyroscope\";\n mTextFmt = \"%+.2f %+.2f %+.2f\";\n mEmulatorFriendlyName = \"gyroscope\";\n break;\n case Sensor.TYPE_LIGHT:\n mUiName = \"Light\";\n mTextFmt = \"%.0f\";\n mEmulatorFriendlyName = \"light\";\n break;\n case 10: // Sensor.TYPE_LINEAR_ACCELERATION is missing in API 7\n mUiName = \"Linear acceleration\";\n mTextFmt = \"%+.2f %+.2f %+.2f\";\n mEmulatorFriendlyName = \"linear-acceleration\";\n break;\n case Sensor.TYPE_MAGNETIC_FIELD:\n mUiName = \"Magnetic field\";\n mTextFmt = \"%+.2f %+.2f %+.2f\";\n mEmulatorFriendlyName = \"magnetic-field\";\n break;\n case Sensor.TYPE_ORIENTATION:\n mUiName = \"Orientation\";\n mTextFmt = \"%+03.0f %+03.0f %+03.0f\";\n mEmulatorFriendlyName = \"orientation\";\n break;\n case Sensor.TYPE_PRESSURE:\n mUiName = \"Pressure\";\n mTextFmt = \"%.0f\";\n mEmulatorFriendlyName = \"pressure\";\n break;\n case Sensor.TYPE_PROXIMITY:\n mUiName = \"Proximity\";\n mTextFmt = \"%.0f\";\n mEmulatorFriendlyName = \"proximity\";\n break;\n case 11: // Sensor.TYPE_ROTATION_VECTOR is missing in API 7\n mUiName = \"Rotation\";\n mTextFmt = \"%+.2f %+.2f %+.2f\";\n mEmulatorFriendlyName = \"rotation\";\n break;\n case Sensor.TYPE_TEMPERATURE:\n mUiName = \"Temperature\";\n mTextFmt = \"%.0f\";\n mEmulatorFriendlyName = \"temperature\";\n break;\n default:\n mUiName = \"<Unknown>\";\n mTextFmt = \"N/A\";\n mEmulatorFriendlyName = \"unknown\";\n if (DEBUG) Loge(\"Unknown sensor type \" + mSensor.getType() +\n \" for sensor \" + mSensor.getName());\n break;\n }\n }",
"private LogEvent()\n\t{\n\t\tsuper();\n\t}",
"public LogEntry(String logData) {\n\n this.logData = logData;\n }",
"public SignalCollector(File log) {\r\n this.log = log;\r\n }",
"public LogEvent newInstance()\n {\n return new LogEvent();\n }",
"public Log(String fp)\n {\n this.filePath = fp;\n\n open();\n }",
"public LogWatch() {\n\t\tsuper();\n\t\tthis.start();\n\t}",
"public HeadTiltProcessingService(Sensor sensor, int timeInterval){\n this(sensor);\n this.timeInterval=timeInterval;\n }",
"protected SuperSensor createNewSensor(SensorMessage message)\n {\n return ModuleInstanceProvider.getSensorInstanceByType(message.getType());\n }",
"SensorDescription(){\n\n }",
"public MonitoredData() {}",
"public NGATAstro()\n\t{\n\t\tsuper();\n\t\tlogger = LogManager.getLogger(this);\n\t\tinitialiseLoggerReference(logger);\n\t}",
"public ETLLogDAOImpl() {\r\n this(new Configuration());\r\n }",
"private TicketLog createLog() throws SQLException {\n\t\t\t\t\treturn new TicketLog(rs.getLong(1), rs.getString(2),\n\t\t\t\t\t\t\trs.getLong(3),\n\t\t\t\t\t\t\tTicketLog.Action.valueOf(rs.getString(4)),\n\t\t\t\t\t\t\trs.getInt(5));\n\t\t\t\t}",
"public OrderLogRecord() {\n super(OrderLog.ORDER_LOG);\n }",
"public static Log getInstance() {\r\n if (firstInstance == null) {\r\n firstInstance = new Log();\r\n }\r\n return firstInstance;\r\n }",
"public static synchronized Logging initialize()\n {\n if (instance == null) {\n instance = new Logging();\n }\n\n return instance;\n }",
"public Logger(int loglv) {\r\n LOGLV = loglv;\r\n }",
"public AddSensor() {\n initComponents();\n }",
"@Override\n\tprotected void initial() throws SiDCException, Exception {\n\t\tLogAction.getInstance().initial(logger, this.getClass().getCanonicalName());\n\t}",
"static void init(LoggerManager manager) {\n setLogDir(manager.getLogDirFullPath());\n setLogLevel(manager.getLevel());\n sLogcatEnabled = manager.enableLogcat();\n logGenerator = manager.logExecutor;\n\n if (logWriterThread != null) {\n logWriterThread.quit();\n }\n\n logWriterThread = new LogWriterThread(manager);\n logWriterThread.start();\n\n android.util.Log.i(TAG, \"initialized... level=\" + sLogLvlName + \",lvl=\"\n + sLogLvl + \",Logcat Enabled=\" + sLogcatEnabled + \",dir=\" + manager\n .getLogDirFullPath());\n }",
"public PersistentLogEventListener() {\n\t\tthis(new EventDAO());\n\t}",
"public TOpLogs() {\n this(DSL.name(\"t_op_logs\"), null);\n }",
"private ExtentLogger() {}",
"public abstract void createSensors() throws Exception;",
"public SearchLogs() {\n this(\"search_logs\", null);\n }",
"public Systemlog (java.lang.Integer rowid) {\n\t\tsuper(rowid);\n\t}",
"private HostessState(String logRepresentation){\n this.logRepresentation = logRepresentation;\n }",
"public ActuatorData()\n\t{\n\t\tsuper(); \n\t}",
"public void init() {\n log.info(\"initialization\");\n }",
"public ScreeningLogger() {\n int defaultMaxRetries = DEFAULT_MAX_RETRIES;\n int defaultRetrySleepTime = DEFAULT_RETRY_SLEEP_TIME;\n\n try {\n ConfigManager cm = ConfigManager.getInstance();\n\n String maxRetriesString = cm.getString(SCREENING_LOGGER_NAMESPACE, MAX_RETRIES_PROPERTY_NAME);\n if (maxRetriesString != null) {\n try {\n defaultMaxRetries = Integer.parseInt(maxRetriesString);\n } catch (NumberFormatException nfe) {\n // uses default\n }\n }\n\n String retrySleepTimeString = cm.getString(SCREENING_LOGGER_NAMESPACE, RETRY_SLEEP_TIME_PROPERTY_NAME);\n if (retrySleepTimeString != null) {\n try {\n defaultRetrySleepTime = Integer.parseInt(retrySleepTimeString);\n } catch (NumberFormatException nfe) {\n // uses default\n }\n }\n } catch (Exception e) {\n // uses default\n }\n\n maxRetries = defaultMaxRetries;\n retrySleepTime = defaultRetrySleepTime;\n\n initializeIdGen();\n }",
"private Logger() {\n\n }",
"private LogService()\n {\n logWriter = new CleanSweepLogWriterImpl();\n\n Calendar date = Calendar.getInstance();\n int year = date.get(Calendar.YEAR);\n int month = date.get(Calendar.MONTH)+1;\n int day = date.get(Calendar.DAY_OF_MONTH);\n\n todaysDate=\"\";\n if(day<10) {\n todaysDate += year + \"\" + month + \"0\" + day;\n }\n else\n {\n todaysDate += year + \"\" + month + \"\" + day;\n }\n\n }",
"public RAlarmLogDAOImpl() {\r\n super();\r\n }",
"void initializeLogging(String loggingProperties);",
"public void setUp() {\n instance = new LogMessage(type, id, operator, message, error);\n }",
"public LogsV3() {\n nodeidx = \"\";\n name = \"\";\n log = \"\";\n _excludeFields = \"\";\n }",
"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 }",
"public TPMTransportLog( int tpmManufacturer )\r\n {\r\n super();\r\n this.tpmManufacturer = tpmManufacturer;\r\n }",
"public Log createLog(TopicAndPartition topicAndPartition, LogConfig config) {\n synchronized (logCreationLock) {\n Log log = logs.get(topicAndPartition);\n\n // check if the log has already been created in another thread\n if (log != null)\n return log;\n\n // if not, create it\n File dataDir = nextLogDir();\n File dir = new File(dataDir, topicAndPartition.topic + \"-\" + topicAndPartition.partition);\n dir.mkdirs();\n log = new Log(dir, config, /*recoveryPoint = */0L, scheduler, time);\n logs.put(topicAndPartition, log);\n logger.info(\"Created log for partition [{},{}] in {} with properties {{}}.\", topicAndPartition.topic, topicAndPartition.partition, dataDir.getAbsolutePath(), config.toProps());\n return log;\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 }",
"private Log()\n {\n //Hides implicit constructor.\n }",
"private void initLogger() {\n\t\ttry {\n\t\t\tjava.util.logging.Logger rootLogger = java.util.logging.Logger.getLogger(\"\");\n\t\t\trootLogger.setUseParentHandlers(false);\n\t\t\tHandler csvFileHandler = new FileHandler(\"logger/log.csv\", 100000, 1, true);\n\t\t\tlogformater = new LogFormatter();\n\t\t\trootLogger.addHandler(csvFileHandler);\n\t\t\tcsvFileHandler.setFormatter(logformater);\n\t\t\tlogger.setLevel(Level.ALL);\n\t\t} catch (IOException ie) {\n\t\t\tSystem.out.println(\"Logger initialization failed\");\n\t\t\tie.printStackTrace();\n\t\t}\n\t}",
"private void initLogConfig() {\n\t\t logConfigurator = new LogConfigurator();\n\t\t// Setting append log coudn't cover by a new log.\n\t\tlogConfigurator.setUseFileAppender(true);\n\t\t// Define a file path for output log.\n\t\tString filename = StorageUtils.getLogFile();\n\t\tLog.i(\"info\", filename);\n\t\t// Setting log output\n\t\tlogConfigurator.setFileName(filename);\n\t\t// Setting log's level\n\t\tlogConfigurator.setRootLevel(Level.DEBUG);\n\t\tlogConfigurator.setLevel(\"org.apache\", Level.ERROR);\n\t\tlogConfigurator.setFilePattern(\"%d %-5p [%c{2}]-[%L] %m%n\");\n\t\tlogConfigurator.setMaxFileSize(1024 * 1024 * 5);\n\t\t// Set up to use the cache first and then output to a file for a period\n\t\t// of time\n\t\tlogConfigurator.setImmediateFlush(false);\n\t\tlogConfigurator.setUseLogCatAppender(true);\n\t\t// logConfigurator.setResetConfiguration(true);\n\t\tlogConfigurator.configure();\n\t}",
"public WriteLogger( )\n {\n this.logfilename = null;\n\n this.logfile = null;\n this.out = null;\n }"
] | [
"0.8172945",
"0.65701777",
"0.65532696",
"0.6528035",
"0.6503362",
"0.6447434",
"0.6312588",
"0.6292965",
"0.6268334",
"0.62568516",
"0.6243232",
"0.62306905",
"0.61649275",
"0.60164285",
"0.6007314",
"0.60033995",
"0.59988004",
"0.5981224",
"0.5963795",
"0.5961021",
"0.5949289",
"0.5890426",
"0.58694375",
"0.5850193",
"0.5830457",
"0.57955813",
"0.5795413",
"0.5791563",
"0.5789862",
"0.57891726",
"0.57827854",
"0.5763067",
"0.57489544",
"0.57380545",
"0.57181835",
"0.57134044",
"0.57104105",
"0.5710032",
"0.5702623",
"0.5683017",
"0.5680005",
"0.56657964",
"0.56623024",
"0.5647917",
"0.56477904",
"0.56271225",
"0.56212914",
"0.5619509",
"0.56102026",
"0.55950665",
"0.5591215",
"0.5588605",
"0.5582045",
"0.5578492",
"0.55759495",
"0.5573819",
"0.5573337",
"0.5551555",
"0.5549429",
"0.55333114",
"0.551996",
"0.5519533",
"0.55111307",
"0.55097884",
"0.55076146",
"0.549553",
"0.5491318",
"0.5487789",
"0.5485144",
"0.5479456",
"0.54763573",
"0.54706484",
"0.54605544",
"0.54563135",
"0.543961",
"0.5427359",
"0.5423602",
"0.54233193",
"0.54198956",
"0.541868",
"0.54085726",
"0.540409",
"0.53960675",
"0.5390739",
"0.5389331",
"0.53678614",
"0.5358775",
"0.5349764",
"0.53460497",
"0.53266484",
"0.53241456",
"0.5323218",
"0.5321277",
"0.53138006",
"0.53098357",
"0.52998763",
"0.52988386",
"0.5297835",
"0.5297161",
"0.5293242"
] | 0.65199256 | 4 |
todo: move to slf4j interface | public interface Log {
void debug(String msg, Object... args);
void info(String msg, Object... args);
void warn(String msg, Object... args);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void log()\n {\n }",
"@Override\n public void logs() {\n \n }",
"void log();",
"abstract public LoggingService getLoggingService();",
"public interface FsmLogger {\n\t/**\n\t * Get name of the logger.\n\t * \n\t * @return the name\n\t */\n\tpublic String getName();\n\n\t/**\n\t * Log a fatal message.\n\t * \n\t * @param message\n\t * the message\n\t */\n\tpublic void fatal(String message);\n\n\t/**\n\t * Log a fatal message.\n\t * \n\t * @param message\n\t * the message\n\t * @param throwable\n\t * a throwable object\n\t */\n\tpublic void fatal(String message, Throwable throwable);\n\n\t/**\n\t * Log an error message.\n\t * \n\t * @param message\n\t * the message\n\t */\n\tpublic void error(String message);\n\n\t/**\n\t * Log an error message.\n\t * \n\t * @param message\n\t * the message\n\t * @param throwable\n\t * a throwable object\n\t */\n\tpublic void error(String message, Throwable throwable);\n\n\t/**\n\t * Log a warning message.\n\t * \n\t * @param message\n\t * the message\n\t */\n\tpublic void warn(String message);\n\n\t/**\n\t * Log a warning message.\n\t * \n\t * @param message\n\t * the message\n\t * @param throwable\n\t * a throwable object\n\t */\n\tpublic void warn(String message, Throwable throwable);\n\n\t/**\n\t * Log an info message.\n\t * \n\t * @param message\n\t * the message\n\t */\n\tpublic void info(String message);\n\n\t/**\n\t * Log an info message.\n\t * \n\t * @param message\n\t * the message\n\t * @param throwable\n\t * a throwable object\n\t */\n\tpublic void info(String message, Throwable throwable);\n\n\t/**\n\t * Log a debug message.\n\t * \n\t * @param message\n\t * the message\n\t */\n\tpublic void debug(String message);\n\n\t/**\n\t * Log a debug message.\n\t * \n\t * @param message\n\t * the message\n\t * @param throwable\n\t * a throwable object\n\t */\n\tpublic void debug(String message, Throwable throwable);\n\n\t/**\n\t * Log a trace message.\n\t * \n\t * @param message\n\t * the message\n\t */\n\tpublic void trace(String message);\n\n\t/**\n\t * Log a trace message.\n\t * \n\t * @param message\n\t * the message\n\t * @param throwable\n\t * a throwable object\n\t */\n\tpublic void trace(String message, Throwable throwable);\n\n\t/**\n\t * Get status of info messages logging in this logger.\n\t * \n\t * @return true if logging of info messages is enabled otherwise false\n\t */\n\tpublic boolean isInfoEnabled();\n\n\t/**\n\t * Get status of debug messages logging in this logger.\n\t * \n\t * @return true if logging of debug messages is enabled otherwise false\n\t */\n\tpublic boolean isDebugEnabled();\n\n\t/**\n\t * Get status of trace messages logging in this logger.\n\t * \n\t * @return true if logging of trace messages is enabled otherwise false\n\t */\n\tpublic boolean isTraceEnabled();\n}",
"Appendable getLog();",
"public interface ILogger {\r\n //name of columns for measuring multiple values together\r\n public void init(String... names) throws IOException;\r\n //datapoints per column for measuring multiple values together\r\n public void log(Object... vals) throws IOException;\r\n //all datapoints where submitted so clean up\r\n public void finish() throws IOException;\r\n}",
"protected abstract ILogger getLogger();",
"String getLogHandled();",
"@Override\n public Logger getLog(Class clazz) {\n return new Slf4jLogger(LoggerFactory.getLogger(clazz));\n }",
"IFileLogger log();",
"void initializeLogging();",
"public interface Logger {\n void enable(boolean enabled);\n\n void d(String s, Object... args);\n\n void i(String s, Object... args);\n\n void w(String s, Object... args);\n\n void e(Throwable e, String s, Object... args);\n}",
"public void enableLogging();",
"protected abstract Logger getLogger();",
"protected void slflog(String operation, String repositoryId) {\r\n\t\tif (repositoryId == null) {\r\n\t\t\trepositoryId = \"<none>\";\r\n\t\t}\r\n\r\n\t\tHttpServletRequest request = (HttpServletRequest) getCallContext().get(CallContext.HTTP_SERVLET_REQUEST);\r\n\t\tString userAgent = request.getHeader(\"User-Agent\");\r\n\t\tif (userAgent == null) {\r\n\t\t\tuserAgent = \"<unknown>\";\r\n\t\t}\r\n\r\n\t\tString binding = getCallContext().getBinding();\r\n\r\n\t\tLOG.info(\"Operation: {}, Repository ID: {}, Binding: {}, User Agent: {}\", operation, repositoryId, binding,\r\n\t\t\t\tuserAgent);\r\n\t\t\r\n\t\t// also dump to console for testing\r\n\t\tString result =\r\n\t\tString.format(\"Operation: %s, Repository ID: %s, Binding: %s, User Agent: %s\", \r\n\t\t\t\toperation, repositoryId, binding, userAgent);\r\n\t\tSystem.out.println(result);\r\n\t}",
"public interface Logger {\n\tpublic void log(String msg);\n}",
"@Override\n public void log(String message) {\n }",
"@Override\n\tpublic void log(Level level, Marker marker, Supplier<?> msgSupplier) {\n\n\t}",
"public abstract void logd(String str);",
"void log(HandlerInput input, String message) {\n System.out.printf(\"[%s] [%s] : %s]\\n\",\n input.getRequestEnvelope().getRequest().getRequestId().toString(),\n new Date(),\n message);\n }",
"void log(Log log);",
"interface Logger {\n\n void d(String tag, String message);\n\n void e(String tag, String message, Throwable t);\n\n void e(String tag, String message);\n}",
"public interface LogFormatter {\n\n /**\n * Creates a log message.\n *\n * @param className The class name that the logger targets at.\n * @param message The original message that is specified with a log method of {@link Log}.\n * @return A log message.\n */\n String format(String className, String message);\n\n /**\n * Creates a log message.\n *\n * @param className The class name that the logger targets at.\n * @param format The format that is specified with a log method of {@link Log}.\n * @param args The additional arguments that are specified with a log method of {@link Log}.\n * @return A log message.\n */\n String format(String className, String format, Object... args);\n}",
"@Override\n\tpublic void log(Level level, Marker marker, MessageSupplier msgSupplier) {\n\n\t}",
"abstract void initiateLog();",
"public interface ILogClassFormatter<T>\n{\n String log(T item, boolean logInList);\n}",
"public String getLog();",
"@Override\n\tpublic void log(Level level, Marker marker, String message, Supplier<?>... paramSuppliers) {\n\n\t}",
"public StatusLogger getStatusLogger();",
"private ExtentLogger() {}",
"private void doIt() {\n\t\tlogger.debug(\"hellow this is the first time I use Logback\");\n\t\t\n\t}",
"@Override\n\tpublic void log(Level level, Marker marker, Supplier<?> msgSupplier, Throwable t) {\n\n\t}",
"private JavaUtilLogHandlers() { }",
"private static void log(IStatus status) {\n\t getDefault().getLog().log(status);\n\t}",
"public void logData(){\n }",
"public interface CombinedLoggerHelper<S extends State> extends\n CombinedLogger<S>, CombinedLoggerAware<S> {\n}",
"abstract protected void _log(Snapshot snapshot) throws Exception;",
"public interface Logger {\n void verbose(String message, Object... args);\n void debug(Object msg);\n void debug(String message, Object... args);\n void info(String message, Object... args);\n void warning(String message, Object... args);\n void error(String message, Object... args);\n void error(Throwable throwable, String message, Object... args);\n}",
"private void logToFile() {\n }",
"protected static Logger initLogger() {\n \n \n File logFile = new File(\"workshop2_slf4j.log\");\n logFile.delete();\n return LoggerFactory.getLogger(Slf4j.class.getName());\n }",
"@Override\n\tpublic void log(Level level, Marker marker, MessageSupplier msgSupplier, Throwable t) {\n\n\t}",
"private void loggerEinrichten() {\n\t\tlogger.setLevel(Level.INFO);\n//\t\tHandler handler = new FileHandler(\"/home/programmieren/TestFiles/iCalender/temp.log\");\n\t\tHandler handler = new ConsoleHandler();\n\t\thandler.setLevel(Level.FINEST);\n\t\thandler.setFormatter(new Formatter() {\n\t\t\t@Override\n\t\t\tpublic String format(LogRecord record) {\n\t\t\t\treturn record.getSourceClassName() + \".\" + record.getSourceMethodName() + \": \" + record.getMessage()\n\t\t\t\t\t\t+ \"\\n\";\n\t\t\t}\n\t\t});\n\t\tlogger.addHandler(handler);\n\t\tlogger.setUseParentHandlers(false);\n\t\tlogger.finest(\"begonnen\");\n\t}",
"void printHellow() {\n logger.debug(\"hellow world begin....\");\n logger.info(\"it's a info message\");\n logger.warn(\"it's a warning message\");\n loggerTest.warn(\"from test1 :....\");\n loggerTest.info(\"info from test1 :....\");\n\n // print internal state\n LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();\n StatusPrinter.print(lc);\n }",
"void log(Message message);",
"abstract protected void _log(Source src, OpLevel sev, String msg, Object... args) throws Exception;",
"public interface Logger\n{\n /**\n * Returns the name of the object.\n *\n * @return name of the Logger class\n */\n public String getName();\n\n /**\n * Rerturns the time of the object.\n *\n * @return time of the Logger object\n */\n public double getTime();\n}",
"private void divertLog() {\n wr = new StringWriter(1000);\n LogTarget[] lt = { new WriterTarget(wr, fmt) };\n SampleResult.log.setLogTargets(lt);\n }",
"abstract void initiateErrorLog();",
"@FunctionalInterface\n public interface FormattedLogger {\n /**\n * Logs the specified message.\n *\n * @param format\n * A <a href=\"../util/Formatter.html#syntax\">format string</a>\n * @param args\n * Arguments referenced by the format specifiers in the format string. If there are more arguments than\n * format specifiers, the extra arguments are ignored. The number of arguments is variable and may be\n * zero.\n */\n @FormatMethod\n void print(String format, Object... args);\n }",
"LogRecorder getLogRecorder();",
"LogRecorder getLogRecorder();",
"public RevisorLogger getLogger();",
"public interface LoggerUtil {\n\t/**\n\t * Set the logger for the controller\n\t * \n\t * @param logName\n\t * @param filePath\n\t * @param logLevel\n\t * @return\n\t */\n\tLogger loggerArrangement(String logName, String filePath, LogeLevel logLevel);\n}",
"public interface NSAutoLogger {\n\n void info(String msg);\n \n void info(String msg, Color color);\n\n void error(String msg);\n\n void debug(String msg);\n}",
"@Override\n\tpublic void initLogger() {\n\t\t\n\t}",
"public interface Logger {\n public void writeLog();\n}",
"protected void log(Object msg) {\n\t\n\t\tSystem.out.println(\"MusicDataAccessor: \" + msg);\n\t}",
"@Override\n protected Logger getLogger() {\n return LOGGER;\n }",
"public Slf4jLogService() {\n this(System.getProperties());\n }",
"public void doLog() {\n SelfInvokeTestService self = (SelfInvokeTestService)context.getBean(\"selfInvokeTestService\");\n self.selfLog();\n //selfLog();\n }",
"void log(String string);",
"@Override\n\tpublic void log(Level level, String message, Supplier<?>... paramSuppliers) {\n\n\t}",
"public String get_log(){\n }",
"private void printStackTrace(Exception ex, GUILog gl) {\n StringWriter sw = new StringWriter();\n PrintWriter pw = new PrintWriter(sw);\n ex.printStackTrace(pw);\n gl.log(sw.toString()); // stack trace as a string\n ex.printStackTrace();\n }",
"public void viewLogs() {\n\t}",
"private static void _logInfo ()\n {\n System.err.println (\"Logging is enabled using \" + log.getClass ().getName ());\n }",
"static Handler bindAndLog() {\n return Handlers.chain(bind(), new Handler() {\n private final Logger logger = LoggerFactory.getLogger(RequestId.class);\n\n @Override\n public void handle(Context ctx) throws Exception {\n ctx.onClose((RequestOutcome outcome) -> {\n Request request = ctx.getRequest();\n StringBuilder logLine = new StringBuilder()\n .append(request.getMethod().toString())\n .append(\" \")\n .append(request.getUri())\n .append(\" \")\n .append(outcome.getResponse().getStatus().getCode());\n\n request.maybeGet(RequestId.class).ifPresent(id1 -> {\n logLine.append(\" id=\");\n logLine.append(id1.toString());\n });\n\n logger.info(logLine.toString());\n });\n\n ctx.next();\n }\n });\n }",
"@Override\n\tprotected Logger getLogger() {\n\t\treturn HMetis.logger;\n\t}",
"@Override\n\t\t\t\t\t\t\tpublic void log(String msg, int level, Date date, StackTraceElement trace) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}",
"protected Log getLog()\n/* */ {\n/* 59 */ return log;\n/* */ }",
"@Override\n\tpublic void log(Level level, Supplier<?> msgSupplier) {\n\n\t}",
"private Log() {\r\n\t}",
"private void logika_rozpocznij(){\n\t}",
"public LogScrap() {\n\t\tconsumer = bin->Conveyor.LOG.debug(\"{}\",bin);\n\t}",
"Logger getLog(Class clazz);",
"public interface ILog {\n void print(LogLevel logLevel, String tag, String msg, long tid);\n}",
"void setupFileLogging();",
"public void writeLog() {\n\n\t}",
"public void writeLog() {\n\n\t}",
"public void writeLog() {\n\n\t}",
"@Override\n\tpublic void log(Level level, Marker marker, String message, Object... params) {\n\n\t}",
"abstract protected void _log(TrackingEvent event) throws Exception;",
"public interface Log {\n\n /**\n * This is a method description.\n *\n * <p>Another description after blank line.\n *\n * @param handler 添加handler.\n * @author admin\n */\n default void addHandler(Handler handler) {\n //\n }\n\n /**\n * This is a method description.\n *\n * <p>Another description after blank line.\n *\n * @param newLevel 设置日志级别.\n * @throws SecurityException 抛出安全异常.\n * @author admin\n */\n default void setLevel(final Level newLevel) throws SecurityException {\n //\n }\n\n /**\n * 信息日志.\n *\n * <p>Another description after blank line.\n *\n * @param message 日志消息.\n * @param args 日志消息格式化填充对象.\n * @author admin\n */\n void info(final String message, final Object... args);\n\n /**\n * This is a method description.\n *\n * <p>Another description after blank line.\n *\n * @param message 日志消息.\n * @author admin\n */\n void info(final String message);\n\n /**\n * 详细日志.\n *\n * <p>Another description after blank line.\n *\n * @param message 日志消息.\n * @param args 日志消息格式化填充对象.\n * @author admin\n */\n void debug(final String message, final Object... args);\n\n /**\n * This is a method description.\n *\n * <p>Another description after blank line.\n *\n * @param message 日志消息.\n * @author admin\n */\n void debug(final String message);\n\n /**\n * 较详细日志.\n *\n * <p>Another description after blank line.\n *\n * @param message 日志消息.\n * @param args 日志消息格式化填充对象.\n * @author admin\n */\n void trace(final String message, final Object... args);\n\n /**\n * 较详细日志.\n *\n * <p>Another description after blank line.\n *\n * @param message 日志消息.\n * @author admin\n */\n void trace(final String message);\n\n /**\n * 警告日志.\n *\n * <p>Another description after blank line.\n *\n * @param message 日志消息.\n * @param args 日志消息格式化填充对象.\n * @author admin\n */\n void warn(final String message, final Object... args);\n\n /**\n * 较详细日志.\n *\n * <p>Another description after blank line.\n *\n * @param message 日志消息.\n * @author admin\n */\n void warn(final String message);\n\n /**\n * 严重日志.\n *\n * <p>Another description after blank line.\n *\n * @param message 日志消息.\n * @param args 日志消息格式化填充对象.\n * @author admin\n */\n void error(final String message, final Object... args);\n\n /**\n * 较详细日志.\n *\n * <p>Another description after blank line.\n *\n * @param message 日志消息.\n * @author admin\n */\n void error(final String message);\n\n /**\n * 致命错误日志.\n *\n * <p>Another description after blank line.\n *\n * @param message 日志消息.\n * @param args 日志消息格式化填充对象.\n * @author admin\n */\n void fatal(final String message, final Object... args);\n\n /**\n * 致命错误日志.\n *\n * <p>Another description after blank line.\n *\n * @param message 日志消息.\n * @author admin\n */\n void fatal(final String message);\n\n /**\n * This is a method description.\n *\n * <p>Another description after blank line.\n *\n * @param args 日志传递进来的参数.\n * @param message 日志消息.\n * @author admin\n */\n default void off(final String message, final Object... args) {\n //\n }\n\n /**\n * This is a method description.\n *\n * <p>Another description after blank line.\n *\n * @param message 日志消息.\n * @author admin\n */\n default void off(final String message) {\n //\n }\n\n /**\n * This is a method description.\n *\n * <p>Another description after blank line.\n *\n * @param args 日志传递进来的参数.\n * @param message 日志消息.\n * @author admin\n */\n default void all(final String message, final Object... args) {\n //\n }\n\n /**\n * This is a method description.\n *\n * <p>Another description after blank line.\n *\n * @param message 日志消息.\n * @author admin\n */\n default void all(final String message) {\n //\n }\n\n /**\n * This is a method description.\n *\n * <p>Another description after blank line.\n *\n * @param args 日志传递进来的参数.\n * @param message 日志消息.\n * @author admin\n */\n default void config(final String message, final Object... args) {\n //\n }\n\n /**\n * This is a method description.\n *\n * <p>Another description after blank line.\n *\n * @param message 日志消息.\n * @author admin\n */\n default void config(final String message) {\n //\n }\n\n /**\n * This is a method description.\n *\n * <p>Another description after blank line.\n *\n * @return 是否开启调试.\n * @author admin\n */\n default boolean isDebugEnabled() {\n return false;\n }\n\n /**\n * This is a method description.\n *\n * <p>Another description after blank line.\n *\n * @return 是否开启Info.\n * @author admin\n */\n default boolean isInfoEnabled() {\n return false;\n }\n\n /**\n * This is a method description.\n *\n * <p>Another description after blank line.\n *\n * @return 是否开启Warn.\n * @author admin\n */\n default boolean isWarnEnabled() {\n return false;\n }\n}",
"public interface LoggingManager {\n \n /**\n * Method configure is called at Shark start up, to configure\n * implementation of LoggingManager.\n *\n * @param cus an instance of CallbackUtilities used to get\n * properties for configuring logging in Shark.\n *\n * @exception RootException Thrown if configuring doesn't succeed.\n */\n void configure (CallbackUtilities cus) throws RootException;\n \n /**\n * Log a message object with the <i>ERROR</i> Level.\n *\n * @param msg the message to log.\n *\n * @exception RootException If something unexpected happens.\n *\n */\n void error (String msg) throws RootException;\n \n /**\n * Log a message object with the <i>ERROR</i> Level.\n *\n * @param msg the message to log.\n * @param ex the exception to log, including its stack trace. \n *\n * @exception RootException If something unexpected happens.\n *\n */\n void error (String msg, RootException ex) throws RootException;\n \n /**\n * Log a message object with the <i>ERROR</i> Level.\n *\n * @param channel the log channel to be used for logging. \n * @param msg the message to log.\n *\n * @exception RootException If something unexpected happens.\n *\n */\n void error (String channel, String msg) throws RootException;\n \n /**\n * Log a message object with the <i>ERROR</i> Level.\n *\n * @param channel the log channel to be used for logging. \n * @param msg the message to log.\n * @param ex the exception to log, including its stack trace. \n *\n * @exception RootException If something unexpected happens.\n *\n */\n void error (String channel, String msg, RootException ex) throws RootException;\n\n /**\n * Log a message object with the <i>WARN</i> Level.\n *\n * @param msg the message to log.\n *\n * @exception RootException If something unexpected happens.\n *\n */\n void warn (String msg) throws RootException;\n\n /**\n * Log a message object with the <i>WARN</i> Level.\n *\n * @param msg the message to log.\n * @param ex the exception to log, including its stack trace. \n *\n * @exception RootException If something unexpected happens.\n *\n */\n void warn (String msg, RootException ex) throws RootException;\n\n /**\n * Log a message object with the <i>WARN</i> Level.\n *\n * @param channel the log channel to be used for logging. \n * @param msg the message to log.\n *\n * @exception RootException If something unexpected happens.\n *\n */\n void warn (String channel,String msg) throws RootException;\n\n /**\n * Log a message object with the <i>WARN</i> Level.\n *\n * @param channel the log channel to be used for logging. \n * @param msg the message to log.\n * @param ex the exception to log, including its stack trace. \n *\n * @exception RootException If something unexpected happens.\n *\n */\n void warn (String channel, String msg, RootException ex) throws RootException;\n\n /**\n * Log a message object with the <i>INFO</i> Level.\n *\n * @param msg the message to log.\n *\n * @exception RootException If something unexpected happens.\n *\n */\n void info (String msg) throws RootException;\n\n /**\n * Log a message object with the <i>INFO</i> Level.\n *\n * @param msg the message to log.\n * @param ex the exception to log, including its stack trace. \n *\n * @exception RootException If something unexpected happens.\n *\n */\n void info (String msg, RootException ex) throws RootException;\n\n /**\n * Log a message object with the <i>INFO</i> Level.\n *\n * @param channel the log channel to be used for logging. \n * @param msg the message to log.\n *\n * @exception RootException If something unexpected happens.\n *\n */\n void info (String channel, String msg) throws RootException;\n\n /**\n * Log a message object with the <i>INFO</i> Level.\n *\n * @param channel the log channel to be used for logging. \n * @param msg the message to log.\n * @param ex the exception to log, including its stack trace. \n *\n * @exception RootException If something unexpected happens.\n *\n */\n void info (String channel, String msg, RootException ex) throws RootException;\n\n /**\n * Log a message object with the <i>DEBUG</i> level.\n *\n * @param msg the message to log.\n *\n * @exception RootException If something unexpected happens.\n *\n */\n void debug (String msg) throws RootException;\n\n /**\n * Log a message object with the <i>DEBUG</i> level.\n *\n * @param msg the message to log.\n * @param ex the exception to log, including its stack trace. \n *\n * @exception RootException If something unexpected happens.\n *\n */\n void debug (String msg, RootException ex) throws RootException;\n\n /**\n * Log a message object with the <i>DEBUG</i> level.\n *\n * @param channel the log channel to be used for logging. \n * @param msg the message to log.\n *\n * @exception RootException If something unexpected happens.\n *\n */\n void debug (String channel, String msg) throws RootException;\n\n /**\n * Log a message object with the <i>DEBUG</i> level.\n *\n * @param channel the log channel to be used for logging. \n * @param msg the message to log.\n * @param ex the exception to log, including its stack trace. \n *\n * @exception RootException If something unexpected happens.\n *\n */\n void debug (String channel, String msg, RootException ex) throws RootException;\n\n\n}",
"abstract protected String getLogFileName();",
"interface Solution {\n\n// use this Object to print the log (call from slf4j facade)\nstatic Logger log = LoggerFactory.getLogger(Solution.class);\n\n String decodeString(String s);\n}",
"public interface ILog {\n /**\n * 打印日志\n * @param L 虚拟机地址,可通过 {@link org.luaj.vm2.Globals#getGlobalsByLState(long)}获取\n */\n void l(long L, String tag, String log);\n\n /**\n * 打印错误日志\n * @param L 虚拟机地址,可通过 {@link org.luaj.vm2.Globals#getGlobalsByLState(long)}获取\n */\n void e(long L, String tag, String log);\n}",
"@Override\n\tpublic void trace(Supplier<?> msgSupplier) {\n\n\t}",
"private void logUser() {\n }",
"@Override\n\tpublic void trace(Marker marker, Supplier<?> msgSupplier) {\n\n\t}",
"@Override\n\tpublic void log(String msg) throws IOException {\n\t\t\n\t}",
"public boolean isLogging();",
"@Test\n\tpublic void test() {\n\t\tLoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();\n\t\t// print logback's internal status\n\t\tStatusPrinter.print(lc);\n\t\t\n\t\tLOG.trace(\"this is a trace message\");\n\n\t\tLOG.debug(\"this is a debug message\");\n\n\t\tLOG.info(\"this is an info message\");\n\n\t\tLOG.warn(\"this is a warn message\");\n\n\t\tLOG.error(\"this is an error message\");\n\n\t}",
"void log(@NotNull LogLevel level, @NotNull Marker marker, @NotNull Supplier<?> supplier);",
"public void serializeLogs();",
"public interface ThrowableFormatter extends Formatter<Throwable> {\n}",
"@Override\n public void log(Class<?> clazz, String message,Object... bizObjects) {\n Logger.i(clazz.getSimpleName(),message);\n }",
"@Override\n\tpublic void log(Level level, MessageSupplier msgSupplier) {\n\n\t}",
"@Override\r\n\tsynchronized public void f(String tag, String format, Object... args) {\n\t\tif (isF()) Log.e(tag, (format != null) ? String.format(format, args) : String.valueOf(format));\r\n\t}"
] | [
"0.6509099",
"0.64638907",
"0.63505524",
"0.6189239",
"0.61662847",
"0.59998316",
"0.5994251",
"0.5966835",
"0.5955805",
"0.59346604",
"0.593411",
"0.5892771",
"0.58852404",
"0.5880967",
"0.5879186",
"0.58628505",
"0.5854717",
"0.5829675",
"0.58250403",
"0.58186114",
"0.58104616",
"0.57996744",
"0.5794202",
"0.57903063",
"0.5778797",
"0.57633924",
"0.5754541",
"0.5746243",
"0.5740341",
"0.572377",
"0.57154673",
"0.5700429",
"0.5686519",
"0.5681974",
"0.56624615",
"0.56596684",
"0.565244",
"0.5646901",
"0.5631807",
"0.5631516",
"0.56248283",
"0.56221616",
"0.56196445",
"0.56182927",
"0.56010497",
"0.559718",
"0.5587146",
"0.5586256",
"0.5584322",
"0.5583883",
"0.55651706",
"0.55651706",
"0.5547351",
"0.554223",
"0.55354035",
"0.55280876",
"0.5527145",
"0.55164737",
"0.5511868",
"0.55077606",
"0.55039823",
"0.5503334",
"0.55024135",
"0.5490514",
"0.5475718",
"0.547355",
"0.54711384",
"0.54668254",
"0.54635894",
"0.5462227",
"0.544773",
"0.54468715",
"0.5444625",
"0.544002",
"0.5423523",
"0.5422689",
"0.5413557",
"0.5412282",
"0.54043645",
"0.54043645",
"0.54043645",
"0.54026514",
"0.5394589",
"0.5387599",
"0.5380087",
"0.5375384",
"0.5374249",
"0.53704363",
"0.53682613",
"0.53666264",
"0.5364554",
"0.5363194",
"0.5362645",
"0.53582525",
"0.53578603",
"0.53452504",
"0.53418624",
"0.5341499",
"0.53369653",
"0.5329776"
] | 0.550793 | 59 |
TODO Autogenerated method stub | @Override
public List<User> getAllUser() {
List<User> listStudents = new ArrayList<User>();
listStudents = userReposotory.findAll();
return listStudents;
} | {
"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 User addUser(User user) {
return userReposotory.save(user);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"private stendhal() {\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.66708666",
"0.65675074",
"0.65229905",
"0.6481001",
"0.64770633",
"0.64584893",
"0.6413091",
"0.63764185",
"0.6275735",
"0.62541914",
"0.6236919",
"0.6223816",
"0.62017626",
"0.61944294",
"0.61944294",
"0.61920846",
"0.61867654",
"0.6173323",
"0.61328775",
"0.61276996",
"0.6080555",
"0.6076938",
"0.6041293",
"0.6024541",
"0.6019185",
"0.5998426",
"0.5967487",
"0.5967487",
"0.5964935",
"0.59489644",
"0.59404725",
"0.5922823",
"0.5908894",
"0.5903041",
"0.5893847",
"0.5885641",
"0.5883141",
"0.586924",
"0.5856793",
"0.58503157",
"0.58464456",
"0.5823378",
"0.5809384",
"0.58089525",
"0.58065355",
"0.58065355",
"0.5800514",
"0.57912874",
"0.57912874",
"0.57912874",
"0.57912874",
"0.57912874",
"0.57912874",
"0.57896614",
"0.5789486",
"0.5786597",
"0.5783299",
"0.5783299",
"0.5773351",
"0.5773351",
"0.5773351",
"0.5773351",
"0.5773351",
"0.5760369",
"0.5758614",
"0.5758614",
"0.574912",
"0.574912",
"0.574912",
"0.57482654",
"0.5732775",
"0.5732775",
"0.5732775",
"0.57207066",
"0.57149917",
"0.5714821",
"0.57132614",
"0.57132614",
"0.57132614",
"0.57132614",
"0.57132614",
"0.57132614",
"0.57132614",
"0.57115865",
"0.57045746",
"0.5699",
"0.5696016",
"0.5687285",
"0.5677473",
"0.5673346",
"0.56716853",
"0.56688815",
"0.5661065",
"0.5657898",
"0.5654782",
"0.5654782",
"0.5654782",
"0.5654563",
"0.56536144",
"0.5652585",
"0.5649566"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public User searchUser(Integer id) {
return userReposotory.getById(id);
} | {
"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 deleteByUser(User user) {
userReposotory.delete(user);
} | {
"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 deleteByIdUser(int id) {
userReposotory.deleteById(id);
} | {
"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 updateUser(User user) {
userReposotory.save(user);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"private stendhal() {\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.66708666",
"0.65675074",
"0.65229905",
"0.6481001",
"0.64770633",
"0.64584893",
"0.6413091",
"0.63764185",
"0.6275735",
"0.62541914",
"0.6236919",
"0.6223816",
"0.62017626",
"0.61944294",
"0.61944294",
"0.61920846",
"0.61867654",
"0.6173323",
"0.61328775",
"0.61276996",
"0.6080555",
"0.6076938",
"0.6041293",
"0.6024541",
"0.6019185",
"0.5998426",
"0.5967487",
"0.5967487",
"0.5964935",
"0.59489644",
"0.59404725",
"0.5922823",
"0.5908894",
"0.5903041",
"0.5893847",
"0.5885641",
"0.5883141",
"0.586924",
"0.5856793",
"0.58503157",
"0.58464456",
"0.5823378",
"0.5809384",
"0.58089525",
"0.58065355",
"0.58065355",
"0.5800514",
"0.57912874",
"0.57912874",
"0.57912874",
"0.57912874",
"0.57912874",
"0.57912874",
"0.57896614",
"0.5789486",
"0.5786597",
"0.5783299",
"0.5783299",
"0.5773351",
"0.5773351",
"0.5773351",
"0.5773351",
"0.5773351",
"0.5760369",
"0.5758614",
"0.5758614",
"0.574912",
"0.574912",
"0.574912",
"0.57482654",
"0.5732775",
"0.5732775",
"0.5732775",
"0.57207066",
"0.57149917",
"0.5714821",
"0.57132614",
"0.57132614",
"0.57132614",
"0.57132614",
"0.57132614",
"0.57132614",
"0.57132614",
"0.57115865",
"0.57045746",
"0.5699",
"0.5696016",
"0.5687285",
"0.5677473",
"0.5673346",
"0.56716853",
"0.56688815",
"0.5661065",
"0.5657898",
"0.5654782",
"0.5654782",
"0.5654782",
"0.5654563",
"0.56536144",
"0.5652585",
"0.5649566"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void apiUpdateUser(User user) {
User a = findByIdUser(user.getId());
if (StringUtils.hasText(user.getUserName()))
{
a.setUserName(user.getUserName());
}
if (StringUtils.hasText(user.getPassWord()))
{
a.setPassWord(user.getPassWord());
}
userReposotory.save(a);
} | {
"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<User> timUser(String user) {
List<User> a =userReposotory.getByName(user);
return a;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public int checkInit(String name) {
int a = -1;
a = userReposotory.checkInitByName(name);
return a;
} | {
"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 User findByIdUser(Integer id) {
return userReposotory.findById(id).get();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"private stendhal() {\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.66708666",
"0.65675074",
"0.65229905",
"0.6481001",
"0.64770633",
"0.64584893",
"0.6413091",
"0.63764185",
"0.6275735",
"0.62541914",
"0.6236919",
"0.6223816",
"0.62017626",
"0.61944294",
"0.61944294",
"0.61920846",
"0.61867654",
"0.6173323",
"0.61328775",
"0.61276996",
"0.6080555",
"0.6076938",
"0.6041293",
"0.6024541",
"0.6019185",
"0.5998426",
"0.5967487",
"0.5967487",
"0.5964935",
"0.59489644",
"0.59404725",
"0.5922823",
"0.5908894",
"0.5903041",
"0.5893847",
"0.5885641",
"0.5883141",
"0.586924",
"0.5856793",
"0.58503157",
"0.58464456",
"0.5823378",
"0.5809384",
"0.58089525",
"0.58065355",
"0.58065355",
"0.5800514",
"0.57912874",
"0.57912874",
"0.57912874",
"0.57912874",
"0.57912874",
"0.57912874",
"0.57896614",
"0.5789486",
"0.5786597",
"0.5783299",
"0.5783299",
"0.5773351",
"0.5773351",
"0.5773351",
"0.5773351",
"0.5773351",
"0.5760369",
"0.5758614",
"0.5758614",
"0.574912",
"0.574912",
"0.574912",
"0.57482654",
"0.5732775",
"0.5732775",
"0.5732775",
"0.57207066",
"0.57149917",
"0.5714821",
"0.57132614",
"0.57132614",
"0.57132614",
"0.57132614",
"0.57132614",
"0.57132614",
"0.57132614",
"0.57115865",
"0.57045746",
"0.5699",
"0.5696016",
"0.5687285",
"0.5677473",
"0.5673346",
"0.56716853",
"0.56688815",
"0.5661065",
"0.5657898",
"0.5654782",
"0.5654782",
"0.5654782",
"0.5654563",
"0.56536144",
"0.5652585",
"0.5649566"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public Boolean kiemTonTaiTheoUserName(String id) {
return userReposotory.existsByUserName(id);
} | {
"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 void main(String[] args) {
NReinas tablero = new NReinas(15);
tablero.busca();
} | {
"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 |
/ Method to call the ViewModel which will hit the API & will give the response. | void makeMainListCall() {
mViewModel.getProgressDialog().observe(this, isLoading -> {
if (isLoading != null) {
mLoadingView.setVisibility(isLoading ? View.VISIBLE : View.GONE);
if (isLoading) {
mErrorTextView.setVisibility(View.GONE);
mListView.setVisibility(View.GONE);
}
}
});
mViewModel.getMainListData().observe(this, new Observer<ListData>() {
@Override
public void onChanged(@Nullable ListData listData) {
mSwipeRefresh.setRefreshing(false);
getActivity().setTitle(listData.getTitle());
mMainListData = listData;
mAboutListAdapter.setData(mMainListData.getRows());
mErrorTextView.setVisibility(View.GONE);
mListView.setVisibility(View.VISIBLE);
}
});
mViewModel.getErrorMsg().observe(this, new Observer<String>() {
@Override
public void onChanged(@Nullable String s) {
mSwipeRefresh.setRefreshing(false);
mErrorTextView.setVisibility(View.VISIBLE);
mListView.setVisibility(View.GONE);
}
});
mViewModel.makeMainListCall();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"LiveData<WalletDataDecl.ListResultTmpl<Response>> results();",
"public ModelBags call() throws Exception {\n SyncHttpClient syncHttpClient = new SyncHttpClient(true, 80, 443);\n String a = UrlEnum.MODEL_SERVER.mo21104a();\n HttpEntity b = m11177b();\n GetListHttpHandler bVar = new GetListHttpHandler();\n this.f10793a = syncHttpClient.post(null, a, b, RequestParams.APPLICATION_JSON, bVar);\n return bVar.mo21173a();\n }",
"public String callPage() throws Exception {\r\n\t\tVendorMasterModel model = new VendorMasterModel();\r\n\t\tmodel.initiate(context, session);\r\n\t\tmodel.Data(vendorMaster, request);\r\n\t\tmodel.terminate();\r\n\t\treturn SUCCESS;\r\n\r\n\t}",
"public interface LooksoftMainApi {\n @GET(\"main\")\n Call<Data> loadData();\n}",
"private void fetchEverything() {\n ApiNewsMethods newsEverything = retrofit.create(ApiNewsMethods.class);\n newsEverything.getEverything(\"bitcoin\"/*topic input by user*/, newsApiKey).enqueue(new Callback<NewsModelClass>() {\n @Override\n public void onResponse(Call<NewsModelClass> call, Response<NewsModelClass> response) {\n if(response.isSuccessful()) {\n newsModelBody = response.body();\n Log.d(\"myBODY\", newsModelBody.getStatus());\n //text to speech object of the response fetched\n newsUIChanges();\n } else {\n Log.d(\"mySTRING\", \"DID NOT OCCUR\");\n }\n }\n\n @Override\n public void onFailure(Call<NewsModelClass> call, Throwable t) {\n }\n\n });\n }",
"public interface MovieService {\n @GET(\"/json/movies.json\")\n Call<List<MovieModel>> getDealModel();\n\n}",
"private void CallOnGoingRideAPI(){\n\n JsonObject object = OnGoingRideObject();\n AtroadsService service = ServiceFactory.createRetrofitService(getActivity(), AtroadsService.class);\n mSubscription = service.OnGoingRidesResponse(object)\n .subscribeOn(Schedulers.newThread())\n .observeOn(AndroidSchedulers.mainThread())\n .subscribe(new Subscriber<OnGoingRidesResponseModel>() {\n @Override\n public void onCompleted() {\n }\n\n @Override\n public void onError(Throwable e) {\n if (e instanceof HttpException) {\n ((HttpException) e).code();\n ((HttpException) e).message();\n ((HttpException) e).response().errorBody();\n try {\n ((HttpException) e).response().errorBody().string();\n } catch (IOException e1) {\n e1.printStackTrace();\n }\n e.printStackTrace();\n }\n }\n\n @Override\n public void onNext(OnGoingRidesResponseModel mResponse) {\n Log.i(TAG, \"OnGoingRidesResponseModel: \"+mResponse);\n Toast.makeText(getActivity(), mResponse.getMessage(), Toast.LENGTH_SHORT).show();\n if(mResponse.getStatus() == 0)\n {\n //Toast.makeText(PairSuccessScreen.this, mResponse.getMessage(), Toast.LENGTH_SHORT).show();\n }\n else if(mResponse.getStatus() == 1)\n {\n if(mResponse.getResult().size() == 0)\n {\n ongoing_ride_cardview.setVisibility(View.INVISIBLE);\n lin_nodata.setVisibility(View.VISIBLE);\n }\n else {\n ongoing_ride_cardview.setVisibility(View.VISIBLE);\n lin_nodata.setVisibility(View.GONE);\n number.setText(\" : \"+mResponse.getResult().get(0).getAutoNumber());\n dateandtime.setText(\"\"+Utilities.GetCurrentDateTime());\n pickup.setText(\"\"+mResponse.getResult().get(0).getUserSourceAddress());\n droplocation.setText(\"\"+mResponse.getResult().get(0).getUserDestAddress());\n List<Double> srcList = mResponse.getResult().get(0).getUserSourceLatLong();\n List<Double> destList = mResponse.getResult().get(0).getUserDestLatLong();\n LatLng srcLatLng = new LatLng(srcList.get(0),srcList.get(1));\n LatLng destLatLng = new LatLng(destList.get(0),destList.get(1));\n// new FetchURL(getActivity()).execute(getUrl(srcLatLng, destLatLng,\n// \"driving\"), \"driving\");\n\n\n// RideStatus = getIntent().getStringExtra(\"RideStatus\");\n// UserRideId = getIntent().getIntExtra(\"UserRideId\",0);\n// AutoNo = getIntent().getStringExtra(\"AutoNo\");\n ongoing_ride_cardview.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n SharedPreferences pref1 = getActivity().getSharedPreferences(\"PairedUserPref\", 0); // 0 - for private mode\n int user_ride_id = pref1.getInt(\"user_ride_id\",0);\n\n Intent i = new Intent(getActivity(), PairSuccessScreen.class);\n i.putExtra(\"RideStatus\",\"RideStarted\");\n i.putExtra(\"UserRideId\",user_ride_id);\n i.putExtra(\"AutoNo\",mResponse.getResult().get(0).getAutoNumber());\n startActivity(i);\n }\n });\n\n\n }\n\n }\n }\n });\n\n }",
"public interface QMApi {\n @GET(\"10001/getProvinceCityAreaList\")\n Call<BaseResModel<AddressEntity>> getProvinceCityAreaList(@Query(\"localVersion\") String localVersion);\n\n @POST(\"10001/qmLogin\")\n Call<BaseResModel<UserInfoEntity>> login(@Body RequestBody jsonBody);\n}",
"@SuppressWarnings(\"unchecked\")\n public <T> T execute() {\n return (T) fetchResponse(getCallToExecute());\n }",
"@MainThread // MainThread since threading is handled by Retrofit\n public abstract LiveData<NetworkModel> fetchFromNetwork();",
"public LiveData<List<AllUsersLocationResponse>> fetchAllUserLocationRequest(){\n final MutableLiveData<List<AllUsersLocationResponse>> fetchAllUserLocationResponse = new MutableLiveData<>();\n //final MutableLiveData<LocationList> locationListMutableLiveData = new MutableLiveData<>();\n apiService = ApiUtils.getAPIService();\n\n apiService.fetchAllUserLocation().enqueue(new Callback<List<AllUsersLocationResponse>>() {\n @Override\n public void onResponse(Call<List<AllUsersLocationResponse>> call, Response<List<AllUsersLocationResponse>> response) {\n if(response.isSuccessful()){\n fetchAllUserLocationResponse.setValue(response.body());\n Log.d(\"Response\", \"onResponse: ****Response Json**** \" + response.body());\n\n Log.d(\"Response\", \"onResponse: \" + response.message());\n Log.d(\"Response\", \"onResponse: \" + response.code());\n }else {\n try {\n JSONObject jObjError = new JSONObject(response.errorBody().string());\n Log.d(\"Response\", \"onResponse: \" + jObjError.getString(\"message\"));\n fetchAllUserLocationResponse.setValue(response.body());\n }catch (Exception e) {\n Log.d(\"Response\", \"onResponse: \" + e.getMessage());\n }\n }\n\n }\n\n @Override\n public void onFailure(Call<List<AllUsersLocationResponse>> call, Throwable t) {\n\n }\n });\n\n return fetchAllUserLocationResponse;\n }",
"public interface AppApi {\n @GET(\"/\")\n Observable<MovieModel> getMovie(@Query(\"apikey\") String apiKey,@Query(\"t\") String mSearhMovie,@Query(\"plot\") String mPlot);\n}",
"@Override\n public Observable<MainModelImp> getResults() {\n return model.build().getNearbyResult(lat, lon);\n }",
"private void getStateRelay(){\n Retrofit retrofit = new Retrofit.Builder()\n .baseUrl(URL)\n .addConverterFactory(GsonConverterFactory.create())\n .build();\n\n ServiceAPI serviceAPI = retrofit.create(ServiceAPI.class);\n final Call<RelayModel> relayModel = serviceAPI.getStateRelay();\n relayModel.enqueue(new Callback<RelayModel>() {\n @Override\n public void onResponse(Call<RelayModel> call, Response<RelayModel> response) {\n switchButtonLamp.setChecked(response.body().getLamp());\n switchButtonFan.setChecked(response.body().getFan());\n //switchButtonSpray.setChecked(response.body().getSpray());\n switchButtonExhaustFan.setChecked(response.body().getExhaust());\n\n }\n\n @Override\n public void onFailure(Call<RelayModel> call, Throwable t) {\n\n }\n });\n }",
"public interface ApiServer {\n\n @GET(\"musicDetails?id=604392760\")\n Observable<BaseResponseBean<BasicResponseBean>> getCall();\n\n}",
"public interface GetCountryDataService {\n\n\n\n @GET(\"country/get/all\")\n Call<Info> getResults();\n\n\n\n\n\n\n\n\n}",
"public interface ArticleApi {\n\n\n //获取所有文章\n @GET(value = \"article/list/{random}\")\n Observable<List<PushArticleDataBean>> getArticleList(@Path(\"random\") int random);\n\n //获取单篇文章\n @GET(value = \"article/single/{article_id}\")\n Observable<PushArticleDataBean> getArticle(@Path(\"article_id\") int article_id);\n\n //搜索文章\n @POST(value = \"article/search\")\n Call<ArrayList<PushArticleDataBean>> search(@Query(\"searchData\") String searchData);\n\n}",
"@Api(1.1)\n public Response execute() throws HaloNetException {\n return mBuilder.mClient.request(mRequest);\n }",
"public interface IParkingListMvpView extends MvpView {\n\n void onFetchDataCompleted(List<ParkingModel> parkingModels);\n}",
"public interface MainView {\n void getDataSuccess(CircleResponse response);\n\n void getDataFail(String msg);\n}",
"public interface Observer {\n @GET(\"/?q=simpsons+characters&format=json\")\n Observable<Model> fetchData();\n\n}",
"public interface Server {\n\n @GET\n Call<CalonModel> getCalon(@Url String url);\n\n}",
"public interface ApiService {\n\n\n public static final String BASE_URL = \"http://112.124.22.238:8081/course_api/cniaoplay/\";\n\n// @GET(\"featured\")\n// public Call<PageBean<AppInfo>> getApps(@Query(\"p\") String jsonParam);\n\n @GET(\"featured\")\n public Observable<BaseBean<PageBean<AppInfo>>> getApps(@Query(\"p\") String jsonParam);\n\n}",
"public interface UserApi {\n @POST(\"mobile/user/login\")\n Observable<BS_BaseBean<UserLoginBean>> userLogin(@Query(\"urid\") String urid, @Query(\"pwd\") String pwd, @Query(\"jgid\") String jgid);\n @GET(\"mobile/user/get/agencys\")\n Observable<BS_BaseListBean<AgencyBean>> getAgency(@Query(\"urid\") String urid);\n\n\n}",
"@NonNull\n @MainThread\n protected abstract LiveData<ApiResponse<RequestType>> createCall();",
"private CallResponse() {\n initFields();\n }",
"public interface NeighborService {\n\n\n @FormUrlEncoded\n @POST(\"login/\")\n Call<TokenInfo> login(@Field(\"username\") String userName, @Field(\"password\") String password);\n\n @GET(\"{id}/user/\")\n Call<User> getUser(@Path(\"id\") String userId);\n\n @GET(\"{id}/user/\")\n Observable<User> getUserRx(@Path(\"id\") String userId);\n\n\n}",
"void getData() {\n api = retrofitClient.getClient().create(API.class);\n //Defining the method\n api.getBuys().enqueue(new Callback<Data>() {\n @Override\n public void onResponse(Call<Data> call, Response<Data> response) {\n if (response.isSuccessful()) {\n Data data = response.body();\n buyList = data.getData();\n adapterView = new Adapter_sp(getActivity(), buyList);\n rv.setAdapter(adapterView);\n }\n }\n\n @Override\n public void onFailure(Call<Data> call, Throwable t) {\n Log.d(\"loi\",t.toString());\n\n }\n });\n\n\n }",
"private void GetRetrofitResponseAccordingToID(){\n\n IMovieApi IMovieApi = Servicey.getMovieApi();\n Call<MovieModel> responseCall = IMovieApi\n .getMovie(\n 343611,\n Credentials.API_KEY);\n\n responseCall.enqueue(new Callback<MovieModel>() {\n @Override\n public void onResponse(Call<MovieModel> call, Response<MovieModel> response) {\n if (response.code() == 200){\n MovieModel model = response.body();\n Log.v(TAG, \"The Response: \" +model.getTitle());\n }else {\n\n try {\n Log.v(TAG, \"Error \" + response.errorBody().string());\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }\n }\n\n @Override\n public void onFailure(Call<MovieModel> call, Throwable t) {\n t.printStackTrace();\n }\n });\n\n }",
"public interface GateWay {\n @GET(\"retrofit-demo.php?company_no=123\")\n Call<EmployeeList> getEmployee();\n}",
"public interface Api {\n @GET(\"top250\")\n// Call<MovieEntity> getTopMoive(@Query(\"start\") int start,@Query(\"count\") int count);\n Observable<httpResult<MovieEntity>> getTopMoive(@Query(\"start\") int start, @Query(\"count\") int count);\n\n}",
"private void sendToAPI(final View v, JSONObject jsonLogin){\n APIClient apiClient = new APIClient();\n Service apiService = apiClient.getClient().create(Service.class);\n Call<User> call = apiService.login(new Login(\"efef\",\"dfwd\"));\n call.enqueue(new Callback<User>() {\n @Override\n public void onResponse(Call<User> call, Response<User> response) {\n if (response.isSuccessful()) {\n new CustomToast().displyToast(getContext(), v, \"Error:\"+response.code()+\" \"+response.body().getMessage()+\n \"Token is: \"+response.body().getAccessToken());\n }\n else{\n new CustomToast().displyToast(getContext(), v, \"Error: \"+response.code()+\" \"+\n response.headers()+ \"...Incorrect username or password!\");\n }\n }\n\n @Override\n public void onFailure(Call<User> call, Throwable t) {\n new CustomToast().displyToast(getContext(), v, \"Server unreachable, Please retry again later\");\n }\n });\n\n }",
"public interface ApiServer {\n//\n @GET(\"umIPmfS6c83237d9c70c7c9510c9b0f97171a308d13b611?uri=homepage\")\n Observable<HomeBean> getHome();\n @POST\n Observable<Login> getDengLu(@Url String name, @QueryMap Map<String, String> paw);\n @GET(\"product/getCatagory\")\n Observable<Sort_lift> lift();\n @GET\n Observable<Sort_right> right(@Url String s);\n @GET\n Observable<Commodity_pagingBean> xia(@Url String s);\n @GET\n Observable<detailsBean> spxq(@Url String ss);\n @GET\n Observable<AddcartBean> add(@Url String s);\n @GET\n Observable<QurryBean> qurry(@Url String s);\n @GET\n Observable<AddcartBean> delete(@Url String s);\n @GET\n Observable<AddcartBean> addDd(@Url String s);\n @GET\n Observable<OrderBean> Ddlb(@Url String s);\n\n\n\n\n\n\n}",
"private static Response callAPI(VERB verb, String url, Workflow mo) throws Exception {\n\n Response result;\n Entity<Workflow> wfEntity = Entity.entity(mo, MediaType.APPLICATION_JSON_TYPE);\n switch (verb) {\n case POST:\n result = RequestSender.sendPOSTRequest(getAPIURL() + url, wfEntity);\n break;\n case GET:\n result = RequestSender.sendGETRequest(getAPIURL() + url);\n break;\n case PUT:\n result = RequestSender.sendPUTRequest(getAPIURL() + url, wfEntity);\n break;\n case DELETE:\n result = RequestSender.sendDELETERequest(getAPIURL() + url);\n break;\n default:\n throw new Exception(\"Bad VERB\");\n }\n\n return result;\n }",
"@Override\n public void onResponse(Call<List<String>> call, Response<List<String>> response) { //ViewModel had what we asked for and all is well\n //Declare and instantiate an instance of the ShibeAdapter class called adapter.\n // Pass the body of the response the viewModel gave us to the adapter\n ShibeAdapter adapter = new ShibeAdapter(response.body());\n\n //tell the recyclerView to use our handy dandy new ShibeAdapter.\n rvShibes.setAdapter(adapter);\n }",
"public interface RiverCruiseContract {\n interface Model extends BaseModel {\n Observable<Response<String>> getReverInfo(int longitude,int latitude); //获取河道信息\n /**\n * 开始巡湾\n * @param bay_id -- 海湾id\n * @param patrol_start -- 开始地址名称\n * @param lon --开始地址经度\n * @param lat --开始地址纬度\n * @return\n */\n Observable<Response<String>> sendLocationData(String bay_id, String patrol_start,String lon,String lat);//上传巡检时候的起点\n /**\n * 结束巡海\n * @param patrol_id -- 巡海记录id\n * @param patrol_end -- 结束地点名\n * @param lon --结束地址经度\n * @param lat --结束地址纬度\n * @param location -- 路线点数组字符串[\"12 14\",\"12 15\",\"12 14\",\"12 16\"]\n * @return\n */\n Observable<Response<String>> endLocationData(String patrol_id, String patrol_end,String lon,String lat,String location);\n\n }\n\n interface View extends BaseView {\n void showData(CommonBeachBean<BeachAndBenchlandBean> data);\n void uploadLocationSucced(BeachTrackBean trackBean);\n void endLocationSucced(String s); //结束巡检定位返回\n void toRequsetUserInfo(String token);\n void onSucceed(); //成功\n void onFaild(String msg); //登录失败\n\n }\n\n interface Presenter {\n// void login(String login_name, String password);\n void getReverInfo(int longitude,int latitude);\n void sendLocationData(String bay_id, String patrol_start,String lon,String lat);//上传巡检时候的起点\n void endLocationData(String patrol_id, String patrol_end,String lon,String lat,String location);\n }\n}",
"public interface TvApi {\n\n /*\n 获取电视节目表\n */\n @POST(\"getProgram\")\n Call<TvShowData> getProgram(@Query(\"code\") String code, @Query(\"date\") String date, @Query(\"key\") String key);\n\n /*\n 获取频道类型列表\n */\n @POST(\"getCategory\")\n Call<TvTypeData> getCategory(@Query(\"key\") String key);\n\n /*\n\n */\n @POST(\"getChannel\")\n Call<TvChannelData> getChannel(@Query(\"pId\") String pId, @Query(\"key\") String key);\n}",
"public interface IReserveView extends IBaseView {\n\n void getReserveSuccess(ReserveResponseBody data);\n}",
"public interface Api {\n\n// root url after add multiple servlets\n\n String BASE_URL = \"https://simplifiedcoding.net/demos/\";\n\n @GET(\"marvel\")\n Call<List<Modelclass>> getmodelclass();\n\n\n\n}",
"public interface PokeApiService {\n\n @GET(\"qvqk-dtmf.json\")\n Call<ArrayList<ViasRespuesta>> obtenerListaPokemon();\n}",
"public interface APIService {\n\n @GET(\"api/rates\")\n Observable<List<ProductModel>> getproductdata();\n\n}",
"public interface UserAppliedInvitationCodeApi {\n @POST(\"invited/detail\")\n Observable<UserAppliedInvitationCodeBean> userAppliedInvitationCode();\n}",
"public interface RemoteMovieDataSource {\n\n @GET(\"movie/now\")\n Call<DataMovie> nowShowing();\n\n @GET(\"movie/upcoming\")\n Call<DataMovie> upcoming();\n}",
"@Override\n\tpublic Response call() throws Exception {\n\t\tClientResponse response = callWebService(this.spaceEntry);\n\t\tthis.transId = (int) response.getEntity(Integer.class);\n\t\tresponse.close();\n\t\t/*wait for web service to provide tuple Object result*/\n\t\tawaitResult();\n\t\t\n\t\t/*return result*/\n\t\treturn result;\n\t}",
"@Override\r\n\tpublic Response invoke() {\n\t\treturn null;\r\n\t}",
"public interface MainBaseView extends BaseView {\n\n void onGetFirstDataSuccess(FirstDataResponse response);\n\n void onSelectNationSuccess(ProvinceResponse response);\n\n void onCheckUserStatusSuccess(User user);\n}",
"public interface ApiService {\n\n @GET(\"block/height\")\n Observable<CommonResponse<BlockHeight>> requestBlockHeight();\n\n @POST(\"transaction/send\")\n Observable<CommonResponse<TradeInfo>> transactionSend(@Body RequestBody requestBody);\n\n\n\n}",
"public interface ApiCall {\n\n @GET(\"news_feeds\")\n Call<NewsFeedResponse> getNewsFeed(@Query(\"city\") String city, @Query(\"page\") String page);\n\n @GET(\"news\")\n Call<FeedContent> getSingleNewsArticle(@Query(\"city\") String city, @Query(\"news_id\") String newsId);\n\n @GET(\"get_latest_app\")\n Call<FeedHeaderContentResponse> getFeedHeaderResponse(@Query(\"app_name\") String appName, @Query(\"installed_version\") String installedVersion);\n\n @GET(\"jokes\")\n Call<List<JokesResponse>> getAllJokes(@Query(\"page\") String page);\n\n @GET(\"single_joke\")\n Call<SingleJokeResponse> getSingleJoke(@Query(\"joke_id\") String jokeId);\n}",
"public interface HttpService {\n\n @POST(\"/demo/store/getStoreById/40\")\n Observable<BaseBean<ArticleInfo>> getCarousel();\n\n}",
"public interface UserMgrService {\n\n @GET(\"login\")\n Call<UserInfoModel> login(@Query(\"username\") String username,@Query(\"pwd\") String pwd);\n\n\n}",
"public interface ApiInterface {\n @GET(\"json/movies.json\")\n Call<List<Movie>> getStudentDetails();\n}",
"private void getData() {\n showDialog();\n Call<InfoMcWkMoldRes> call = apiInterface.getCompositeMaster(idActual);\n call.enqueue(new Callback<InfoMcWkMoldRes>() {\n @Override\n public void onResponse(Call<InfoMcWkMoldRes> call, Response<InfoMcWkMoldRes> response) {\n if(response.isSuccessful()){\n compositeMasterArrayList = new ArrayList<>();\n InfoMcWkMoldRes res = response.body();\n if (res!=null){\n compositeMasterArrayList = res.getCompositeMasterList();\n if (compositeMasterArrayList.isEmpty()) {\n dialog.dismiss();\n nodata.setVisibility(View.VISIBLE);\n mapping.setVisibility(View.GONE);\n return;\n }\n dialog.dismiss();\n buildRecycleView();\n }\n\n }else {\n nodata.setVisibility(View.VISIBLE);\n mapping.setVisibility(View.GONE);\n AlertError.alertError(\"The server response error\", CompositeActivity.this);\n dialog.dismiss();\n }\n }\n\n @Override\n public void onFailure(Call<InfoMcWkMoldRes> call, Throwable t) {\n call.cancel();\n nodata.setVisibility(View.VISIBLE);\n mapping.setVisibility(View.GONE);\n AlertError.alertError(t.getMessage(), CompositeActivity.this);\n dialog.dismiss();\n\n }\n });\n\n Log.e(\"getData\", webUrl + \"ActualWO/Getinfo_mc_wk_mold?id_actual=\" + idActual);\n }",
"public interface PresenterAPI {\n @GET(NetConfig.NEWS_LIST)\n Observable<TestBean> getNewsList(@Query(\"access_token\") String access_token,\n @Query(\"catalog\") int catalog,\n @Query(\"dataType\") String dataType,\n @Query(\"page\") int page,\n @Query(\"pageSize\") int pageSize);\n\n @POST(NetConfig.NEWS_LIST)\n Observable<TestBean> getPosts();\n /* @GET(NetConfig.BASE_URL)\n Observable<TestBean> requestNewsPicData(@Query(\"param\") int param);\n\n @FormUrlEncoded\n @POST(NetConfig.BASE_URL)\n Observable<ResponseBody> Test1(@Field(\"param\") String param);\n\n @FormUrlEncoded\n @POST(NetConfig.BASE_URL)\n Observable<ResponseBody> Test2(@FieldMap HashMap<String, String> params);*/\n}",
"public interface WeatherApi {\n @GET(\"weather\")\n Observable<Weather> getWeather(@Query(\"q\") String cityName, @Query(\"units\") String units, @Query(\"APPID\") String openWeatherApiKey);\n\n @GET(\"weather\")\n Call<Weather> getWeather2(@Query(\"q\") String cityName, @Query(\"units\") String units, @Query(\"APPID\") String openWeatherApiKey);\n}",
"public interface DemoApi {\n\n @GET(\"user/{id}\")\n Call<User> getUserInfoWithPath(@Path(\"id\") int user_id);\n\n @POST(\"login/json\")\n Call<BaseResult> login(@Body UserParam userParam);\n\n @POST(\"login/json\")\n Observable<BaseResult> login2(@Body UserParam userParam);\n\n}",
"public interface Model {\n\tObservable<SignUpResponse> userLogin(String userEmail, String userPassword);\n\n\tObservable<ConferenceFeedResponse> getConferenceFeed(int offset);\n\n\tObservable<ConferenceDataResponse> getConferenceData(int id);\n\n\tObservable<ProfileDataResponse> getProfileData(int id);\n}",
"public interface ApiService {\n @GET(\"api/timelines/users/918753190470619136\")\n Call<HeadPOJO> pojoGetter();\n}",
"@Override\n\t\t\tpublic void onCallback(String result) {\n\n\t\t\t\tsquareLiveModel = (SquareLiveModel) GsonUtils.jsonToBean(\n\t\t\t\t\t\tresult, SquareLiveModel.class);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tinitLoadView();\n\t\t\t}",
"public interface ApiService {\n @GET(\"questcms/floorplan\")\n Call<List<FloorPlan>> listFloorPlan();\n}",
"public interface SWAPIInterface {\n @GET(\"people\")\n Call<PeopleResponse> getPeopleFromPage();\n}",
"public interface HomeView {\n\n void showWait();\n void removeWait();\n\n void onFailure(String appErrorMessage);\n void getCityListSuccess(CityListResponse cityListResponse);\n\n}",
"public interface ApiManager {\n @POST\n Call<ResponseBody> upload(@Url() String url);\n\n //上传文件\n @POST\n Call<ResponseBody> uploadFile(@Url() String url, @Body RequestBody body);\n\n //修改手机号\n @POST\n Call<ResponseBody> changePhone(@Url() String url);\n\n //订单详情\n @POST\n Observable<PayDetails> orderDetatls(@Url() String url);\n\n //通知已读\n @POST\n Call<ResponseBody> notityReader(@Url() String url);\n}",
"public interface LogisticsDataApi {\n\n\n /**\n * 用户类型:-1用户, 0-咨询会员,1-交易会员,2-商家会员\n * 会员认证 状态: 0 -未认证, 1 -已认证\n * 会员锁定 状态: 0 -正常, 1 -锁定, 2 -注销\n * /member/query_type_new?token GET 用户类型\n */\n @GET(\"member/query_type_new\")\n Observable<UserTypeData> getUserType(@Query(\"token\") String token);\n\n /**\n * 发布求购 publish\n *\n * 收货信息 member/get_member_delivery_address?token 取默认地址 / 没有默认取第一条\n *\n * 原料品名 baseData/query_breed?keyword\n * 原料牌号 baseData/query_spec?keyword & code // code 为 breed code\n * 生产厂家 baseData/query_brand?keyword\n *\n * 提交 求购数据 member/publish_buy - post reference: class: MemberPurchaseDTOs\n */\n\n\n // 收货地址\n @GET(\"member/get_member_delivery_address\")\n Observable<PublishData.AddressData> getAddressData(@Query(\"token\") String token);\n\n // breed\n @GET(\"baseData/query_breed\")\n Observable<PublishData> getBreedData(@Query(\"keyword\") String keyword);\n // spec\n @GET(\"baseData/query_spec\")\n Observable<PublishData> getSpecData(@Query(\"keyword\") String keyword,\n @Query(\"code\") String breedCode);\n // brand\n @GET(\"baseData/query_brand\")\n Observable<PublishData.PublishBrandData> getBrandData(@Query(\"keyword\") String keyword);\n\n\n\n // 提交 求购数据 post Content-Type为application/json todo\n @POST(\"member/publish_buy\")\n Observable<VerifyData> postPurchaseData(@Body RequestBody requestBody);\n\n\n /**\n * 发布求购 publish - 收货地址 新增/编辑 get\n @\"/member/save_member_delivery_address\" // 新增收货信息\n @\"/member/update_member_delivery_address\" // 编辑收货信息\n */\n // 新增收货信息\n @GET(\"member/save_member_delivery_address\")\n Observable<VerifyData> getSaveAddressData(\n @Query(\"token\") String token,\n @Query(\"address\") String address,\n @Query(\"contactName\") String contactName,\n @Query(\"mobile\") String mobile,\n @Query(\"isDefault\") String isDefault,\n @Query(\"provinceCode\") String provinceCode,\n @Query(\"provinceName\") String provinceName,\n @Query(\"cityCode\") String cityCode,\n @Query(\"cityName\") String cityName,\n @Query(\"districtCode\") String districtCode,\n @Query(\"districtName\") String districtName\n );\n\n // 修改收货信息 (memberDeliveryAddressId 新增地址没有此参数)\n @GET(\"member/update_member_delivery_address\")\n Observable<VerifyData> getUpdateAddressData(\n @Query(\"token\") String token,\n @Query(\"address\") String address,\n @Query(\"contactName\") String contactName,\n @Query(\"mobile\") String mobile,\n @Query(\"isDefault\") int isDefault,\n @Query(\"provinceCode\") String provinceCode,\n @Query(\"provinceName\") String provinceName,\n @Query(\"cityCode\") String cityCode,\n @Query(\"cityName\") String cityName,\n @Query(\"districtCode\") String districtCode,\n @Query(\"districtName\") String districtName,\n @Query(\"memberDeliveryAddressId\") String memberDeliveryAddressId\n );\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n /**\n * purchase\n * member/purchase_pool?token 求购池数据\n * member/my_purchase_list?token 我的求购\n * shop/my_quote_list?token 我的报价\n */\n @GET(\"member/purchase_pool\")\n Observable<PurchaseData> getPurchasePoolData(@Query(\"token\") String token,\n @Query(\"pageNum\") int pageNum,\n @Query(\"pageSize\") int pageSize);\n\n\n @GET(\"member/my_purchase_list\")\n Observable<PurchaseData> getMyPurchaseData(@Query(\"token\") String token,\n @Query(\"pageNum\") int pageNum,\n @Query(\"pageSize\") int pageSize);\n\n @GET(\"shop/my_quote_list\")\n Observable<PurchaseData> getMyQuoteData(@Query(\"token\") String token,\n @Query(\"pageNum\") int pageNum,\n @Query(\"pageSize\") int pageSize);\n\n /**\n * member/purchase_quote_list?token&memberPurchaseId 求购报价详情\n * shop/my_quote_detail?quoteId&token 报价详情\n */\n\n @GET(\"member/purchase_quote_list\")\n Observable<PurchaseQuoteData> getMyPurchaseDetailData(@Query(\"token\") String token,\n @Query(\"memberPurchaseId\") String memberPurchaseId);\n\n @GET(\"shop/my_quote_detail\")\n Observable<QuoteDetailData> getMyQuoteDetailData(@Query(\"token\") String token,\n @Query(\"quoteId\") String quoteId);\n\n\n /**\n * member/member_review_quote ?token&sellMemberQuoteId& reviewNote 买家复议\n * shop/sell_review_quote ? token& quoteId& price 卖家复议\n */\n\n @GET(\"member/member_review_quote\")\n Observable<VerifyData> getPurchaseReviewData(@Query(\"token\") String token,\n @Query(\"sellMemberQuoteId\") String sellMemberQuoteId,\n @Query(\"reviewNote\") String reviewNote);\n\n @GET(\"shop/sell_review_quote\")\n Observable<VerifyData> getQuoteReviewData(@Query(\"token\") String token,\n @Query(\"quoteId\") String quoteId,\n @Query(\"price\") String price);\n\n\n /** 商家报价\n * baseData/query_like_warehouse?companyShortName 模糊搜索仓库\n * baseData/query_warehouse?companyShortName 精准搜索仓库 1.创建新仓库校验 2.选择历史\n * shop/sell_price 报价 - 提交报价数据 post\n */\n\n @GET(\"baseData/query_like_warehouse\")\n Observable<WarehouseData> getFuzzyWarehouseData(@Query(\"companyShortName\") String companyShortName);\n\n @GET(\"baseData/query_warehouse\")\n Observable<WarehouseData.WarehouseCheckData> getWarehouseData(@Query(\"companyShortName\") String companyShortName);\n\n\n // 提交报价数据 post todo\n @FormUrlEncoded\n @POST(\"shop/sell_price\")\n Observable<VerifyData> postQuoteData(\n @Field(\"token\") String token,\n @Field(\"memberPurchaseId\") long memberPurchaseId,\n @Field(\"price\") double price,\n @Field(\"isSupplierDistribution\") int isSupplierDistribution, // 0 - no ; 1 - yes;\n @Field(\"deliveryDate\") String deliveryDate,\n @Field(\"warehouse\") String warehouse // warehouse json\n );\n\n\n\n\n\n\n /**\n * logistics\n * /app/logistics/from_address 出发地\n * /app/logistics/to_address?provFrom&cityFrom&distinctFrom 目的地\n * /app/logistics/query_price?provFrom&cityFrom&distinctFrom&provTo&cityTo&distinctTo&amount 价格\n * @return\n */\n\n // 出发地\n @GET(\"logistics/from_address\")\n Observable<LogisticsCityData> getFromData();\n\n // 目的地\n @GET(\"logistics/to_address\")\n Observable<LogisticsCityData> getDestinationData(@Query(\"provFrom\") String provFrom,\n @Query(\"cityFrom\") String cityFrom,\n @Query(\"distinctFrom\") String distinctFrom\n );\n\n // 价格\n @GET(\"logistics/query_price\")\n Observable<LogisticsResultData> getPriceData(@Query(\"provFrom\") String provFrom,\n @Query(\"cityFrom\") String cityFrom,\n @Query(\"distinctFrom\") String distinctFrom,\n @Query(\"provTo\") String provTo,\n @Query(\"cityTo\") String cityTo,\n @Query(\"distinctTo\") String distinctTo,\n @Query(\"amount\") int amount\n );\n\n\n /**\n * 一键下单页面计算:\n 采购单价:求购报价的价格;\n 运费单价:求购报价的运费单价;(非供配情况下,选择自提,重置为0)\n 资金服务费利率:未认证会员为0;\n 账期:使用授信(部分授信,或全部授信)默认为最大账期天数;款到发货,账期为0;\n\n 选择账期后计算-----------------------------------------------------\n\n 1.资金服务费 =(采购单价+运费单价)*数量*资金服务费利率*账期\n\n * 全部授信- 资金服务费 =(采购单价+运费单价)*数量*资金服务费利率*账期\n * 部分授信- 资金服务费 = 授信额度(自填)*资金服务费利率*账期\n\n\n 2.销售总货款 =(采购单价+运费单价)*数量 + 资金服务费\n\n 3.采购总货款 = 采购单价*数量\n\n 4.物流总货款 = 运费单价*数量\n\n 5.销售单价 = 销售总货款/数量\n\n\n 6.使用授信(授信金额)\n 全部授信-使用授信 =(采购单价+运费单价)* 数量 + 资金服务费\n 部分授信-使用授信 = 授信额度(自填);\n 款到发货-使用授信 = 0;\n\n 7.手续费 = 销售总货款*0.3%\n *\n * /member/purchase_check_create_order?token \t\t\t\t 检验能否一键下单\n * /member/query_purchase_create_order_details?token"eId 确认订单\n */\n\n // 检验能否一键下单\n @GET(\"member/purchase_check_create_order\")\n Observable<VerifyData> getOrderCheckData(@Query(\"token\") String token);\n\n // 确认订单\n @GET(\"member/query_purchase_create_order_details\")\n Observable<OrderConfirmData> getOrderConfirmData(@Query(\"token\") String token,\n @Query(\"quoteId\") String quoteId);\n\n /**\n * 保证金\n * order/check_deposit?token & receivableWay\n */\n @GET(\"order/check_deposit\")\n Observable<VerifyData> getCheckDepositData(@Query(\"token\") String token,\n @Query(\"receivableWay\") String receivableWay);\n\n /**\n * private Long memberPurchaseId = 0L;\t\t\t\t\t\t// 会员求购单Id\n private Long sellMemberQuoteId = 0L;\t\t\t\t\t // 报价单Id\n\n private Double saleSumQty = 0D;\t\t\t\t\t\t\t// 销售总重量\n private Double saleSumAmt = 0D;\t\t\t\t\t\t\t// 销售总金额\n private Double purchaseSumQty = 0D;\t\t\t\t\t\t// 采购总重量\n private Double purchaseSumAmt = 0D;\t\t\t\t\t\t// 采购总金额\n private Double logisticsSumCost = 0D;\t\t\t\t\t // 物流总货款\n private Double salePrice = 0D;\t\t\t\t\t\t\t // 销售单价\n\n private Integer distributionWay = 0;\t\t\t\t\t// 配送方式 0-供方配送 1-自提 2-平台配送\n private String deliveryDate = \"\";\t\t\t\t\t\t// 交货日期\n private Integer receivableWay = 0;\t\t\t\t\t\t// 结算方式 0-全额授信 1-部分授信 2-款到发货\n private Double creditAmount = 0D;\t\t\t\t\t\t// 授信金额\n private Integer receivableDay = 0;\t\t\t\t\t\t// 货到收款天数- 账期\n\n private String packagSpec = \"\";\t\t\t\t\t\t// 包装规格\n\n private Double memberMoneyRate = 0D;\t\t\t\t\t// 服务费利率\n private\tDouble serviceAmt = 0D;\t\t\t\t\t\t// 服务费\n */\n /**\n * /order/purchase_save_sale_order // 一键下单 todo\n */\n @FormUrlEncoded\n @POST(\"order/purchase_save_sale_order\")\n Observable<VerifyData> postOrderData(@Field(\"token\") String token,\n @Field(\"memberPurchaseId\") Long memberPurchaseId,\n @Field(\"sellMemberQuoteId\") Long sellMemberQuoteId,\n @Field(\"saleSumQty\") Double saleSumQty,\n @Field(\"saleSumAmt\") Double saleSumAmt,\n @Field(\"purchaseSumQty\") Double purchaseSumQty,\n @Field(\"purchaseSumAmt\") Double purchaseSumAmt,\n @Field(\"logisticsSumCost\") Double logisticsSumCost,\n @Field(\"salePrice\") Double salePrice,\n @Field(\"distributionWay\") int distributionWay,\n @Field(\"deliveryDate\") String deliveryDate,\n @Field(\"receivableWay\") int receivableWay,\n @Field(\"creditAmount\") Double creditAmount,\n @Field(\"receivableDay\") int receivableDay,\n @Field(\"packagSpec\") String packagSpec,\n @Field(\"memberMoneyRate\") Double memberMoneyRate,\n @Field(\"serviceAmt\") Double serviceAmt);\n\n\n\n\n\n /**\n * OrderFragment 订单列表\n * @param token\n * @param subStatus\n * 10-待审核 12-待支付手续费 11-待上传采购合同\n * 20-待收款 30-待付款 40-待发货 50-待确认收货\n * 90-交易失败 100-待开票? 101-待开票审核? 102-交易成功\n */\n @GET(\"order/query_order_list\")\n Observable<OrdersData> getOrderData(@Query(\"token\") String token,\n @Query(\"subStatus\") String subStatus,\n @Query(\"pageNum\") int pageNum,\n @Query(\"pageSize\") int pageSize);\n\n /**\n * 订单详情\n * order/query_order_detail?token&orderId\n */\n @GET(\"order/query_order_detail\")\n Observable<OrderDetailData> getOrderDetailData(@Query(\"token\") String token,\n @Query(\"orderId\") String orderId);\n\n /**\n * 支付手续费\n * order/member_purchase_alipay_create?token&orderSn&goodsAmount 支付宝 todo\n * order/member_purchase_wx_create?token&orderSn&goodsAmount 微信 todo\n * private String operateStatus;\t// 操作状态 null没有; A0-支付手续费; A1-开票申请; A2-申请展期\n */\n\n // 支付宝支付\n @FormUrlEncoded\n @POST(\"order/member_purchase_alipay_create\")\n Observable<OrderData> postAliPayData(@Field(\"token\") String token,\n @Query(\"orderId\") String orderId,\n @Field(\"orderSn\") String orderSn,\n @Field(\"goodsAmount\") String goodsAmount);\n\n\n\n // 微信支付\n @FormUrlEncoded\n @POST(\"order/member_purchase_wx_create\")\n Observable<OrderPayData> postWeChatPayData(@Field(\"token\") String token,\n @Query(\"orderId\") String orderId,\n @Field(\"orderSn\") String orderSn,\n @Field(\"goodsAmount\") String goodsAmount);\n\n /**\n * rder/query_extends_days_detail?orderId&token 展期详情\n * order/save_extends_days 申请展期\n */\n @GET(\"order/query_extends_days_detail\")\n Observable<ExtensionData> getExtensionData(@Query(\"token\") String token,\n @Query(\"orderId\") String orderId);\n\n /**\n * order/save_extends_days 申请展期\n * private String token ;\n private Long orderId = 0L; // 订单Id\n private String contractCode = \"\"; // 关联合同号\n private Double amount = 0D; // 金额\n private Integer days = 0; // 天数\n private String note = \"\"; // 备注\n */\n\n @FormUrlEncoded\n @POST(\"order/save_extends_days\")\n Observable<VerifyData> postExtensionData(@Field(\"token\") String token,\n @Query(\"orderId\") long orderId,\n @Field(\"contractCode\") String contractCode,\n @Field(\"amount\") double amount,\n @Field(\"days\") int days,\n @Field(\"note\") String note);\n\n}",
"@Override\n\tpublic void execute(HttpServletRequest request, HttpServletResponse response) {\n\t\tSystem.out.println(\"View1Model execute(HttpServletRequest request, HttpServletResponse response) 호출\");\n\t}",
"public interface TravelApiService {\n @GET(\"api/users/{userCode}/travels\")\n Call<List<Travel>> getTravel(@Path(value = \"userCode\") String userCode);\n\n @POST(\"api/users/{userCode}/travels\")\n Call<PostTravelGsonResponce> postTravel(@Path(value = \"userCode\") String userCode, @Field(\"travel_date\") String travelDate, @Field(\"latitude\") Double latitude, @Field(\"longitude\") Double longitude, @Field(\"area_name\") String areaName, @Field(\"contry_name\") String countryName, @Field(\"token\") String token);\n}",
"public interface MRPApi {\n @POST(\"get_mrp_production\")\n Call<GetMrpProductionResponseBean> getMrpProduction(@Body GetMrpProductionRequestBean requestBean);\n\n @POST(\"get_stock_inventory_list\")\n Call<GetStockInventoryResponse> getStockInventoryList(@Body GetStockInventoryRequestBean getStockInventoryRequestBean);\n\n @POST(\"find_product_by_condition\")\n Call<FindProductByConditionResponse> findProductByCondition(@Body findProductByConditionRequest findProductByConditionRequest);\n\n @POST(\"get_area_list\")\n Observable<GetAreaListResponse> getAreaList(@Body HashMap map);\n\n @POST(\"get_stock_inventory_detail\")\n Call<GetStockInventoryDetailResponse> getStockInventoryDetail(@Body HashMap map);\n\n @POST(\"create_stock_inventory\")\n Call<CreatInventoryResponse> creatStockInventory(@Body GetStockInventoryDetailResponse.ResultBean.ResDataBean resDataBean);\n\n\n\n}",
"public interface Api {\n @GET(\"ad/getAd\")\n Observable<ImageBean> getImage();\n @GET(\"product/getCatagory\")\n Observable<JiuBean> getJiu();\n @GET(\"home/getHome\")\n Observable<HomeBean> getHome();\n @GET(\"product/getProductCatagory\")\n Observable<SortBean> getSort(@Query(\"cid\") int cid);\n @GET(\"user/reg\")\n Observable<RegBean> getReg(@Query(\"mobile\") String mobile, @Query(\"password\") String password);\n @GET(\"user/login\")\n Observable<LoginBean> getLogin(@Query(\"mobile\") String mobile, @Query(\"password\") String password);\n @GET(\"product/searchProducts\")\n Observable<SouSuoBean> getSouSuo(@Query(\"keywords\") String keywords, @Query(\"page\") int page);\n @GET(\"product/getProductDetail\")\n Observable<XiangQingBean> getXiangQing(@Query(\"pid\") int pid);\n @GET(\"product/getCarts\")\n Observable<CarBean> getCar(@Query(\"uid\") int uid);\n}",
"public interface ApiService {\n @GET(\"/student/mobileRegister\")\n Observable<HttpResult<UserEntity>> login(@Query(\"phone\") String phone, @Query(\"password\") String psw);\n\n\n @GET(\"top250\")\n Observable<HttpResult<List<Subject>>> getTopMovie(@Query(\"start\") int start, @Query(\"count\") int count);\n\n @GET(\"top250\")\n Observable<HttpResult<Subject>> getUser( @Query(\"touken\") String touken);\n}",
"private void observableViewModel() {\n }",
"public interface CharactersApiDataSource {\n\n @GET(\"people\")\n Call<PeopleResponse> getCharacter();\n\n}",
"public interface Weather {\n @GET(\"/data/2.5/forecast/daily?mode=json\")\n Call<Result> forecast(@Query(\"q\") String q, @Query(\"units\") String units, @Query(\"cnt\") int cnt, @Query(\"appid\") String appid);\n}",
"public interface IRequestInterface {\n\n@GET(API_CONSTANTS.SANFRAN_API)\n Observable<List<ParkingModel>> getParkingList();\n\n\n}",
"public interface ApiService {\n\n @GET(\"products.json\")\n Call<Product> loadProduct();\n\n}",
"public void getResultsFromApi() {\n// if (! isGooglePlayServicesAvailable()) {\n// acquireGooglePlayServices();\n// } else if (mCredential.getSelectedAccountName() == null) {\n// chooseAccount();\n// } else if (! isDeviceOnline()) {\n//// mOutputText.setText(\"No network connection available.\");\n// } else {\n MakeRequestTask req = new MakeRequestTask(mCredential);\n AsyncTaskCompat.executeParallel(req);\n// }\n }",
"public interface RestApi {\n\n @GET(\"/ride.asp\")\n Call<List<Model>> getData (@Query(\"userid\") int userId,\n @Query(\"from_name\") String fromName,\n @Query(\"from_lat\") double lat,\n @Query(\"from_lng\") double lng,\n @Query(\"to_name\") String toName,\n @Query(\"to_lat\") double toLat,\n @Query(\"to_lng\") double toLng,\n @Query(\"time\") long time);\n}",
"private void getData() {\n ApiInterface apiInterface = ServiceGenerator.createService(ApiInterface.class);\n Call<TermsConditionApi> call = apiInterface.getTermsCondition();\n call.enqueue(new Callback<TermsConditionApi>() {\n @Override\n public void onResponse(Call<TermsConditionApi> call, Response<TermsConditionApi> response) {\n if (response.isSuccessful()) {\n if (response.body().getStatus().equals(200)) {\n data = response.body().getData();\n } else {\n }\n } else {\n\n }\n }\n\n @Override\n public void onFailure(Call<TermsConditionApi> call, Throwable t) {\n// Toast.makeText(HomeActivity.this, \"\" + t.getMessage(), Toast.LENGTH_LONG).show();\n }\n });\n }",
"public abstract String getResponse();",
"public interface SkateParks_API {\n String BASE_URL = \"http://danielburkedev.com/isa\";\n\n @GET(\"/isa_skateparksdb.php\")\n void getSkateParks( Callback<Skateparks_Model> cb);\n\n\n\n\n\n}",
"public interface MainMvpView extends MvpView {\n\n void showSchoolModel(SchoolModel schoolModel);\n void showInfo(BabyModel babyModel, TCUserModel userModel,String babyId,String userId);\n void uploadHeadImgResult(boolean isSuccess,String name);\n void showTeacherInfo(AttendenceTeacherModel teacherModel,String qrCode,String teacherId, String schoolId);\n void onError(String msg);\n void toUpdate(AppVersionModel model);\n void inputUUIDClick(String uuid);\n void updateStateSuccess();\n void updateError();\n}",
"public interface Api {\n @GET(\"sites\") //Check urls here https://inthecheesefactory.com/blog/retrofit-2.0/en?fb_comment_id=885081521586565_886605554767495\n Single<List<Site>> sitesGet();\n\n @GET(\"sites/state\")\n Single<List<SiteState>> sitesStateGet(@QueryMap() Map<String, String> query);\n\n @POST(\"sites/state/connection/follow\")\n Single<SiteState> follow(@Body FollowCommand params);\n\n @POST(\"sites/state/connection/unfollow\")\n Completable unfollow(@Body UnfollowCommand params);\n }",
"org.naru.park.ParkModel.UIParkResponse getResponse();",
"private void callAPI() {\n\n Log.d(TAG, \"Starting volley request to API\");\n\n RequestQueue queue = Volley.newRequestQueue(this);\n JSONObject parameters = new JSONObject();\n\n try {\n parameters.put(\"key\", \"value\");\n } catch (Exception e) {\n Log.d(TAG, \"Failed to put parameters: \" + e.toString());\n }\n JsonObjectRequest request = new JsonObjectRequest(Request.Method.GET, Constants.API_URL,\n parameters,new Response.Listener<JSONObject>() {\n @Override\n public void onResponse(JSONObject response) {\n /* Successfully called API */\n Log.d(TAG, \"Response: \" + response);\n try {\n ((TextView) findViewById(R.id.welcome)).setText(\"Welcome, \"\n + response.getString(\"name\"));\n Toast.makeText(getBaseContext(), \"Response: \" + response.get(\"name\"), Toast.LENGTH_SHORT)\n .show();\n } catch (JSONException e) {\n Log.d(TAG, \"JSONEXception Error: \" + e.toString());\n }\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n Log.d(TAG, \"Error: \" + error.toString());\n }\n }) {\n @Override\n public Map<String, String> getHeaders() throws AuthFailureError {\n Map<String, String> headers = new HashMap<>();\n Log.d(TAG, \"Token: \" + authResult.getAccessToken().toString());\n headers.put(\"Authorization\", \"Bearer \" + authResult.getAccessToken());\n return headers;\n }\n };\n\n queue.add(request);\n }",
"public interface ArtApiEndpointInterface {\n\n @GET(\"fta.php\")\n Observable<JsonElement> getArt();\n\n}",
"private void getResultsFromApi() {\n if (! isGooglePlayServicesAvailable()) {\n acquireGooglePlayServices();\n } else if (mCredential.getSelectedAccountName() == null) {\n chooseAccount();\n } else if (! isDeviceOnline()) {\n\n Toast.makeText(getApplicationContext(), \"No Network Connection\",\n Toast.LENGTH_SHORT).show();\n mOutputText.setText(\"No network connection available.\");\n } else {\n new MakeRequestTask(mCredential).execute();\n }\n }",
"public interface NewsService {\n @GET(\"v1/sources?language=en\")\n Call<WebSite> getSources();\n}",
"public interface APIService {\n /**\n * 如果不需要转换成Json数据,可以用了ResponseBody;\n * @return call\n */\n @GET(\"apps?api_token={Your API Token}\")\n// Call<AppInfo> getAppInfo();\n Call<ResponseBody> getAppInfo();\n // you can add some other meathod\n}",
"public interface MaximApiService {\n @GET(\"\")\n Observable<MaximModel> getPriceMaxim();\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\tpublic void run() {\n\t\tRequestBody body = RequestBody.create(this.jsonType, this.contents);\n\t\tRequest request = new Request.Builder()\n\t\t\t.url(this.serverURL)\n\t\t\t.post(body)\n\t\t\t.build();\n\t\t\n\t\ttry {\n\t\t\tResponse response = client.newCall(request).execute();\n\t\t\tString str = response.body().string();\n\t\t\t//logger.log(Level.INFO, \n\t\t\t//\t\tString.format(\"DEBUG postCallInfoToServerTask succeed: %s\", str));\n\t\t} catch (IOException e) {\n\t\t\tNetProphetLogger.logError(\"PostCallInfoTask.run\", e.toString());\n\t\t}\n\t}",
"public interface MemberView extends MvpView {\n\n void onMemberIndexSuccess(MemberIndex data);\n\n void onFinancialRecordsSuccess(FinanceRecords data);\n\n void onWithdrawInfoSuccess(BaseBean<Withdraw> data);\n\n void onCouponNumSuccess(Coupon data);\n}",
"public interface ApiInterFace {\n @GET(\"restaurants\")\n Call<Restaurant_model> getRestaurants();\n\n @POST(\"/profile\")\n @FormUrlEncoded\n Call<LoginFragment.UserSentResponse> sendUserData(@Field(\"name\") String name, @Field(\"picUrl\") String picUrl, @Field(\"email\") String email);\n\n\n @GET(\"/search/{keyword}\")\n Call<SearchModel> search(@Path(\"keyword\") String keyword);\n\n @GET(\"/profile/{id}\")\n Call<UserProfile_model> getUserInfo(@Path(\"id\") String id);\n\n @GET(\"/meal/{id}\")\n Call<RestaurantMealResponse> getRestaurantMeal(@Path(\"id\") int id);\n\n @GET(\"/restaurant/{id}\")\n Call<RestaurantDetailResponse> getRestaurantDetailResponse(@Path(\"id\") int id);\n}",
"private void loadCityDetails() {\n\n apiCall = ApiUtils.getCityDetails();\n\n Call<CityData> call = apiCall.getCityDetails();\n\n call.enqueue(new Callback<CityData>() {\n @Override\n public void onResponse(Call<CityData> call, Response<CityData> response) {\n\n //finally we are setting the list to our MutableLiveData\n cityList.setValue(response.body());\n\n }\n\n @Override\n public void onFailure(Call<CityData> call, Throwable t) {\n System.out.println(\"is failed\");\n }\n });\n }",
"public interface AboutUnivStarService {\n\n @POST(\"/v1/m/user/setting/about\")\n Observable<AboutUnivStarBean> loadAboutUnivStarMessage();\n}",
"public interface ApiService {\n\n @GET(\"20/1\")\n Observable<HttpResult<List<Result>>> getWeal();\n\n\n}",
"public interface TestService {\n /**\n * 获取首页详情\n */\n @POST(\"borrow/findIndex.htm\")\n Observable<HttpResult<HomeRec>> getHomeIndex();\n /** 登录 */\n @POST(\"user/login.htm\")\n Flowable<HttpResult<User>> doLogin(@Body LoginSub sub);\n /**\n *\n */\n @GET\n Call<HttpResult<ArrayList<SplashRec>>> getPositionContent(@Url String url, @Query(\"appflag\") String appflag, @Query(\"positionid\") String positionid);\n}",
"public interface DataView extends View\n{\n //Returns the status of the response\n //True: successful\n //False: failed\n public boolean getResponseStatus();\n \n //Returns the response message\n public String getResponseMessage();\n \n //Returns the data from the controller\n public Message getResponseData();\n \n //Returns a json representation of the data\n public String getJson();\n \n}",
"@GET(\"posts/1\")\n public Call<Post> getPost();",
"public interface HeroService {\n @GET(\"/heroes\")\n LiveData<ApiResponse<HeroResult>> getHeroes();\n\n @POST(\"/vote\")\n LiveData<ApiResponse<VoteResult>> vote(VoteBody body);\n}",
"public interface WelcomeScreenRequestApi {\n\n @GET(Urls.REQUEST_Welcome_SCREEN)\n Call<WelcomeScreenData> getWelcomeData();\n\n}",
"public interface IFeedBackView extends IView {\n void feedBackListSuccess(List<FeedBackResponse> response);\n}",
"public abstract V getViewModel();"
] | [
"0.59509987",
"0.59149563",
"0.5843942",
"0.58087933",
"0.57438856",
"0.570195",
"0.5664319",
"0.56083226",
"0.5592582",
"0.5586291",
"0.5577326",
"0.556633",
"0.55291206",
"0.55216235",
"0.5519788",
"0.5518106",
"0.55145067",
"0.5512038",
"0.5508833",
"0.5498635",
"0.54916245",
"0.5486082",
"0.545604",
"0.54519534",
"0.5443441",
"0.5424388",
"0.54196936",
"0.54121697",
"0.54118145",
"0.54078674",
"0.5400995",
"0.53908134",
"0.5390423",
"0.53848755",
"0.53795683",
"0.53767955",
"0.53767526",
"0.5365967",
"0.53653276",
"0.53596556",
"0.5355576",
"0.53522456",
"0.53446394",
"0.5341351",
"0.5339615",
"0.5330513",
"0.53272504",
"0.53232735",
"0.5315543",
"0.5311476",
"0.53110516",
"0.53103006",
"0.5301048",
"0.52947134",
"0.5294522",
"0.5290376",
"0.52855545",
"0.52843726",
"0.5282814",
"0.52817255",
"0.5276044",
"0.5274668",
"0.527031",
"0.5266692",
"0.52643245",
"0.52610916",
"0.5256394",
"0.5252926",
"0.52501124",
"0.5248031",
"0.5247062",
"0.5246218",
"0.5244254",
"0.52439535",
"0.5243282",
"0.5238089",
"0.5235986",
"0.5232906",
"0.5230295",
"0.5222989",
"0.52221394",
"0.52190965",
"0.52186906",
"0.52161974",
"0.5213698",
"0.52131486",
"0.5211743",
"0.52109975",
"0.5207967",
"0.5197923",
"0.51953435",
"0.519179",
"0.5190492",
"0.5189712",
"0.51894546",
"0.5187747",
"0.5184162",
"0.51812047",
"0.51760775",
"0.51737064",
"0.5170295"
] | 0.0 | -1 |
this method operates in almost the reverse of setBit(). fist, we create a number like 1110 1111 by creating the reverse of it (0001 0000) and negating it. then, we perform an AND with num. this will clear the ith bit and leave the remainder unchanged. | public static int clearBit(int num, int i) {
int mask = ~(1 << i);
return num & mask;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static int clearBit(int num, int pos) {\n\t\t\tint mask = ~(1<<pos);\n\t\t\treturn num & mask;\n\t\t}",
"static int toggleBit(int n){\n return n & (n-1);\n }",
"static int isolateBit(int n){\n return n & (-n);\n }",
"private static void isSetOrUnset(long num, int pos) {\n\t\tlong temp = 1l << pos;\n\t\tlong result = num & temp;\n\t\tif (temp == result) {\n\t\t\tSystem.out.println(\"Bit is set\");\n\t\t} else {\n\t\t\tSystem.out.println(\"Bit is unset\");\n\t\t}\n\t}",
"public int updateBit(int i,int j, boolean set){\n int value=(set)?1:0;\n int mask=~(1<<j);\n int clear=mask&i;\n return clear|(1<<value);\n\n}",
"static int setBit(int num, int pos) {\n\t\t\treturn num | (1<<pos);\n\t\t}",
"public void toggle()\n\t{\n\t\tbitHolder.setValue(Math.abs(bitHolder.getValue() - 1 ));\n\t\t\n\t}",
"static int toggleBit(int n, int pos){\n return n ^ (1<<pos);\n }",
"public static int cleanBitsIthrough0(int num, int i) {\n int mask = (-1 << (i + 1));\n return num & mask;\n }",
"public int clearBit(int i,int j){\n int mask=~(1<<j);\n return i&mask;\n }",
"private static int mask(int bit) {\n return MSB >>> bit;\n }",
"int xnor(int num1, int num2)\n {\n return ~((num1 | num2) & ~(num1 & num2));\n }",
"static int clearMSBtoI(int num, int pos) {\n\t\t\tint mask = (1<<pos) - 1;\n\t\t\treturn num & mask;\n\t\t}",
"public int findComplement(int num) {\n for (int i = Integer.SIZE - 1; i >= 0; i--) {\n if ((num >>> i & 1) == 1) {\n int move = Integer.SIZE - 1 - i;\n return (~(num << move)) >>> move;\n }\n }\n return 1;\n }",
"public UnmodifiableBitSet setBit(int i){\n\t\tUnmodifiableBitSet nbs = (UnmodifiableBitSet)this.clone();\n\t\tnbs.setBitInn(i);\n\t\treturn nbs;\n\t}",
"public static int _clearBit(final int originalInt,final int bitIndex) {\n return originalInt & ~_getMask(bitIndex);\n }",
"public static int cleanBitsMSBthroughI(int num, int i) {\n int mask = (1 << i) - 1;\n return num & mask;\n }",
"static int setBit(int n, int pos){\n return n | (1<<pos);\n }",
"public static int clearBitsUpToMS(int n, int i) {\n return n & (1<<i)-1;\n }",
"void setBit(int index, int value);",
"private static void toggle(long num, int pos) {\n\t\tlong temp = 1l << pos;\n\t\tlong result = num ^ temp;\n\t\tSystem.out.println(result);\n\t}",
"void invertAllBits();",
"public static int flipBit(int value, int bitIndex) {\n\n// value = value ^ (1<<(bitIndex-1));\n\n return value ^ (1<<(bitIndex-1)); // put your implementation here\n }",
"public static int clearBitsUpToLS(int n, int i) {\n return n & ~(-1>>(31-i));\n }",
"private int getLowTenBitNumber(int num) {\n return num & 1023;\n }",
"public bit not()\n\t{\n\t\tbit notBit = new bit();\n\t\t\n\t\tnotBit.setValue(Math.abs(bitHolder.getValue() - 1));\n\t\t\n\t\treturn notBit;\n\t}",
"protected long setBit(long word, boolean flag, long position) {\n\t\tif (!flag) {\n\t\t\treturn word & (~(1L << position));\n\t\t}\n\t\treturn word | (1L << position);\n\t}",
"private int setNibble(int num, int data, int which, int bitsToReplace) {\n return (num & ~(bitsToReplace << (which * 4)) | (data << (which * 4)));\n }",
"public void flip(int bitIndex);",
"private static int toggle(int bitVector, int index) {\n\t\tif(index < 0)\n\t\t\treturn bitVector;\n\t\t\n\t\tint mask = 1 << index;\n\t\tif((bitVector & mask) == 0) {\n\t\t\tbitVector |= mask;\n\t\t}else {\n\t\t\tbitVector &= ~mask;\n\t\t}\n\t\t\n\t\treturn bitVector;\n\t}",
"public void clearFlag( int flag )\n {\n value &= ~( 1 << ( MAX_SIZE - 1 - flag ) );\n }",
"public void flipper(int bit)\n\t{\n\t\tif (binaryCode[bit])\n\t\t{\n\t\t\t//if value is true, it becomes false\n\t\t\tbinaryCode[bit]=false;\n\n\t\t} else {\n\t\t\t\n\t\t\t//if value is false, it becomes true\n\t\t\tbinaryCode[bit]=true;\n\t\t}\n\t}",
"int bitRange(int num, int s, int n)\n {\n return (num >> s) & ~(-1 << n);\n }",
"public int setBit(int i, int j){\n return (i|(1<<j));\n }",
"public void resetZero() {\n\t\tset((byte) (get() & ~(1 << 7)));\n\t}",
"public BitSet makeMod(){\n\t\tBitSet bs = new BitSet(this.length());\n\t\tbs.or(this);\n\t\treturn bs;\n\t}",
"private long mask(int n) {\n\t\treturn 1L << n;\n\t}",
"protected void clearBitAt(final int bitIndex) {\n _bitMap = _clearBit(_bitMap,\n \t\t\t\t\t(Numbers.INTEGER_WIDTH*8-1)-bitIndex-1);\n }",
"public void set()\n\t{\n\t\tbitHolder.setValue(1);\n\t}",
"void setCollideBits (long bits);",
"public void resetSubtraction() {\n\t\tset((byte) (get() & ~(1 << 6)));\n\t}",
"public void andNot(BitSet set){\n for(int i=Math.min(wordsInUse,set.wordsInUse)-1;i>=0;i--)\n words[i]&=~set.words[i];\n recalculateWordsInUse();\n checkInvariants();\n }",
"public void clear()\n\t{\n\t\tbitHolder.setValue(0);\n\t}",
"private static int setKthBit(int num,int k){\n int p=0;\n int m =1;\n while(p<k){\n p++;\n m =m<<1;\n }\n return num|m;\n }",
"public void \nsetFlag( int pFlagNumber, boolean pYesNo ) {\n if (pYesNo)\n fFlagBox = fFlagBox | (1 << pFlagNumber); \n else\n fFlagBox = fFlagBox & (~(1 << pFlagNumber));\n}",
"boolean bitSet(int p, int b) // check if int p bit b is 1\n {\n return ((p>>b) & 1)>0;\n }",
"public void and(FormatableBitSet otherBit)\n \t{\n \t\tif (otherBit == null) {\n \t\t\tclear();\n \t\t\treturn;\n \t\t}\n \t\tint otherLength = otherBit.getLength();\n \n \t\tif (otherLength > getLength()) {\n \t\t\tgrow(otherLength);\n \t\t}\n \n \t\t// Since this bitset is at least as large as the other bitset,\n \t\t// one can use the length of the other bitset in the iteration\n \t\tint byteLength = otherBit.getLengthInBytes();\n \t\tint i = 0;\n \t\tfor (; i < byteLength; ++i) {\n \t\t\tvalue[i] &= otherBit.value[i];\n \t\t}\n \n \t\t// If the other bitset is shorter the excess bytes in this\n \t\t// bitset must be cleared\n \t\tbyteLength = getLengthInBytes();\n \t\tfor (; i < byteLength; ++i) {\n \t\t\tvalue[i] = 0;\n \t\t}\n \t\tif (SanityManager.DEBUG) {\n \t\t\tSanityManager.ASSERT(invariantHolds(),\"and() broke invariant\");\n \t\t}\n \t}",
"public static int setFlag(final int intValue, Bits bit, final boolean condition) {\n if (condition) {\n return intValue | bit.getMask();\n } else {\n return intValue & ~bit.getMask();\n }\n }",
"public static byte set(byte value, int bit){\n return (byte)(value|(1<<bit));\n }",
"public static byte setBit(byte input, int position, boolean val){\n return val? (byte) (input | (1 << position)):(byte) (input & ~(1 << position));\n }",
"public void xor(FormatableBitSet otherBit)\n \t{\n \t\tif (otherBit == null) {\n \t\t\treturn;\n \t\t}\n \t\tint otherLength = otherBit.getLength();\n \t\tif (otherLength > getLength()) {\n \t\t\tgrow(otherLength);\n \t\t}\n \n \t\tint obByteLen = otherBit.getLengthInBytes();\n \t\tfor (int i = 0; i < obByteLen; ++i) {\n \t\t\tvalue[i] ^= otherBit.value[i];\n \t\t}\n \t\tif (SanityManager.DEBUG) {\n \t\t\tSanityManager.ASSERT(invariantHolds(),\"xor() broke invariant\");\n \t\t}\n \t}",
"public void clearBits()\r\n {\r\n clear();\r\n }",
"public static int sign(int num) {\n\t\treturn (num >> 31) & 1;\n\t}",
"private static int setBit(int ci, int bo, int newBit) {\n int clearMask = ~(1 << bo);\n int ciWithBitCleared = ci & clearMask;\n int bitMask = newBit << bo;\n int xiWithNewBitSet = ciWithBitCleared | bitMask;\n return xiWithNewBitSet;\n }",
"private static void invertBitAt(final int index, final String byte_, final StringBuilder builder)\n\t{\n\t\tif(byte_.charAt(index) == BIT_ONE)\n\t\t\tbuilder.setCharAt(index, BIT_ZERO);\n\t\telse if(byte_.charAt(index) == BIT_ZERO)\n\t\t\tbuilder.setCharAt(index, BIT_ONE);\n\t}",
"public static String toHex(int num) {\n if(num==0) return \"0\";\n StringBuilder sb=new StringBuilder();\n while(num!=0){\n sb.append(intToHex(num&15));\n num >>>= 4; //Its not >> but >>>. >> will copy the sign bit. 10000 will become 11000 with >>, and 01000 with >>>.\n } //>> is called arithmetic shift. >>> is logical shift.\n return sb.reverse().toString();\n }",
"static boolean getBit(int num, int pos) {\n\t\t\treturn ((num & (1<<pos)) != 0) ;\n\t\t}",
"public void setBitToZero(int k) {\n if (this.inBitRange(k)) {\n int i = k / 8;\n int j = k % 8;\n int b = this.data.get(i);\n int c = ~(1 << (7 - j));\n b = b & c;\n byte d = (byte) b;\n this.data.set(i, d);\n }\n }",
"void setBit(int index, boolean value);",
"private static int setBits(int n) {\r\n int highestBitValue = 1;\r\n int c = 0;\r\n\r\n while (highestBitValue < n) {\r\n highestBitValue = highestBitValue * 2;\r\n }\r\n\r\n \r\n int currentBitValue = highestBitValue;\r\n while (currentBitValue > 0) {\r\n if (currentBitValue <= n) {\r\n\r\n n -= currentBitValue;\r\n c++;\r\n }\r\n currentBitValue = currentBitValue / 2;\r\n }\r\n\r\n return c;\r\n }",
"public void setZero() {\n\t\tset((byte) (get() | (1 << 7)));\n\t}",
"public Object visitBitwiseNegationExpression(GNode n) {\n Object a, result;\n \n nonboolean = true;\n \n dostring = true;\n \n a = dispatch(n.getGeneric(0));\n \n dostring = false;\n \n if (a instanceof Long) {\n result = ~ (Long) a;\n }\n else {\n return \"~ \" + parens(a);\n }\n \n return result;\n }",
"public static int setBit(final int intValue, final Bits bit) {\n return setFlag(intValue, bit, true);\n }",
"int setShort(int num, int a_short, int which)\n {\n return ((num & (0b1111111111111111 << ((~which) << 4))) | (a_short << (which << 4)));\n }",
"public void setFlagBin(int n) {\n flagBin=Translate.decTobinN(n, 4);\n }",
"private EfficientTerminalSet setBit(int index, boolean value) {\n int[] newData = data.clone();\n int blockIndex = index / 32;\n int bitIndex = index % 32;\n if (value)\n newData[blockIndex] |= 1 << bitIndex;\n else\n newData[blockIndex] &= ~(1 << bitIndex);\n return new EfficientTerminalSet(terminals, indices, newData);\n }",
"public static int _setBit(final int originalInt,final int bitIndex) {\n return originalInt | _getMask(bitIndex);\n }",
"public Builder clearField1111() {\n \n field1111_ = getDefaultInstance().getField1111();\n onChanged();\n return this;\n }",
"protected void setBit(long bitIndex) {\r\n\t long intIndex = (bitIndex >>> ADDRESS_BITS_PER_UNIT);\r\n\t bits[(int)(intIndex / ONE_MB_INTS)][(int)(intIndex % ONE_MB_INTS)] \r\n\t |= 1 << (bitIndex & BIT_INDEX_MASK);\r\n\t }",
"public int reverseBits(int n) {\n int answer = 0;\n for(int i =0;i<31;i++){\n answer |= (n&1);\n answer = answer<<1;\n n = n>>1;\n }\n answer |= (n&1);\n return answer;\n }",
"static void getIndexSetBits(int[] setBits, long board) {\n\t\tint onBits = 0;\n\t\twhile (board != 0) {\n\t\t\tsetBits[onBits] = Long.numberOfTrailingZeros(board);\n\t\t\tboard ^= (1L << setBits[onBits++]);\n\t\t}\n\t\tsetBits[onBits] = -1;\n\t}",
"private static int invertirNumero(int num) {\n\t\tint cifra, inverso = 0;\n\t\twhile (num > 0) {\n\t\t\tcifra = num % 10;\n\t\t\tinverso = cifra + inverso * 10;\n\t\t\tnum /= 10;\n\t\t}\n\t\treturn inverso;\n\t}",
"public void clearFlag( int flag )\n {\n value &= ~( 1 << flag );\n clearBit( flag );\n }",
"protected final void operationBIT(final int data) {\r\n this.signFlag = data >= 0x80;\r\n this.overflowFlag = (data & 0x40) > 0;\r\n this.zeroFlag = (this.ac & data) == 0;\r\n }",
"public int updateBits(int n, int m, int i, int j) {\n int clearMask = 0;\n if(j < 31){\n int allones = ~0;\n int left = allones << (j+1);\n int right = (1 << i) -1;\n clearMask = left | right;\n }else{\n clearMask = (1 << i)-1;\n }\n \n int clearedn = clearMask&n;\n int longerM = m << i;\n return clearedn | longerM;\n }",
"private static void create(int num1, int num2) {\n\t\tlong result = (~(~0<<num1)) << num2;\n\t\tSystem.out.println(result);\n\t}",
"public static long setBit(long value, int pos) {\n pos--;\n return value | (1L << pos);\n\n }",
"protected void setAll() {\n for (int i=0; i <= (Numbers.INTEGER_WIDTH*8-2); i++) {\n \tthis.setBitAt(i);\n } \t\n }",
"public static int missingNumberBitManipulation(int[] nums) {\n if (nums == null || nums.length == 0) return -1;\n\n int missing = nums.length;\n for (int i = 0; i < nums.length; i++) {\n missing ^= i ^ nums[i];\n }\n return missing;\n }",
"public int reverseBits(int n) {\n int rev = 0;\n for(int i = 0; i<32; i++){\n rev = rev << 1;//creating a space of 1 in reverse\n rev = rev | (n & 1);// (n & 1 will give the last bit)\n // | operator will help in entering the last bit into rev\n n = n >> 1;// delete the last bit\n } \n return rev;\n }",
"public void setInverted(boolean inv) {\n/* 69 */ int dat = getData() & 0x7;\n/* 70 */ if (inv) {\n/* 71 */ dat |= 0x8;\n/* */ }\n/* 73 */ setData((byte)dat);\n/* */ }",
"public int rangeBitwiseAnd2(int m, int n) {\n if (m == n){\n return m;\n }\n //The highest bit of 1 in diff is the highest changed bit.\n int diff = m ^ n;\n //Index is the index of the highest changed bit. Starting at 1.\n int index = (int)(Math.log(diff) / Math.log(2)) + 1;\n //Eliminate the changed part.\n m = m & (0xffffffff<<index);\n return m;\n }",
"public int reverseBits(int n) {\n\n return 1;\n }",
"public Builder clearField1101() {\n \n field1101_ = getDefaultInstance().getField1101();\n onChanged();\n return this;\n }",
"static boolean boolFrBit(int input){\n return input!=0;\n }",
"public final void negate() {\n \n \tthis.m00 = -this.m00;\n \tthis.m01 = -this.m01;\n \tthis.m02 = -this.m02;\n this.m10 = -this.m10;\n this.m11 = -this.m11;\n this.m12 = -this.m12;\n this.m20 = -this.m20;\n this.m21 = -this.m21;\n this.m22 = -this.m22;\n }",
"public FormatableBitSet(int numBits)\n \t{\n \t\tinitializeBits(numBits);\n \t}",
"@Test\n public void encodeAsBitSetNegative()\n {\n final int value = -5;\n final BinaryEncoder encoder = new BinaryEncoder(-8, 8, 1.0);\n\n final BitSet result = encoder.encodeAsBitSet(value);\n\n if (IS_VERBOSE)\n {\n System.out.println(\"result = \" + result);\n }\n assertNotNull(result);\n\n assertTrue(result.get(0));\n assertTrue(result.get(1));\n assertFalse(result.get(2));\n assertFalse(result.get(3));\n }",
"public static byte unsetEighthBit(byte b) {\r\n\t\treturn andBits(b, MASK_WITH_FIRST_SEVEN_BITS_SET);\r\n\t}",
"int getNibble(int num, int which)\n {\n return 0b1111 & num >> (which << 2);\n }",
"public int reverseBits(int n) {\n /*\n StringBuilder ans = new StringBuilder();\n for(int i=0; i<32; i++)\n {\n int temp = n&1;\n ans.append(temp);\n n = n>>>1;\n }\n return Integer.parseInt(ans.toString(), 2);\n */\n \n int result = 0;\n for(int i=0; i<32; i++){\n result <<= 1;\n result += n&1;\n n >>>= 1;\n }\n \n return result;\n \n }",
"public void setBitField(BitField bitField){\n \tthis.bitField=bitField;\n }",
"boolean multipleOf2(int num)\n {\n return (num & 0b1) != 1;\n }",
"protected void setBitAt(final int bitIndex) {\n _bitMap = _setBit(_bitMap,\n \t\t\t\t (Numbers.INTEGER_WIDTH*8-1)-bitIndex-1);\n }",
"public bit xor(bit other)\n\t{\n\t\tbit xorBit = new bit();\n\t\t\n\t\tif(bitHolder.getValue() == other.getValue())\n\t\t{\n\t\t\txorBit.setValue(0);\n\t\t}else\n\t\t{\n\t\t\txorBit.setValue(1);\n\t\t}\n\t\t\n\t\treturn xorBit;\n\t}",
"public Builder clearField1011() {\n \n field1011_ = getDefaultInstance().getField1011();\n onChanged();\n return this;\n }",
"protected void clearAll() {\n for (int i=0; i <= (Numbers.INTEGER_WIDTH*8-2); i++) {\n \tthis.clearBitAt(i);\n } \t\n }",
"public static byte setSpecifiedBitToReverse(byte originByte, int bitIndex) {\n return originByte ^= (1 << bitIndex);\n }",
"public Builder clearNumb() {\n bitField0_ = (bitField0_ & ~0x00000002);\n numb_ = getDefaultInstance().getNumb();\n onChanged();\n return this;\n }",
"public static int flipBits(int a) {\n if(~a == 0)\n return Integer.SIZE;\n int maxlen=0, currlen=0, prevlen=0;\n\n while(a != 0) {\n if((a&1) == 1) {\n currlen++;\n } else if((a&1) == 0) {\n prevlen = (a&2) == 0 ? 0 : currlen;\n currlen=0;\n }\n maxlen = Math.max(currlen + prevlen + 1, maxlen);\n a >>>= 1;\n }\n return maxlen;\n }"
] | [
"0.68853724",
"0.67471313",
"0.6458302",
"0.6208582",
"0.6174647",
"0.60953796",
"0.602252",
"0.60190934",
"0.5978996",
"0.59640056",
"0.5926268",
"0.5909219",
"0.5875727",
"0.58350456",
"0.583422",
"0.5793214",
"0.5662562",
"0.56421",
"0.5607909",
"0.5590471",
"0.55884284",
"0.5582924",
"0.55757797",
"0.55688566",
"0.5564449",
"0.5529841",
"0.5469347",
"0.5464239",
"0.54495794",
"0.54339916",
"0.5416096",
"0.5406392",
"0.5405667",
"0.5391502",
"0.53739375",
"0.53364414",
"0.53038925",
"0.5300129",
"0.5248151",
"0.5238783",
"0.5232935",
"0.5225901",
"0.5201344",
"0.5196951",
"0.5183864",
"0.51689273",
"0.5167948",
"0.51611036",
"0.51572895",
"0.51426435",
"0.5141841",
"0.5133793",
"0.5132102",
"0.5128827",
"0.51215386",
"0.51176107",
"0.5113542",
"0.5113292",
"0.5107075",
"0.510059",
"0.5080947",
"0.50750256",
"0.5073854",
"0.50604796",
"0.5049774",
"0.50389636",
"0.5036845",
"0.50251496",
"0.50189686",
"0.50171494",
"0.500926",
"0.5007009",
"0.5002615",
"0.4985962",
"0.49807236",
"0.4973662",
"0.49711284",
"0.49616838",
"0.49554688",
"0.4952451",
"0.4947592",
"0.49418452",
"0.4940755",
"0.49395826",
"0.49389377",
"0.49210522",
"0.49167678",
"0.49157134",
"0.49081486",
"0.4907132",
"0.4888163",
"0.48703435",
"0.48670307",
"0.4857984",
"0.48505294",
"0.4849954",
"0.48493457",
"0.48378772",
"0.48370612",
"0.4836149"
] | 0.7137553 | 0 |
the most significant bit(MSB) is sometimes referred to as the leftmost bit due to the convention in positional notation of writing more significant digits further to the left the least significant bit (LSB) is sometimes referred to as the rightmost bit, due to the convention in positional notation of writing less significant digits further to the right to clear all bits from the most significant bit through i (inclusive), we create a mask with a 1 at the ith bit (1 << i). then, we subtract 1 from it, giving us a sequence of 0s followed by i 1s. we then AND our number with this mask to leave just the last i bits. | public static int cleanBitsMSBthroughI(int num, int i) {
int mask = (1 << i) - 1;
return num & mask;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static int clearBitsUpToLS(int n, int i) {\n return n & ~(-1>>(31-i));\n }",
"public static int clearBitsUpToMS(int n, int i) {\n return n & (1<<i)-1;\n }",
"public static int cleanBitsIthrough0(int num, int i) {\n int mask = (-1 << (i + 1));\n return num & mask;\n }",
"public static int clearBit(int num, int i) {\n int mask = ~(1 << i);\n return num & mask;\n }",
"static int clearMSBtoI(int num, int pos) {\n\t\t\tint mask = (1<<pos) - 1;\n\t\t\treturn num & mask;\n\t\t}",
"private long mask(int n) {\n\t\treturn 1L << n;\n\t}",
"private static int mask(int bit) {\n return MSB >>> bit;\n }",
"static int toggleBit(int n){\n return n & (n-1);\n }",
"public static int updateBits(int n, int m, int i, int j) {\n\t\tint allOnes = ~0;\r\n\t\tSystem.out.println(\"allOnes: \" +AssortedMethods.toFullBinaryString( allOnes));\r\n\t\t//shift left allOnes j+1 times make all ones from j+1 to the end\r\n\t\t// if the time shift equals 32 result will be 32 bits 0s;\r\n\t\tint left = j < 31 ? allOnes << (j + 1) : 0;\r\n\t\tSystem.out.println(\"left: \" + AssortedMethods.toFullBinaryString(left));\r\n\t\t// shift 1 i times left make 1000000000, then minus 1 make first bit to i-1 bit to be 1111111;\r\n\t\tint right = ((1 << i) - 1);\r\n\t\tSystem.out.println(\"right: \" + AssortedMethods.toFullBinaryString(right));\r\n\t\t// combine left and right to be 1111110000000111111111\r\n\t\tint mask = left | right;\r\n\t\tSystem.out.println(\"mask: \" + AssortedMethods.toFullBinaryString(mask));\r\n\t\t// make int n from i to j to be 0s by and then together to make the mask\r\n\t\tint nWith0s = n & mask;\r\n\t\tSystem.out.println(\"nWith0s: \" + AssortedMethods.toFullBinaryString(nWith0s));\t\r\n\t\t// left shift m j times to make it match with the j to i empty position\r\n\t\tint mShifted = m << i;\r\n\t\tSystem.out.println(\"mShifted: \" + AssortedMethods.toFullBinaryString(mShifted));\r\n\t\t// insert m into n by or them together\r\n\t\treturn mShifted | nWith0s;\r\n\t}",
"public int updateBit(int i,int j, boolean set){\n int value=(set)?1:0;\n int mask=~(1<<j);\n int clear=mask&i;\n return clear|(1<<value);\n\n}",
"public static long lowestOneBit(long i) {\r\n // HD, Section 2-1\r\n return i & -i;\r\n }",
"private static int makeMask(int n) throws IllegalArgumentException {\n\t\tCheck.arg().notNegative(n);\n\t\tif (n > 32) throw new IllegalArgumentException(\"n = \" + n + \" > 32\");\n\t\t\n\t\tif (n == 32) return ~0;\t// ~0 is thirty two 1's in binary\n\t\t\t/*\n\t\t\tThe n = 32 special case must be detected for two reasons, one obvious and one subtle.\n\t\t\t\n\t\t\tThe obvious reason is that any int that is left shifted by 32 or more ought to pushed into a long value which is impossible, so you know something weird must happen.\n\t\t\t\n\t\t\tThe subtle reason is the details of how Java's shift operators (<<, >>, >>>) work:\n\t\t\tthey only use the 5 lower bits of the right side operand (i.e. shift amount).\n\t\t\t(This statement assumes that the left hand operand is an int; if it is a long, then the lower 6 bits are used.)\n\t\t\tTHIS MEANS THAT THEY ONLY DO WHAT YOU THINK THEY WILL WHEN THE SHIFT AMOUNT IS INSIDE THE RANGE [0, 31].\n\t\t\tSo, in the code above, 1 << n when n = 32 evaluates to 1 << 0 (because 32 has 0 in its lower 5 bits)\n\t\t\tso the overall expression is then (1 << 0) - 1 == 1 - 1 == 0 which is a wrong result.\n\t\t\t\n\t\t\tThis \"use only the lower shift bits\" behavior is why this code (also suggested by Sean Anderson)\n\t\t\t\treturn (~0) >>> (32 - n);\n\t\t\tcannot be used: it fails at n = 0 (returning thirty two ones instead of 0).\n\t\t\t\n\t\t\tReferences:\n\t\t\t\thttp://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6201273\n\t\t\t\thttp://www.davidflanagan.com/blog/000021.html\n\t\t\t\thttp://java.sun.com/docs/books/jls/third_edition/html/expressions.html#15.19\n\t\t\t*/\n\t\t\n\t\treturn (1 << n) - 1;\t// acknowledgement: this technique sent to me by Sean Anderson, author of http://graphics.stanford.edu/~seander/bithacks.html\n\t}",
"static int isolateBit(int n){\n return n & (-n);\n }",
"public int reverseBits(int n) {\n int rev = 0;\n for(int i = 0; i<32; i++){\n rev = rev << 1;//creating a space of 1 in reverse\n rev = rev | (n & 1);// (n & 1 will give the last bit)\n // | operator will help in entering the last bit into rev\n n = n >> 1;// delete the last bit\n } \n return rev;\n }",
"public static int flipBits(int a) {\n if(~a == 0)\n return Integer.SIZE;\n int maxlen=0, currlen=0, prevlen=0;\n\n while(a != 0) {\n if((a&1) == 1) {\n currlen++;\n } else if((a&1) == 0) {\n prevlen = (a&2) == 0 ? 0 : currlen;\n currlen=0;\n }\n maxlen = Math.max(currlen + prevlen + 1, maxlen);\n a >>>= 1;\n }\n return maxlen;\n }",
"private static int setBits(int n) {\r\n int highestBitValue = 1;\r\n int c = 0;\r\n\r\n while (highestBitValue < n) {\r\n highestBitValue = highestBitValue * 2;\r\n }\r\n\r\n \r\n int currentBitValue = highestBitValue;\r\n while (currentBitValue > 0) {\r\n if (currentBitValue <= n) {\r\n\r\n n -= currentBitValue;\r\n c++;\r\n }\r\n currentBitValue = currentBitValue / 2;\r\n }\r\n\r\n return c;\r\n }",
"public int reverseBits(int n) {\n \n if(n == 0){\n return 0;\n }\n \n int result = 0;\n \n for(int i=0;i<32;i++){\n \n result = result + (n & 1);// take the last bit from n and also add to result,note:for result we already added a dummy zero at the last so as to perform an add operation\n \n n = n >> 1;// now shift right 1 bit for the next iteration\n \n if(i<31){// need to shift only 31 because we need add a left dummy zero for the last bit\n \n result = (result << 1);// move to the right and add a zero at last so that in next iteration we can add a bit to that last place\n }\n \n \n }\n return result; \n }",
"public int reverseBits(int n) {\n // 001011 -> 110100\n // get bits from right to left\n // use & and mask 1 to keep the right most bit\n // 001001 & 000001 -> 000001\n \n // unsigned integer has 32 bits \n int res = 0;\n for (int i = 0; i < 32; i++) {\n // must shift res first otherwise we will lose the first bit\n res <<= 1;\n res = res + (n & 1);\n n >>= 1;\n }\n \n return res;\n }",
"public int reverseBits(int n) {\n int answer = 0;\n for(int i =0;i<31;i++){\n answer |= (n&1);\n answer = answer<<1;\n n = n>>1;\n }\n answer |= (n&1);\n return answer;\n }",
"public int updateBits(int n, int m, int i, int j) {\n int clearMask = 0;\n if(j < 31){\n int allones = ~0;\n int left = allones << (j+1);\n int right = (1 << i) -1;\n clearMask = left | right;\n }else{\n clearMask = (1 << i)-1;\n }\n \n int clearedn = clearMask&n;\n int longerM = m << i;\n return clearedn | longerM;\n }",
"public int bitAt(int i) {\n // PUT YOUR CODE HERE\n }",
"static void getIndexSetBits(int[] setBits, long board) {\n\t\tint onBits = 0;\n\t\twhile (board != 0) {\n\t\t\tsetBits[onBits] = Long.numberOfTrailingZeros(board);\n\t\t\tboard ^= (1L << setBits[onBits++]);\n\t\t}\n\t\tsetBits[onBits] = -1;\n\t}",
"private int m10275g(int i) {\r\n return (i >>> 1) ^ (-(i & 1));\r\n }",
"static int toggleBit(int n, int pos){\n return n ^ (1<<pos);\n }",
"private static int getMaskAsInt(int nrBits) {\n return 0xFFFFFFFF >>> (32 - nrBits);\n }",
"public int reverseBits(int n) {\n\n int reverseBits = 0;\n for (int i = 0; i < 32; i++) {\n // Left shift by 1 position\n reverseBits <<= 1;\n if ((n & 1) == 1) {\n reverseBits |= 1; // Set the least significant bit to 1\n }\n n >>= 1; // Right shift by 1 position\n }\n return reverseBits;\n }",
"public static int reverseBits(int n) {\n\n int res = 0;\n for (int i = 1; i <= 32; i++){\n //结果往左移一位,来空出以为放原数字的最后一位。此时res最后一位为0\n res <<= 1;\n //n&1得到n二进制位的最后一位,通过与res最后一位0进行或运算,放入到res中\n res |= n&1;\n //n向右移动一位,即丢弃已经存入res中的二进制位\n n >>= 1;\n }\n return res;\n }",
"public int clearBit(int i,int j){\n int mask=~(1<<j);\n return i&mask;\n }",
"public int anySetBit()\n \t{\n \t\tint numbytes = getLengthInBytes();\n \t\tint bitpos;\n \n \t\tfor (int i = 0; i < numbytes-1; i++)\n \t\t{\n \t\t\tif (value[i] != 0)\n \t\t\t{\n \t\t\t\tfor (int j = 0; j < 8; j++)\n \t\t\t\t{\n \t\t\t\t\tbitpos = 7-j;\n \t\t\t\t\tif (((1 << bitpos) & value[i]) != 0)\n \t\t\t\t\t\treturn ((i*8)+j);\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \n \n \t\t// only the top part of the last byte is relevant\n \t\tbyte mask = (byte)(0xFF << (8-bitsInLastByte));\n \t\tif ((value[numbytes-1] & mask) != 0)\n \t\t{\n \t\t\tfor (int j = 0; j < bitsInLastByte; j++)\n \t\t\t{\n \t\t\t\tbitpos = 7-j;\n \t\t\t\tif (((1 << bitpos) & value[numbytes-1]) != 0)\n \t\t\t\t\treturn ((numbytes-1)*8)+j;\n \t\t\t}\n \t\t}\n \n \t\treturn -1;\n \t}",
"void crossOut(int i) {\n if(i % 2 == 0){\n return;\n }\n\n int bitIndex = (i-1) / 2;\n int arrayIndex = bitIndex / 8; //bitArr[arrayIndex] - Where the number is stored\n bitIndex = bitIndex % 8; //which bit in bitArr[arrayIndex] corresponds to the number\n\n bitArr[arrayIndex] = (byte) (bitArr[arrayIndex] & bitMask2[bitIndex]); //Uses the correct mask over the array index to single out our value.\n }",
"public int reverseBits(int n) {\n int ans = 0;\n for(int i = 0; i < 32; i++){\n ans <<= 1;\n ans += n&1;\n n >>= 1;\n }\n return ans;\n }",
"IntExpression explicitMask(Expression p) {\n\t\treturn ones.shl(implicitMask(p));\n\t}",
"public int reverseBits(int n) {\n\n return 1;\n }",
"void set(int i, int val) {\n int numPosition = i / MAX_BITS;\n int intPosition = i % MAX_BITS;\n\n if (val == 1)\n values[numPosition] |= (1 << intPosition);\n else\n values[numPosition] = values[numPosition]&~(1 << intPosition);\n }",
"private static void testShift() {\n for (int a:new int[]{96754441, -206107026, 803362655, Integer.MIN_VALUE+1}) {\n System.out.println(\"<<\");\n for (int i=0;i<=32;i++) {\n System.out.println(intToBin(a<<i) + \" \" + (a<<i));\n }\n System.out.println();\n System.out.println(\">>\");\n for (int i=0;i<=32;i++) {\n System.out.println(intToBin(a>>i) + \" \" + (a>>i));\n }\n System.out.println();\n System.out.println(\">>>\");\n for (int i=0;i<=32;i++) {\n System.out.println(intToBin(a>>>i) + \" \" + (a>>>i));\n }\n System.out.println();\n }\n }",
"public static int getBitMask(int x) {\n return (0x01 << x);\n }",
"public static int updateBits(int n, int m, int i, int j){\n\n\t\t// all '1's\n\t\tint max = ~0;\n\n\t\t// left with '1'\n\t\tint left = max - ((1<<j) -1);\n\n\t\t// right with '1'\n\t\tint right = ((1<<i) - 1);\n\n\t\t// left with '1', middle '0', and right '1'\n\t\tint mask = left | right;\n\n\t\t// clear up the middle\n\t\treturn (n & mask) | (m << i);\n\t}",
"public int anySetBit(int beyondBit)\n \t{\n \t\tif (SanityManager.DEBUG)\n \t\t{\n \t\t\tif (beyondBit >= this.getLength())\n SanityManager.THROWASSERT(\n \"Attempt to access bit position that exceeds the max length (\"\n + this.getLength() + \")\");\n \t\t}\n \n \t\tint startingBit = (beyondBit+1);\n \n \t\t// we have seen the last bit.\n \t\tif (startingBit >= this.getLength())\n \t\t\treturn -1;\n \n \t\tint numbytes = getLengthInBytes();\n \t\tint startingByte = startingBit / 8;\n \t\tint startingBitpos = startingBit % 8;\n \t\tint bitpos;\n \t\tbyte mask;\n \n \t\t// see if any bits in this byte is set, only the bottom part of the\n \t\t// first byte is relevant\n \t\tmask = (byte)(0xFF >> startingBitpos);\n \n \t\tif (startingByte == numbytes-1)\t// starting byte == last byte \n \t\t\tmask &= (byte)(0xFF << (8-bitsInLastByte));\n \n \t\tif ((value[startingByte] & mask ) != 0)\n \t\t{\n \t\t\t// I know we will see the bit before bitsInLastByte even if we are\n \t\t\t// at the last byte, no harm in going up to 8 in the loop\n \t\t\tfor (int j = startingBitpos; j < 8; j++)\n \t\t\t{\n \t\t\t\tif (SanityManager.DEBUG)\n \t\t\t\t{\n \t\t\t\t\tif (startingByte == numbytes-1)\n \t\t\t\t\t\tSanityManager.ASSERT(j < bitsInLastByte,\n \t\t\t\t\t\t\t\t \"going beyond the last bit\");\n \t\t\t\t}\n \t\t\t\tbitpos = 7-j;\n \t\t\t\tif (((1 << bitpos) & value[startingByte]) != 0)\n \t\t\t\t{\n \t\t\t\t\treturn (startingByte*8+j);\n \t\t\t\t}\n \t\t\t}\t\n \t\t}\n \n \t\tfor (int i = (startingByte+1); i < numbytes-1; i++)\n \t\t{\t\t\t\n \t\t\tif (value[i] != 0)\n \t\t\t{\n \t\t\t\tfor (int j = 0; j < 8; j++)\n \t\t\t\t{\n \t\t\t\t\tbitpos = 7-j;\n \t\t\t\t\tif (((1 << bitpos) & value[i]) != 0)\n \t\t\t\t\t{\n \t\t\t\t\t\treturn ((i*8)+j);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\t\n \t\t// Last byte if there are more than one bytes. Only the top part of\n \t\t// the last byte is relevant \n \t\tif (startingByte != numbytes-1)\n \t\t{\n \t\t\tmask = (byte)(0xFF << (8-bitsInLastByte));\n \n \t\t\tif ((value[numbytes-1] & mask) != 0)\n \t\t\t{\n \t\t\t\tfor (int j = 0; j < bitsInLastByte; j++)\n \t\t\t\t{\n \t\t\t\t\tbitpos = 7-j;\n \t\t\t\t\tif (((1 << bitpos) & value[numbytes-1]) != 0)\n \t\t\t\t\t{\n \t\t\t\t\t\treturn ((numbytes-1)*8)+j;\t\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \n \t\treturn -1;\n \n \t}",
"private int m10266c(int i) {\r\n return (i << 1) ^ (i >> 31);\r\n }",
"public static int flipBit(int value, int bitIndex) {\n\n// value = value ^ (1<<(bitIndex-1));\n\n return value ^ (1<<(bitIndex-1)); // put your implementation here\n }",
"public UnmodifiableBitSet setBit(int i){\n\t\tUnmodifiableBitSet nbs = (UnmodifiableBitSet)this.clone();\n\t\tnbs.setBitInn(i);\n\t\treturn nbs;\n\t}",
"private static int toggle(int bitVector, int index) {\n\t\tif(index < 0)\n\t\t\treturn bitVector;\n\t\t\n\t\tint mask = 1 << index;\n\t\tif((bitVector & mask) == 0) {\n\t\t\tbitVector |= mask;\n\t\t}else {\n\t\t\tbitVector &= ~mask;\n\t\t}\n\t\t\n\t\treturn bitVector;\n\t}",
"public int reverseBits(int n) {\n int x = 0;\n for(int i=0;i<32;i++){\n x = x<<1 | (n&1);\n n=n>>1;\n }\n return x;\n }",
"public int reverseBits(int n) {\n int i = 0;\n int tmp = 0;\n while(i<32){\n tmp <<= 1;//tmp左移,为新来元素空出位置,注意tmp刚开始为0,远远到不了32位,所以不存在溢出的情况\n tmp |= (n & 1);//将n的最低位添加到tmp,这里n&1,表示n除了最后一位表示正确值,其他位都被置为0;和tmp 与 操作\n n >>= 1;//n右移 去掉刚刚处理的最低位\n i++;\n }\n return tmp;\n }",
"public int reverseBits(int n) {\n int mask = 1;\n int result = 0;\n for (int i = 0; i < 32; i++) {\n result = result << 1;\n if ((n & mask) != 0) {\n result++;\n }\n mask = mask << 1;\n }\n return result;\n }",
"public static int getLeftMostSetBitPosition(int integer){\n\t\t\n\t\tint ret = -1 ;\n\t\tif(integer < 0){\n\t\t\treturn Integer.SIZE -1 ;\n\t\t}\n\t\t\n\t\twhile(integer > 0){\n\t\t\tret++;\n\t\t\tinteger = integer >> 1;\n\t\t}\n\t\t\n\t\treturn ret ;\n\t\t\n\t}",
"public static int updateBits(int n, int m, int i, int j) {\n int max = ~0; /* All 1’s */\n\n // 1’s through position j, then 0’s\n int left = max - ((1 << j) - 1);\n\n // 1’s after position i\n int right = ((1 << i) - 1);\n\n // 1’s, with 0s between i and j\n int mask = left | right;\n\n // Clear i through j, then put m in there\n return (n & mask) | (m << i);\n }",
"public static int getBitMask(int[] x) {\n int rc = 0;\n for(int xVal : x) {\n rc |= getBitMask(xVal);\n }\n\n return rc;\n }",
"static int clearBit(int num, int pos) {\n\t\t\tint mask = ~(1<<pos);\n\t\t\treturn num & mask;\n\t\t}",
"public int reverseBits(int n) {\n /*\n StringBuilder ans = new StringBuilder();\n for(int i=0; i<32; i++)\n {\n int temp = n&1;\n ans.append(temp);\n n = n>>>1;\n }\n return Integer.parseInt(ans.toString(), 2);\n */\n \n int result = 0;\n for(int i=0; i<32; i++){\n result <<= 1;\n result += n&1;\n n >>>= 1;\n }\n \n return result;\n \n }",
"static int setBit(int n, int pos){\n return n | (1<<pos);\n }",
"public static void main(int a) {\n// System.out.println(~43);\n int bit []=new int[8];\n for (int i = 7; i >=0;){\n\n\n\n }\n\n}",
"public int reverseBits(int n) {\n int r=0;\n for(int i=0;i<32;i++){\n \tr|=((n>>i)&1)<<(31-i);\n }\n return r;\n }",
"public static int bit(byte[] h, int i) {\n return (h[i >> 3] >> (i & 7)) & 1;\n }",
"int bitRange(int num, int s, int n)\n {\n return (num >> s) & ~(-1 << n);\n }",
"public int reverseBits(int n) {\n int res = 0;\n for (int i = 0; i < 32; i++){\n res = (res << 1) | (n & 1);\n n = (n >> 1);\n }\n\n return res;\n\n }",
"private int getLowTenBitNumber(int num) {\n return num & 1023;\n }",
"public int reverseBits(int n) {\n int a=0;\n for(int i=0;i<=31;i++){\n a=a+((1&(n>>i))<<(31-i));\n }\n return a;\n }",
"BitField getMSBs(int digits);",
"public static long highestOneBit(long i) {\r\n // HD, Figure 3-1\r\n i |= (i >> 1);\r\n i |= (i >> 2);\r\n i |= (i >> 4);\r\n i |= (i >> 8);\r\n i |= (i >> 16);\r\n i |= (i >> 32);\r\n return i - (i >>> 1);\r\n }",
"private static void m616a(int i, int[] iArr) {\n for (int i2 = 0; i2 < 9; i2++) {\n iArr[i2] = ((1 << (8 - i2)) & i) == 0 ? 0 : 1;\n }\n }",
"public static int mask(int start, int size) {\r\n // Checks that start and size form a valid bit range\r\n checkArgument(start >= 0 && start <= Integer.SIZE && size >= 0\r\n && size <= Integer.SIZE && start + size <= Integer.SIZE);\r\n\r\n // Creating a value whose binary representation has size 1s as its\r\n // LSBs (1L is used instead of 1 to bypass the int\r\n // type's bit shifting limit)\r\n int unshiftedMask = (int) (1L << size) - 1;\r\n\r\n // Shifting those 1s to the correct position\r\n return unshiftedMask << start;\r\n }",
"int get(int i) {\n int numPosition = i / MAX_BITS;\n int intPosition = i % MAX_BITS;\n long val = values[numPosition] & (1 << intPosition);\n return (int) (val >> intPosition);\n }",
"public int rangeBitwiseAnd(int m, int n) {\n\t \tint ans = 0;\n\t for (int i = 0; i < 32; ++ i) {\n \t\tif (1 == ((m >> i) & 1)) {\n \t\t\tif (((m & ~0 << (i + 1)) | (~0 >>> (31 - i))) >= n) {\n \t\t\t\tans |= 1 << i;\n \t\t\t}\n \t\t}\n\t }\n\t System.out.println(ans);\n\t return ans;\n\t }",
"public static int m7403a(int i) {\n int i2 = 0;\n while (i > 0) {\n i2++;\n i >>>= 1;\n }\n return i2;\n }",
"public int reverseBits(int n) {\n int result = 0;\n for (int i = 0; i < 32; i++) {\n if ((n & 1) == 1) {\n result = (result << 1) + 1;\n } else {\n result <<= 1;\n }\n n >>= 1;\n }\n return result;\n }",
"private static long getBitSetIndexFor(final long value) {\n return value >> RIGHT_SHIFTS_FOR_LIMIT_AS_DIVISOR;\n }",
"public void set(final int i) {\n\t\tint wordPos;\n\t\tint bitPos = 0;\n\t\tint offset;\n\n\t\tassert (i >= 0);\n\n\t\t// try simple set (append style)\n\t\tif (fastSet(i))\n\t\t\treturn;\n\n\t\t// simple set failed. Find compressed word where to set the bit\n\t\tRunningLengthWord rlw = null, prev = null, next = null;\n\n\t\tEWAHIterator iter = new EWAHIterator(this.buffer, actualsizeinwords);\n\t\twhile (iter.hasNext() && (bitPos < i || bitPos == 0)) {\n\t\t\tif (rlw != null)\n\t\t\t\tprev = new RunningLengthWord(rlw);\n\t\t\trlw = iter.next();\n\t\t\tbitPos += rlw.size() * wordinbits;\n\t\t}\n\t\tif (iter.hasNext())\n\t\t\tnext = rlw.getNext();\n\n\t\tbitPos -= rlw.size() * 64;\n\t\toffset = i - bitPos;\n\t\twordPos = rlw.position;\n\n\t\t// the bit to set is in a literal word. Try to set bit directly\n\t\tif (offset >= rlw.getRunningLength() * 64) {\n\t\t\toffset -= rlw.getRunningLength() * 64;\n\t\t\tint literalPos = (offset / 64);\n\t\t\twordPos += literalPos + 1;\n\t\t\tfinal long newdata = 1l << (offset % 64);\n\t\t\tthis.buffer[wordPos] = this.buffer[wordPos] | newdata;\n\t\t\t// if all bits of literal set, then either merge with run length\n\t\t\t// or create new RLW.\n\t\t\tif (this.buffer[wordPos] == oneMask) {\n\t\t\t\t// first literal of current RLW and running bit is set\n\t\t\t\t// increase count by one (unless maximal count reached)\n\t\t\t\tif (literalPos == 0\n\t\t\t\t\t\t&& (rlw.getRunningBit() || rlw.getRunningLength() == 0)\n\t\t\t\t\t\t&& rlw.getRunningLength() < RunningLengthWord.largestrunninglengthcount) {\n\t\t\t\t\trlw.setRunningBit(true);\n\t\t\t\t\trlw.setRunningLength(rlw.getRunningLength() + 1);\n\t\t\t\t\trlw.setNumberOfLiteralWords(rlw.getNumberOfLiteralWords() - 1);\n\t\t\t\t\t// current RLW has no literals left, try to merge with\n\t\t\t\t\t// following RLW\n\t\t\t\t\tif (rlw.getNumberOfLiteralWords() == 0\n\t\t\t\t\t\t\t&& next != null\n\t\t\t\t\t\t\t&& next.getRunningBit()\n\t\t\t\t\t\t\t&& next.getRunningLength() + rlw.getRunningLength() < RunningLengthWord.largestrunninglengthcount) {\n\t\t\t\t\t\tif (rlw.equals(this.rlw))\n\t\t\t\t\t\t\tthis.rlw.position = next.position;\n\t\t\t\t\t\tnext.setRunningLength(next.getRunningLength()\n\t\t\t\t\t\t\t\t+ rlw.getRunningLength());\n\t\t\t\t\t\tshiftCompressedWordsLeft(rlw.position + 2, 2);\n\t\t\t\t\t}\n\t\t\t\t\t// merging doesn't work because of size\n\t\t\t\t\t// else just reduce length of rlw by 1\n\t\t\t\t\telse\n\t\t\t\t\t\tshiftCompressedWordsLeft(rlw.position + 2, 1);\n\t\t\t\t}\n\t\t\t\t// if last word increase following running length count if\n\t\t\t\t// possible\n\t\t\t\telse if (next != null\n\t\t\t\t\t\t&& next.getRunningLength() \n\t\t\t\t\t\t\t\t< RunningLengthWord.largestrunninglengthcount\n\t\t\t\t\t\t&& (next.getRunningLength() == 0 || next\n\t\t\t\t\t\t\t\t.getRunningBit())\n\t\t\t\t\t\t&& literalPos == rlw.getNumberOfLiteralWords() - 1) {\n\t\t\t\t\tnext.setRunningBit(true);\n\t\t\t\t\tnext.setRunningLength(next.getRunningLength() + 1);\n\t\t\t\t\trlw.setNumberOfLiteralWords(rlw.getNumberOfLiteralWords() - 1);\n\t\t\t\t\t// current RLW has no literals left, try to merge with\n\t\t\t\t\t// following\n\t\t\t\t\tif (rlw.getNumberOfLiteralWords() == 0\n\t\t\t\t\t\t\t&& next != null\n\t\t\t\t\t\t\t&& next.getRunningBit()) {\n\t\t\t\t\t\tlong totalRunLen = next.getRunningLength() + rlw.getRunningLength(); \n\t\t\t\t\t\t\n\t\t\t\t\t\t// merging into next possible?\n\t\t\t\t\t\tif (totalRunLen < RunningLengthWord.largestrunninglengthcount) {\n\t\t\t\t\t\t\tnext.setRunningLength(next.getRunningLength()\n\t\t\t\t\t\t\t\t\t+ rlw.getRunningLength());\n\t\t\t\t\t\t\tshiftCompressedWordsLeft(rlw.position + 2, 2);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// run length to large, move run length from next to current\n\t\t\t\t\t\t// and shift next one to the left\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\trlw.setRunningLength(RunningLengthWord.\n\t\t\t\t\t\t\t\t\tlargestrunninglengthcount);\n\t\t\t\t\t\t\tnext.setRunningLength(totalRunLen - RunningLengthWord\n\t\t\t\t\t\t\t\t\t.largestrunninglengthcount);\n\t\t\t\t\t\t\tshiftCompressedWordsLeft(rlw.position + 2, 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// remove RLW\n\t\t\t\t\telse\n\t\t\t\t\t\tshiftCompressedWordsLeft(\n\t\t\t\t\t\t\t\trlw.position + rlw.getNumberOfLiteralWords()\n\t\t\t\t\t\t\t\t\t\t+ 2, 1);\n\t\t\t\t}\n\t\t\t\t// cannot merge, have to create new RLW and adapt literal count\n\t\t\t\t// of current RLW\n\t\t\t\telse {\n\t\t\t\t\tint beforeLit = literalPos;\n\t\t\t\t\tint afterLit =\n\t\t\t\t\t\t\trlw.getNumberOfLiteralWords() - literalPos - 1;\n\n\t\t\t\t\tif (log.isDebugEnabled()) {log.debug(\"split into \" + beforeLit + \" and \" + afterLit);};\n\n\t\t\t\t\tRunningLengthWord newRlw = new RunningLengthWord(rlw);\n\t\t\t\t\tnewRlw.position += literalPos + 1;\n\t\t\t\t\tnewRlw.setRunningBit(true);\n\t\t\t\t\tnewRlw.setRunningLength(1L);\n\t\t\t\t\tnewRlw.setNumberOfLiteralWords(afterLit);\n\n\t\t\t\t\trlw.setNumberOfLiteralWords(beforeLit);\n\n\t\t\t\t\t// if next one is full running length 1's we have to switch\n\t\t\t\t\t// running lengths\n\t\t\t\t\tif (next != null\n\t\t\t\t\t\t\t&& next.getRunningBit()\n\t\t\t\t\t\t\t&& next.getRunningLength() == RunningLengthWord.largestrunninglengthcount) {\n\t\t\t\t\t\tnext.setRunningLength(1L);\n\t\t\t\t\t\tnewRlw.setRunningLength(RunningLengthWord.largestrunninglengthcount);\n\t\t\t\t\t}\n\n\t\t\t\t\t// we split the last word, adapt it\n\t\t\t\t\tif (rlw.position == this.rlw.position)\n\t\t\t\t\t\tthis.rlw.position = newRlw.position;\n\t\t\t\t\tif (log.isDebugEnabled()) {log.debug(\"split because new 1's run\");};\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// bit is in a clean word, if it is a '1' sequence we are fine\n\t\telse if (rlw.getRunningBit()) {\n\t\t\treturn;\n\t\t}\n\t\t// bit to set is in '0' clean word. We have to split this clean word and\n\t\t// shift following words in the buffer.\n\t\t// We do this by adding a new RLW y after the RLW x which has to be\n\t\t// split. This new RWL y takes over all the\n\t\t// literal words of x and encodes the part of the 0 sequence that\n\t\t// follows the bit we want to set. RWL x's\n\t\t// run length is reduced and we add the new bit as the new single\n\t\t// literal word for x.\n\t\telse {\n\t\t\tlong zeroRunLen = rlw.getRunningLength();\n\t\t\tlong newRunLen = offset / 64;\n\t\t\tlong afterRunLen = ((zeroRunLen * 64 - 63) / 64) - newRunLen;\n\t\t\tlong newNumLiterals = rlw.getNumberOfLiteralWords() + 1;\n\t\t\tfinal long newdata = 1l << (offset % 64);\n\n\t\t\t// no preceeding and following run length.\n\t\t\t// CASE 1) Try to merge with preceeding or following RLW.\n\t\t\tif (newRunLen == 0 && afterRunLen == 0) {\n\t\t\t\t// merge with previous if exists and possible\n\t\t\t\tif (prev != null\n\t\t\t\t\t\t&& prev.getNumberOfLiteralWords() + newNumLiterals <= RunningLengthWord.largestliteralcount) {\n\t\t\t\t\tprev.setNumberOfLiteralWords(prev.getNumberOfLiteralWords()\n\t\t\t\t\t\t\t+ newNumLiterals);\n\t\t\t\t\tthis.buffer[rlw.position] = newdata;\n\n\t\t\t\t\tif (this.rlw.equals(rlw))\n\t\t\t\t\t\tthis.rlw = prev;\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// No merging possible!\n\t\t\t// CASE 2) if previous run length = 0 then add new literal into\n\t\t\t// previous if previous still has space\n\t\t\tif (newRunLen == 0\n\t\t\t\t\t&& prev != null\n\t\t\t\t\t&& prev.getNumberOfLiteralWords() < RunningLengthWord.largestliteralcount) {\n\t\t\t\tprev.setNumberOfLiteralWords(prev.getNumberOfLiteralWords() + 1);\n\t\t\t\trlw.setRunningLength(afterRunLen);\n\t\t\t\tshiftCompressedWordsRight(rlw.position, 1);\n\t\t\t\tthis.buffer[prev.position + prev.getNumberOfLiteralWords()] =\n\t\t\t\t\t\tnewdata;\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// CASE 3) No merging possible, if following run length = 0, then\n\t\t\t// try to extend R with the new literal.\n\t\t\tif (afterRunLen == 0\n\t\t\t\t\t&& rlw.getNumberOfLiteralWords() < RunningLengthWord.largestliteralcount) {\n\t\t\t\trlw.setNumberOfLiteralWords(rlw.getNumberOfLiteralWords() + 1);\n\t\t\t\trlw.setRunningLength(newRunLen);\n\t\t\t\tshiftCompressedWordsRight(rlw.position + 1, 1);\n\t\t\t\tthis.buffer[rlw.position + 1] = newdata;\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// TODO rlw is full (literals) and next one has no running length\n\t\t\t// and is not full\n\t\t\tif (afterRunLen == 0\n\t\t\t\t\t& next != null\n\t\t\t\t\t&& rlw.getNumberOfLiteralWords() == RunningLengthWord.largestliteralcount\n\t\t\t\t\t&& next.getNumberOfLiteralWords() < RunningLengthWord.largestliteralcount) {\n\t\t\t\trlw.setRunningLength(rlw.getRunningLength() - 1);\n\t\t\t\tshiftCompressedWordsRight(rlw.position + 1, 1);\n\t\t\t\trlw.array = this.buffer;\n\t\t\t\tnext.array = this.buffer;\n\n\t\t\t\tthis.buffer[rlw.position + 1] = newdata;\n\n\t\t\t\t// switch next header with last literal\n\t\t\t\tlong temp = this.buffer[next.position + 1];\n\t\t\t\tthis.buffer[next.position + 1] = this.buffer[next.position];\n\t\t\t\tthis.buffer[next.position] = temp;\n\t\t\t\tnext.setNumberOfLiteralWords(next.getNumberOfLiteralWords() + 1);\n\n\t\t\t\tif (next.position + 1 == this.rlw.position)\n\t\t\t\t\tthis.rlw.position = next.position;\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// CASE 4) no extension possible. Have to SPLIT the zero sequence\n\t\t\t// and create new RLW\n\t\t\t// new RLW only gets a single literal\n\t\t\tif (afterRunLen == 0) {\n\t\t\t\tassert (rlw.getNumberOfLiteralWords() == RunningLengthWord.largestliteralcount);\n\n\t\t\t\tshiftCompressedWordsRight(rlw.position + 1, 1);\n\t\t\t\tshiftCompressedWordsRight(\n\t\t\t\t\t\trlw.position + rlw.getNumberOfLiteralWords() + 1, 1);\n\t\t\t\tRunningLengthWord newRlw =\n\t\t\t\t\t\tnew RunningLengthWord(this.buffer, rlw.position\n\t\t\t\t\t\t\t\t+ rlw.getNumberOfLiteralWords() + 1);\n\t\t\t\trlw.array = this.buffer;\n\n\t\t\t\tnewRlw.setNumberOfLiteralWords(1L);\n\t\t\t\tnewRlw.setRunningLength(0);\n\t\t\t\tnewRlw.setRunningBit(false);\n\n\t\t\t\trlw.setRunningLength(newRunLen);\n\n\t\t\t\tthis.buffer[rlw.position + 1] = newdata;\n\n\t\t\t\tif (newRlw.position > this.rlw.position)\n\t\t\t\t\tthis.rlw.position = newRlw.position;\n\t\t\t}\n\t\t\t// new RLW also gets run length\n\t\t\telse {\n\t\t\t\tshiftCompressedWordsRight(wordPos + 1, 2);\n\t\t\t\tRunningLengthWord newRlw =\n\t\t\t\t\t\tnew RunningLengthWord(this.buffer, wordPos + 2);\n\t\t\t\trlw.array = this.buffer;\n\n\t\t\t\tnewRlw.setNumberOfLiteralWords(rlw.getNumberOfLiteralWords());\n\t\t\t\tnewRlw.setRunningLength(afterRunLen);\n\t\t\t\tnewRlw.setRunningBit(false);\n\n\t\t\t\trlw.setRunningLength(newRunLen);\n\t\t\t\trlw.setNumberOfLiteralWords(1);\n\n\t\t\t\tthis.buffer[wordPos + 1] = newdata;\n\n\t\t\t\tif (newRlw.position > this.rlw.position)\n\t\t\t\t\tthis.rlw.position = newRlw.position;\n\t\t\t}\n\t\t}\n\t}",
"void invertAllBits();",
"public long bits() {\n\t\tlong x = n;\n\t\tif (x > 0) {\n\t\t\tlong msw = get(x - 1) & 0xffffffffL;\n\t\t\tx = (x - 1) * BPU;\n\t\t\tx = x & 0xffffffffL;\n\t\t\tlong w = BPU;\n\t\t\tdo {\n\t\t\t\tw >>= 1;\n\t\t\t\tif (msw >= ((1 << w) & 0xffffffffL)) {\n\t\t\t\t\tx += w;\n\t\t\t\t\tx = x & 0xffffffffL;\n\t\t\t\t\tmsw >>= w;\n\t\t\t\t}\n\t\t\t} while (w > 8);\n\t\t\tx += bittab[(int) msw];\n\t\t\tx = x & 0xffffffffL;\n\t\t}\n\t\treturn x;\n\t}",
"public int rangeBitwiseAnd2(int m, int n) {\n if (m == n){\n return m;\n }\n //The highest bit of 1 in diff is the highest changed bit.\n int diff = m ^ n;\n //Index is the index of the highest changed bit. Starting at 1.\n int index = (int)(Math.log(diff) / Math.log(2)) + 1;\n //Eliminate the changed part.\n m = m & (0xffffffff<<index);\n return m;\n }",
"public static int missingNumberBitManipulation(int[] nums) {\n if (nums == null || nums.length == 0) return -1;\n\n int missing = nums.length;\n for (int i = 0; i < nums.length; i++) {\n missing ^= i ^ nums[i];\n }\n return missing;\n }",
"public int setBit(int i, int j){\n return (i|(1<<j));\n }",
"private static int _getMask(final int bitIndex) {\n return (1 << bitIndex);\n }",
"public static void main(String[] args)\n\t{\n\t\tint n = 3;\n\t\tint m = 8;\n\t\t\n\t\tint tmp = m;\n\t\t\n\t\tif( (tmp >> (n-1) & 1) == 1)\n\t\t\ttmp &=~(1 << (n-1)) ;\n\t\telse\n\t\t\ttmp |=(1 << (n-1)) ;\n\t\t\n\t\tSystem.out.println(tmp);\n\t\t\n\t\tSystem.out.println(m ^= (1<<n-1));\n\t}",
"static int countSetBits(int n)\r\n {\r\n int count = 0;\r\n while (n > 0) {\r\n count += n & 1;\r\n n >>= 1;\r\n }\r\n return count;\r\n }",
"int left(int i) { return i<<1; }",
"public int reverseBits(int n) {\n // get all bits & calculate the res\n int res = 0;\n int mask = 1;\n for (int i = 0; i < 32; ++i) {\n res *= 2;\n if (checkBit(mask, n)) {\n ++res;\n }\n mask = mask << 1;\n }\n \n return res;\n }",
"public static void main(String[] args) {\n\t\tint x = ~0;\r\n\t\tSystem.out.println(Integer.toBinaryString(x));\r\n\t\tint y = x>>>8;\r\n\t\tSystem.out.println(Integer.toBinaryString(y));\r\n\t\tSystem.out.println(x+\" \"+y);\r\n\t\t\r\n\t\tint N = 1<<31;\r\n\t\tint M = 0b11;\r\n\t\tint j=2;\r\n\t\tint i=1;\r\n\t\tSystem.out.println(Integer.toBinaryString(N));\r\n\t\tSystem.out.println(Integer.toBinaryString(M));\r\n\t\tSystem.out.println(Integer.toBinaryString(insertMIntoNFromJtoI(M, N, j, i)));\r\n\t\t\r\n\t}",
"public String toBitString (int i) {\n\tint[] result = new int[64];\n\tint counter = 0;\n\twhile (i > 0) {\n\t\tresult[counter] = i % 2;\n\t\ti /= 2;\n\t\tcounter++;\n\t}\n\tString answer = \"\";\n\tfor (int j = 0; j < counter; j++)\n\t\tanswer += \"\" + result[j];\n\treturn answer;\t\n}",
"static int setBit(int num, int pos) {\n\t\t\treturn num | (1<<pos);\n\t\t}",
"protected void setAll() {\n for (int i=0; i <= (Numbers.INTEGER_WIDTH*8-2); i++) {\n \tthis.setBitAt(i);\n } \t\n }",
"int getBitAsInt(int index);",
"private int getBit(int value, int k) {\r\n\t\treturn (value >> k) & 1;\r\n\t}",
"static long flippingBits(long n) {\n\n String strBinary = String.format(\"%32s\", Long.toBinaryString(n)).replace(' ', '0');\n String strBinaryFlip = \"\";\n\n for (int i = 0; i < strBinary.length(); i++) {\n if (strBinary.charAt(i) == '0') {\n strBinaryFlip = strBinaryFlip + '1';\n } else {\n strBinaryFlip = strBinaryFlip + '0';\n }\n }\n\n String result = String.format(\"%32s\", strBinaryFlip).replace(' ', '0');\n long base10 = parseLong(result,2);\n return base10;\n }",
"public int numSetBits1(long a) {\n int count=0;\n while (a>0){\n count++;\n a = a & (a-1); //(x & (x - 1)) will unset the last set bit in x (which is why x&(x-1) is 0 for powers of 2).\n }\n\n return count;\n\t}",
"private static synchronized int nextMask() {\n return (int) Math.pow(2, maskCount++);\n }",
"public static int shiftmask(int bitwidth) {\n return bitwidth < 1 ? 0 : (1 << (32 - Integer.numberOfLeadingZeros(bitwidth - 1))) - 1;\n }",
"public void setFlagBin(int n) {\n flagBin=Translate.decTobinN(n, 4);\n }",
"private int m690g(int i) {\n return (-(i & 1)) ^ (i >>> 1);\n }",
"public BitSet getBitSetMask() {\r\n return newMask;\r\n }",
"public int reverseBits(int n) {\n return Integer.reverse(n);\n }",
"private static int writeBits(byte[] bytes, int value, int pos, int len) {\n assert(value > 0 && pos + len <= bytes.length * 8);\n int ind = pos / 8;\n int lastPos = 0;\n for (int i = 0; i < len; i++) {\n int bi = (pos + i) % 8;\n if ((value & (1 << (len - i - 1))) != 0) {\n bytes[ind] |= 1 << (7 - bi);\n lastPos = pos + i;\n }\n if (bi == 7) {\n ind++;\n }\n }\n return lastPos;\n }",
"public static int backwardScanBit(long map, int start)\n {\n if ( start >= 0 )\n {\n start = Math.min(start, 63);\n long bit = 1L << start;\n\n for (int i = start; i >= 0; i--, bit >>= 1)\n {\n if ((map & bit) != 0) return i;\n }\n }\n return -1;\n }",
"public static String getBits(long f, int size) {\n StringBuffer sb = new StringBuffer();\n sb = f < 0 ? sb.append(\"1\") : sb.append(\"0\");\n long mask = 1;\n for (int i = size; i >= 0; i--) {\n int x = (mask<<i & f) == 0 ? 0 : 1;\n sb.append(x);\n }\n return sb.toString();\n }",
"public boolean fastSet(final int i) {\n\t\tif (i < this.sizeinbits)\n\t\t\treturn false;\n\t\t// must I complete a word?\n\t\tif ((this.sizeinbits % 64) != 0) {\n\t\t\tfinal int possiblesizeinbits = (this.sizeinbits / 64) * 64 + 64;\n\t\t\tif (possiblesizeinbits < i + 1) {\n\t\t\t\tthis.sizeinbits = possiblesizeinbits;\n\t\t\t}\n\t\t}\n\t\taddStreamOfEmptyWords(false, (i / 64) - this.sizeinbits / 64);\n\t\tfinal int bittoflip = i - (this.sizeinbits / 64 * 64);\n\t\t// next, we set the bit\n\t\tif ((this.rlw.getNumberOfLiteralWords() == 0)\n\t\t\t\t|| ((this.sizeinbits - 1) / 64 < i / 64)) {\n\t\t\tfinal long newdata = 1l << bittoflip;\n\t\t\taddLiteralWord(newdata);\n\t\t}\n\t\telse {\n\t\t\tthis.buffer[this.actualsizeinwords - 1] |= 1l << bittoflip;\n\t\t\t// check if we just completed a stream of 1s\n\t\t\tif (this.buffer[this.actualsizeinwords - 1] == oneMask) {\n\t\t\t\t// we remove the last dirty word\n\t\t\t\tthis.buffer[this.actualsizeinwords - 1] = 0;\n\t\t\t\t--this.actualsizeinwords;\n\t\t\t\tthis.rlw.setNumberOfLiteralWords(this.rlw\n\t\t\t\t\t\t.getNumberOfLiteralWords() - 1);\n\t\t\t\t// next we add one clean word\n\t\t\t\taddEmptyWord(true);\n\t\t\t}\n\t\t}\n\t\tthis.sizeinbits = i + 1;\n\t\treturn true;\n\t}",
"public static int _clearBit(final int originalInt,final int bitIndex) {\n return originalInt & ~_getMask(bitIndex);\n }",
"private static BitSet makeBitSet( int... args ) {\n\tBitSet result = new BitSet( MAX_OPCODE + 1 ) ;\n\tfor (int value : args )\n\t result.set( value ) ;\n\treturn result ;\n }",
"static void findI1s(final int length, int[] B) {\r\n\t final long max = 1 << length;\r\n\t for (long i = 0; i < max; i++) {\r\n\t long currentNumber = i;\r\n\t final int[] buffer = new int[length];\r\n\t boolean[] I1 = new boolean[length]; // I1 to be passed to next method\r\n\t int bufferPosition = buffer.length;\r\n\t while (bufferPosition > 0) {\r\n\t buffer[--bufferPosition] = (int) (currentNumber & 1);\r\n\t currentNumber >>>= 1;\r\n\t }\r\n\t for(int x = 0; x < buffer.length; x++) {\r\n\t \tif(buffer[x] == 1) {\r\n\t \t\tI1[x] = true;\r\n\t \t}\r\n\t \telse {\r\n\t \t\tI1[x] = false;\r\n\t \t}\r\n\t \tSystem.out.print(buffer[x]);\r\n\t }\r\n\t\t System.out.println();\r\n\t }\r\n\t}",
"public static void main(String[] args) {\n\t\tint i=10;\n\t\tSystem.out.println(Integer.toBinaryString(i));\n\t\tSystem.out.printf(\"%d --> %s \\n\",i<<1,Integer.toBinaryString(i<<1));\n\t\tSystem.out.printf(\"%d --> %s \\n\",i>>1, Integer.toBinaryString(i>>1));\n\t\t\n\t\tSystem.out.println(i&(1<<0));\n\t}"
] | [
"0.6800314",
"0.6600717",
"0.6519545",
"0.64930433",
"0.64907914",
"0.64390564",
"0.64171666",
"0.63713497",
"0.6368205",
"0.6284049",
"0.6281098",
"0.62492245",
"0.6233364",
"0.6051605",
"0.6020541",
"0.6012435",
"0.5996556",
"0.5972192",
"0.59630066",
"0.59508204",
"0.5940377",
"0.59268886",
"0.5891324",
"0.5877129",
"0.587623",
"0.58708996",
"0.58523005",
"0.5850421",
"0.58152807",
"0.5815108",
"0.5814399",
"0.58095276",
"0.5807259",
"0.5805235",
"0.57982206",
"0.5794138",
"0.57829523",
"0.57715327",
"0.5768204",
"0.575884",
"0.57572305",
"0.57390505",
"0.5727267",
"0.57129675",
"0.5705073",
"0.5700192",
"0.5690037",
"0.56873727",
"0.5677915",
"0.56734306",
"0.5663568",
"0.5662374",
"0.5651859",
"0.56466746",
"0.56230974",
"0.56218266",
"0.5604351",
"0.5595382",
"0.55896837",
"0.558424",
"0.5567848",
"0.55667555",
"0.5566735",
"0.5565004",
"0.5562739",
"0.55584234",
"0.5558136",
"0.5556634",
"0.5546856",
"0.5539827",
"0.55377",
"0.5500612",
"0.54786086",
"0.54754305",
"0.54749984",
"0.5465323",
"0.54543495",
"0.54532725",
"0.5428026",
"0.5424052",
"0.54129785",
"0.54065144",
"0.5395391",
"0.539268",
"0.5386181",
"0.5381928",
"0.5371184",
"0.53666025",
"0.53571254",
"0.5351783",
"0.5343941",
"0.5341442",
"0.5339603",
"0.5334521",
"0.5329588",
"0.5327058",
"0.5326756",
"0.53149533",
"0.53119105",
"0.5311111"
] | 0.7072461 | 0 |
to clear all bits from i through 0 (inclusive), we take a sequence of all 1s (which is 1) and shift it left by i + 1 bit. this gives us a sequence of 1s (in the most significant bits) followed by i 0 bits. | public static int cleanBitsIthrough0(int num, int i) {
int mask = (-1 << (i + 1));
return num & mask;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static int clearBitsUpToLS(int n, int i) {\n return n & ~(-1>>(31-i));\n }",
"protected void clearAll() {\n for (int i=0; i <= (Numbers.INTEGER_WIDTH*8-2); i++) {\n \tthis.clearBitAt(i);\n } \t\n }",
"public static int clearBit(int num, int i) {\n int mask = ~(1 << i);\n return num & mask;\n }",
"public static int clearBitsUpToMS(int n, int i) {\n return n & (1<<i)-1;\n }",
"public static int cleanBitsMSBthroughI(int num, int i) {\n int mask = (1 << i) - 1;\n return num & mask;\n }",
"public int clearBit(int i,int j){\n int mask=~(1<<j);\n return i&mask;\n }",
"public void clearBits(int[][] bits, int start, int len) {\n\t\tint left = start; \n\t\tint right = start + len - 1; \n\t\tfor (int i = 0; i < bits.length; i++) {\n\t\t\tfor (int j = left; j <= right; j++) {\n\t\t\t\tbits[i][j] = 0;\n\t\t\t}\n\t\t\tleft = left / 2;\n\t\t\tright = right / 2;\n\t\t}\n\t}",
"void set(int i, int val) {\n int numPosition = i / MAX_BITS;\n int intPosition = i % MAX_BITS;\n\n if (val == 1)\n values[numPosition] |= (1 << intPosition);\n else\n values[numPosition] = values[numPosition]&~(1 << intPosition);\n }",
"static int clearMSBtoI(int num, int pos) {\n\t\t\tint mask = (1<<pos) - 1;\n\t\t\treturn num & mask;\n\t\t}",
"public void resetZero() {\n\t\tset((byte) (get() & ~(1 << 7)));\n\t}",
"protected void setAll() {\n for (int i=0; i <= (Numbers.INTEGER_WIDTH*8-2); i++) {\n \tthis.setBitAt(i);\n } \t\n }",
"public UnmodifiableBitSet setBit(int i){\n\t\tUnmodifiableBitSet nbs = (UnmodifiableBitSet)this.clone();\n\t\tnbs.setBitInn(i);\n\t\treturn nbs;\n\t}",
"private static void zero(int[] x)\n {\n for (int i = 0; i != x.length; i++)\n {\n x[i] = 0;\n }\n }",
"public boolean fastSet(final int i) {\n\t\tif (i < this.sizeinbits)\n\t\t\treturn false;\n\t\t// must I complete a word?\n\t\tif ((this.sizeinbits % 64) != 0) {\n\t\t\tfinal int possiblesizeinbits = (this.sizeinbits / 64) * 64 + 64;\n\t\t\tif (possiblesizeinbits < i + 1) {\n\t\t\t\tthis.sizeinbits = possiblesizeinbits;\n\t\t\t}\n\t\t}\n\t\taddStreamOfEmptyWords(false, (i / 64) - this.sizeinbits / 64);\n\t\tfinal int bittoflip = i - (this.sizeinbits / 64 * 64);\n\t\t// next, we set the bit\n\t\tif ((this.rlw.getNumberOfLiteralWords() == 0)\n\t\t\t\t|| ((this.sizeinbits - 1) / 64 < i / 64)) {\n\t\t\tfinal long newdata = 1l << bittoflip;\n\t\t\taddLiteralWord(newdata);\n\t\t}\n\t\telse {\n\t\t\tthis.buffer[this.actualsizeinwords - 1] |= 1l << bittoflip;\n\t\t\t// check if we just completed a stream of 1s\n\t\t\tif (this.buffer[this.actualsizeinwords - 1] == oneMask) {\n\t\t\t\t// we remove the last dirty word\n\t\t\t\tthis.buffer[this.actualsizeinwords - 1] = 0;\n\t\t\t\t--this.actualsizeinwords;\n\t\t\t\tthis.rlw.setNumberOfLiteralWords(this.rlw\n\t\t\t\t\t\t.getNumberOfLiteralWords() - 1);\n\t\t\t\t// next we add one clean word\n\t\t\t\taddEmptyWord(true);\n\t\t\t}\n\t\t}\n\t\tthis.sizeinbits = i + 1;\n\t\treturn true;\n\t}",
"public void clear() {\n\t\tfor (int x = 0; x < counters.length; x++) {\n\t\t\tcounters[x] = 0;\n\t\t\tArrays.fill(counters, (byte)0);\n\t\t}\n\t}",
"void crossOut(int i) {\n if(i % 2 == 0){\n return;\n }\n\n int bitIndex = (i-1) / 2;\n int arrayIndex = bitIndex / 8; //bitArr[arrayIndex] - Where the number is stored\n bitIndex = bitIndex % 8; //which bit in bitArr[arrayIndex] corresponds to the number\n\n bitArr[arrayIndex] = (byte) (bitArr[arrayIndex] & bitMask2[bitIndex]); //Uses the correct mask over the array index to single out our value.\n }",
"public static int _clearBit(final int originalInt,final int bitIndex) {\n return originalInt & ~_getMask(bitIndex);\n }",
"public void clearBits()\r\n {\r\n clear();\r\n }",
"void invertAllBits();",
"public int updateBit(int i,int j, boolean set){\n int value=(set)?1:0;\n int mask=~(1<<j);\n int clear=mask&i;\n return clear|(1<<value);\n\n}",
"private static int[] stripLeadingZeroInts(int val[]) {\n int vlen = val.length;\n int keep;\n\n // Find first nonzero byte\n for (keep = 0; keep < vlen && val[keep] == 0; keep++)\n ;\n return java.util.Arrays.copyOfRange(val, keep, vlen);\n }",
"private static void m616a(int i, int[] iArr) {\n for (int i2 = 0; i2 < 9; i2++) {\n iArr[i2] = ((1 << (8 - i2)) & i) == 0 ? 0 : 1;\n }\n }",
"public static void clear (int []n) {\n\t\tfor (int i = 0; i < n.length; i++) {\n\t\t\tn[i] = 0;\n\t\t}\n\t}",
"public void makeEmpty(){\n for(int element = set.length - 1; element >= 0; element--){\n remove(set[element]);\n }\n }",
"private static int[] makePositive(int a[]) {\n int keep, j;\n\n // Find first non-sign (0xffffffff) int of input\n for (keep=0; keep < a.length && a[keep] == -1; keep++)\n ;\n\n /* Allocate output array. If all non-sign ints are 0x00, we must\n * allocate space for one extra output int. */\n for (j=keep; j < a.length && a[j] == 0; j++)\n ;\n int extraInt = (j == a.length ? 1 : 0);\n int result[] = new int[a.length - keep + extraInt];\n\n /* Copy one's complement of input into output, leaving extra\n * int (if it exists) == 0x00 */\n for (int i = keep; i < a.length; i++)\n result[i - keep + extraInt] = ~a[i];\n\n // Add one to one's complement to generate two's complement\n for (int i=result.length-1; ++result[i] == 0; i--)\n ;\n\n return result;\n }",
"public void setZero() {\n\t\tset((byte) (get() | (1 << 7)));\n\t}",
"public void set(final int i) {\n\t\tint wordPos;\n\t\tint bitPos = 0;\n\t\tint offset;\n\n\t\tassert (i >= 0);\n\n\t\t// try simple set (append style)\n\t\tif (fastSet(i))\n\t\t\treturn;\n\n\t\t// simple set failed. Find compressed word where to set the bit\n\t\tRunningLengthWord rlw = null, prev = null, next = null;\n\n\t\tEWAHIterator iter = new EWAHIterator(this.buffer, actualsizeinwords);\n\t\twhile (iter.hasNext() && (bitPos < i || bitPos == 0)) {\n\t\t\tif (rlw != null)\n\t\t\t\tprev = new RunningLengthWord(rlw);\n\t\t\trlw = iter.next();\n\t\t\tbitPos += rlw.size() * wordinbits;\n\t\t}\n\t\tif (iter.hasNext())\n\t\t\tnext = rlw.getNext();\n\n\t\tbitPos -= rlw.size() * 64;\n\t\toffset = i - bitPos;\n\t\twordPos = rlw.position;\n\n\t\t// the bit to set is in a literal word. Try to set bit directly\n\t\tif (offset >= rlw.getRunningLength() * 64) {\n\t\t\toffset -= rlw.getRunningLength() * 64;\n\t\t\tint literalPos = (offset / 64);\n\t\t\twordPos += literalPos + 1;\n\t\t\tfinal long newdata = 1l << (offset % 64);\n\t\t\tthis.buffer[wordPos] = this.buffer[wordPos] | newdata;\n\t\t\t// if all bits of literal set, then either merge with run length\n\t\t\t// or create new RLW.\n\t\t\tif (this.buffer[wordPos] == oneMask) {\n\t\t\t\t// first literal of current RLW and running bit is set\n\t\t\t\t// increase count by one (unless maximal count reached)\n\t\t\t\tif (literalPos == 0\n\t\t\t\t\t\t&& (rlw.getRunningBit() || rlw.getRunningLength() == 0)\n\t\t\t\t\t\t&& rlw.getRunningLength() < RunningLengthWord.largestrunninglengthcount) {\n\t\t\t\t\trlw.setRunningBit(true);\n\t\t\t\t\trlw.setRunningLength(rlw.getRunningLength() + 1);\n\t\t\t\t\trlw.setNumberOfLiteralWords(rlw.getNumberOfLiteralWords() - 1);\n\t\t\t\t\t// current RLW has no literals left, try to merge with\n\t\t\t\t\t// following RLW\n\t\t\t\t\tif (rlw.getNumberOfLiteralWords() == 0\n\t\t\t\t\t\t\t&& next != null\n\t\t\t\t\t\t\t&& next.getRunningBit()\n\t\t\t\t\t\t\t&& next.getRunningLength() + rlw.getRunningLength() < RunningLengthWord.largestrunninglengthcount) {\n\t\t\t\t\t\tif (rlw.equals(this.rlw))\n\t\t\t\t\t\t\tthis.rlw.position = next.position;\n\t\t\t\t\t\tnext.setRunningLength(next.getRunningLength()\n\t\t\t\t\t\t\t\t+ rlw.getRunningLength());\n\t\t\t\t\t\tshiftCompressedWordsLeft(rlw.position + 2, 2);\n\t\t\t\t\t}\n\t\t\t\t\t// merging doesn't work because of size\n\t\t\t\t\t// else just reduce length of rlw by 1\n\t\t\t\t\telse\n\t\t\t\t\t\tshiftCompressedWordsLeft(rlw.position + 2, 1);\n\t\t\t\t}\n\t\t\t\t// if last word increase following running length count if\n\t\t\t\t// possible\n\t\t\t\telse if (next != null\n\t\t\t\t\t\t&& next.getRunningLength() \n\t\t\t\t\t\t\t\t< RunningLengthWord.largestrunninglengthcount\n\t\t\t\t\t\t&& (next.getRunningLength() == 0 || next\n\t\t\t\t\t\t\t\t.getRunningBit())\n\t\t\t\t\t\t&& literalPos == rlw.getNumberOfLiteralWords() - 1) {\n\t\t\t\t\tnext.setRunningBit(true);\n\t\t\t\t\tnext.setRunningLength(next.getRunningLength() + 1);\n\t\t\t\t\trlw.setNumberOfLiteralWords(rlw.getNumberOfLiteralWords() - 1);\n\t\t\t\t\t// current RLW has no literals left, try to merge with\n\t\t\t\t\t// following\n\t\t\t\t\tif (rlw.getNumberOfLiteralWords() == 0\n\t\t\t\t\t\t\t&& next != null\n\t\t\t\t\t\t\t&& next.getRunningBit()) {\n\t\t\t\t\t\tlong totalRunLen = next.getRunningLength() + rlw.getRunningLength(); \n\t\t\t\t\t\t\n\t\t\t\t\t\t// merging into next possible?\n\t\t\t\t\t\tif (totalRunLen < RunningLengthWord.largestrunninglengthcount) {\n\t\t\t\t\t\t\tnext.setRunningLength(next.getRunningLength()\n\t\t\t\t\t\t\t\t\t+ rlw.getRunningLength());\n\t\t\t\t\t\t\tshiftCompressedWordsLeft(rlw.position + 2, 2);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// run length to large, move run length from next to current\n\t\t\t\t\t\t// and shift next one to the left\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\trlw.setRunningLength(RunningLengthWord.\n\t\t\t\t\t\t\t\t\tlargestrunninglengthcount);\n\t\t\t\t\t\t\tnext.setRunningLength(totalRunLen - RunningLengthWord\n\t\t\t\t\t\t\t\t\t.largestrunninglengthcount);\n\t\t\t\t\t\t\tshiftCompressedWordsLeft(rlw.position + 2, 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// remove RLW\n\t\t\t\t\telse\n\t\t\t\t\t\tshiftCompressedWordsLeft(\n\t\t\t\t\t\t\t\trlw.position + rlw.getNumberOfLiteralWords()\n\t\t\t\t\t\t\t\t\t\t+ 2, 1);\n\t\t\t\t}\n\t\t\t\t// cannot merge, have to create new RLW and adapt literal count\n\t\t\t\t// of current RLW\n\t\t\t\telse {\n\t\t\t\t\tint beforeLit = literalPos;\n\t\t\t\t\tint afterLit =\n\t\t\t\t\t\t\trlw.getNumberOfLiteralWords() - literalPos - 1;\n\n\t\t\t\t\tif (log.isDebugEnabled()) {log.debug(\"split into \" + beforeLit + \" and \" + afterLit);};\n\n\t\t\t\t\tRunningLengthWord newRlw = new RunningLengthWord(rlw);\n\t\t\t\t\tnewRlw.position += literalPos + 1;\n\t\t\t\t\tnewRlw.setRunningBit(true);\n\t\t\t\t\tnewRlw.setRunningLength(1L);\n\t\t\t\t\tnewRlw.setNumberOfLiteralWords(afterLit);\n\n\t\t\t\t\trlw.setNumberOfLiteralWords(beforeLit);\n\n\t\t\t\t\t// if next one is full running length 1's we have to switch\n\t\t\t\t\t// running lengths\n\t\t\t\t\tif (next != null\n\t\t\t\t\t\t\t&& next.getRunningBit()\n\t\t\t\t\t\t\t&& next.getRunningLength() == RunningLengthWord.largestrunninglengthcount) {\n\t\t\t\t\t\tnext.setRunningLength(1L);\n\t\t\t\t\t\tnewRlw.setRunningLength(RunningLengthWord.largestrunninglengthcount);\n\t\t\t\t\t}\n\n\t\t\t\t\t// we split the last word, adapt it\n\t\t\t\t\tif (rlw.position == this.rlw.position)\n\t\t\t\t\t\tthis.rlw.position = newRlw.position;\n\t\t\t\t\tif (log.isDebugEnabled()) {log.debug(\"split because new 1's run\");};\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// bit is in a clean word, if it is a '1' sequence we are fine\n\t\telse if (rlw.getRunningBit()) {\n\t\t\treturn;\n\t\t}\n\t\t// bit to set is in '0' clean word. We have to split this clean word and\n\t\t// shift following words in the buffer.\n\t\t// We do this by adding a new RLW y after the RLW x which has to be\n\t\t// split. This new RWL y takes over all the\n\t\t// literal words of x and encodes the part of the 0 sequence that\n\t\t// follows the bit we want to set. RWL x's\n\t\t// run length is reduced and we add the new bit as the new single\n\t\t// literal word for x.\n\t\telse {\n\t\t\tlong zeroRunLen = rlw.getRunningLength();\n\t\t\tlong newRunLen = offset / 64;\n\t\t\tlong afterRunLen = ((zeroRunLen * 64 - 63) / 64) - newRunLen;\n\t\t\tlong newNumLiterals = rlw.getNumberOfLiteralWords() + 1;\n\t\t\tfinal long newdata = 1l << (offset % 64);\n\n\t\t\t// no preceeding and following run length.\n\t\t\t// CASE 1) Try to merge with preceeding or following RLW.\n\t\t\tif (newRunLen == 0 && afterRunLen == 0) {\n\t\t\t\t// merge with previous if exists and possible\n\t\t\t\tif (prev != null\n\t\t\t\t\t\t&& prev.getNumberOfLiteralWords() + newNumLiterals <= RunningLengthWord.largestliteralcount) {\n\t\t\t\t\tprev.setNumberOfLiteralWords(prev.getNumberOfLiteralWords()\n\t\t\t\t\t\t\t+ newNumLiterals);\n\t\t\t\t\tthis.buffer[rlw.position] = newdata;\n\n\t\t\t\t\tif (this.rlw.equals(rlw))\n\t\t\t\t\t\tthis.rlw = prev;\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// No merging possible!\n\t\t\t// CASE 2) if previous run length = 0 then add new literal into\n\t\t\t// previous if previous still has space\n\t\t\tif (newRunLen == 0\n\t\t\t\t\t&& prev != null\n\t\t\t\t\t&& prev.getNumberOfLiteralWords() < RunningLengthWord.largestliteralcount) {\n\t\t\t\tprev.setNumberOfLiteralWords(prev.getNumberOfLiteralWords() + 1);\n\t\t\t\trlw.setRunningLength(afterRunLen);\n\t\t\t\tshiftCompressedWordsRight(rlw.position, 1);\n\t\t\t\tthis.buffer[prev.position + prev.getNumberOfLiteralWords()] =\n\t\t\t\t\t\tnewdata;\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// CASE 3) No merging possible, if following run length = 0, then\n\t\t\t// try to extend R with the new literal.\n\t\t\tif (afterRunLen == 0\n\t\t\t\t\t&& rlw.getNumberOfLiteralWords() < RunningLengthWord.largestliteralcount) {\n\t\t\t\trlw.setNumberOfLiteralWords(rlw.getNumberOfLiteralWords() + 1);\n\t\t\t\trlw.setRunningLength(newRunLen);\n\t\t\t\tshiftCompressedWordsRight(rlw.position + 1, 1);\n\t\t\t\tthis.buffer[rlw.position + 1] = newdata;\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// TODO rlw is full (literals) and next one has no running length\n\t\t\t// and is not full\n\t\t\tif (afterRunLen == 0\n\t\t\t\t\t& next != null\n\t\t\t\t\t&& rlw.getNumberOfLiteralWords() == RunningLengthWord.largestliteralcount\n\t\t\t\t\t&& next.getNumberOfLiteralWords() < RunningLengthWord.largestliteralcount) {\n\t\t\t\trlw.setRunningLength(rlw.getRunningLength() - 1);\n\t\t\t\tshiftCompressedWordsRight(rlw.position + 1, 1);\n\t\t\t\trlw.array = this.buffer;\n\t\t\t\tnext.array = this.buffer;\n\n\t\t\t\tthis.buffer[rlw.position + 1] = newdata;\n\n\t\t\t\t// switch next header with last literal\n\t\t\t\tlong temp = this.buffer[next.position + 1];\n\t\t\t\tthis.buffer[next.position + 1] = this.buffer[next.position];\n\t\t\t\tthis.buffer[next.position] = temp;\n\t\t\t\tnext.setNumberOfLiteralWords(next.getNumberOfLiteralWords() + 1);\n\n\t\t\t\tif (next.position + 1 == this.rlw.position)\n\t\t\t\t\tthis.rlw.position = next.position;\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// CASE 4) no extension possible. Have to SPLIT the zero sequence\n\t\t\t// and create new RLW\n\t\t\t// new RLW only gets a single literal\n\t\t\tif (afterRunLen == 0) {\n\t\t\t\tassert (rlw.getNumberOfLiteralWords() == RunningLengthWord.largestliteralcount);\n\n\t\t\t\tshiftCompressedWordsRight(rlw.position + 1, 1);\n\t\t\t\tshiftCompressedWordsRight(\n\t\t\t\t\t\trlw.position + rlw.getNumberOfLiteralWords() + 1, 1);\n\t\t\t\tRunningLengthWord newRlw =\n\t\t\t\t\t\tnew RunningLengthWord(this.buffer, rlw.position\n\t\t\t\t\t\t\t\t+ rlw.getNumberOfLiteralWords() + 1);\n\t\t\t\trlw.array = this.buffer;\n\n\t\t\t\tnewRlw.setNumberOfLiteralWords(1L);\n\t\t\t\tnewRlw.setRunningLength(0);\n\t\t\t\tnewRlw.setRunningBit(false);\n\n\t\t\t\trlw.setRunningLength(newRunLen);\n\n\t\t\t\tthis.buffer[rlw.position + 1] = newdata;\n\n\t\t\t\tif (newRlw.position > this.rlw.position)\n\t\t\t\t\tthis.rlw.position = newRlw.position;\n\t\t\t}\n\t\t\t// new RLW also gets run length\n\t\t\telse {\n\t\t\t\tshiftCompressedWordsRight(wordPos + 1, 2);\n\t\t\t\tRunningLengthWord newRlw =\n\t\t\t\t\t\tnew RunningLengthWord(this.buffer, wordPos + 2);\n\t\t\t\trlw.array = this.buffer;\n\n\t\t\t\tnewRlw.setNumberOfLiteralWords(rlw.getNumberOfLiteralWords());\n\t\t\t\tnewRlw.setRunningLength(afterRunLen);\n\t\t\t\tnewRlw.setRunningBit(false);\n\n\t\t\t\trlw.setRunningLength(newRunLen);\n\t\t\t\trlw.setNumberOfLiteralWords(1);\n\n\t\t\t\tthis.buffer[wordPos + 1] = newdata;\n\n\t\t\t\tif (newRlw.position > this.rlw.position)\n\t\t\t\t\tthis.rlw.position = newRlw.position;\n\t\t\t}\n\t\t}\n\t}",
"public void clear()\n\t{\n\t\tbitHolder.setValue(0);\n\t}",
"public static long lowestOneBit(long i) {\r\n // HD, Section 2-1\r\n return i & -i;\r\n }",
"public static void shift(){\n int[] x= {1, 5, 10, 7, -2};\n \n for (int i =0; i<x.length-1; i++){\n x[i]=x[i+1];\n }\n x[x.length-1]=0;\n for (int j=0; j<x.length; j++){\n System.out.println(x[j]);\n }\n\n\n\n }",
"public static int m7403a(int i) {\n int i2 = 0;\n while (i > 0) {\n i2++;\n i >>>= 1;\n }\n return i2;\n }",
"public void clearFlag( int flag )\n {\n value &= ~( 1 << ( MAX_SIZE - 1 - flag ) );\n }",
"static void findI1s(final int length, int[] B) {\r\n\t final long max = 1 << length;\r\n\t for (long i = 0; i < max; i++) {\r\n\t long currentNumber = i;\r\n\t final int[] buffer = new int[length];\r\n\t boolean[] I1 = new boolean[length]; // I1 to be passed to next method\r\n\t int bufferPosition = buffer.length;\r\n\t while (bufferPosition > 0) {\r\n\t buffer[--bufferPosition] = (int) (currentNumber & 1);\r\n\t currentNumber >>>= 1;\r\n\t }\r\n\t for(int x = 0; x < buffer.length; x++) {\r\n\t \tif(buffer[x] == 1) {\r\n\t \t\tI1[x] = true;\r\n\t \t}\r\n\t \telse {\r\n\t \t\tI1[x] = false;\r\n\t \t}\r\n\t \tSystem.out.print(buffer[x]);\r\n\t }\r\n\t\t System.out.println();\r\n\t }\r\n\t}",
"public static void main(int a) {\n// System.out.println(~43);\n int bit []=new int[8];\n for (int i = 7; i >=0;){\n\n\n\n }\n\n}",
"public void m21287OooO0O0(int i) throws RuntimeException {\n if (i < 0) {\n throw new RuntimeException();\n } else if (i <= this.f22758OooO00o - 1) {\n int[] iArr = this.f22759OooO00o;\n int i2 = i >>> 5;\n iArr[i2] = (OooO0O0[i & 31] ^ -1) & iArr[i2];\n }\n }",
"public static int[] removeZeros(int[] input)\n {\n int targetIndex = 0;\n for(int sourceIndex = 0; sourceIndex < input.length; sourceIndex++ )\n {\n if( input[sourceIndex] != 0 )\n input[targetIndex++] = input[sourceIndex];\n }\n\n int[] newArray = new int[targetIndex];\n System.arraycopy( input, 0, newArray, 0, targetIndex );\n\n return newArray;\n }",
"public static int updateBits(int n, int m, int i, int j) {\n\t\tint allOnes = ~0;\r\n\t\tSystem.out.println(\"allOnes: \" +AssortedMethods.toFullBinaryString( allOnes));\r\n\t\t//shift left allOnes j+1 times make all ones from j+1 to the end\r\n\t\t// if the time shift equals 32 result will be 32 bits 0s;\r\n\t\tint left = j < 31 ? allOnes << (j + 1) : 0;\r\n\t\tSystem.out.println(\"left: \" + AssortedMethods.toFullBinaryString(left));\r\n\t\t// shift 1 i times left make 1000000000, then minus 1 make first bit to i-1 bit to be 1111111;\r\n\t\tint right = ((1 << i) - 1);\r\n\t\tSystem.out.println(\"right: \" + AssortedMethods.toFullBinaryString(right));\r\n\t\t// combine left and right to be 1111110000000111111111\r\n\t\tint mask = left | right;\r\n\t\tSystem.out.println(\"mask: \" + AssortedMethods.toFullBinaryString(mask));\r\n\t\t// make int n from i to j to be 0s by and then together to make the mask\r\n\t\tint nWith0s = n & mask;\r\n\t\tSystem.out.println(\"nWith0s: \" + AssortedMethods.toFullBinaryString(nWith0s));\t\r\n\t\t// left shift m j times to make it match with the j to i empty position\r\n\t\tint mShifted = m << i;\r\n\t\tSystem.out.println(\"mShifted: \" + AssortedMethods.toFullBinaryString(mShifted));\r\n\t\t// insert m into n by or them together\r\n\t\treturn mShifted | nWith0s;\r\n\t}",
"public void shiftLeft(int[] nums, int zeroIndex)\n {\n // shift everything 1 to the left\n for ( int i = zeroIndex; i < nums.length - 1; i++)\n {\n nums[i] = nums[i+1];\n }\n \n // put zero at last\n nums[nums.length-1] = 0;\n }",
"public void clear() {\r\n\t\tbitset.clear();\r\n\t\tnumberOfAddedElements = 0;\r\n\t}",
"void reset() {\n for (int i = 0; i < array.length; i++) {\n array[i] = -1;\n }\n }",
"public static int flipBits(int a) {\n if(~a == 0)\n return Integer.SIZE;\n int maxlen=0, currlen=0, prevlen=0;\n\n while(a != 0) {\n if((a&1) == 1) {\n currlen++;\n } else if((a&1) == 0) {\n prevlen = (a&2) == 0 ? 0 : currlen;\n currlen=0;\n }\n maxlen = Math.max(currlen + prevlen + 1, maxlen);\n a >>>= 1;\n }\n return maxlen;\n }",
"private static int toggle(int bitVector, int index) {\n\t\tif(index < 0)\n\t\t\treturn bitVector;\n\t\t\n\t\tint mask = 1 << index;\n\t\tif((bitVector & mask) == 0) {\n\t\t\tbitVector |= mask;\n\t\t}else {\n\t\t\tbitVector &= ~mask;\n\t\t}\n\t\t\n\t\treturn bitVector;\n\t}",
"public String toBitString (int i) {\n\tint[] result = new int[64];\n\tint counter = 0;\n\twhile (i > 0) {\n\t\tresult[counter] = i % 2;\n\t\ti /= 2;\n\t\tcounter++;\n\t}\n\tString answer = \"\";\n\tfor (int j = 0; j < counter; j++)\n\t\tanswer += \"\" + result[j];\n\treturn answer;\t\n}",
"protected void clearBitAt(final int bitIndex) {\n _bitMap = _clearBit(_bitMap,\n \t\t\t\t\t(Numbers.INTEGER_WIDTH*8-1)-bitIndex-1);\n }",
"public int anySetBit()\n \t{\n \t\tint numbytes = getLengthInBytes();\n \t\tint bitpos;\n \n \t\tfor (int i = 0; i < numbytes-1; i++)\n \t\t{\n \t\t\tif (value[i] != 0)\n \t\t\t{\n \t\t\t\tfor (int j = 0; j < 8; j++)\n \t\t\t\t{\n \t\t\t\t\tbitpos = 7-j;\n \t\t\t\t\tif (((1 << bitpos) & value[i]) != 0)\n \t\t\t\t\t\treturn ((i*8)+j);\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \n \n \t\t// only the top part of the last byte is relevant\n \t\tbyte mask = (byte)(0xFF << (8-bitsInLastByte));\n \t\tif ((value[numbytes-1] & mask) != 0)\n \t\t{\n \t\t\tfor (int j = 0; j < bitsInLastByte; j++)\n \t\t\t{\n \t\t\t\tbitpos = 7-j;\n \t\t\t\tif (((1 << bitpos) & value[numbytes-1]) != 0)\n \t\t\t\t\treturn ((numbytes-1)*8)+j;\n \t\t\t}\n \t\t}\n \n \t\treturn -1;\n \t}",
"public static int[] reduce (int []n1) {\n\t\tfor (int i = 0; i < n1.length; i++) {\n\t\t\tif (n1[i] != 0) {\n\t\t\t\tif (i == 0) return copy(n1);\n\t\t\t\t\n\t\t\t\tint []newVal = new int[n1.length-i];\n\t\t\t\textract(newVal,0,n1,i,n1.length-i);\n\t\t\t\treturn newVal;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// just zero.\n\t\treturn new int[]{0};\n\t}",
"public int setBit(int i, int j){\n return (i|(1<<j));\n }",
"private int m10266c(int i) {\r\n return (i << 1) ^ (i >> 31);\r\n }",
"static int clearBit(int num, int pos) {\n\t\t\tint mask = ~(1<<pos);\n\t\t\treturn num & mask;\n\t\t}",
"private static void testShift() {\n for (int a:new int[]{96754441, -206107026, 803362655, Integer.MIN_VALUE+1}) {\n System.out.println(\"<<\");\n for (int i=0;i<=32;i++) {\n System.out.println(intToBin(a<<i) + \" \" + (a<<i));\n }\n System.out.println();\n System.out.println(\">>\");\n for (int i=0;i<=32;i++) {\n System.out.println(intToBin(a>>i) + \" \" + (a>>i));\n }\n System.out.println();\n System.out.println(\">>>\");\n for (int i=0;i<=32;i++) {\n System.out.println(intToBin(a>>>i) + \" \" + (a>>>i));\n }\n System.out.println();\n }\n }",
"public void clear() {\n\t\tn1 = n0 = 0L;\n\t}",
"public void resetBinary()\n\t{\n\t\tint k=0;\n\t\t\n\t\tfor (int i=0;i<binaryCode.length;i++)\n\t\t{\n\t\t\tfor (int j=0; j<PARITY.length; j++)\n\t\t\t{\n\t\t\t\t//if the bit is a parity bit, it is skipped\n\t\t\t\tif (i==PARITY[j])\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\t//if it is not a parity bit, the value is sent to the binary number\n\t\t\t\t\tbinaryNumber.setBinary(k, binaryCode[i]);\n\t\t\t\t\tk++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"public void setBitToZero(int k) {\n if (this.inBitRange(k)) {\n int i = k / 8;\n int j = k % 8;\n int b = this.data.get(i);\n int c = ~(1 << (7 - j));\n b = b & c;\n byte d = (byte) b;\n this.data.set(i, d);\n }\n }",
"private void reset(int i) {\n long x = data[i];\n if (isTag(x))\n cas(i, x, save[threadId(x)]);\n }",
"private static int[] trustedStripLeadingZeroInts(int val[]) {\n int vlen = val.length;\n int keep;\n\n // Find first nonzero byte\n for (keep = 0; keep < vlen && val[keep] == 0; keep++)\n ;\n return keep == 0 ? val : java.util.Arrays.copyOfRange(val, keep, vlen);\n }",
"public void moveZeroes(int[] nums) {\n for(int i=0; i<nums.length-1; i++) {\n if(nums[i] == 0) {\n int j=i+1;\n while(j < nums.length) {\n if(nums[j] != 0) {\n break;\n }\n j++;\n }\n //switch\n if(j < nums.length) {\n nums[i] = nums[j];\n nums[j] = 0;\n \n }\n }\n }\n }",
"static int toggleBit(int n){\n return n & (n-1);\n }",
"public int nextClearBit(int fromIndex){\n if(fromIndex<0)\n throw new IndexOutOfBoundsException(\"fromIndex < 0: \"+fromIndex);\n checkInvariants();\n int u=wordIndex(fromIndex);\n if(u>=wordsInUse)\n return fromIndex;\n long word=~words[u]&(WORD_MASK<<fromIndex);\n while(true){\n if(word!=0)\n return (u*BITS_PER_WORD)+Long.numberOfTrailingZeros(word);\n if(++u==wordsInUse)\n return wordsInUse*BITS_PER_WORD;\n word=~words[u];\n }\n }",
"private byte[] bit_conversion(int i) {\n // originally integers (ints) cast into bytes\n // byte byte7 = (byte)((i & 0xFF00000000000000L) >>> 56);\n // byte byte6 = (byte)((i & 0x00FF000000000000L) >>> 48);\n // byte byte5 = (byte)((i & 0x0000FF0000000000L) >>> 40);\n // byte byte4 = (byte)((i & 0x000000FF00000000L) >>> 32);\n\n // only using 4 bytes\n byte byte3 = (byte) ((i & 0xFF000000) >>> 24); // 0\n byte byte2 = (byte) ((i & 0x00FF0000) >>> 16); // 0\n byte byte1 = (byte) ((i & 0x0000FF00) >>> 8); // 0\n byte byte0 = (byte) ((i & 0x000000FF));\n // {0,0,0,byte0} is equivalent, since all shifts >=8 will be 0\n return (new byte[] { byte3, byte2, byte1, byte0 });\n }",
"public int reverseBits(int n) {\n int rev = 0;\n for(int i = 0; i<32; i++){\n rev = rev << 1;//creating a space of 1 in reverse\n rev = rev | (n & 1);// (n & 1 will give the last bit)\n // | operator will help in entering the last bit into rev\n n = n >> 1;// delete the last bit\n } \n return rev;\n }",
"public void setZeroes1(int[][] matrix) {\n boolean col00 = false;\n\n int row, col;\n int rows = matrix.length;\n int cols = matrix[0].length;\n for (row = 0; row < rows; ++row) {\n for (col = 0; col < cols; ++col) {\n if (matrix[row][col] == 0) {\n if (col != 0) {\n matrix[0][col] = 0;\n matrix[row][0] = 0;\n } else {\n col00 = true;\n }\n }\n }\n }\n for (row = rows - 1; row >= 0; --row) {\n for (col = 1; col < cols; ++col) {\n if (matrix[row][0] == 0 || matrix[0][col] == 0) {\n matrix[row][col] = 0;\n }\n }\n }\n if (col00) {\n for (row = rows - 1; row >= 0; --row) {\n matrix[row][0] = 0;\n }\n }\n }",
"public static int updateBits(int n, int m, int i, int j){\n\n\t\t// all '1's\n\t\tint max = ~0;\n\n\t\t// left with '1'\n\t\tint left = max - ((1<<j) -1);\n\n\t\t// right with '1'\n\t\tint right = ((1<<i) - 1);\n\n\t\t// left with '1', middle '0', and right '1'\n\t\tint mask = left | right;\n\n\t\t// clear up the middle\n\t\treturn (n & mask) | (m << i);\n\t}",
"public void removeZeros(ArrayList<Integer> arr) {\n\t\tfor (int i = arr.size() -1; i > -1; i--) {\n\t\t\tif(arr.get(i) == 0){\n\t\t\t\tarr.remove(i);\n\t\t\t}\n\t\t}\n\t}",
"public void reset() {\r\n\t\tfor(AnalogInput m_analog : mAnalogs)\r\n\t\t{\r\n\t\t\tif (m_analog != null) {\r\n\t\t\t\tm_analog.resetAccumulator();\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public int updateBits(int n, int m, int i, int j) {\n int clearMask = 0;\n if(j < 31){\n int allones = ~0;\n int left = allones << (j+1);\n int right = (1 << i) -1;\n clearMask = left | right;\n }else{\n clearMask = (1 << i)-1;\n }\n \n int clearedn = clearMask&n;\n int longerM = m << i;\n return clearedn | longerM;\n }",
"private static void setMatrixOnes(int[][] matrix) {\n\n\t\tint row = matrix.length;\n\t\tint col = matrix[0].length;\n\n\t\tboolean rowFlag = false;\n\t\tboolean colFlag = false;\n\n\t\tfor (int i = 0; i < row; i++) {\n\t\t\tfor (int j = 0; j < col; j++) {\n\n\t\t\t\t/* next two if conditions take special care for first row and first column */\n\n\t\t\t\t/* Scan the first row and set a variable rowFlag to indicate whether we need to set all 1s in first row or not. */\n\t\t\t\tif (i == 0 && matrix[i][j] == 1) {\t/* if any values in first row is 1, set rowFlag true */\n\t\t\t\t\trowFlag = true;\n\t\t\t\t}\n\n\t\t\t\t/* Scan the first column and set a variable colFlag to indicate whether we need to set all 1s in first column or not. */\n\t\t\t\tif (j == 0 && matrix[i][j] == 1) {\t/* if any values in first col is 1, set colFlag true */\n\t\t\t\t\tcolFlag = true;\n\t\t\t\t}\n\n\t\t\t\t/* Use first row and first column as the auxiliary arrays row[] and col[] respectively,\n\t\t\t\t * consider the matrix as sub matrix starting from second row and second column\n\t\t\t\t * */\n\t\t\t\tif (matrix[i][j] == 1) {\n\t\t\t\t\tmatrix[0][j] = 1;\n\t\t\t\t\tmatrix[i][0] = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/* Modify the given input matrix using the first row and first column of this matrix itself */\n\t\tfor (int i = 1; i < row; i++) {\n\t\t\tfor (int j = 1; j < col; j++) {\n\t\t\t\tif (matrix[0][j] == 1 || matrix[i][0] == 1) {\n\t\t\t\t\tmatrix[i][j] = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/* modify first row if there was any 1 */\n\t\tif (rowFlag) {\n\t\t\tfor (int j = 0; j < col; j++) {\n\t\t\t\tmatrix[0][j] = 1;\n\t\t\t}\n\t\t}\n\n\t\t/* modify first col if there was any 1 */\n\t\tif (colFlag) {\n\t\t\tfor (int i = 0; i < row; i++) {\n\t\t\t\tmatrix[i][0] = 1;\n\t\t\t}\n\t\t}\n\n\t\tprintTheMatrix(matrix);\n\t}",
"public final int mo41855a(int i) {\n if ((i & 2) == 0) {\n return 0;\n }\n lazySet(8);\n return 2;\n }",
"public static BitSet ShiftSet(BitSet bs, int a, boolean set) {\n BitSet temp = bs.get(0, a - 1);\n BitSet result = new BitSet();\n\n if (set == true) {\n result.set(0);\n }\n\n int j = 0;\n for (int i = 1; i < a; i++) {\n if (temp.get(j) == true) {\n result.set(i);\n }\n j++;\n }\n return result;\n }",
"public Builder clearOneof1111() {\n if (hugeOneofCase_ == 1111) {\n hugeOneofCase_ = 0;\n hugeOneof_ = null;\n onChanged();\n }\n return this;\n }",
"private int m690g(int i) {\n return (-(i & 1)) ^ (i >>> 1);\n }",
"static void getIndexSetBits(int[] setBits, long board) {\n\t\tint onBits = 0;\n\t\twhile (board != 0) {\n\t\t\tsetBits[onBits] = Long.numberOfTrailingZeros(board);\n\t\t\tboard ^= (1L << setBits[onBits++]);\n\t\t}\n\t\tsetBits[onBits] = -1;\n\t}",
"public Builder clearOneof1011() {\n if (hugeOneofCase_ == 1011) {\n hugeOneofCase_ = 0;\n hugeOneof_ = null;\n onChanged();\n }\n return this;\n }",
"public int numSetBits1(long a) {\n int count=0;\n while (a>0){\n count++;\n a = a & (a-1); //(x & (x - 1)) will unset the last set bit in x (which is why x&(x-1) is 0 for powers of 2).\n }\n\n return count;\n\t}",
"private void resetMask() {\n maskArray = new int [][]{\n {0,0,0,0},\n {0,0,0,0},\n {0,0,0,0},\n {0,0,0,0}\n };\n }",
"public static void sort(int[] arr)\n {\n // count number of 0's\n int count = 0;\n for (int value: arr)\n {\n if (value == 0) {\n count++;\n\n }\n }\n //System.out.println(count);\n // put 0's at the beginning\n int i = 0;\n while (count-- != 0) {\n arr[i] = 0;\n i++;\n }\n //System.out.println(i);\n\n // fill all remaining elements by 1\n while (i < arr.length) {\n arr[i] = 1;\n i++;\n }\n }",
"@Override\n\tpublic void reset() {\n\t\tfor(int i=0; i<mRemainedCounters; i++){\n\t\t\tfinal ICounter counter = this.mCounters.getFirst();\n\t\t\tcounter.reset();\n\t\t\tthis.mCounters.removeFirst();\n\t\t\tthis.mCounters.addLast(counter);\n\t\t}\n\t\tthis.mRemainedCounters = this.mCounters.size();\n\t}",
"private int m10275g(int i) {\r\n return (i >>> 1) ^ (-(i & 1));\r\n }",
"public static void plus1(int[]arr)\r\n\t{\r\n\t\tint i=arr.length-1;\r\n\t\twhile(i>=0&&arr[i]==1)\r\n\t\t\tarr[i--]=0;\r\n\t\tif(i>=0)\r\n\t\t\tarr[i]=1;\r\n\t}",
"public int bitAt(int i) {\n // PUT YOUR CODE HERE\n }",
"static boolean allBitsAreSet(int n)\r\n {\r\n // if true, then all bits are set\r\n if (((n + 1) & n) == 0)\r\n return true;\r\n\r\n // else all bits are not set\r\n return false;\r\n }",
"public static int[] exe1(int[] arr){ // Solution O(n) in time and constant in Memory\n int nzeros=0;\n\n for (int i=0; i<arr.length; i++) {\n arr[i-nzeros] = arr[i];\n if (arr[i] == 0) {\n nzeros++;\n }\n }\n for (int i=arr.length-1; i>arr.length-nzeros-1; i--) {\n arr[i] = 0;\n }\n\n return arr;\n }",
"public static void main(String[] args){\n\t\t int[] input = {1,3,0,3,0,6,0,9,23,45};\n\t\t int[] output = new ShiftAllZero().shiftZero(input);\n\t\t for (int index = 0; index < input.length; index++) {\n\t\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(output[index]);\n\t\t\t\n\t\t\t}\n\t\t \n\t\t \n\t\t \n\t \n\t }",
"public int reverseBits(int n) {\n\n return 1;\n }",
"void removeScans(int i);",
"public BigInteger shiftLeftOneBit() {\n return signum() == 0 ? this : BitLevel.shiftLeftOneBit(this);\n }",
"public void clear()\n\t{\n\t\tfor (int i = 0; i < data.length; i++)\n\t\t{\n\t\t\tdata[i] = 0;\n\t\t}\n\t}",
"private void resetToBase(){\n\t\t//find number of markers after base\n\t\tSystem.out.println(\"here is the base: \" + base);\n\t\tint numMarkers = 0;\n\n\t\tfor(int i=base+1; i<indices.length; i++){\n\t\t\tif(indices[i]==1){\n\t\t\t\tindices[i] = 0;\n\t\t\t\tnumMarkers++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i=base; i<base+numMarkers; i++){\n\t\t\tindices[i+1] = 1;\n\t\t}\n\t}",
"public EfficientTerminalSet empty() {\n return new EfficientTerminalSet(terminals, indices, new int[data.length]);\n }",
"public void setZeroes(int[][] matrix) {\n\t\t\tint m = matrix.length;\n\t\t\tint n = matrix[0].length;\n\t\t\t\n\t\t\tboolean fc = false, fr = false; // first row, first column as markers\n\t\t\tfor (int i = 0; i < m; i++) {\n\t\t\t\tfor (int j = 0; j < n; j++) {\n\t\t\t\t\tif (matrix[i][j] == 0) {\n\t\t\t\t\t\tif (i == 0) fr = true;\n\t\t\t\t\t\tif (j == 0) fc = true;\n\t\t\t\t\t\tmatrix[0][j] = 0;\n\t\t\t\t\t\tmatrix[i][0] = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (int i = 1; i < m; i++) {\n\t\t\t\tfor (int j = 1; j < n; j++) {\n\t\t\t\t\tif (matrix[0][j] == 0 || matrix[i][0] == 0) {\n\t\t\t\t\t\tmatrix[i][j] = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (fr) {\n\t\t\t\tfor (int j = 0; j < n; j++) {\n\t\t\t\t\tmatrix[0][j] = 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (fc) {\n\t\t\t\tfor (int i = 0; i < m; i++) {\n\t\t\t\t\tmatrix[i][0] = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public void setZeroes(int[][] matrix) {\n int MOD = -1000000;\n //no of rows\n int m = matrix.length;\n //no of columns\n int n = matrix[0].length;\n //Iterate over the matrix\n for (int i = 0; i<m; i++)\n {\n for (int j = 0; j<n; j++)\n {\n //check if element is 0\n if(matrix[i][j] == 0)\n {\n \n //for all the values in that row i which contains the 0 element \n for (int k = 0; k < n ; k++)\n {\n //Check for non zero elements in that row \n if(matrix[i][k] !=0)\n {\n //Assign dummy value to it\n matrix[i][k] = MOD;\n }\n }\n //all the values in that column j which contains the 0 element\n for (int k=0; k< m; k++)\n { \n //Check for non zero elements in that column\n if(matrix[k][j]!=0)\n {\n //Assign dummy value to it\n matrix[k][j] = MOD;\n } \n }\n }\n }\n }\n //Iterate again for final output matrix\n for (int i = 0; i< m ; i++)\n {\n for (int j = 0; j< n; j++ )\n {\n //Check if the value of element is MOD\n if (matrix[i][j] == MOD)\n {\n //if so Change to 0\n matrix[i][j] = 0;\n }\n }\n }\n \n }",
"public void resetCarry() {\n\t\tset((byte) (get() & ~(1 << 4)));\n\t}",
"public int[][] zeroMatrix(int[][] matrix){\n\tboolean[][] zeros = new boolean[matrix.length][matrix[0].length];\n\tfor (int i = 0; i < matrix.length; i++){\n\t\tfor (int j = 0; j < matrix[0].length; j++) {\n\t\t\tif (matrix[i][j] == 0) zeros[i][j] = true;\n\t\t}\n\t}\n\n\tfor (int i = 0; i < matrix.length; i++) {\n\t\tfor (int j = 0; j < matrix[0].length; j++) {\n\t\t\tif (zeros[i][j]){\n\t\t\t\tfor (int k = 0; k < matrix.length; k++){\n\t\t\t\t\tmatrix[k][j] = 0;\n\t\t\t\t}\n\t\t\t\tfor (int k = 0; k < matrix[0].length; k++){\n\t\t\t\t\tmatrix[i][k] = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn matrix;\n}",
"private void clearAll(byte value) {\n for (int i = 0; i < size; i++) {\n data[i] = (byte) (value & 0xff);\n }\n }",
"public DigitalNetBase2IteratorShiftNoGray() {\n super(); \n dimS = dim + 1;\n if (digitalShift != null && dimShift < dimS)\n addRandomShift (dimShift, dimS, shiftStream);\n resetCurPointIndex();\n }",
"public Builder clearI17() {\n bitField0_ = (bitField0_ & ~0x00010000);\n i17_ = 0;\n onChanged();\n return this;\n }",
"public static int mask(int start, int size) {\r\n // Checks that start and size form a valid bit range\r\n checkArgument(start >= 0 && start <= Integer.SIZE && size >= 0\r\n && size <= Integer.SIZE && start + size <= Integer.SIZE);\r\n\r\n // Creating a value whose binary representation has size 1s as its\r\n // LSBs (1L is used instead of 1 to bypass the int\r\n // type's bit shifting limit)\r\n int unshiftedMask = (int) (1L << size) - 1;\r\n\r\n // Shifting those 1s to the correct position\r\n return unshiftedMask << start;\r\n }",
"public void flip(int bitIndex);",
"private static String zeroPaddedBitString(int value) {\n String bitString = Integer.toBinaryString(value);\n return String.format(\"%32s\", bitString).replace(\" \", \"0\");\n }",
"private void _setUnshifted ()\r\n {\r\n m_bBase64mode = false;\r\n m_nBitsRead = 0;\r\n m_nTempChar = 0;\r\n }",
"public void leftRotateByOne(int[] data) {\n\t\tint temp = data[0]; // Storing first element in temp value\n\t\tfor (int i = 0; i < data.length - 1; i++) {\n\t\t\t// shift each element\n\t\t\tdata[i] = data[i + 1];\n\t\t}\n\t\t// store the last index by temp val\n\t\tdata[data.length - 1] = temp;\n\t}"
] | [
"0.66237324",
"0.6515706",
"0.6446545",
"0.6434919",
"0.63777524",
"0.6018041",
"0.589573",
"0.58884233",
"0.57173735",
"0.57133555",
"0.56650543",
"0.5554546",
"0.54829824",
"0.545864",
"0.5431187",
"0.5423641",
"0.5352806",
"0.5313683",
"0.5281762",
"0.52734435",
"0.5258113",
"0.5243472",
"0.5235416",
"0.5167778",
"0.51479477",
"0.5125631",
"0.5120323",
"0.5118191",
"0.510916",
"0.5086987",
"0.5084656",
"0.50811785",
"0.5079175",
"0.50774926",
"0.506101",
"0.50496286",
"0.5046874",
"0.50425166",
"0.5038253",
"0.49959704",
"0.4984856",
"0.4962155",
"0.4952505",
"0.49504003",
"0.49496946",
"0.49356523",
"0.49300358",
"0.4922219",
"0.4914245",
"0.4909759",
"0.49076292",
"0.48978466",
"0.48797813",
"0.48709765",
"0.48601958",
"0.48546982",
"0.48467225",
"0.48453274",
"0.4843042",
"0.4835411",
"0.48246568",
"0.4819193",
"0.48161882",
"0.4795804",
"0.47802785",
"0.47786754",
"0.47738916",
"0.476528",
"0.47602177",
"0.47528505",
"0.47406238",
"0.47328055",
"0.47305882",
"0.4718793",
"0.4716998",
"0.471323",
"0.4713065",
"0.47114876",
"0.4702866",
"0.4699434",
"0.46970627",
"0.46895868",
"0.46881998",
"0.46849012",
"0.46695134",
"0.46662855",
"0.4666263",
"0.46627656",
"0.46486476",
"0.4647127",
"0.46469522",
"0.46467987",
"0.46425712",
"0.46405092",
"0.46290708",
"0.46229082",
"0.462025",
"0.46113688",
"0.4609871",
"0.46088722"
] | 0.64115655 | 4 |
Create Date: 11/01/16 Author: Peiweiwei Description: ProductCategoryContract | public interface ProductCategoryContract {
interface Presenter extends IPresenter {
void onCategoryClick(String pos);
}
interface View extends IView {
void onCateClickChange(String pos);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"CategoryType createCategoryType();",
"public CategoryRecord() {\n\t\tsuper(com.cellarhq.generated.tables.Category.CATEGORY);\n\t}",
"public String getCategory_name(){return category_name;}",
"public ProductListContract() {}",
"public long createCategory(CategoryModel categoryModel){\n //access the database\n SQLiteDatabase db = this.getWritableDatabase();\n\n //set the parameters\n ContentValues values = new ContentValues();\n values.put(InventoryContract.CategoryEntry.COLUMN_CATEGORY_NAME, categoryModel.getName());\n\n //insert the row\n long category_id = db.insert(CategoryEntry.TABLE_NAME, null, values);\n\n return category_id;\n }",
"x0401.oecdStandardAuditFileTaxPT1.ProductDocument.Product addNewProduct();",
"@Override\n\t\t\t\tpublic String getKey() {\n\t\t\t\t\treturn \"category\";\n\t\t\t\t}",
"@Override\n public ProductCategories createFromParcel(Parcel parcel_in) {\n return new ProductCategories(parcel_in);\n }",
"public String getName(){\n return category;\n }",
"public void createContract() {\n\r\n\t}",
"void add(ProductCategory category);",
"@Override\n public Category createCategory(Category newCategory)\n {\n // format the string\n String query = \"INSERT INTO Categories(CategoryName, Description, CreationDate)\";\n query += \" VALUES ('%1$s', '%2$s', '%3$s')\";\n \n query = String.format(query, newCategory.getCategoryName(), newCategory.getDescription(),\n newCategory.getCreationDate());\n \n // if everything worked, inserted id will have the identity key\n // or primary key\n int insertedId = DataService.executeCreate(query);\n if (insertedId > 0)\n {\n return getCategoryById(insertedId);\n }\n \n return null;\n }",
"private static void getAttributes(productCategory product) {\n PreparedStatement stmt = null;\n ResultSet myRst = null;\n\n try {\n //we can use DESCRIBE query if we hard code the tale name.\n //swap the parameterized statement for a normal statement\n //object since we will not take dynamic input\n\n //String pstmt = \"DESCRIBE ?;\";\n\n String pstmt = \"SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = ?\";\n\n stmt = DBConnectionManager.con.prepareStatement(pstmt);\n stmt.setString(1, product.categoryName.getValue());\n myRst = stmt.executeQuery();\n\n while (myRst.next()) {\n product.attributes.add(myRst.getString(4));\n }\n\n } catch (SQLException e) {\n e.printStackTrace();\n } finally {\n try {\n if (myRst != null) myRst.close();\n } catch (Exception ignored) {\n }\n try {\n if (stmt != null) stmt.close();\n } catch (Exception ignored) {\n }\n }\n\n }",
"private CatalogContract() {}",
"void createCodeCategory(CodeCategory codeCategory)\n throws DAOException;",
"public Product(String name, String group){\n \tthis.name = name;\n this.group = group;\n \tbDate = new Date();\n pastEDays = new ArrayList<Integer>();\n pastUDays = new ArrayList<Integer>();\n }",
"public String getCategory(){\r\n\t\treturn this.category;\r\n\t}",
"public Category getTicketCategory() { return ticketCategory; }",
"CreateCategoryResponse createCategory(CreateCategoryRequest request);",
"public void createProductCategory(HttpServletRequest request){\n \n HttpSession session = request.getSession();\n \n DAOFactory mySqlFactory = DAOFactory.getDAOFactory();\n ProductCategoryDAO riverProductCategoryDAO = mySqlFactory.getProductCategoryDAO();\n ProductCategoryDAO productCategoryDAO = new MySQLProductCategoryDAOImpl();\n \n List productCategories = productCategoryDAO.getAllProductCategories();\n \n //productCategories\n ProductCategory tmp3 = null;\n String[][] productCategoriesMatrix = new String[productCategories.size()][2];\n\n for(int i=0; i<productCategories.size(); i++){\n\n tmp3 = (ProductCategory)productCategories.get(i);\n\n productCategoriesMatrix[i][0] = Integer.toString(tmp3.getPCID());\n productCategoriesMatrix[i][1] = tmp3.getName();\n \n }\n \n session.setAttribute(\"productCategories\", productCategoriesMatrix);\n \n }",
"public Category getCategory() {\n return category;\n }",
"public void newCategory() {\n btNewCategory().push();\n }",
"public Category() {\n categoryName = null;\n }",
"@Override\r\n\tpublic void addCategory() {\n\t\tCategory cat=new Category();\r\n\t\tcat.setNameCategory(\"Computing Tools\");\r\n\t\tem.persist(cat);\r\n\t\t\r\n\t}",
"@Test\n public void testCreationTimestamp() {\n Product newProduct = TestUtil.createProduct();\n productCurator.create(newProduct);\n Pool pool = createPoolAndSub(owner, newProduct, 1L,\n TestUtil.createDate(2011, 3, 30),\n TestUtil.createDate(2022, 11, 29));\n poolCurator.create(pool);\n \n assertNotNull(pool.getCreated());\n }",
"CategoriesType createCategoriesType();",
"CategoriesType createCategoriesType();",
"public Cgg_veh_categoria(){}",
"public String getCategory() {\n return this.category;\n }",
"java.lang.String getProductDescription();",
"public ComProduct create_comproduct(ComProduct ComProduct, IBUser user) throws Exception {\n\n \t\t log.setLevel(Level.INFO);\n\t log.info(\"create_comproduct service operation started !\");\n\n\t\ttry{\n\t\t\tComProduct the_ComProduct;\n\n\t\t\tthe_ComProduct = ComProduct_Default_Activity_dao.create_comproduct(ComProduct, user);\n\n \t\t\tlog.info(\" Object returned from create_comproduct service method !\");\n\t\t\treturn the_ComProduct;\n\n\t\t}catch(Exception e){\n\n\t\t\tSystem.out.println(\"ServiceException: \" + e.toString());\n\t\t\tlog.error(\"create_comproduct service throws exception : \"+ e.toString());\n\n\t\t}\n\t\treturn null;\n\n\n\n\t}",
"private static String constructValues(productCategory product,ArrayList<String> attributes,String partNumber)\n {\n //Since we will already have INSERT INTO *Category* we can start with the '('\n\n /* STMT: INSERT INTO *Category* */\n StringBuilder val = new StringBuilder(\" (\");\n\n /* STMT: INSERT INTO *Category* ( */\n\n val.append(product.categoryName.getValue());\n if(attributes.size() > 0)\n {\n val.append(\"_Part_Number,\");\n }\n else\n {\n val.append(\"_Part_Number\");\n }\n\n //the attributes array holds the names of\n //each column in the specified category table\n //here we add them all to the string in the\n //proper format\n for(int i=0; i<attributes.size(); i++)\n {\n attributes.set(i,attributes.get(i).replace(\" \",\"_\"));\n val.append(attributes.get(i));\n //If we are at the last attribute we\n //don't need to add the extra comma\n if(i != attributes.size()-1)\n {\n val.append(\",\");\n }\n\n }\n\n /* STMT: INSERT INTO *Category* (*All columns in table* */\n\n //Close the columns and start values\n val.append(\") VALUES ('\");\n\n /* STMT: INSERT INTO *Category* (*All columns in table*) VALUES (' */\n\n //Since attributes does not contain the part\n //number we have to add that separately\n val.append(partNumber);\n\n /* STMT: INSERT INTO *Category* (*All columns in table*) VALUES ('*PartNumber* */\n\n //It is possible that a product category can\n //have no attributes except the part number.\n //if this is the case make sure we don't add\n //the extra comma in the statement\n if(!attributes.isEmpty())\n {\n val.append(\"',\");\n }\n else\n {\n val.append(\"'\");\n }\n\n /* STMT: INSERT INTO *Category* (*All columns in table*) VALUES ('*PartNumber*', */\n\n\n //Now we can get the actual values for each column\n //by pulling the values from the productCategory\n //'product' object's 'attributes' array\n for(int i=0; i<product.attributes.size(); i++)\n {\n val.append(\"'\");\n val.append(product.attributes.get(i));\n //If we are at the last value make sure\n //we don't add the extra comma\n if(i != product.attributes.size()-1)\n {\n val.append(\"',\");\n }\n else\n {\n val.append(\"'\");\n }\n }\n\n /* STMT: INSERT INTO *Category* (*All columns in table*) VALUES ('*PartNumber*,'*All Values*' */\n\n //finally we close the statement\n val.append(\");\");\n\n /* STMT: INSERT INTO *Category* (*All columns in table*) VALUES ('*PartNumber*,'*All Values*'); */\n\n return val.toString();\n }",
"@Override\n public String getCategory() {\n return category;\n }",
"public String getCategory()\n {\n return category;\n }",
"public List<CatalogueCompatableResource> toResources(List<Catalogue> catalogueList,Long merchantNo,String cusLoyaltyId){\n List<CatalogueCompatableResource> catalogueCompatableResourcesList = new ArrayList<CatalogueCompatableResource>();\n\n\n\n\n\n for(Catalogue catalogue:catalogueList){\n\n Integer customerHasPoint =0;\n\n CatalogueCompatableResource catalogueCompatableResource =new CatalogueCompatableResource();\n\n catalogueCompatableResource.setCat_prd_no(catalogue.getCatProductNo()==null?0L:catalogue.getCatProductNo());\n\n String catPrdCategoryText =\"\";\n\n //for setting product category test\n if(catalogue.getCatCategory() !=null){\n\n int catCategory = catalogue.getCatCategory();\n\n //getting coded value for catcategory\n CodedValue codedValue = codedValueService.findByCdvIndexAndCdvCodeValue(CodedValueIndex.CATALOGUE_PRODUCT_CATEGORY,catCategory);\n\n if(codedValue !=null){\n\n catPrdCategoryText =codedValue.getCdvCodeLabel();\n }\n\n }\n\n\n\n catalogueCompatableResource.setCat_prd_category_text(catPrdCategoryText);\n\n catalogueCompatableResource.setCat_prd_category(catalogue.getCatCategory()==null?0:catalogue.getCatCategory());\n\n catalogueCompatableResource.setCat_prd_code(catalogue.getCatProductCode()==null?\"\":catalogue.getCatProductCode());\n\n catalogueCompatableResource.setCat_prd_desc(catalogue.getCatDescription() == null ? \"\" : catalogue.getCatDescription());\n\n catalogueCompatableResource.setCat_prd_long_desc(catalogue.getCatLongDescription()==null?\"\":catalogue.getCatLongDescription());\n\n\n\n // Check if the image exists\n Image image = catalogue.getImage();\n\n //get the imageUrl\n String imageUrl = environment.getProperty(\"IMAGE_PATH_URL\");\n\n\n //If the image is set, then we need to set the image path\n if ( image != null ) {\n\n // Get the image path\n String imagePath = imageService.getPathForImage(image, ImagePathType.MOBILE);\n\n // Set the imagePath\n catalogueCompatableResource.setCat_image(imageUrl + imagePath);\n\n\n }\n\n catalogueCompatableResource.setCat_image_id(catalogue.getCatProductImage()==null?0L:catalogue.getCatProductImage());\n\n catalogueCompatableResource.setCat_rwd_points(catalogue.getCatNumPoints()==null?0.0:catalogue.getCatNumPoints());\n\n catalogueCompatableResource.setCat_cash(catalogue.getCatPartialCash()==null?0.0:catalogue.getCatPartialCash());\n\n //find reward balance\n CustomerRewardBalance customerRewardBalance =customerRewardBalanceService.findByCrbLoyaltyIdAndCrbMerchantNoAndCrbRewardCurrency(cusLoyaltyId,merchantNo,catalogue.getCatRewardCurrencyId());\n\n if(customerRewardBalance !=null){\n\n Double rewardBalance = customerRewardBalance.getCrbRewardBalance();\n\n if(rewardBalance !=null){\n\n\n //check customer has balance if its true set 1 otherwise set o\n if(rewardBalance>=catalogue.getCatNumPoints()){\n\n customerHasPoint =1;\n }\n }\n\n catalogueCompatableResource.setCat_rwd_balance(rewardBalance==null?0.0:rewardBalance);\n\n\n\n\n }\n\n catalogueCompatableResource.setCat_rwd_currency(catalogue.getCatRewardCurrencyId()==null?0:catalogue.getCatRewardCurrencyId());\n\n //for setting merchant name\n Merchant merchant = merchantService.findByMerMerchantNo(merchantNo);\n\n if(merchant !=null){\n\n catalogueCompatableResource.setCat_merchant_name(merchant.getMerMerchantName()==null?\"\":merchant.getMerMerchantName());\n }\n\n\n catalogueCompatableResource.setCat_has_balance(customerHasPoint);\n\n catalogueCompatableResourcesList.add(catalogueCompatableResource);\n\n\n\n\n }\n\n\n return catalogueCompatableResourcesList;\n\n }",
"public Category getCategory() {\r\n return category;\r\n }",
"@Override\n\tpublic String toString() {\n\t\treturn \"Category [categoryid=\" + categoryid + \", name=\" + capitalize(name) + \"]\";\n\t}",
"public String getCategory() {\n return category;\n }",
"@Override\n\tpublic Date getCreated_date() {\n\t\treturn _buySellProducts.getCreated_date();\n\t}",
"@Test\r\n\tpublic void testGetCategoryString() {\r\n\t\tManagedIncident incident = new ManagedIncident(\"jsmith\", Category.NETWORK, Priority.LOW, \"Johnny\", \"lol\");\r\n\t\tassertEquals(\"Network\", incident.getCategoryString());\r\n\t\t\r\n\t\tManagedIncident incident1 = new ManagedIncident(\"jsmith\", Category.DATABASE, Priority.LOW, \"Johnny\", \"lol\");\r\n\t\tassertEquals(\"Database\", incident1.getCategoryString());\r\n\t\t\r\n\t\tManagedIncident incident2 = new ManagedIncident(\"jsmith\", Category.INQUIRY, Priority.LOW, \"Johnny\", \"lol\");\r\n\t\tassertEquals(\"Inquiry\", incident2.getCategoryString());\r\n\t\t\r\n\t\tManagedIncident incident3 = new ManagedIncident(\"jsmith\", Category.HARDWARE, Priority.LOW, \"Johnny\", \"lol\");\r\n\t\tassertEquals(\"Hardware\", incident3.getCategoryString());\r\n\t\t\r\n\t\tManagedIncident incident4 = new ManagedIncident(\"jsmith\", Category.SOFTWARE, Priority.LOW, \"Johnny\", \"lol\");\r\n\t\tassertEquals(\"Software\", incident4.getCategoryString());\r\n\t\t\r\n\t}",
"public ItemCategory getCategory();",
"public List<ProductCatagory> getAllCategory() throws BusinessException;",
"public String toString() {\n\t\treturn category;\n\t}",
"@Test\n\tpublic void testCreateCategoryDetails() throws Exception {\n\n\t\tList<Category> categories = new ArrayList<>();\n\t\tCategory category = new Category();\n\t\tcategory.setTenantId(\"default\");\n\n\t\tAuditDetails auditDetails = new AuditDetails();\n\t\tcategory.setAuditDetails(auditDetails);\n\n\t\tCategoryDetail categoryDetail = new CategoryDetail();\n\n\t\tList<CategoryDetail> categoryDetails = new ArrayList<>();\n\t\tcategoryDetails.add(categoryDetail);\n\t\tcategory.setDetails(categoryDetails);\n\t\tcategories.add(category);\n\n\t\tCategoryResponse categoryResponse = new CategoryResponse();\n\t\tcategoryResponse.setResponseInfo(new ResponseInfo());\n\t\tcategoryResponse.setCategories(categories);\n\n\t\ttry {\n\n\t\t\twhen(categoryService.createCategoryMaster(any(CategoryRequest.class),any(String.class))).thenReturn(categoryResponse);\n\n\t\t\tmockMvc.perform(\n\t\t\t\t\tpost(\"/category/v1/_create\")\n\t\t\t\t\t.contentType(MediaType.APPLICATION_JSON)\n\t\t\t\t\t.content(getFileContents(\"categoryDetailsCreateRequest.json\")))\n\t\t\t\t\t.andExpect(status().isOk())\n\t\t\t\t\t.andExpect(content().contentTypeCompatibleWith(MediaType.APPLICATION_JSON))\n\t\t\t\t\t.andExpect(content().json(getFileContents(\"categoryDetailsCreateResponse.json\")));\n\n\t\t} catch (Exception e) {\n\n\t\t\tassertTrue(Boolean.FALSE);\n\t\t}\n\n\t\tassertTrue(Boolean.TRUE);\n\n\t}",
"public void setCategory(String category){\n this.category = category;\n }",
"CodeType getCategory();",
"public String getCategory() {\r\n return category;\r\n }",
"public Category() {\n }",
"public void callCreateBillCategory(String partnerKey, String billerCategory, String description)\r\n\t{\r\n\t\tfinal String methodName = \"callListBillCategory\";\r\n\t\tlogger.entering(CLASS_NAME, methodName);\r\n\t\ttry\r\n\t\t{\r\n\t\t\tCreateBillCategoryRequestType billCategory = new CreateBillCategoryRequestType();\r\n\t\t\tBillCategoryDetailType billCategoryDetail = new BillCategoryDetailType();\r\n\t\t\t\r\n\t\t\tbillCategoryDetail.setBillCategory(billerCategory);\r\n\t\t\tbillCategoryDetail.setDescription(description);\r\n\t\t\tbillCategoryDetail.setStatus(ConfigurationStatusEnum.ACTIVE);\r\n\t\t\t\r\n\t\t\tbillCategory.setMessageHeader(getMessageHeaderType(\"CREATE_BILL_CATEGORY\"));\r\n\t\t\tbillCategory.setPartnerKey(partnerKey);\r\n\t\t\tbillCategory.setBillCategoryDetail(billCategoryDetail);\r\n\t\t\t\r\n\t\t\tpartnerProfileServices.createBillCategory(billCategory);\r\n\t\t}\r\n\t\tcatch (NullPointerException e)\r\n\t\t{\r\n\t\t\tlogger.logp(Level.SEVERE, CLASS_NAME, methodName, e.getMessage());\r\n\t\t\tif (logger.isLoggable(Level.FINEST))\r\n\t\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tcatch (DatatypeConfigurationException e)\r\n\t\t{\r\n\t\t\tlogger.logp(Level.SEVERE, CLASS_NAME, methodName, e.getMessage());\r\n\t\t\tif (logger.isLoggable(Level.FINEST))\r\n\t\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tcatch (PartnerProfileFaultMsg e)\r\n\t\t{\r\n\t\t\tlogger.logp(Level.SEVERE, CLASS_NAME, methodName, e.getMessage());\r\n\t\t\tif (logger.isLoggable(Level.FINEST))\r\n\t\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tlogger.exiting(CLASS_NAME, methodName);\r\n\t}",
"public ProductCategory(int category_id, String categoryName) {\n this.category_id = category_id;\n this.categoryName = categoryName;\n }",
"String productKind();",
"public category() {\r\n }",
"List<ProductCategory> getAll();",
"public String category() {\n return this.category;\n }",
"public String category() {\n return this.category;\n }",
"public Category() {\n super();\n }",
"x0401.oecdStandardAuditFileTaxPT1.SAFPTProductDescription xgetProductDescription();",
"public String getCategory() {\n return category;\n }",
"public String getCategory() {\n return category;\n }",
"public RoomCategory getRoomCategory(com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.roomcategory.v1.RoomCategory res){\n\t\tRoomCategory roomCategory = new RoomCategory();\n\t\t\n\t\troomCategory.setRoomTypeCode( res.getRoomTypeCode() );\n\t\troomCategory.setRoomTypeDescription( res.getRoomTypeDescription() );\n\t\t\n//\t\tCode to set the room description in UI\n\t\tString roomDescription = res.getRoomTypeDescription();\n\t\tif (roomDescription!=null && roomDescription.contains(\":\")) {\n\t\t\tint firstColonIndex=roomDescription.indexOf(\":\");\n\t\t\tint lastCOlonIndex= roomDescription.lastIndexOf(\":\");\n\t\t\tString removedString = (roomDescription.substring(firstColonIndex,lastCOlonIndex+1));\n\t\t\tString roomTypeToBediplayedonUI = roomDescription.replace(removedString, \"\");\n\t\t\t\n\t\t\troomCategory.setRoomTypeCode( res.getRoomTypeCode() + \"-RD-\" + roomDescription);\n\t\t\troomCategory.setRoomTypeDescription(roomTypeToBediplayedonUI);\n\t\t}\n\t\telse{\n\t\t\t//Start the fix of HBSI 52 - Phase 1 // Setting the default roomTypeCode and Description\n\t\t\troomCategory.setRoomTypeCode( res.getRoomTypeCode());\n\t\t\troomCategory.setRoomTypeDescription(res.getRoomTypeDescription());\n\t\t}\n\t\t //End the fix of HBSI 52 -Phase 1 \n\t\troomCategory.setRatePlanId( res.getRatePlanId() );\n\t\troomCategory.setRatePlanCode( res.getRatePlanCode() );\n\t\troomCategory.setRatePlanDescription( res.getRatePlanDescription() );\n\t\tif( res.getRateIndicator() != null ){\n\t\t\troomCategory.setRateIndicator( res.getRateIndicator() );\n\t\t}\n\t\telse{\n\t\t\troomCategory.setRateIndicator( \"\" );\n\t\t}\n\t\tif( res.getCorporateId() != null ){\n\t\t\troomCategory.setCorporateId( res.getCorporateId() );\n\t\t}\n\t\telse{\n\t\t\troomCategory.setCorporateId( \"\" );\n\t\t}\n\t\tif( res.getGuaranteeType() != null ){\n\t\troomCategory.setGuaranteeType( res.getGuaranteeType() );\n\t\t}\n\t\telse{\n\t\t\troomCategory.setGuaranteeType( \"\" );\n\t\t}\n\t\tif( res.getGuaranteeMethod() != null ){\n\t\troomCategory.setGuaranteeMethod( res.getGuaranteeMethod() );\n\t\t}\n\t\telse{\n\t\t\troomCategory.setGuaranteeMethod( \"\" );\n\t\t}\n\t\tif( res.getGuaranteeRequired() != null ){\n\t\troomCategory.setGuaranteeRequired( res.getGuaranteeRequired() );\n\t\t}\n\t\telse{\n\t\t\troomCategory.setGuaranteeRequired( \"\" );\n\t\t}\n\t\troomCategory.setRatePlanCategory( res.getRatePlanCategory() );\n\t\troomCategory.setStatus( res.getStatus() );\n\t\tif( res.getCurrency() != null ){\n\t\t\troomCategory.setCurrency( res.getCurrency() );\n\t\t}\n\t\telse{\n\t\t\troomCategory.setCurrency( \"\" );\n\t\t}\n\t\troomCategory.setPosnr( res.getPosnr() );\n\t\troomCategory.setOldPosnr( res.getOldPosnr() );\n\t\troomCategory.setMealplanDesc( res.getMealplanDesc() );\n\t\tif( res.getHotelId() != null ){\n\t\t\troomCategory.setHotelId( res.getHotelId().intValue() );\n\t\t}\n\t\tif( res.getRoomCategoryId() != null ){\n\t\t\troomCategory.setRoomCategoryId( res.getRoomCategoryId().intValue() );\n\t\t}\n\t\tif( res.getNoOfRoomsAvailable() != null ){\n\t\t\troomCategory.setNoOfRoomsAvailable( res.getNoOfRoomsAvailable().intValue() );\n\t\t}\n\t\tif( res.isRiskRoomCategory() != null ){\n\t\t\troomCategory.setRiskRoomCategory( res.isRiskRoomCategory().booleanValue() );\n\t\t}\n\t\tif( res.isAppleChoice() != null ){\n\t\t\troomCategory.setAppleChoice( res.isAppleChoice().booleanValue() );\n\t\t}\n\t\tif( res.getGuaranteeAmount() != null ){\n\t\t\troomCategory.setGuaranteeAmount( res.getGuaranteeAmount() );\n\t\t}\n\t\tif( res.getDisplayRoomPrice() != null ){\n\t\t\troomCategory.setDisplayRoomPrice( this.getRoomPrice( res.getDisplayRoomPrice() ) );\n\t\t}\n\t\tif( (res.getMealPlanType() != null) && (res.getMealPlanType().getCode() != null) ){\n\t\t\troomCategory.setMealPlanType( this.getMealPlanType( res.getMealPlanType() ) );\n\t\t}\n\t\tif( (res.getRoomPrices() != null) && (res.getRoomPrices().size() > 0) ){\n\t\t\tList<RoomPrice> roomPrices = new ArrayList<RoomPrice>();\n\t\t\tfor(int i=0; i < res.getRoomPrices().size(); i++){\n\t\t\t\tif( res.getRoomPrices().get(i) != null )\n\t\t\t\troomPrices.add( this.getRoomPrice( res.getRoomPrices().get(i) ) );\n\t\t\t}\n\t\t\troomCategory.setRoomPrices( roomPrices );\n\t\t}\n\t\tif( (res.getAmenities() != null) && (res.getAmenities().size() > 0) ){\n\t\t\tList<Amenity> amenities = new ArrayList<Amenity>(res.getAmenities().size());\n\t\t\tfor(int i=0; i < res.getAmenities().size(); i++){\n\t\t\t\tif( res.getAmenities().get(i) != null )\n\t\t\t\tamenities.add( this.getAmenity( res.getAmenities().get(i) ) );\n\t\t\t}\n\t\t\troomCategory.setAmenities( amenities );\n\t\t}\n\t\t\n\t\tif(res!=null && res.getHbsiRates()!=null && res.getHbsiRates().size()>0){\n\t\t\tList<HBSiRates> hbsiRates = new ArrayList<HBSiRates>(res.getHbsiRates().size());\n\t\t\tfor(int hbsiRate=0;hbsiRate<res.getHbsiRates().size();hbsiRate++)\n\t\t\t{\n\t\t\t\tif(res.getHbsiRates().get(hbsiRate)!=null)\n\t\t\t\t{\n\t\t\t\t\thbsiRates.add(this.getHBSiRate(res.getHbsiRates().get(hbsiRate)));\n\t\t\t\t\t//roomCategory.getHbsiRates().add(hbsiRate, getHBSiRate(res.getHbsiRates().get(hbsiRate)));\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\troomCategory.setHbsiRates(hbsiRates);\n\t\t}\n\t\t\n\t\t//set Cancel Policy for room category\n\t\tif(res!=null && res.getCancelPolicy()!=null && res.getCancelPolicy().size()>0)\n\t\t{\n\t\t\tList<com.kcdata.abe.data.dto.CancelPolicy> canccelPolicies = new ArrayList<com.kcdata.abe.data.dto.CancelPolicy>(res.getCancelPolicy().size());\n\t\t\tfor(int cancelPolicy=0;cancelPolicy<res.getCancelPolicy().size();cancelPolicy++)\n\t\t\t{\n\t\t\t\tif(res.getCancelPolicy().get(cancelPolicy)!=null)\n\t\t\t\t{\n\t\t\t\t\tcanccelPolicies.add(this.getCancelPolicy(res.getCancelPolicy().get(cancelPolicy)));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\troomCategory.setCancelPolicy(canccelPolicies);\n\t\t}\n\t\treturn roomCategory;\n\t}",
"public com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.roomcategory.v1.RoomCategory getRoomCategoryReq(RoomCategory roomCategory){\n\t\tcom.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.roomcategory.v1.RoomCategory roomCategoryReq =\n\t\t\tnew com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.roomcategory.v1.RoomCategory();\n\t\t\n\t\troomCategoryReq.setHotelId( new Integer( roomCategory.getHotelId() ) );\n\t\troomCategoryReq.setRoomCategoryId( new Integer( roomCategory.getRoomCategoryId() ) );\n\n\t\troomCategoryReq.setRoomTypeCode( roomCategory.getRoomTypeCode() );\n\t\tString desc = roomCategory.getRoomTypeDescription();\n if(desc!=null && desc.contains(\":\")){\n String split[]=desc.split(\":\");\n String description= split[0]+split[split.length-1];\n System.out.println(description);\n roomCategoryReq.setRoomTypeDescription(description); \n }else{\n \troomCategoryReq.setRoomTypeDescription( roomCategory.getRoomTypeDescription()!=null? roomCategory.getRoomTypeDescription().replaceAll(\": \", \"\"):\"\" );\n }\n//\t\tString roomTypeCode = roomCategory.getRoomTypeCode();\n//\t\tif(roomTypeCode.contains(\"-RD-\")) {\n//\t\t\tString [] splitRoomTypeCode = null;\n//\t\t\tsplitRoomTypeCode = roomTypeCode.split(\"-RD-\");\n//\t\t\troomCategoryReq.setRoomTypeCode(splitRoomTypeCode[0]);\n//\t\t\troomCategoryReq.setRoomTypeDescription(splitRoomTypeCode[1]);\n//\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\troomCategoryReq.setRatePlanId( roomCategory.getRatePlanId() );\n\t\troomCategoryReq.setRatePlanCode( roomCategory.getRatePlanCode() );\n\t\troomCategoryReq.setRatePlanDescription( roomCategory.getRatePlanDescription() );\n\t\troomCategoryReq.setRateIndicator( roomCategory.getRateIndicator() );\n\t\troomCategoryReq.setCorporateId( roomCategory.getCorporateId() );\n\t\troomCategoryReq.setGuaranteeType( roomCategory.getGuaranteeType() );\n\t\troomCategoryReq.setGuaranteeMethod( roomCategory.getGuaranteeMethod() );\n\t\troomCategoryReq.setGuaranteeRequired( roomCategory.getGuaranteeRequired() );\n\t\troomCategoryReq.setGuaranteeAmount( new Double( roomCategory.getGuaranteeAmount() ) );\n\t\troomCategoryReq.setRatePlanCategory( roomCategory.getRatePlanCategory() );\n\t\troomCategoryReq.setNoOfRoomsAvailable( new Integer( roomCategory.getNoOfRoomsAvailable() ) );\n\t\troomCategoryReq.setStatus( roomCategory.getStatus() );\n\t\troomCategoryReq.setCurrency( roomCategory.getCurrency() );\n\t\troomCategoryReq.setPosnr( roomCategory.getPosnr() );\n\t\troomCategoryReq.setOldPosnr( roomCategory.getOldPosnr() );\n\t\troomCategoryReq.setRiskRoomCategory( new Boolean( roomCategory.isRiskRoomCategory() ) );\n\t\troomCategoryReq.setAppleChoice( new Boolean( roomCategory.getAppleChoice() ) );\n\t\troomCategoryReq.setMealplanDesc( roomCategory.getMealplanDesc() );\n\t\tif( roomCategory.getDisplayRoomPrice()!= null ){\n\t\t\troomCategoryReq.setDisplayRoomPrice( this.getRoomPriceReq( roomCategory.getDisplayRoomPrice() ) );\n\t\t}\n\t\tif( roomCategory.getMealPlanType() != null ){\n\t\t\troomCategoryReq.setMealPlanType( this.getMealPlanTypeReq( roomCategory.getMealPlanType() ) );\n\t\t}\n\t\t\n\t\tif( (roomCategory.getRoomPrices() != null) && (roomCategory.getRoomPrices().size() > 0) ){\n\t\t\tfor(int i=0; i < roomCategory.getRoomPrices().size(); i++){\n\t\t\t\troomCategoryReq.getRoomPrices().add( this.getRoomPriceReq(roomCategory.getRoomPrices().get(i)));\n\t\t\t}\n\t\t}\n\t\tif( (roomCategory.getAmenities() != null) && (roomCategory.getAmenities().size() > 0) ){\n\t\t\tfor(int i=0; i < roomCategory.getAmenities().size(); i++){\n\t\t\t\troomCategoryReq.getAmenities().add( this.getAmenityReq( roomCategory.getAmenities().get(i) ) );\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(roomCategory!=null && roomCategory.getHbsiRates()!=null && roomCategory.getHbsiRates().size()>0)\n\t\t{\n\t\t\tHBSiRates hbsi;\n\t\t\t \n\t\t\tfor(int hbsiRate=0;hbsiRate<roomCategory.getHbsiRates().size();hbsiRate++)\n\t\t\t{\n\t\t\t\tif(roomCategory.getHbsiRates().get(hbsiRate)!=null)\n\t\t\t\t{\n\t\t\t\t\tObject hbsiRateObject = roomCategory.getHbsiRates().get(hbsiRate);\n\t\t\t\t\tif(hbsiRateObject instanceof HBSiRates)\n\t\t\t\t\t{\n\t\t\t\t\t\troomCategoryReq.getHbsiRates().add(hbsiRate,this.getHBSiRateReq(roomCategory.getHbsiRates().get(hbsiRate)));\n\t\t\t\t\t}\n//\t\t\t\t\telse \tif(hbsiRateObject instanceof ASObject)\n//\t\t\t\t\t{\n//\t\t\t\t\t\tASTranslator ast = new ASTranslator();\n//\t\t\t\t\t\tASObject hbsiAsObject = (ASObject)hbsiRateObject;\n//\t\t\t\t\t\thbsiAsObject.setType(\"com.kcdata.abe.data.dto.HBSiRates\");\n//\t\t\t\t\t\thbsi= (HBSiRates)ast.convert(hbsiAsObject, HBSiRates.class);\n//\t\t\t\t\t\troomCategoryReq.getHbsiRates().add(this.getHBSiRateReq(hbsi));\n//\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Set cancel Policy\n\t\t\n\t\tif(roomCategory!=null && roomCategory.getCancelPolicy()!=null && roomCategory.getCancelPolicy().size()>0)\n\t\t{\n\t\t\tcom.kcdata.abe.data.dto.CancelPolicy cancelPolicy;\n\t\t\t\n\t\t\tfor(int cancel=0;cancel<roomCategory.getCancelPolicy().size();cancel++)\n\t\t\t{\n\t\t\t\tif(roomCategory.getCancelPolicy().get(cancel)!=null)\n\t\t\t\t{\n\t\t\t\t\tObject cancelObject = roomCategory.getCancelPolicy().get(cancel);\n\t\t\t\t\tif(cancelObject instanceof com.kcdata.abe.data.dto.CancelPolicy)\n\t\t\t\t\t{\n\t\t\t\t\t\troomCategoryReq.getCancelPolicy().add(cancel,this.getCancelPolicyReq(roomCategory.getCancelPolicy().get(cancel)));\n\t\t\t\t\t}\n//\t\t\t\t\telse if(cancelObject instanceof ASObject)\n//\t\t\t\t\t{\n//\t\t\t\t\t\tASTranslator ast = new ASTranslator();\n//\t\t\t\t\t\tASObject cancelASObject = (ASObject)cancelObject;\n//\t\t\t\t\t\tcancelASObject.setType(\"com.kcdata.abe.data.dto.CancelPolicy\");\n//\t\t\t\t\t\tcancelPolicy=(com.kcdata.abe.data.dto.CancelPolicy)ast.convert(cancelASObject, com.kcdata.abe.data.dto.CancelPolicy.class);\n//\t\t\t\t\t\t\n//\t\t\t\t\t\troomCategoryReq.getCancelPolicy().add(this.getCancelPolicyReq(cancelPolicy));\n//\t\t\t\t\t\t\n//\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn roomCategoryReq;\n\t}",
"public interface ProductCategoryService\n{\n /**\n * 列出相应商铺的商品分类列表\n *\n * @param shopId 商铺ID\n * @return 商品分类列表\n */\n List<ProductCategory> list(Long shopId);\n\n /**\n * 批量插入商品分类\n *\n * @param productCategories 待添加分类列表\n * @return top.ywlog.o2o.dto.ProductCategoryExecution\n */\n ProductCategoryExecution batchInsert(List<ProductCategory> productCategories) throws ProductCategoryOperationException;\n\n /**\n * 将该分类下的所有商品的分类Id置为空,再删除商品分类\n *\n * @param productCategoryId 分类Id\n * @param shopId 分类所属店铺Id\n * @return top.ywlog.o2o.dto.ProductCategoryExecution\n */\n ProductCategoryExecution deleteProductCategory(Long productCategoryId, Long shopId);\n}",
"public String getCategory() {\n return this.category;\n }",
"public Category() {}",
"private CategoryDTO getCategoryDto(){\n\t\tCategoryDTO category = new CategoryDTO(Long.valueOf(1L), \"categoryName\", \"categoryDesc\");\n\t\treturn category;\n\t}",
"@Override\n public List<ProductCategory> getAllAvailableProductCategoriesForMetaData() {\n final List<Category> avaliableCategories = productCategoryDao.fetchAllAvailableCategoriesForProduct();\n final List<ProductCategory> availableProductCategories = new ArrayList<ProductCategory>();\n for (final Category availableCategory : avaliableCategories) {\n final ProductCategory category = new ProductCategory();\n category.setCategoryId(availableCategory.getCategoryId());\n category.setCategoryName(availableCategory.getCategoryName());\n category.setCategoryPartNumber(availableCategory.getCategoryPartNumber());\n availableProductCategories.add(category);\n }\n return availableProductCategories;\n }",
"public String getCategoryName() {\n return categoryName;\n }",
"public static boolean insertCategory(productCategory product,ArrayList<String> attributes,String partNumber)\n {\n PreparedStatement stmt = null;\n\n try\n {\n String pstmt = \"INSERT INTO \" + product.categoryName.getValue() + constructValues(product,attributes,partNumber);\n\n stmt = DBConnectionManager.con.prepareStatement(pstmt);\n\n\n stmt.executeUpdate();\n\n return true;\n\n } catch (SQLException e)\n {\n e.printStackTrace();\n }\n finally\n {\n try { if (stmt != null) stmt.close(); } catch (Exception ignored) {}\n }\n\n return false;\n }",
"public Category getCategory() {\n return category;\n }",
"public Category getCategory() {\n return category;\n }",
"public Category getCategory() {\n return category;\n }",
"public Category getCategory() {\n return category;\n }",
"public Category getCategory() {\n return category;\n }",
"public Byte getCategoryType() {\n return categoryType;\n }",
"@Test\n\tpublic void testCreateCategory() throws Exception {\n\n\t\tList<Category> categories = new ArrayList<>();\n\t\tCategory category = new Category();\n\t\tcategory.setTenantId(\"default\");\n\n\t\tAuditDetails auditDetails = new AuditDetails();\n\t\tcategory.setAuditDetails(auditDetails);\n\n\t\tCategoryResponse categoryResponse = new CategoryResponse();\n\t\tcategories.add(category);\n\n\t\tcategoryResponse.setResponseInfo(new ResponseInfo());\n\t\tcategoryResponse.setCategories(categories);\n\n\t\ttry {\n\n\t\t\twhen(categoryService.createCategoryMaster(any(CategoryRequest.class),any(String.class))).thenReturn(categoryResponse);\n\n\t\t\tmockMvc.perform(post(\"/category/v1/_create\")\n\t\t\t\t\t.contentType(MediaType.APPLICATION_JSON)\n\t\t\t\t\t.content(getFileContents(\"categoryCreateRequest.json\")))\n\t\t\t\t\t.andExpect(status().isOk())\n\t\t\t\t\t.andExpect(content().contentTypeCompatibleWith(MediaType.APPLICATION_JSON))\n\t\t\t\t\t.andExpect(content().json(getFileContents(\"categoryCreateResponse.json\")));\n\n\t\t} catch (Exception e) {\n\n\t\t\tassertTrue(Boolean.FALSE);\n\t\t}\n\n\t\tassertTrue(Boolean.TRUE);\n\n\t}",
"private static productCategory extractProductCategoryFromResultSet(ResultSet myRs) throws SQLException\n {\n productCategory productCategory = new productCategory();\n\n productCategory.categoryName.setValue(myRs.getString(2));\n productCategory.productName.setValue(myRs.getString(3));\n getAttributes(productCategory);\n\n\n return productCategory;\n }",
"@Test\n void test_constructor_campaign_with_category_and_info_related_discount_quantity() {\n Campaign sampleCampaign = new Campaign(new Category(\"food\"), 20.0, 3, RATE);\n\n assertNotNull(sampleCampaign.getCategory());\n assertEquals(sampleCampaign.getMinimumAmount(), 3);\n assertEquals(sampleCampaign.getDiscountAmount(), 20.0);\n assertEquals(sampleCampaign.getDiscountType(), Discount.DiscountType.valueOf(\"RATE\"));\n }",
"public String getCategory() {\n return category;\n }",
"public String getCategory() {\n return category;\n }",
"public String getCategory() {\n return category;\n }",
"public String getCategory() {\n return category;\n }",
"public String getCategory() {\n return category;\n }",
"public String getCategory() {\n return category;\n }",
"public String getCategory() {\n return category;\n }",
"@Override\n\tpublic ICategoryView getProductCategoryView() {\n\t\tLog.debug(\"getProductCategoryView is null ......................\");\n\t\treturn null;\n\t}",
"public String[] getCategoryList(){\n return new String[]{\n \"Macros\",\n \"Instrument Type\",\n \"TOF_NSCD\",\n \"NEW_SNS\"\n };\n }",
"public void setCateCreated(Date cateCreated) {\n this.cateCreated = cateCreated;\n }",
"public String getCategory();",
"public String getProductDescription() {\r\n/* 221 */ return this._productDescription;\r\n/* */ }",
"public String getCategoryDescription() {\n return categoryDesc;\n }",
"String category();",
"public String createCategory()\n {\n logger.info(\"**** In createCategory in Controller ****\");\n if (category != null && StringUtils.isNotEmpty(category.getCategoryName()))\n {\n String creationMessage = categoryService.createCategory(category);\n if (creationMessage.equalsIgnoreCase(Constants.CATEGORY_CREATION_SUCCESS))\n {\n FacesMessage facesMsg = new FacesMessage(FacesMessage.SEVERITY_INFO, Constants.CATEGORY_CREATION_SUCCESS, Constants.CATEGORY_CREATION_SUCCESS);\n FacesContext.getCurrentInstance().getExternalContext().getFlash().setKeepMessages(true);\n FacesContext.getCurrentInstance().addMessage(null, facesMsg);\n }\n else if (creationMessage.equalsIgnoreCase(Constants.CATEGORY_ALREADY_EXISTS))\n {\n FacesMessage facesMsg = new FacesMessage(FacesMessage.SEVERITY_ERROR, Constants.CATEGORY_ALREADY_EXISTS, Constants.CATEGORY_ALREADY_EXISTS);\n FacesContext.getCurrentInstance().getExternalContext().getFlash().setKeepMessages(true);\n FacesContext.getCurrentInstance().addMessage(null, facesMsg);\n }\n else if (creationMessage.equalsIgnoreCase(Constants.CATEGORY_CREATION_EXCEPTION))\n {\n FacesMessage facesMsg = new FacesMessage(FacesMessage.SEVERITY_ERROR, Constants.CATEGORY_CREATION_EXCEPTION, Constants.CATEGORY_CREATION_EXCEPTION);\n FacesContext.getCurrentInstance().getExternalContext().getFlash().setKeepMessages(true);\n FacesContext.getCurrentInstance().addMessage(null, facesMsg);\n }\n else if (creationMessage.equalsIgnoreCase(Constants.FAILURE))\n {\n FacesMessage facesMsg = new FacesMessage(FacesMessage.SEVERITY_ERROR, Constants.CATEGORY_CREATION_FAILURE, Constants.CATEGORY_CREATION_FAILURE);\n FacesContext.getCurrentInstance().getExternalContext().getFlash().setKeepMessages(true);\n FacesContext.getCurrentInstance().addMessage(null, facesMsg);\n }\n }\n\n return Constants.CREATE_CATEGORY_VIEW;\n }",
"@Test\n public void getCategory_CorrectInformation(){\n int returned = testDatabase.addCategory(category);\n Category retrieved = testDatabase.getCategory(returned);\n assertEquals(\"getCategory - Correct Name\", \"Lunch\", retrieved.getName());\n assertEquals(\"getCategory - Correct ID\", returned, retrieved.getKeyID());\n }",
"@Test\n public void testSave() throws Exception {\n ProductCategory productCategory = categoryServiceImpl.findOne(1);\n productCategory.setCategoryName(\"Lego\");\n ProductCategory category = categoryServiceImpl.save(productCategory);\n System.out.println(\"category:\" + category);\n }",
"public String getCncategory() {\n return cncategory;\n }",
"public Category(String n) {\n this.name = n;\n }",
"public final Class<? extends Attribute> getCategory() {\n/* 219 */ return (Class)SheetCollate.class;\n/* */ }",
"public void createPackageContents()\r\n {\r\n if (isCreated) return;\r\n isCreated = true;\r\n\r\n // Create classes and their features\r\n productEClass = createEClass(PRODUCT);\r\n createEAttribute(productEClass, PRODUCT__PRICE);\r\n createEAttribute(productEClass, PRODUCT__NAME);\r\n createEAttribute(productEClass, PRODUCT__ID);\r\n createEReference(productEClass, PRODUCT__PRODUCER);\r\n createEReference(productEClass, PRODUCT__WISHLISTS);\r\n createEReference(productEClass, PRODUCT__OFFERED_BY);\r\n\r\n customerEClass = createEClass(CUSTOMER);\r\n createEReference(customerEClass, CUSTOMER__ALL_BOUGHT_PRODUCTS);\r\n createEAttribute(customerEClass, CUSTOMER__NAME);\r\n createEAttribute(customerEClass, CUSTOMER__AGE);\r\n createEAttribute(customerEClass, CUSTOMER__ID);\r\n createEReference(customerEClass, CUSTOMER__WISHLISTS);\r\n createEAttribute(customerEClass, CUSTOMER__USERNAME);\r\n\r\n producerEClass = createEClass(PRODUCER);\r\n createEAttribute(producerEClass, PRODUCER__ID);\r\n createEAttribute(producerEClass, PRODUCER__NAME);\r\n createEReference(producerEClass, PRODUCER__PRODUCTS);\r\n\r\n storeEClass = createEClass(STORE);\r\n createEReference(storeEClass, STORE__CUSTOMERS);\r\n createEReference(storeEClass, STORE__PRODUCTS);\r\n createEReference(storeEClass, STORE__PRODUCERS);\r\n createEReference(storeEClass, STORE__SELLERS);\r\n\r\n bookEClass = createEClass(BOOK);\r\n createEAttribute(bookEClass, BOOK__AUTHOR);\r\n\r\n dvdEClass = createEClass(DVD);\r\n createEAttribute(dvdEClass, DVD__INTERPRET);\r\n\r\n wishlistEClass = createEClass(WISHLIST);\r\n createEReference(wishlistEClass, WISHLIST__PRODUCTS);\r\n\r\n sellerEClass = createEClass(SELLER);\r\n createEAttribute(sellerEClass, SELLER__NAME);\r\n createEAttribute(sellerEClass, SELLER__ID);\r\n createEAttribute(sellerEClass, SELLER__USERNAME);\r\n createEReference(sellerEClass, SELLER__ALL_PRODUCTS_TO_SELL);\r\n createEReference(sellerEClass, SELLER__EREFERENCE0);\r\n createEReference(sellerEClass, SELLER__SOLD_PRODUCTS);\r\n }",
"public Category(String categoryName) {\n this.categoryName = categoryName;\n }",
"public Category(String categoryName) {\n this.categoryName = categoryName;\n }",
"public String getCategory()\n\t{\n\t\treturn category;\n\t}"
] | [
"0.56860995",
"0.56794894",
"0.5658219",
"0.562538",
"0.5597696",
"0.5571661",
"0.5561999",
"0.5557889",
"0.55502945",
"0.55311835",
"0.55309856",
"0.5525553",
"0.55205923",
"0.5496048",
"0.5468042",
"0.54440504",
"0.5432411",
"0.5424816",
"0.5411047",
"0.54103047",
"0.5404869",
"0.53978914",
"0.53971404",
"0.5396411",
"0.5390616",
"0.5376298",
"0.5376298",
"0.5373408",
"0.53676564",
"0.53674006",
"0.5361111",
"0.5346021",
"0.53375113",
"0.5325046",
"0.5300071",
"0.5284563",
"0.5274019",
"0.52730787",
"0.5270939",
"0.5269351",
"0.5268452",
"0.52682436",
"0.5265166",
"0.5263837",
"0.526001",
"0.5250228",
"0.5248643",
"0.5247888",
"0.5247081",
"0.524502",
"0.5241129",
"0.52397776",
"0.5235152",
"0.5233864",
"0.5233864",
"0.5233077",
"0.5221757",
"0.52216727",
"0.52216727",
"0.5219763",
"0.52175385",
"0.52162874",
"0.5215877",
"0.5213648",
"0.5210398",
"0.52098334",
"0.52089286",
"0.520597",
"0.5205825",
"0.5205825",
"0.5205825",
"0.5205825",
"0.5205825",
"0.52049065",
"0.5204694",
"0.5204185",
"0.5190411",
"0.51897687",
"0.51897687",
"0.51897687",
"0.51897687",
"0.51897687",
"0.51897687",
"0.51897687",
"0.51874083",
"0.5187142",
"0.5180824",
"0.5173543",
"0.5170886",
"0.516675",
"0.5166203",
"0.5161707",
"0.51530945",
"0.5145564",
"0.51435274",
"0.51430064",
"0.5130948",
"0.5129007",
"0.5125477",
"0.5125477",
"0.510665"
] | 0.0 | -1 |
FXML fields put in parameters to have access to them. Handles the File menutab Not all functionaries are working. | public static void fileHandler(ActionEvent actionEvent, Canvas canvas, Pane shapesPane, MenuItem itemNew,
MenuItem itemOpen, MenuItem itemSave, MenuItem itemSaveAs, MenuItem itemExit) {
// clearing pane to clear shapes and clearing canvas for free drawing
if (actionEvent.getSource() == itemNew) {
shapesPane.getChildren().clear();
GraphicsContext gc = canvas.getGraphicsContext2D();
gc.clearRect(canvas.getLayoutX(), canvas.getLayoutY(), canvas.getWidth(), canvas.getHeight());
shapesPane.getChildren().add(canvas);
}
// currently not functioning, to be added to later versions
else if (actionEvent.getSource() == itemOpen) {
FileChooser fileChooser = new FileChooser();
fileChooser.setTitle("Open your painting");
fileChooser.getExtensionFilters().add(new FileChooser.ExtensionFilter("mps", "*.mps"));
File selectedFile = fileChooser.showOpenDialog(Driver.myStage);
ObjectInputStream read;
try {
read = new ObjectInputStream(new FileInputStream(selectedFile));
try {
shapesPane = (Pane) read.readObject();
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
read.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
/*
* // Scene a = new Scene(selectedFile,300,300); // // //
* Driver.myStage.show(selectedFile);
*/
}
// currently not functioning, to be added to later versions
else if (actionEvent.getSource() == itemSave) {
FileChooser fileChooser = new FileChooser();
fileChooser.getExtensionFilters().add(new FileChooser.ExtensionFilter("S²H³", "*.S²H³"));
File mpsFile = fileChooser.showSaveDialog(null);
shapesPane.getChildren().add(canvas); // to save free drawing
/*
* WritableImage wimPane = new WritableImage((int) shapesPane.getWidth(), (int)
* shapesPane.getHeight());
*
*
*
* shapesPane.snapshot(null, wimPane);
*
* try { ImageIO.write(SwingFXUtils.fromFXImage(wimPane, null), "png", mpsFile);
* } catch (Exception s) { }
*/
ObjectOutputStream out;
try {
out = new ObjectOutputStream(new FileOutputStream(mpsFile));
out.writeObject(shapesPane);
out.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
// currently not functioning, to be added to later versions
else if (actionEvent.getSource() == itemSaveAs) {
FileChooser fileChooser = new FileChooser();
fileChooser.getExtensionFilters().addAll(new FileChooser.ExtensionFilter("mps", "*.mps"),
new FileChooser.ExtensionFilter("png", "*.png"));
File mpsFile = fileChooser.showSaveDialog(null);
shapesPane.getChildren().add(canvas);
WritableImage wimPane = new WritableImage((int) shapesPane.getWidth(), (int) shapesPane.getHeight());
shapesPane.snapshot(null, wimPane);
try {
ImageIO.write(SwingFXUtils.fromFXImage(wimPane, null), "png", mpsFile);
} catch (Exception s) {
}
}
// should add confirmation and saving option in later versions
else if (actionEvent.getSource() == itemExit) {
Platform.exit();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setFileConfig() {\n try {\n int col = 0, row = 0;\n fileType = new JFXComboBox();\n fileType.setPromptText(\"Select File Type\");\n fileType.setItems(getFileTypes());\n /*\n File Properties\n */\n srcSep = new JFXTextField();\n srcSep.setPromptText(\"Enter the new file seperator\");\n trgSep = new JFXTextField();\n trgSep.setPromptText(\"Enter the Old file seperator\");\n remotePath = new JFXTextField();\n remotePath.setPromptText(\"Enter the Remote path\");\n filePath = new JFXTextField();\n filePath.setPromptText(\"Select Local Path directory\");\n filePath.setDisable(true);\n loadLocalPath = new Button(\"Browse\");\n trgFileheader = new JFXTextField();\n trgFileheader.setPromptText(\"Enter the Fields Name seperated by ','\");\n srcFileheader = new JFXTextField();\n srcFileheader.setPromptText(\"Enter the Fields Name seperated by ','\");\n statusFilePath = new JFXTextField();\n statusFilePath.setText(\"Enter the Status Path\");\n statusFilePath.setDisable(true);\n statusFileLoad = new Button(\"Browse\");\n srcSep = new JFXTextField();\n srcSep.setPromptText(\"Enter the New File Separator\");\n trgSep = new JFXTextField();\n trgSep.setPromptText(\"Enter the Old File Separator\");\n\n GridPane fileGrid = new GridPane();\n fileGrid.setHgap(20);\n fileGrid.setVgap(5);\n\n fileGrid.add(new Label(\"File Type\"), col, ++row);\n fileGrid.add(fileType, col + 1, row, 2, 1);\n fileGrid.add(new Label(\"Remote File name with path\"), col, ++row);\n fileGrid.add(remotePath, col + 1, row, 2, 1);\n fileGrid.add(new Label(\"Local File Path\"), col, ++row);\n fileGrid.add(filePath, col + 1, row, 2, 1);\n fileGrid.add(loadLocalPath, col + 3, row, 2, 1);\n fileGrid.add(new Label(\"New File Header\"), col, ++row);\n fileGrid.add(srcFileheader, col + 1, row, 2, 1);\n fileGrid.add(new Label(\"Old File header\"), col, ++row);\n fileGrid.add(trgFileheader, col + 1, row, 2, 1);\n fileGrid.add(new Label(\"New File Separator\"), col, ++row);\n fileGrid.add(srcSep, col + 1, row, 2, 1);\n fileGrid.add(new Label(\"Old File Separator\"), col, ++row);\n fileGrid.add(trgSep, col + 1, row, 2, 1);\n fileGrid.add(new Label(\"Status File Path\"), col, ++row);\n fileGrid.add(statusFilePath, col + 1, row, 2, 1);\n fileGrid.add(statusFileLoad, col + 3, row, 2, 1);\n fileConf.setContent(fileGrid);\n\n loadLocalPath.setOnAction((ActionEvent event) -> {\n Stage mainstage = (Stage) mainvbox.getScene().getWindow();\n File fileName = directoryChooser.showDialog(mainstage);\n if (fileName != null) {\n filePath.setText(fileName.getAbsolutePath());\n if (!fileName.exists()) {\n fileName.mkdir();\n }\n }\n });\n statusFileLoad.setOnAction((ActionEvent event) -> {\n Stage mainstage = (Stage) mainvbox.getScene().getWindow();\n File fileName = directoryChooser.showDialog(mainstage);\n if (fileName != null) {\n statusFilePath.setText(fileName.getAbsolutePath());\n\n if (!fileName.exists()) {\n fileName.mkdir();\n }\n }\n });\n\n } catch (IOException ex) {\n Logger.getLogger(ConfigFile.class.getName()).log(Level.SEVERE, null, ex);\n new ExceptionUI(ex);\n }\n }",
"public void OpenFileOptions(ActionEvent event) throws Exception {\n\n Parent root = FXMLLoader.load(getClass().getResource(\"ListWindow.fxml\"));\n Stage stage = new Stage();\n stage.setResizable(false);\n stage.setTitle(\"File Options\");\n stage.setScene(new Scene(root, 1000, 800));\n stage.show();\n }",
"public void setUpFileMenu() {\n add(fileMenu);\n fileMenu.add(new OpenAction(parent));\n fileMenu.add(new SaveAction(parent));\n fileMenu.add(new SaveAsAction(parent));\n fileMenu.addSeparator();\n fileMenu.add(new ShowWorldPrefsAction(parent.getWorldPanel()));\n fileMenu.add(new CloseAction(parent.getWorkspaceComponent()));\n }",
"@FXML\r\n\tprivate void choisirFichier()\r\n\t{\r\n\t\tFileChooser fileChooser = new FileChooser();\r\n\r\n\t\tfileChooser\r\n\t\t\t\t.setInitialDirectory(new File(System.getProperty(\"user.dir\")));\r\n\t\tFile fichier = fileChooser.showOpenDialog(new Stage());\r\n\r\n\t\tif (fichier != null)\r\n\t\t{\r\n\t\t\ttextFieldFichier.setText(fichier.getPath());\r\n\t\t}\r\n\t}",
"@FXML\n private void handleChooseBtn(ActionEvent event)\n {\n try\n {\n sm.initializeFile();\n txtDuration.setText(sm.getDuration());\n txtTitleInput.setText(sm.getSongTitle());\n txtFile.setText(sm.getFilePath());\n txtArtistInput.setText(sm.getArtist());\n } catch (MTBllException ex)\n {\n displayError(ex);\n }\n }",
"@FXML\n\tpublic void handleMenu(){\n\t\tFile file2 = mainApp.getProspectFilePath();\n if (file2 != null) {\n mainApp.saveProspectDataToFile(file2);}\n\t\tmainApp.showMenuPrincipale();\n\t}",
"@Override\n public void start(Stage primaryStage) {\n \n tabPane = new TabPane();\n tree = new OwnTreeView(tabPane, new OwnTreeItem());\n tabs = new OwnTabs(tree,tabPane);\n areas = new OwnTextAreas(tree,tabPane);\n projects = new Projects();\n file = new OwnFile(areas,tabs,tree,projects);\n areas.setTabs(tabs);\n tabs.setAreas(areas);\n tree.setAreas(areas);\n tree.setTabs(tabs);\n\n //Creo un array de separadores de menuitems\n for (int i = 0; i < separate.length; i++) {\n separate[i] = new SeparatorMenuItem();\n }\n\n Point3D punto = new Point3D(0, 0, 1);\n\n //Panel que contiene todos los demás contenidos\n root = new BorderPane();\n root.autosize();\n root.setMaxHeight(BorderPane.USE_COMPUTED_SIZE);\n root.setMaxWidth(BorderPane.USE_COMPUTED_SIZE);\n root.setMinHeight(BorderPane.USE_COMPUTED_SIZE);\n root.setMinWidth(BorderPane.USE_COMPUTED_SIZE);\n root.setPrefHeight(BorderPane.USE_COMPUTED_SIZE);\n root.setPrefWidth(BorderPane.USE_COMPUTED_SIZE);\n root.setScaleX(1);\n root.setScaleY(1);\n root.setScaleZ(1);\n root.setRotationAxis(punto);\n\n //Barra principal con las pestañas de los menús\n bar = new MenuBar();\n bar.autosize();\n bar.setMaxHeight(MenuBar.USE_COMPUTED_SIZE);\n bar.setMaxWidth(MenuBar.USE_COMPUTED_SIZE);\n bar.setMinHeight(24);\n bar.setMinWidth(MenuBar.USE_COMPUTED_SIZE);\n bar.setPrefHeight(22);\n bar.setPrefWidth(1024);\n bar.setScaleX(1);\n bar.setScaleY(1);\n bar.setScaleZ(1);\n bar.setRotationAxis(punto);\n\n //Menús\n menuFile = new Menu(\"Archivo\");\n\n //MenuItems del menú \"Archivo\"\n open = new MenuItem(\"Abrir Ctrl+O\");\n open.getStyleClass().add(\"menuitem\");\n /**\n * Abre un archivo en un nuevo tab que crea y escribe el texto de dicho\n * archivo en el area correspondiente al tab seleccionado, que es el tab\n * creado. ATAJO : CTRL+0\n */\n open.setOnAction(_openFile = new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n\n file.open();\n }\n });\n \n /*\n * Abre un proyecto seleccionado,con todas sus subcarpetas\n * y archivos llamando a la función abrirProyecto(explicada mas abajo)\n */\n openProject = new MenuItem(\"Abrir proyecto\");\n openProject.getStyleClass().add(\"menuitem\");\n openProject.setOnAction(_projectOpen = new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n file.openProject();\n }\n });\n /**\n * Guarda un archivo, en el caso de que el archivo haya sido abierto y\n * ya existiese, se guardará en la dirección que le corresponda, en el\n * caso de que no existiese se llamará a la función guardarComo\n * guardandose en la dirección que se le indique. ATAJO : CTRL + S\n */\n save = new MenuItem(\"Guardar Ctrl+S\");\n save.getStyleClass().add(\"menuitem\");\n save.setOnAction(_saveFile = new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n file.save();\n }\n });\n\n /**\n * Guarda un archivo en una dirección determinada, ya estuviese o no\n * creado el archivo, al realizar el guardado con otro nombre\n * actualizara el nombre del tab y el nombre que aparezca en el\n * TreeView.\n */\n saveAs = new MenuItem(\"Guardar Como...\");\n saveAs.getStyleClass().add(\"menuitem\");\n saveAs.setOnAction(_asSave = new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n file.saveAs();\n }\n });\n\n /**\n * Cierra el programa JavEditor\n */\n close = new MenuItem(\"Cerrar\");\n close.getStyleClass().add(\"menuitem\");\n close.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n System.exit(0);\n }\n });\n\n /**\n * Abre una nueva pestaña para crear un nuevo archivo. ATAJO : CTRL+N\n */\n newTab = new MenuItem(\"Nuevo Archivo Ctrl+N\");\n newTab.getStyleClass().add(\"menuitem\");\n newTab.setOnAction(_tabNew = new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n tabs.newTab(_isForOpen);\n }\n });\n \n\n /*\n * Cierra el tab que se encuentra seleccionado. Buscamos el tab seleccionado, y cuando lo encontramos\n * borramos del TreeView el nombre del archivo correspondiente con actualizarArbol, y eliminamos\n * la posición creada para la dirección del archivo, el area y el tab de las listas tabs y areas, \n * a parte de eliminarlo del tabPane ya que al ser un atajo no se realiza por defecto. ATAJO : CTRL+A\n */\n closeFile = new MenuItem(\"Cerrar Archivo Ctrl+T\");\n closeFile.getStyleClass().add(\"menuitem\");\n closeFile.setOnAction(_fileClose = new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n String s;\n boolean noestab = false;\n OwnTextArea a = areas.seleccionarArea();\n if(areas.isModificated(a)){\n int n = JOptionPane.showConfirmDialog(null, \"Do you want save the file?\");\n if(n==JOptionPane.CANCEL_OPTION){\n return;\n }else if(n==JOptionPane.YES_OPTION){\n _asSave.handle(null);\n }\n }\n for(int i=0;i<tabs.size();i++){\n if(!tabs.get(i).isSelected()){\n continue;\n }else{\n tree.getItems().getChildren().remove(tabs.get(i).getTreeItem());\n tabPane.getTabs().remove(tabs.get(i));\n areas.remove(a);\n tabs.remove(tabs.get(i));\n break;\n }\n }\n }\n });\n\n /*\n * Cierra todos los tabs abiertos del programa, recorre todos los tabs del tabPane y los va eleminando\n * de la lista uno por uno, ademas, se borran las correspondientes direcciones de archivos guardadas y\n * las areas creadas para los tabs.Además se van borrando los nombres del TreeView\n */\n closeAll = new MenuItem(\"Cerrar Todo Ctrl+Q\");\n closeAll.getStyleClass().add(\"menuitem\");\n closeAll.setOnAction(_allClose = new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n int longitudTabPane = tabPane.getTabs().size();\n for (int i = 0; i < longitudTabPane; i++) {\n OwnTextArea a = areas.seleccionarArea();\n if(areas.isModificated(a)){\n int n = JOptionPane.showConfirmDialog(null, \"Do you want save the file?\");\n if(n==JOptionPane.CANCEL_OPTION){\n return;\n }else if(n==JOptionPane.YES_OPTION){\n _asSave.handle(null);\n }\n }\n if (tree.getItems().getChildren().size() > 0) {\n tree.getItems().getChildren().remove(0);\n }\n tabPane.getTabs().remove(0);\n }\n for (int i = 0; i < tabs.size(); i++) {\n tabs.remove(0);\n areas.remove(0);\n }\n }\n });\n menuFile.getItems().addAll(newTab, separate[0], open, openProject, save, saveAs, separate[1], closeFile, closeAll, separate[2], close);\n menuFile.getStyleClass().add(\"menu\");\n menuEdit = new Menu(\"Edición\");\n\n //Submenús de \"Edición\"\n undo = new MenuItem(\"Deshacer Ctrl+Z\");\n /*\n * Deshace la acción previa hecha\n */\n undo.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n OwnTextArea a = areas.seleccionarArea();\n a.undo();\n }\n });\n\n selectAll = new MenuItem(\"Seleccionar Todo Ctrl+A\");\n\n /*\n * Selecciona todo el texto del area del tab en el que se encuentra en el momento\n */\n selectAll.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n OwnTextArea a = areas.seleccionarArea();\n a.selectAll();\n }\n });\n\n deselect = new MenuItem(\"Deseleccionar\");\n /*\n * Deselecciona lo seleccionado previamente\n */\n deselect.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n OwnTextArea a = areas.seleccionarArea();\n a.deselect();\n }\n });\n\n cut = new MenuItem(\"Cortar Ctrl+X\");\n /*\n * Corta lo seleccionado, elimina de la pantalla lo seleccionado, almacenandolo en la variable seleccion\n * para su posible posterior pegado\n */\n cut.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n OwnTextArea a = areas.seleccionarArea();\n a.cut();\n }\n });\n\n copy = new MenuItem(\"Copiar Ctrl+C\");\n /**\n * Copia lo seleccionado, almacena dicha selección en la variable\n * seleccion para su posible posterior pegado\n */\n copy.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n OwnTextArea a = areas.seleccionarArea();\n a.copy();\n }\n });\n\n paste = new MenuItem(\"Pegar Ctrl+V\");\n /*\n * Añade al texto del area del tab seleccionado lo que se encuentra en la variable selección.\n */\n paste.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n OwnTextArea a = areas.seleccionarArea();\n a.paste(); \n }\n });\n\n delete = new MenuItem(\"Eliminar\");\n /*\n * Elimina lo seleccionado, a diferencia de cortar, este no guarda el texto en ninguna variable.\n */\n delete.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n OwnTextArea a = areas.seleccionarArea();\n a.delete();\n }\n });\n\n menuEdit.getItems().addAll(undo, separate[3], copy, cut, paste, delete, separate[4], selectAll,deselect);\n menuHelp = new Menu(\"Ayuda\");\n\n //Submenús de \"Ayuda\"\n about = new MenuItem(\"Sobre JavEditor\");\n\n /*\n * Abre una nueva ventana donde se da información de JavEditor\n */\n about.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent t) {\n Stage stage = new Stage();\n About sobre = new About();\n sobre.start(stage);\n }\n });\n\n menuHelp.getItems().addAll(about);\n menuPreferences = new Menu(\"Preferencias\");\n\n //SubMenús de \"Preferencias\"\n font = new MenuItem(\"Fuente\");\n menuPreferences.getItems().addAll(font);\n bar.getMenus().addAll(menuFile, menuEdit, menuPreferences, menuHelp);\n\n //TabPane\n \n tabPane.getStyleClass().add(\"tabpane\");\n tabPane.autosize();\n tabPane.setLayoutX(0);\n tabPane.setLayoutY(24);\n tabPane.setTabClosingPolicy(TabPane.TabClosingPolicy.ALL_TABS);\n tabPane.setMinHeight(TabPane.USE_COMPUTED_SIZE);\n tabPane.setMinWidth(TabPane.USE_COMPUTED_SIZE);\n tabPane.setPrefHeight(378);\n tabPane.setPrefWidth(600);\n tabPane.setScaleX(1);\n tabPane.setScaleY(1);\n tabPane.setScaleZ(1);\n tabPane.setRotationAxis(punto);\n tabPane.setPrefWidth(1024);\n\n //TreeView\n \n tree.createChilds();\n tree.setPrefHeight(20);\n tree.getStyleClass().add(\"tree-view\");\n \n \n //Si una tecla es pulsada se almacena el codigo en la lista codigoTeclas y si hay mas de 1\n //se realiza la comprobacion de las teclas pulsadas.\n root.setOnKeyPressed(new EventHandler<KeyEvent>() {\n @Override\n public void handle(KeyEvent event) {\n keyCodes.add(event.getCode());\n if (keyCodes.size() > 1) {\n comprobarTeclas();\n }\n }\n });\n //Si alguna tecla se suelta deja de ser pulsada se elimina de la lista\n root.setOnKeyReleased(new EventHandler<KeyEvent>() {\n @Override\n public void handle(KeyEvent event) {\n keyCodes.remove(event.getCode());\n }\n });\n\n //El panel de tabs y la barra de herramientas se añaden al panel root\n root.setLeft(tree);\n root.setTop(bar);\n root.setCenter(tabPane);\n \n \n Scene scene = new Scene(root);\n scene.getStylesheets().add(\"/JavEditor/JavEditor.css\");\n Image imagen = new Image(\"JavEditor/Images/Icono.gif\", 10, 10, false, false);\n primaryStage.getIcons().add(imagen);\n primaryStage.setTitle(\"JavEditor\");\n primaryStage.setScene(scene);\n primaryStage.show();\n }",
"@FXML\n\tprivate void openConfigFile() {\n\t\tFileChooser fileChooser = new FileChooser();//Allows opening and saving files\n\t\tFileChooser.ExtensionFilter extFilter = new FileChooser.ExtensionFilter(\"CFG files (*.cfg)\", \"*.cfg\"); //sets extension filter\n\t\tfileChooser.getExtensionFilters().add(extFilter);\n\t\tScene scene = mainWindow.getScene();//grabs the scene from the window that initialized this event, required for file selector\n\t\tif (scene != null) {\n\t\t\tWindow window = scene.getWindow();\n\t\t\tif (window != null) {\n\n\t\t\t\tFile file = fileChooser.showOpenDialog(window);\n\t\t\t\tif (file != null) {\n\n\t\t\t\t\tString filePath = file.getAbsolutePath();\n\n\n\t\t\t\t\tNodeController.getNodeController().clear();//wipe all current nodes for new nodes to be generated\n\n\t\t\t\t\tConfigFile.readFile(filePath);//generates the controller with the config file\n\t\t\t\t\trefreshAll();\n\t\t\t}\n\t\t}\n\n\t\t}\n\n\t}",
"@FXML\n void fileOpenPressed(ActionEvent event) {\n \tFileChooser fileChooser = new FileChooser();\n\t\tfileChooser.setTitle(\"Open File\");\n\t\tFile f = fileChooser.showOpenDialog(stage);\n\t\tif (f != null) {\n\t\t\tsetFile(f);\n\t\t\tviewState.set(ViewState.OPEN);\n\t\t}\n }",
"@FXML\n public void openFile(Event e) {\n String inputData = \"\";\n File file = chooser.showOpenDialog(open.getScene().getWindow());\n\n try {\n inputData = new String(Files.readAllBytes(file.toPath()));\n } catch (IOException error) {\n error.getSuppressed();\n }\n\n input.setFont(Font.font(\"monospaced\"));\n input.setText(inputData);\n\n Stage primary = (Stage) open.getScene().getWindow();\n primary.setTitle(file.getName());\n }",
"@FXML\r\n private void handleBrowseBtn(ActionEvent event) {\r\n openFile();\r\n }",
"@FXML\r\n void ClickUploadBtn(ActionEvent event) throws IOException {\r\n FileChooser fileExplorer = new FileChooser();\r\n File file = fileExplorer.showOpenDialog(null);\r\n //Open a file explorer and ask user to select a file\r\n if(file != null && file.exists())\r\n {\r\n UploadScriptField.setText(file.getCanonicalPath());\r\n //Set the upload field text\r\n DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\r\n \"dd/MM/yyyy\");\r\n TextInputDialog dialog = new TextInputDialog(\"Command to\"\r\n + \" run script\");\r\n dialog.setTitle(\"Found script from File Explorer\");\r\n dialog.setHeaderText(\"Enter Command to run\");\r\n Optional<String> result = dialog.showAndWait();\r\n //Wait for response\r\n if(result.isPresent())\r\n {\r\n TextInputDialog dialogDescription = new \r\n TextInputDialog(\"Script Description\");\r\n dialogDescription.setTitle(\"Found script in explorer\");\r\n dialogDescription.setHeaderText(\"Enter script description\");\r\n Optional<String>resultDesc =dialogDescription.showAndWait();\r\n if(resultDesc.isPresent())\r\n {\r\n //Set the date format for the string\r\n //set the image view as the delete button\r\n user.getListOfScripts().add(new Script(file.getName(),\r\n formatter.format(LocalDate.now()), \r\n dialogDescription.getResult(), \r\n dialog.getResult()));\r\n //Add script to list and set details\r\n scriptTable.setItems(user.getListOfScripts());\r\n //Reload table\r\n user.setListOfScripts(user.getListOfScripts());\r\n }\r\n }\r\n }\r\n }",
"public void getDataFromFileOptionsOpen(ActionEvent event) throws Exception {\n\n //file choose\n FileChooser fileChooser = new FileChooser();\n SelectFileButton.setOnAction(e -> {\n try {\n FileImportNameTxtF.clear();\n File selectedFile = fileChooser.showOpenDialog(null);\n //fileChooser.getExtensionFilters().add(new FileChooser.ExtensionFilter(\".txt\"));//only shows .txt files to user\n FileImportNameTxtF.appendText(selectedFile.getPath());\n\n } catch (Exception exception) {\n exception.printStackTrace();\n }\n });\n\n //submit file\n SubmitFileButton.setOnAction(e -> {\n a[0] = FileImportNameTxtF.getText();\n\n });\n }",
"@FXML\n void readFromFile(ActionEvent event)throws FileNotFoundException {\n BoxSetting bx = new BoxSetting(devTempBox,devHumBox,presDevBox,maxTempDevBox,minTempDevBox,measTxt,presChart,humidChart,tempChart,tempBox,humidBox,presBox,maxTempBox,minTempBox,meanTempBox,meanHumidBox,meanPresBox,meanMaxTempBox,meanMinTempBox,meanTempBox,meanHumidBox,meanPresBox);\n cityBox.setText(readNameBox.getText());\n bx.fromFileDisp(tc.fromFile(readNameBox.getText()));\n }",
"@Override\n\tpublic void start(Stage stage) {\n\t\tfinal Menu fileMenu = new Menu(UIText.getString(\"fileMenu\"));\n\t\tfinal Menu optionMenu = new Menu(UIText.getString(\"optionMenu\"));\n\t\tfinal Menu helpMenu = new Menu(UIText.getString(\"helpMenu\"));\n\t\t//endregion\n\n\t\t//region File Menu Items\n\t\tfinal MenuItem fileMenu_new = new MenuItem(UIText.getString(\"fileMenu_new\"));\n\t\tfinal MenuItem fileMenu_open = new MenuItem(UIText.getString(\"fileMenu_open\"));\n\t\tfinal MenuItem fileMenu_save = new MenuItem(UIText.getString(\"fileMenu_save\"));\n\t\t//endregion\n\n\t\t//region Option Menu Items\n\t\tfinal MenuItem optionMenu_settings = new MenuItem(UIText.getString(\"optionMenu_settings\"));\n\t\t//endregion\n\n\t\t//region Help Menu Items\n\t\tfinal MenuItem helpMenu_help = new MenuItem(UIText.getString(\"helpMenu_help\"));\n\t\t//endregion\n\n\t\tMenuBar menubar = new MenuBar();\n\n\t\tfileMenu.getItems().addAll(fileMenu_new, fileMenu_open, fileMenu_save);\n\t\toptionMenu.getItems().addAll(optionMenu_settings);\n\t\thelpMenu.getItems().addAll(helpMenu_help);\n\n\t\tmenubar.getMenus().addAll(fileMenu, optionMenu, helpMenu);\n\n\t\tBorderPane borderPane = new BorderPane();\n\t\tborderPane.setTop(menubar);\n\n\t\tScrollPane rightMenu = new ScrollPane();\n\t\trightMenu.setBackground(new Background(new BackgroundFill(Color.RED, CornerRadii.EMPTY, Insets.EMPTY)));\n\t\tborderPane.setRight(rightMenu);\n\n\t\tScene scene = new Scene(borderPane, 800, 600);\n\t\tstage.setTitle(\"Map Editor\");\n\t\tstage.setResizable(false);\n\t\tstage.setMaxHeight(600);\n\t\tstage.setMaxWidth(800);\n\n\t\tstage.setScene(scene);\n\t\tstage.show();\n\t}",
"@FXML\n\tpublic void openFile() {\n\t\tFileChooser openFileChooser = new FileChooser();\n\t\topenFileChooser.setInitialDirectory(userWorkspace);\n\t\topenFileChooser.getExtensionFilters().add(new FileChooser.ExtensionFilter(\"Text doc(*.txt)\", \"*.txt\"));\n\t\tfile = openFileChooser.showOpenDialog(ap.getScene().getWindow());\n\n\t\tuserText.clear();\n\n\t\tif (file != null) {\n\t\t\tif (file.getName().endsWith(\".txt\")) {\n\t\t\t\tfilePath = file.getAbsolutePath();\n\t\t\t\tStage primStage = (Stage) ap.getScene().getWindow();\n\t\t\t\tprimStage.setTitle(filePath);\n\t\t\t\tTab tab = tabPane.getSelectionModel().getSelectedItem();\n\t\t\t\ttab.setId(filePath);\n\t\t\t\ttab.setText(file.getName());\n\n\t\t\t\twriteToUserText();\n\t\t\t}\n\t\t}\n\t}",
"@FXML\n private void saveFile() {\n FileHandler.saveFileData(stage, dRegister);\n }",
"public Window_File_Editor(FileSystemDirectory rootName, MainWindow parent, List<FileSystemFile> file) {\n initComponents();\n root = rootName; \n this.parent = parent;\n files = file;\n setFileNames(files);\n }",
"public void newDataFile(Stage primaryStage) {\n String title = \"Upload Data File\";\n\n VBox vbox = vboxFormat();\n\n Label title1 = new Label(\"Input CSV File Name\");\n title1.setFont(new Font(\"Arial\", 15));\n Label direction2 = new Label(\"enter file name, hit enter, then done\");\n direction2.setFont(new Font(\"Arial\", 10));\n TextField userInput = new TextField(\"file name with .csv extension\");\n // TODO program text field event, this is where the file name will be collected,\n // send to another class to handle!\n // Input file class called to check syntax of file name and read.\n userInput.setOnAction(e -> {\n new InputFile(userInput.getText(), report);\n updateTable();\n }); // working\n\n // Add done button\n Button done = buttonFormat(\"Done\", 3);\n\n vbox.getChildren().addAll(title1, userInput, direction2, done);\n showDialogWindow(primaryStage, vbox, title, done);\n updateTable();\n }",
"public void showDialog()\n {\n textInputDialog = new TextInputDialog();\n textInputDialog.setTitle(\"Choose File\");\n Pane pane = new Pane();\n pane.setPrefSize(350, 130);\n\n filePath = new TextField();\n filePath.setPrefSize(250, 20);\n filePath.setPromptText(\"Path File :\");\n filePath.setLayoutX(20);\n filePath.setLayoutY(50);\n\n\n JFXButton Browse = new JFXButton(\"Browse\");\n Browse.setStyle(\" -fx-background-color :#ffffff\");\n Browse.setLayoutX(280);\n Browse.setLayoutY(50);\n\n Browse.setButtonType(JFXButton.ButtonType.RAISED);\n\n pane.getChildren().addAll(filePath, Browse);\n textInputDialog.setHeaderText(null);\n textInputDialog.getDialogPane().setContent(pane);\n Browse.setOnMouseClicked(event ->\n {\n FileChooser fileChooser = new FileChooser();\n file = fileChooser.showOpenDialog(rootAnchorPane.getScene().getWindow());\n filePath.setText(file.getAbsolutePath());\n });\n }",
"@Override\n public void start(Stage primaryStage) {\n filePathField.setPrefWidth(300);\n // Adds nodes to mainContent container\n mainContent.getChildren().addAll(label, filePathField, openButton);\n // Sets mainContent container alignment to center\n mainContent.setAlignment(Pos.CENTER);\n // Sets spacing of mainContent children\n mainContent.setSpacing(20);\n // Adds nodes to root container\n root.getChildren().addAll(title, mainContent, result);\n // Sets root alignment to center\n root.setAlignment(Pos.CENTER);\n // Sets spacing of root layout\n root.setSpacing(20);\n // Sets event handler for openButton\n openButton.setOnAction(e-> openFileExplorer());\n // Sets scene container to root and window dimensions\n Scene scene = new Scene(root, 600, 400);\n // Sets title of program window\n primaryStage.setTitle(\"Character Limit Counter\");\n // Sets scene of stage\n primaryStage.setScene(scene);\n // Shows stage\n primaryStage.show();\n }",
"@FXML\n private void writeFiles(){\n setProfileUNr();\n PonsFileFactory ponsFileFactory = new PonsFileFactory();\n ponsFileFactory.setKykgat(isKykgat.isSelected());\n for (Profile profile : profiles) {\n createFile(ponsFileFactory,profile);\n }\n moveXBy.setText(\"0\");\n }",
"@FXML\r\n void ClickOptionsAndSettings(MouseEvent event) throws IOException {\r\n FXMLLoader loader = new FXMLLoader();\r\n loader.setLocation(getClass().getResource(\"OptionsAndSettings.fxml\"));\r\n loader.load();\r\n //Load options and settings page\r\n OptionsAndSettingsController controller = loader.getController();\r\n controller.setUser(user);\r\n //Set user details\r\n Parent root = loader.getRoot();\r\n Scene scene = new Scene(root);\r\n Stage stage = (Stage)((Node)event.getSource()).getScene().getWindow();\r\n stage.setScene(scene);\r\n stage.show();\r\n }",
"@FXML \r\n private void handleIrDescargas() {\r\n \tmain.mostrarVistaDescargarArchivos();\r\n }",
"@Override\r\n\tpublic void initialize(URL arg0, ResourceBundle arg1) {\n\t\tm_DatasetTable.prefWidthProperty().bind(m_MainPane.widthProperty().divide(40).multiply(23));\r\n\t\tm_DatasetTable.prefHeightProperty().bind(m_MainPane.heightProperty().subtract(m_TopHBox.heightProperty()));\r\n\t\tm_ConceptTable.prefWidthProperty().bind(m_MainPane.widthProperty().divide(40).multiply(17));\r\n\t\tm_ConceptTable.prefHeightProperty().bind(m_MainPane.heightProperty().subtract(m_TopHBox.heightProperty()));\r\n\t\tm_PortalList.prefWidthProperty().bind(m_MainPane.widthProperty().divide(4));\r\n\t\tm_menuBar.prefWidthProperty().bind(m_MainPane.widthProperty());\r\n\t\t//Setting up the menu bar\r\n\t\tm_saveMenu.setOnAction(new EventHandler<ActionEvent>() {\r\n\t public void handle(ActionEvent e) {\r\n\t\t\t\t//Set the configuration of the categorizer to the input fields.\r\n\t\t\t\t//If input is invalid do nothing.\r\n\t\t\t\tif(!setConfiguration()) return;\r\n\t \t\r\n\t FileChooser fileChooser = new FileChooser();\r\n\t fileChooser.setTitle(\"Save Settings\");\r\n\t fileChooser.setInitialFileName(\"Settings\");\r\n\t fileChooser.getExtensionFilters().add(new ExtensionFilter(\"Categorizer Settings\", \"*.csf\"));\r\n\t File file = fileChooser.showSaveDialog(new Stage());\r\n\t if(file == null) return;\r\n\t try {\r\n\t\t\t\t\tm_Categorizer.saveSettings(file);\r\n\t\t\t\t} catch (IOException e1) {\r\n\t\t\t\t\tAlert alert = new Alert(AlertType.ERROR);\r\n\t\t\t\t\talert.setContentText(\"Cannot save file\");\r\n\t\t\t\t\talert.showAndWait();\r\n\t\t\t\t}\r\n\r\n\t }\r\n\t });\r\n\t\tm_loadMenu.setOnAction(new EventHandler<ActionEvent>() {\r\n\t\t\t@Override public void handle(ActionEvent e) {\r\n\t FileChooser fileChooser = new FileChooser();\r\n\t fileChooser.setTitle(\"Load Settings\");\r\n\t fileChooser.getExtensionFilters().add(new ExtensionFilter(\"Categorizer Settings\", \"*.csf\"));\r\n\t File file = fileChooser.showOpenDialog(new Stage());\r\n\t if(file == null) return;\r\n\t if(!file.canRead()) return;\r\n\t try {\r\n\t\t\t\t\tm_Categorizer.loadSettings(file);\r\n\t\t\t\t} catch (IOException e1) {\r\n\t\t\t\t\tAlert alert = new Alert(AlertType.ERROR);\r\n\t\t\t\t\talert.setContentText(\"Cannot load file\");\r\n\t\t\t\t\talert.showAndWait();\r\n\t\t\t\t}\r\n\t refreshUI();\r\n\t }\r\n\t });\r\n\t\t//The export results as csv menu item first lets the user select one or more portals \r\n\t\t//and then runs categorization on each portal saving the resulting category frequencies to a csv file\r\n\t\tCategorizerWindow thisWindow = this;\r\n\t\tm_ExportCSV.setOnAction(new EventHandler<ActionEvent>() {\r\n\t\t\t\t@Override public void handle(ActionEvent e) {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\t//Set the configuration of the categorizer to the input fields.\r\n\t\t\t\t\t\t//If input is invalid do nothing.\r\n\t\t\t\t\t\tif(!setConfiguration()) return;\r\n\t\t\t\t\t\t//Let the user select any number of portals\r\n\t\t\t\t\t\tSelectPortalWindow w = new SelectPortalWindow();\r\n\t\t\t\t\t\tList<String> selectedPortals = w.selectPortals(m_Database.getAllPortals());\r\n\t\t\t\t\t\t//Let the user chose a destination file\r\n\t\t\t\t\t\tFileChooser fileChooser = new FileChooser();\r\n\t\t\t\t fileChooser.setTitle(\"Export category frequencies\");\r\n\t\t\t\t fileChooser.setInitialFileName(\"category frequencies\");\r\n\t\t\t\t fileChooser.getExtensionFilters().add(new ExtensionFilter(\"CSV File\", \"*.csv\"));\r\n\t\t\t\t File file = fileChooser.showSaveDialog(new Stage());\r\n\t\t\t\t if(file == null) return;\r\n\t\t\t\t //Run categorization on the selected portals and save the results to the selected file\r\n\t\t\t\t ExportCsvWindow exportWindow = new ExportCsvWindow(selectedPortals);\r\n\t\t\t\t exportWindow.display(m_Database, m_Categorizer, file);\r\n\t\t\t\t \r\n\r\n\t\t\t\t\t} catch (StorageException e1){\r\n\t\t\t\t\t\tAlert alert = new Alert(AlertType.ERROR);\r\n\t\t\t\t\t\talert.setContentText(\"Cannot connect to Database\");\r\n\t\t\t\t\t\talert.showAndWait();\r\n\t\t\t\t\t} catch (IOException e1) {\r\n\t\t\t\t\t\tAlert alert = new Alert(AlertType.ERROR);\r\n\t\t\t\t\t\talert.setContentText(\"Cannot write to this file\");\r\n\t\t\t\t\t\talert.showAndWait();\r\n\t\t\t\t\t}\r\n\t\t\t\t }\r\n\t\t});\r\n\t\t//Save current categories to database\r\n\t\tm_saveCatsDB.setOnAction(new EventHandler<ActionEvent>() {\r\n\t\t\t@Override public void handle(ActionEvent e) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tm_Database.updateCategories(m_data);\r\n\t\t\t\t} catch (StorageException e1) {\r\n\t\t\t\t\tAlert alert = new Alert(AlertType.ERROR);\r\n\t\t\t\t\talert.setContentText(\"Cannot connect to Database\");\r\n\t\t\t\t\talert.showAndWait();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\t//Setting up the columns for the Dataset table\r\n\t\tm_LinkColumn.setCellValueFactory(new Callback<CellDataFeatures<Dataset, String>, ObservableValue<String>>() {\r\n\t\t public ObservableValue<String> call(CellDataFeatures<Dataset, String> arg) {\r\n\t\t\t return new SimpleStringProperty(arg.getValue().ID().value());\r\n\t\t }\r\n\t\t});\r\n\t\tm_PortalColumn.setCellValueFactory(new Callback<CellDataFeatures<Dataset, String>, ObservableValue<String>>() {\r\n\t\t\t public ObservableValue<String> call(CellDataFeatures<Dataset, String> arg) {\r\n\t\t\t\t return new SimpleStringProperty(arg.getValue().Portal());\r\n\t\t\t }\r\n\t\t});\r\n\t\tm_TitleColumn.setCellValueFactory(new Callback<CellDataFeatures<Dataset, String>, ObservableValue<String>>() {\r\n\t\t\t public ObservableValue<String> call(CellDataFeatures<Dataset, String> arg) {\r\n\t\t\t\t return new ReadOnlyStringWrapper(arg.getValue().Title());\r\n\t\t\t }\r\n\t\t});\r\n\t\tm_TitleColumn.setCellFactory(new Callback<TableColumn<Dataset, String>, TableCell<Dataset, String>>() {\r\n\t\t\t public TableCell<Dataset, String> call(TableColumn<Dataset, String> arg) {\r\n\t\t\t\t return getTextWrappingCell();\r\n\t\t\t }\r\n\t\t});\r\n\t\tm_KeywordsColumn.setCellValueFactory(new Callback<CellDataFeatures<Dataset, String>, ObservableValue<String>>() {\r\n\t\t\t public ObservableValue<String> call(CellDataFeatures<Dataset, String> arg) {\r\n\t\t\t\t String keywords = \"\";\r\n\t\t\t\t \r\n\t\t\t\t for(String keyword : arg.getValue().Keywords()){\r\n\t\t\t\t \t keywords += \"\\u25B8 \" + keyword + System.getProperty(\"line.separator\");\r\n\t\t\t\t }\r\n\t\t\t\t if(keywords != \"\") keywords = keywords.substring(0, keywords.length()-2);\r\n\t\t\t\t \r\n\t\t\t\t return new SimpleStringProperty(keywords);\r\n\t\t\t }\r\n\t\t});\r\n\t\tm_CategoriesColumn.setCellValueFactory(new Callback<CellDataFeatures<Dataset, String>, ObservableValue<String>>() {\r\n\t\t\t public ObservableValue<String> call(CellDataFeatures<Dataset, String> arg) {\r\n\t\t\t String categories = \"\";\r\n\t\t\t \r\n\t\t\t for(Map.Entry<BabelDomain, Float> category : Globals.entriesSortedByValues(arg.getValue().Categories())){\r\n\t\t\t \t categories = \"\\u25B8 \" + category.getKey() + System.getProperty(\"line.separator\") + categories;\r\n\t\t\t }\r\n\t\t\t if(categories != \"\") categories = categories.substring(0, categories.length()-2);\r\n\t\t\t \r\n\t\t\t return new SimpleStringProperty(categories);\r\n\t\t\t }\r\n\t\t});\r\n\t\tm_ScoreColumn.setCellValueFactory(new Callback<CellDataFeatures<Dataset, String>, ObservableValue<String>>() {\r\n\t\t\t public ObservableValue<String> call(CellDataFeatures<Dataset, String> arg) {\r\n\t\t\t String categories = \"\";\r\n\t\t\t \r\n\t\t\t for(Map.Entry<BabelDomain, Float> category : Globals.entriesSortedByValues(arg.getValue().Categories())){\r\n\t\t\t \t categories = \"\\u25B8 \" + category.getValue() + System.getProperty(\"line.separator\") + categories;\r\n\t\t\t }\r\n\t\t\t if(categories != \"\") categories = categories.substring(0, categories.length()-2);\r\n\t\t\t \r\n\t\t\t return new SimpleStringProperty(categories);\r\n\t\t\t }\r\n\t\t});\r\n\t\t//Setting up the columns for the Concept table\r\n\t\tm_ConceptNameColumn.setCellValueFactory(new Callback<CellDataFeatures<Concept, String>, ObservableValue<String>>() {\r\n\t\t\t\t public ObservableValue<String> call(CellDataFeatures<Concept, String> arg) {\r\n\t\t\t\t\t return new SimpleStringProperty(arg.getValue().Name());\r\n\t\t\t\t }\r\n\t\t});\r\n\t\tm_ConceptNameColumn.setCellFactory(new Callback<TableColumn<Concept, String>, TableCell<Concept, String>>() {\r\n\t\t\t public TableCell<Concept, String> call(TableColumn<Concept, String> arg) {\r\n\t\t\t\t\t return new ConceptTableCell(CellType.nonEditable);\r\n\t\t\t }\r\n\t\t});\r\n\t\tm_ConceptCatColumn.setCellValueFactory(new Callback<CellDataFeatures<Concept, String>, ObservableValue<String>>() {\r\n\t\t\t public ObservableValue<String> call(CellDataFeatures<Concept, String> arg) {\r\n\t\t\t\t //Concepts may or may not have categories\r\n\t\t\t\t String category = arg.getValue().Category() != null ? arg.getValue().Category().toString() : \"\"; \r\n\t\t\t\t return new SimpleStringProperty(category);\r\n\t\t\t }\r\n\t\t});\r\n\t\tm_ConceptCatColumn.setCellFactory(new Callback<TableColumn<Concept, String>, TableCell<Concept, String>>() {\r\n\t\t\t public TableCell<Concept, String> call(TableColumn<Concept, String> arg) {\r\n\t\t\t\t\t return new ConceptTableCell(CellType.category);\r\n\t\t\t }\r\n\t\t});\r\n\t\tm_ConceptCatConfColumn.setCellValueFactory(new Callback<CellDataFeatures<Concept, String>, ObservableValue<String>>() {\r\n\t\t\t public ObservableValue<String> call(CellDataFeatures<Concept, String> arg) {\r\n\t\t\t\t return new SimpleStringProperty(String.valueOf(arg.getValue().CatConfidence()));\r\n\t\t\t }\r\n\t\t});\r\n\t\tm_ConceptCatConfColumn.setCellFactory(new Callback<TableColumn<Concept, String>, TableCell<Concept, String>>() {\r\n\t\t\t public TableCell<Concept, String> call(TableColumn<Concept, String> arg) {\r\n\t\t\t\t\t return new ConceptTableCell(CellType.confidence);\r\n\t\t\t }\r\n\t\t});\r\n\t\tm_ConceptRelScoreColumn.setCellValueFactory(new Callback<CellDataFeatures<Concept, String>, ObservableValue<String>>() {\r\n\t\t\t public ObservableValue<String> call(CellDataFeatures<Concept, String> arg) {\r\n\t\t\t\t //Remove digist after 2. decimal place\r\n\t\t\t\t float relScore = arg.getValue().Scores().RelevanceScore();\r\n\t\t\t\t relScore = Math.round(relScore*100)/100.0f;\r\n\t\t\t\t return new SimpleStringProperty(String.valueOf(relScore));\r\n\t\t\t }\r\n\t\t});\r\n\t\tm_ConceptRelScoreColumn.setCellFactory(new Callback<TableColumn<Concept, String>, TableCell<Concept, String>>() {\r\n\t\t\t public TableCell<Concept, String> call(TableColumn<Concept, String> arg) {\r\n\t\t\t\t\t return new ConceptTableCell(CellType.nonEditable);\r\n\t\t\t }\r\n\t\t});\r\n\t\tm_ConceptCohScoreColumn.setCellValueFactory(new Callback<CellDataFeatures<Concept, String>, ObservableValue<String>>() {\r\n\t\t\t public ObservableValue<String> call(CellDataFeatures<Concept, String> arg) {\r\n\t\t\t\t //Remove digist after 2. decimal place\r\n\t\t\t\t float cohScore = arg.getValue().Scores().CoherenceScore();\r\n\t\t\t\t cohScore = Math.round(cohScore*100)/100.0f;\r\n\t\t\t\t return new SimpleStringProperty(String.valueOf(cohScore));\r\n\t\t\t }\r\n\t\t});\r\n\t\tm_ConceptCohScoreColumn.setCellFactory(new Callback<TableColumn<Concept, String>, TableCell<Concept, String>>() {\r\n\t\t\t public TableCell<Concept, String> call(TableColumn<Concept, String> arg) {\r\n\t\t\t\t\t return new ConceptTableCell(CellType.nonEditable);\r\n\t\t\t }\r\n\t\t});\r\n\t\tm_ConceptWeightColumn.setCellValueFactory(new Callback<CellDataFeatures<Concept, String>, ObservableValue<String>>() {\r\n\t\t\t public ObservableValue<String> call(CellDataFeatures<Concept, String> arg) {\r\n\t\t\t\t //Remove digist after 2. decimal place\r\n\t\t\t\t float weight = m_Categorizer.ConceptIDsToFeatures().get(arg.getValue().ID()).Weight();\r\n\t\t\t\t weight = Math.round(weight*100)/100.0f;\r\n\t\t\t\t return new SimpleStringProperty(String.valueOf(weight));\r\n\t\t\t }\r\n\t\t});\r\n\t\tm_ConceptWeightColumn.setCellFactory(new Callback<TableColumn<Concept, String>, TableCell<Concept, String>>() {\r\n\t\t\t public TableCell<Concept, String> call(TableColumn<Concept, String> arg) {\r\n\t\t\t\t\t return new ConceptTableCell(CellType.weight);\r\n\t\t\t }\r\n\t\t});\r\n\t\t\r\n\t\t//Ctrl + C in Dataset table copies dataset id to clipboard\r\n\t\tm_DatasetTable.setOnKeyPressed(new EventHandler<KeyEvent>() {\r\n\t\t @Override\r\n\t\t public void handle(KeyEvent t) {\r\n\t\t \tif(t.isControlDown() && t.getCode() == KeyCode.C){\r\n\t\t\t \tDataset selectedDataset = m_DatasetTable.getSelectionModel().getSelectedItem();\r\n\t\t\t \tif(selectedDataset == null) return;\r\n\r\n\t\t\t final Clipboard clipboard = Clipboard.getSystemClipboard();\r\n\t\t\t final ClipboardContent content = new ClipboardContent();\r\n\t\t content.putString(selectedDataset.ID().value());\r\n\t\t\t clipboard.setContent(content);\r\n\t\t\t }\r\n\t\t }\r\n\t\t});\r\n\t\t//Ctrl + C in Concepts table copies url to babelnet synset to clipboard\r\n\t\tm_ConceptTable.setOnKeyPressed(new EventHandler<KeyEvent>() {\r\n\t\t @Override\r\n\t\t public void handle(KeyEvent t) {\r\n\t\t \tif(t.isControlDown() && t.getCode() == KeyCode.C){\r\n\t\t\t \tConcept selectedConcept = m_ConceptTable.getSelectionModel().getSelectedItem();\r\n\t\t\t \tif(selectedConcept == null) return;\r\n\r\n\t\t\t final Clipboard clipboard = Clipboard.getSystemClipboard();\r\n\t\t\t final ClipboardContent content = new ClipboardContent();\r\n\t\t content.putString(\"http://babelnet.org/synset?word=\" + selectedConcept.ID().value());\r\n\t\t\t clipboard.setContent(content);\r\n\t\t\t }\r\n\t\t }\r\n\t\t});\r\n\t\t\r\n\t\tm_DatasetTable.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<Dataset>() {\r\n\t\t @Override\r\n\t\t public void changed(ObservableValue<? extends Dataset> observableValue, Dataset oldValue, Dataset newValue) {\r\n\t\t //Check whether item is selected\r\n\t\t if(m_DatasetTable.getSelectionModel().getSelectedItem() != null){\r\n\t\t \t//Update the Concept table with the concepts of the selected dataset\r\n\t\t \tm_Conceptsdata.clear();\r\n\t\t \t//First add keyword concepts\r\n\t\t \tfor(Concept c : newValue.Concepts())\r\n\t\t \t\tif(c.Mark().startsWith(\"1\")) m_Conceptsdata.add(c);\r\n\t\t \t//Then add non-keyword concepts\r\n\t\t \tfor(Concept c : newValue.Concepts())\r\n\t\t \t\tif(c.Mark().startsWith(\"0\")) m_Conceptsdata.add(c);\r\n\t\t }\r\n\t\t }\r\n\t\t});\r\n\r\n\t\t//The load button opens a new window which lets the user select from all available portals\r\n\t\tm_LoadBtn.setOnAction(new EventHandler<ActionEvent>() {\r\n\t\t\t@Override public void handle(ActionEvent e) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tSelectPortalWindow w = new SelectPortalWindow();\r\n\t\t\t\t\tloadPortals(w.selectPortals(m_Database.getAllPortals()));\r\n\t\t\t\t} catch (StorageException e1){\r\n\t\t\t\t\tAlert alert = new Alert(AlertType.ERROR);\r\n\t\t\t\t\talert.setContentText(\"Cannot connect to Database\");\r\n\t\t\t\t\talert.showAndWait();\r\n\t\t\t\t}\r\n\t\t }\r\n\t\t});\r\n\t\t\r\n\t\t//The unload button removes the selected portal from the list and removes all datasets belonging to the corresponding portal\r\n\t\tm_UnloadBtn.setOnAction(new EventHandler<ActionEvent>() {\r\n\t\t\t@Override public void handle(ActionEvent e) {\r\n\t\t\t\tint selectedPortalIndex = m_PortalList.getSelectionModel().getSelectedIndex();\r\n\t\t\t\t//Only do something if a portal is selected\r\n\t\t\t\tif(selectedPortalIndex < 0) return;\r\n\t\t\t\t//Remove the portal from the categorizer and the tableview\r\n\t\t\t\tm_data.removeAll(m_Categorizer.unloadPortal(m_PortalList.getItems().get(selectedPortalIndex)));\r\n\t\t\t\tm_DatasetTable.refresh();\r\n\t\t\t\t//Clear the concept tableview\r\n\t\t\t\tm_Conceptsdata.clear();\r\n\t\t\t\t//Remove the portal from the listview\r\n\t\t\t\tm_PortalList.getItems().remove(selectedPortalIndex);\r\n\t\t\t\t//Label for number of datasets\r\n\t\t\t\tm_numDatasetsLabel.setText(m_Categorizer.Datasets().size() + \" Datasets loaded.\");\r\n\t\t //Refresh the statistics window\r\n\t\t\t\tm_StatisticsWindow.refresh();\r\n\t\t\t\t//Update the filter choicebox\r\n\t\t\t\tupdateFilterChoiceBox();\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t\t//Setup the statistics window\r\n\t\t//Load the new window\r\n\t\tFXMLLoader loader = new FXMLLoader(getClass().getClassLoader().getResource(\"Statistics.fxml\"));\r\n\t\tParent root1;\r\n\t\ttry {\r\n\t\t\troot1 = (Parent) loader.load();\r\n\t\t} catch (IOException e2) {\r\n\t\t\tAlert alert = new Alert(AlertType.ERROR);\r\n\t\t\talert.setContentText(\"Cannot access statistics.fxml resource!\");\r\n\t\t\talert.showAndWait();\r\n\t\t\treturn;\r\n\t\t}\r\n Stage stage = new Stage();\r\n stage.initModality(Modality.NONE);\r\n stage.initStyle(StageStyle.DECORATED);\r\n stage.setTitle(\"Statistics\");\r\n stage.setScene(new Scene(root1)); \r\n //Keep the statistics window\r\n m_StatisticsWindow = loader.<StatisticsWindow>getController();\r\n //Register the callback with the statistics window\r\n m_StatisticsWindow.registerResultListener(thisWindow);\r\n\t\t\r\n\t\t//The statistics button brings up the statistics window for the current categorization\r\n\t\tm_StatsButton.setOnAction(new EventHandler<ActionEvent>() {\r\n\t\t\t@Override public void handle(ActionEvent e) {\r\n\t\t //Populate UI of statistics window\r\n\t\t m_StatisticsWindow.refresh(); \r\n\t\t\t stage.show();\r\n\t\t }\r\n\t\t});\r\n\t\t\r\n\t\t//The categorize button performs the categorization of all active datasets using the settings entered in the textfields\r\n\t\tm_CategorizeBtn.setOnAction(new EventHandler<ActionEvent>() {\r\n\t\t\t@Override public void handle(ActionEvent e) {\r\n\t\t\t\t//Set the configuration of the categorizer to the input fields.\r\n\t\t\t\t//If input is invalid do nothing.\r\n\t\t\t\tif(!setConfiguration()) return;\r\n\t\t\t\t//Clear the concept tableview\r\n\t\t\t\tm_Conceptsdata.clear();\r\n\t\t\t\t//Run the categorization algorithm\r\n\t\t\t\tm_Categorizer.categorize();\r\n\t\t\t\t//Refresh the dataset table\r\n\t\t\t\tm_DatasetTable.refresh();\r\n\t\t\t\t//Refresh statistics window\r\n\t\t\t\tm_StatisticsWindow.refresh();\r\n\t\t\t\t//Update the filter choicebox\r\n\t\t\t\tupdateFilterChoiceBox();\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t//When a filter is selected in the choicebox the tableview is update accordingly\r\n\t\tm_FilterChoice.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<String>() {\r\n\t\t @Override\r\n\t\t public void changed(ObservableValue<? extends String> observableValue, String oldVal, String newVal) {\r\n\t\t \tif(newVal == null){\r\n\t\t\t \tm_numDisplayedLabel.setText(m_data.size() + \" Datasets displayed\");\r\n\t\t\t \treturn;\r\n\t\t\t }\r\n\t\t \tm_data.clear();\r\n\t\t \t\r\n\t\t \tif(newVal.equals(\"All\")){\r\n\t \t\t\tm_data.addAll(m_Categorizer.Datasets());\t\r\n\t\t \t}else{\r\n\t\t\t \t//Only display datasets that belong to the selected category\r\n\t\t\t \tfor(Dataset dataset : m_Categorizer.Datasets())\r\n\t\t\t \t\tif(dataset.Categories().containsKey(BabelDomain.valueOf(newVal)))\r\n\t\t\t \t\t\tm_data.add(dataset);\r\n\t\t\t }\r\n\t\t \tm_numDisplayedLabel.setText(m_data.size() + \" Datasets displayed\");\r\n\t\t }\r\n\t\t});\r\n\t\t\r\n\t\t//Populate tables and choicebox\r\n\t\tm_DatasetTable.setItems(m_data);\r\n\t\tm_ConceptTable.setItems(m_Conceptsdata);\r\n\t\tm_FilterChoice.setItems(m_FilterChoices);\r\n\t}",
"private void initFileToolbar() {\n fileToolbarPane = new FlowPane();\n\n // HERE ARE OUR FILE TOOLBAR BUTTONS, NOTE THAT SOME WILL\n // START AS ENABLED (false), WHILE OTHERS DISABLED (true)\n newDraftButton = initChildButton(fileToolbarPane, DraftKit_PropertyType.NEW_DRAFT_ICON, DraftKit_PropertyType.NEW_DRAFT_TOOLTIP, false);\n loadDraftButton = initChildButton(fileToolbarPane, DraftKit_PropertyType.LOAD_DRAFT_ICON, DraftKit_PropertyType.LOAD_DRAFT_TOOLTIP, false);\n saveDraftButton = initChildButton(fileToolbarPane, DraftKit_PropertyType.SAVE_DRAFT_ICON, DraftKit_PropertyType.SAVE_DRAFT_TOOLTIP, true);\n exportDraftButton = initChildButton(fileToolbarPane, DraftKit_PropertyType.EXPORT_DRAFT_ICON, DraftKit_PropertyType.EXPORT_DRAFT_TOOLTIP, true);\n exitButton = initChildButton(fileToolbarPane, DraftKit_PropertyType.EXIT_ICON, DraftKit_PropertyType.EXIT_TOOLTIP, false);\n }",
"public FileMenu(ChatWindow parentWindow) {\r\n\r\n super(Messages.getI18NString(\"file\").getText());\r\n\r\n this.parentWindow = parentWindow;\r\n\r\n this.setForeground(new Color(\r\n ColorProperties.getColor(\"chatMenuForeground\")));\r\n\r\n this.add(saveMenuItem);\r\n this.add(printMenuItem);\r\n\r\n this.addSeparator();\r\n\r\n this.add(closeMenuItem);\r\n\r\n this.saveMenuItem.setName(\"save\");\r\n this.printMenuItem.setName(\"print\");\r\n this.closeMenuItem.setName(\"close\");\r\n\r\n this.saveMenuItem.addActionListener(this);\r\n this.printMenuItem.addActionListener(this);\r\n this.closeMenuItem.addActionListener(this);\r\n\r\n this.setMnemonic(Messages.getI18NString(\"file\").getMnemonic());\r\n this.saveMenuItem.setMnemonic(saveString.getMnemonic());\r\n this.printMenuItem.setMnemonic(printString.getMnemonic());\r\n this.closeMenuItem.setMnemonic(closeString.getMnemonic());\r\n \r\n this.saveMenuItem.setAccelerator(\r\n KeyStroke.getKeyStroke(KeyEvent.VK_S,\r\n KeyEvent.CTRL_MASK));\r\n \r\n this.printMenuItem.setAccelerator(\r\n KeyStroke.getKeyStroke(KeyEvent.VK_R,\r\n KeyEvent.CTRL_MASK));\r\n \r\n // Disable all menu items that do nothing.\r\n this.saveMenuItem.setEnabled(false);\r\n this.printMenuItem.setEnabled(false);\r\n }",
"@FXML\n public void New_List(ActionEvent actionEvent) {\n\n //Here we are going to open a window to create a list.\n //Working!!\n try {\n FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource(\"NewTodolist.fxml\"));\n Parent root1 = (Parent) fxmlLoader.load();\n Stage stage = new Stage();\n stage.initModality(Modality.APPLICATION_MODAL);\n stage.initStyle(StageStyle.UNDECORATED);\n stage.setTitle(\"New List\");\n stage.setScene(new Scene(root1));\n stage.show();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"private void fillAllFields() {\r\n combo.setSelectedItem(moviesModule.getConfig().getOpeningSystem());\r\n fileChooser.setFilePath(moviesModule.getConfig().getFFmpegLocation());\r\n }",
"@Override\n public void start(Stage primaryStage) throws Exception{\n BorderPane bp = new BorderPane();\n Scene scene = new Scene(bp, 1200, 600);\n primaryStage.setTitle(\"String Conductor\");\n primaryStage.setScene(scene);\n primaryStage.show();\n\n //Creating the MenuBar\n MenuBar menuBar = new MenuBar();\n Menu menuFile = new Menu(\"File\");\n\n //Add import and save menu item to under file\n MenuItem importBut = new MenuItem(\"Import\");\n MenuItem saveBut = new MenuItem(\"Save results\");\n menuFile.getItems().addAll(importBut, saveBut);\n\n //Adds menu bar to window and set to top of BorderPane\n menuBar.getMenus().add(menuFile);\n bp.setTop(menuBar);\n\n //Creates the original text area at center of BorderPane\n bp.setCenter(va.originalArea);\n bp.setAlignment(va.originalArea, Pos.CENTER);\n bp.setMargin(va.originalArea, new Insets(12, 0, 12, 12));\n va.originalArea.setMaxSize(500, Region.USE_COMPUTED_SIZE);\n va.originalArea.setMinSize(200, 250);\n va.originalArea.setScaleShape(true);\n\n //Creates the filtered field area at right of BorderPane\n bp.setRight(va.filteredArea);\n bp.setAlignment(va.filteredArea, Pos.CENTER);\n bp.setMargin(va.filteredArea, new Insets(12, 12, 12, 12));\n va.filteredArea.setMaxSize(470, Region.USE_COMPUTED_SIZE);\n va.filteredArea.setMinSize(200, 250);\n va.filteredArea.setScaleShape(true);\n\n //Creates VBox for left of BorderPane\n VBox leftPane = new VBox();\n bp.setLeft(leftPane);\n leftPane.setMaxSize(Region.USE_COMPUTED_SIZE, Region.USE_COMPUTED_SIZE);\n leftPane.setMinSize(Region.USE_COMPUTED_SIZE, Region.USE_COMPUTED_SIZE);\n\n //Creates the editor text\n Text editorLabel = new Text(\"Editor\");\n editorLabel.setFont(Font.font(\"System\", FontWeight.BOLD, 24));\n editorLabel.setWrappingWidth(250);\n editorLabel.setTextAlignment(TextAlignment.CENTER);\n\n //Creates the fonts text\n Text fontsLabel = new Text(\"Fonts:\");\n fontsLabel.setFont(Font.font(\"System\", 24));\n\n //Creates the fonts drop menu\n MenuButton fontsMenu = new MenuButton(\"Default\");\n fontsMenu.setPrefWidth(90);\n MenuItem arialBut = new MenuItem(\"Arial\");\n MenuItem georgiaBut = new MenuItem(\"Georgia\");\n fontsMenu.getItems().addAll(arialBut, georgiaBut);\n\n //Creates the fonts HBox\n HBox fontBox = new HBox();\n fontBox.getChildren().addAll(fontsLabel, fontsMenu);\n fontBox.setMargin(fontsMenu, new Insets(13, 0, 0, 10));\n fontBox.setMargin(fontsLabel, new Insets(10, 0, 0, 35));\n\n //Creates the font size text\n Text fontSizeLabel = new Text(\"Size:\");\n fontSizeLabel.setFont(Font.font(\"System\", 24));\n\n //Creates the font size drop menu\n MenuButton fontSizeMenu = new MenuButton(\"Default\");\n fontSizeMenu.setPrefWidth(90);\n MenuItem size12But = new MenuItem(\"12\");\n MenuItem size13But = new MenuItem(\"13\");\n MenuItem size14But = new MenuItem(\"14\");\n MenuItem size16But = new MenuItem(\"16\");\n MenuItem size20But = new MenuItem(\"20\");\n fontSizeMenu.getItems().addAll(size12But, size13But, size14But, size16But, size20But);\n\n //Creates the font size HBox\n HBox fontSizeBox = new HBox();\n fontSizeBox.getChildren().addAll(fontSizeLabel, fontSizeMenu);\n fontSizeBox.setMargin(fontSizeLabel, new Insets(6, 0, 0, 35));\n fontSizeBox.setMargin(fontSizeMenu, new Insets(10, 0, 0, 26));\n\n //Creates the filters text\n Text filtersLabel = new Text(\"Filters\");\n filtersLabel.setFont(Font.font(\"System\", FontWeight.BOLD, 24));\n filtersLabel.setWrappingWidth(250);\n filtersLabel.setTextAlignment(TextAlignment.CENTER);\n\n //Creates the search text\n Text searchLabel = new Text(\"Search:\");\n searchLabel.setFont(Font.font(\"System\", 24));\n\n //Creates the search HBox\n HBox searchBox = new HBox();\n searchBox.getChildren().addAll(searchLabel, va.searchInput);\n\n //Creates the phrase length text\n Text pLengthLabel = new Text(\"Phrase Length:\");\n pLengthLabel.setFont(Font.font(\"System\", 24));\n\n //creates the phrase length drop menu\n MenuItem optionZero = new MenuItem(\"0\");\n MenuItem optionFour = new MenuItem(\"4\");\n MenuItem optionFive = new MenuItem(\"5\");\n MenuItem optionSix = new MenuItem(\"6\");\n MenuItem optionSeven = new MenuItem(\"7\");\n MenuItem optionEight = new MenuItem(\"8\");\n MenuItem optionNine = new MenuItem(\"9\");\n MenuItem optionTen = new MenuItem(\"10\");\n va.pLengthMenu.getItems().addAll(optionZero, optionFour, optionFive, optionSix, optionSeven,\n optionEight, optionNine, optionTen);\n\n //Creates the phrase length HBox\n HBox pLengthBox = new HBox();\n pLengthBox.getChildren().addAll(pLengthLabel, va.pLengthMenu);\n\n //Creates the clear filters and apply button\n Button cFiltersBut = new Button(\"Clear filters\");\n Button applyBut = new Button(\"Apply\");\n applyBut.setDisable(true);\n\n leftPane.setMargin(cFiltersBut, new Insets(20, 0, 0, 80));\n leftPane.setMargin(applyBut, new Insets(15, 0, 0, 100));\n leftPane.setMargin(editorLabel, new Insets(10, 0, 0, 0));\n leftPane.setMargin(filtersLabel, new Insets(10, 0, 0, 0));\n leftPane.setMargin(searchBox, new Insets(10, 0, 0, 0));\n leftPane.getChildren().addAll(editorLabel, fontBox, fontSizeBox,\n filtersLabel, searchBox, pLengthBox,\n cFiltersBut, applyBut);\n\n /**\n * Actions of all buttons\n */\n arialBut.setOnAction(e -> {\n fontsMenu.setText(\"Arial\");\n va.setAllFontsFalse();\n va.arialBool = true;\n va.applyFont();\n });\n\n georgiaBut.setOnAction(e -> {\n fontsMenu.setText(\"Georgia\");\n va.setAllFontsFalse();\n va.georgiaBool = true;\n va.applyFont();\n });\n\n size12But.setOnAction(e -> {\n fontSizeMenu.setText(\"12\");\n va.setAllSizesFalse();\n va.size12Bool = true;\n va.applyFont();\n });\n\n size13But.setOnAction(e -> {\n fontSizeMenu.setText(\"13\");\n va.setAllSizesFalse();\n va.size13Bool = true;\n va.applyFont();\n });\n\n size14But.setOnAction(e -> {\n fontSizeMenu.setText(\"14\");\n va.setAllSizesFalse();\n va.size14Bool = true;\n va.applyFont();\n });\n\n size16But.setOnAction(e -> {\n fontSizeMenu.setText(\"16\");\n va.setAllSizesFalse();\n va.size16Bool = true;\n va.applyFont();\n });\n\n size20But.setOnAction(e -> {\n fontSizeMenu.setText(\"20\");\n va.setAllSizesFalse();\n va.size20Bool = true;\n va.applyFont();\n });\n\n optionZero.setOnAction(e -> {\n va.pLengthMenu.setText(\"0\");\n va.setAllLengthFalse();\n va.pLengthHaveValue = false;\n });\n\n optionFour.setOnAction(e -> {\n va.pLengthMenu.setText(\"4\");\n va.setAllLengthFalse();\n va.optionFourBool = true;\n va.pLengthHaveValue = true;\n });\n\n optionFive.setOnAction(e -> {\n va.pLengthMenu.setText(\"5\");\n va.setAllLengthFalse();\n va.optionFiveBool = true;\n va.pLengthHaveValue = true;\n });\n\n optionSix.setOnAction(e -> {\n va.pLengthMenu.setText(\"6\");\n va.setAllLengthFalse();\n va.optionSixBool = true;\n va.pLengthHaveValue = true;\n });\n\n optionSeven.setOnAction(e -> {\n va.pLengthMenu.setText(\"7\");\n va.setAllLengthFalse();\n va.optionSevenBool = true;\n va.pLengthHaveValue = true;\n });\n optionEight.setOnAction(e -> {\n va.pLengthMenu.setText(\"8\");\n va.setAllLengthFalse();\n va.optionEightBool = true;\n va.pLengthHaveValue = true;\n });\n optionNine.setOnAction(e -> {\n va.pLengthMenu.setText(\"9\");\n va.setAllLengthFalse();\n va.optionNineBool = true;\n va.pLengthHaveValue = true;\n });\n optionTen.setOnAction(e -> {\n va.pLengthMenu.setText(\"10\");\n va.setAllLengthFalse();\n va.optionTenBool = true;\n va.pLengthHaveValue = true;\n });\n\n cFiltersBut.setOnAction(e -> {\n va.clearFilter();\n });\n\n /**\n * Sets action of apply button\n */\n applyBut.setOnAction(e -> {\n\n va.checkFilters();\n\n if (((va.searchHaveValue == false) && (va.pLengthHaveValue == false)) || ((va.searchHaveValue == true) && (va.pLengthHaveValue == true))) {\n Alert importAlert = new Alert(Alert.AlertType.ERROR);\n importAlert.setTitle(\"An error has occurred\");\n importAlert.setHeaderText(\"Select correctly!\");\n importAlert.setContentText(\"Please use only either \\\"Search\\\" or \\\"Phrase Length\\\"\\nPick one only! Use \\\"Clear filters\\\" button!\");\n importAlert.showAndWait();\n }\n\n else if(va.pLengthHaveValue == true) {\n va.filteredArea.setText(franny.getFilteredResultsByWordCount(va.returnPLength()));\n }\n else if(va.searchHaveValue == true) {\n va.filteredArea.setText(franny.getFilteredResultsBySearchPhrase(va.searchInput.getText()));\n }\n\n });\n\n /**\n * Sets action of import button\n */\n importBut.setOnAction(e -> {\n try {\n va.filteredArea.setText(franny.getImportResults(va.getImportFileDirectory(primaryStage)));\n va.originalArea.setText(franny.getOriginalDocument());\n }\n catch(IOException eo){}\n\n if(va.importSuccessful == true) {\n applyBut.setDisable(false);\n }\n });\n\n /**\n * Sets action of save button\n */\n saveBut.setOnAction(e -> {\n va.saveFile(primaryStage);\n });\n }",
"@Override\n public String getFXMLFilename() {\n return \"/view/dataview/airportFilterPopUp.fxml\";\n }",
"private void itemFileButtonActionPerformed(java.awt.event.ActionEvent evt) {\n JFileChooser chooser = new JFileChooser();\n chooser.setDialogTitle(\"Select Raffle Items File\");\n File workingDirectory = new File(System.getProperty(\"user.dir\"));\n chooser.setCurrentDirectory(workingDirectory);\n if (chooser.showSaveDialog(this) == JFileChooser.APPROVE_OPTION) {\n itemFile = chooser.getSelectedFile();\n itemFileLabel.setText(getFileName(itemFile));\n pcs.firePropertyChange(\"ITEM\" , null, itemFile);\n }\n }",
"private void initFileTab()\n\t{\n\t\t\n\t\tMainApp.getMainController().requestAddTab(fileTab);\n\t\t\n\t\t\n\t\tfileTab.getCodeArea().textProperty().addListener((obs, oldv, newv) -> dirty.set(true));\n\t\t\n\t\tdirty.addListener((obs, oldv, newv) -> {\n\t\t\t\n\t\t\tString tabTitle = fileTab.getText();\n\t\t\t\n\t\t\tif (newv && !tabTitle.endsWith(\"*\"))\n\t\t\t\tfileTab.setText(tabTitle + \"*\");\n\t\t\t\n\t\t\telse if (!newv && tabTitle.endsWith(\"*\"))\n\t\t\t\tfileTab.setText(tabTitle.substring(0, tabTitle.length()-1));\n\t\t});\n\t\t\n\t\t\n\t\tfileTab.setOnCloseRequest(e -> {\n\t\t\t\n\t\t\tboolean success = FileManager.closeFile(this);\n\t\t\t\n\t\t\tif (!success)\n\t\t\t\te.consume();\n\t\t});\n\t\t\n\t\tMainApp.getMainController().selectTab(fileTab);\n\t}",
"@FXML\r\n protected void dialogOpen() throws IOException {\r\n final FileChooser fileChooser = new FileChooser();\r\n File file = fileChooser.showOpenDialog(FracGenApplication.getInstance().stageOpenData);\r\n if (file != null) {\r\n if (file.exists()) {\r\n if (file.getAbsolutePath() != null) {\r\n tfFilename.setText(file.getAbsolutePath());\r\n }\r\n }\r\n }\r\n }",
"public void init(Stage primaryStage) {\n initModality(Modality.WINDOW_MODAL);\n initOwner(primaryStage);\n\n textField = new TextField();\n textField.setEditable(false); // Make teh text uneditable\n ready = false;\n messageLabel = new Label();\n\n // Containers\n BorderPane mainContainer = new BorderPane();\n VBox centerPane = new VBox();\n HBox bottomPane = new HBox();\n\n // Init the main container\n mainContainer.setCenter(centerPane);\n mainContainer.setBottom(bottomPane);\n\n // center pane stuff\n HBox centerHBox = new HBox();\n Button chooseFileButton = new Button(ELLIPSIS);\n centerHBox.getChildren().addAll(textField, chooseFileButton);\n centerPane.getChildren().addAll(messageLabel, centerHBox);\n\n // Buttons and such\n Button okButton = new Button(OK);\n Button cancelButton = new Button(CANCEL);\n bottomPane.getChildren().addAll(okButton, cancelButton);\n\n // set style properties\n centerPane.setAlignment(Pos.CENTER);\n centerPane.setSpacing(10);\n\n bottomPane.setAlignment(Pos.CENTER);\n bottomPane.setSpacing(10);\n\n centerHBox.setAlignment(Pos.CENTER);\n\n // Set the event handlers\n okButton.setOnAction(e -> {\n ready = true;\n hide();\n });\n cancelButton.setOnAction(e -> {\n hide();\n });\n chooseFileButton.setOnAction(e -> {\n processChooseFile(primaryStage);\n });\n\n Scene scene = new Scene(mainContainer, 300, 200);\n setScene(scene);\n }",
"@FXML\n\tpublic void abrirSobre(){\n\t}",
"private JMenu createFileMenu() {\n\t\tJMenu menu = new JMenu(\"File\"); \n\t\tmenu.add(createDetectiveNotes());\n\t\tmenu.add(createFileExitItem());\n\t\treturn menu;\n\t}",
"@FXML\n public void MealBrowseBtnClicked(){\n //display the correct panes\n subMenuDisplay(MealSubMenuPane);\n MealsBrowsePane.toFront();\n MenuPane.toFront();\n //clear the browser fields for new selection of meals\n clearMealBrowserFields();\n }",
"@FXML\n void loadButtonClicked(ActionEvent event) throws FileNotFoundException\n {\n FileChooser file = new FileChooser();\n\n file.setTitle(\"Load file (.txt)\");\n\n file.getExtensionFilters().addAll(new FileChooser.ExtensionFilter(\"Text Files\", \"*.txt\"));\n\n File selectedFile = file.showOpenDialog(listView.getScene().getWindow());\n\n // Create new file with all info on file, do this in a method\n loadFile(selectedFile);\n\n // Send all this info to the list in order to create new one\n for(int i=0; i<Item.getToDoList().size(); i++)\n {\n // Display items\n display();\n\n }\n }",
"@FXML\r\n protected void setDatafile() throws Exception {\r\n boolean hasHeader = cbHeader.isSelected();\r\n String sep = \"\\t\";\r\n if (rbSemicolon.isSelected()) {\r\n sep = \";\";\r\n } else if (rbComma.isSelected()) {\r\n sep = \",\";\r\n } else if (rbOther.isSelected()) {\r\n String aux = tfSeparator.getCharacters().toString();\r\n if (aux.length() > 0) {\r\n sep = aux;\r\n } else {\r\n throw new Exception(\"Invalid Separator\");\r\n }\r\n }\r\n if (!tfFilename.getText().trim().isEmpty()) {\r\n ScanlineAnalysisFile file = new ScanlineAnalysisFile();\r\n file.setFilename(tfFilename.getText());\r\n file.setSep(sep);\r\n file.setApColumn(0);\r\n file.setSpColumn(1);\r\n file.setHeader(hasHeader);\r\n if (hasHeader) {\r\n file.setHeaderStrings(DatasetUtils.getHeaders(file.getFileName(), sep));\r\n } else {\r\n ArrayList<String> al = new ArrayList<>(file.getColumnsCount());\r\n for (int i = 0; i < file.getColumnsCount(); i++) {\r\n if (i == 0) {\r\n al.add(\"Ap\");\r\n }\r\n if (i == 1) {\r\n al.add(\"Sp\");\r\n }\r\n if (i > 1) {\r\n al.add(\"Column \" + String.valueOf(i));\r\n }\r\n }\r\n file.setHeaderStrings(al);\r\n }\r\n Scanline sl = OpenScanlineData.openCSVFileToScanline(tfFilename.getText(),\r\n sep, 0, 1, hasHeader);\r\n file.setScanLine(sl);\r\n file.setRowsCount(sl.getFracCount());//TODO fix this\r\n Stage s = (Stage) tfFilename.getScene().getWindow();\r\n s.close();\r\n MainStage.setSclAnalysisFile(file);\r\n MainStage.refreshStats();\r\n MainStage.enableButtons();\r\n }\r\n }",
"@FXML\n void newFilePressed(ActionEvent event) {\n\t\tFileChooser fileChooser = new FileChooser();\n\t\tfileChooser.setTitle(\"Open New File\");\n\t\tFile f = fileChooser.showSaveDialog(stage);\n\t\tif (f != null) {\n\t\t\tsetFile(f);\n\t\t\tviewState.set(ViewState.NEW);\n\t\t}\n\n }",
"@FXML\n public void Edit_Name_List(ActionEvent actionEvent) {\n }",
"public Menu createFileMenu();",
"public void setUIsettingPane(PropertyFileWrapper pfw) {\n\n int col = 0, row = 0;\n\n GridPane uistatusgrid = new GridPane();\n uistatusgrid.setHgap(20);\n uistatusgrid.setVgap(5);\n uistatusgrid.setPadding(new Insets(20, 10, 10, 10));\n timeZone = new JFXTextField();\n timeZone.setPromptText(\"Enter the Time Zone\");\n if (!pfw.getTimeZone().isEmpty() || !pfw.getTimeZone().equals(\"\") || pfw.getTimeZone() != null) {\n timeZone.setText(pfw.getTimeZone());\n }\n\n timeFormat = new JFXTextField();\n timeFormat.setPromptText(\"Enter the time format\");\n if (!pfw.getTimeFormat().isEmpty() || !pfw.getTimeFormat().equals(\"\") || pfw.getTimeFormat() != null) {\n timeFormat.setText(pfw.getTimeFormat());\n }\n fetchTime = new JFXTextField();\n fetchTime.setPromptText(\"Enter Refresh Rate\");\n if (!pfw.getFetchTime().isEmpty() || !pfw.getFetchTime().equals(\"\") || pfw.getFetchTime() != null) {\n fetchTime.setText(pfw.getFetchTime());\n }\n statusPath = new JFXTextField();\n statusPath.setPromptText(\"Please select the Status folder\");\n statusPath.setDisable(true);\n if (!pfw.getStatusPath().isEmpty() || !pfw.getStatusPath().equals(\"\") || pfw.getStatusPath() != null) {\n statusPath.setText(pfw.getStatusPath());\n }\n statusFileLoad = new Button(\"Browse\");\n\n statusFileLoad.setOnAction((ActionEvent event) -> {\n\n try {\n\n Stage mainstage = (Stage) mainvbox.getScene().getWindow();\n File fileName = fileChooser.showOpenDialog(mainstage);\n\n if (fileName != null) {\n\n if (fileName.getAbsoluteFile().exists()) {\n statusPath.setText(fileName.getAbsolutePath());\n\n if (!statusPath.getText().isEmpty()) {\n schedularConf.setDisable(false);\n fileConf.setDisable(false);\n mailAlerts.setDisable(false);\n smtpConf.setDisable(false);\n ftptp.setDisable(false);\n try {\n statusProperties = new StatusProperties(statusPath.getText());\n setConnProperties(statusProperties.getConnFile());\n setSmtpProperties(statusProperties.getMailFile());\n\n } catch (IOException ex) {\n Logger.getLogger(ConfigFile.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n }\n } else {\n throw new FileNotFoundException(fileName.getAbsolutePath() + \" does not exists.\");\n }\n }\n } catch (Exception ex) {\n\n ex.printStackTrace();\n new ExceptionUI(ex);\n }\n\n });\n\n if (statusPath.getText().isEmpty()) {\n schedularConf.setDisable(true);\n fileConf.setDisable(true);\n mailAlerts.setDisable(true);\n smtpConf.setDisable(true);\n ftptp.setDisable(true);\n } else {\n schedularConf.setDisable(false);\n fileConf.setDisable(false);\n mailAlerts.setDisable(false);\n smtpConf.setDisable(false);\n ftptp.setDisable(false);\n }\n\n uistatusgrid.add(new Label(\"Time Zone\"), col, row);\n uistatusgrid.add(timeZone, col + 1, row, 2, 1);\n uistatusgrid.add(new Label(\"Date & Time Format\"), col, ++row);\n uistatusgrid.add(timeFormat, col + 1, row, 2, 1);\n uistatusgrid.add(new Label(\"Refresh Rate\"), col, ++row);\n uistatusgrid.add(fetchTime, col + 1, row, 2, 1);\n uistatusgrid.add(new Label(\"Status File\"), col, ++row);\n uistatusgrid.add(statusPath, col + 1, row, 2, 1);\n uistatusgrid.add(statusFileLoad, col + 3, row, 3, 1);\n// uistatusgrid.add(validate, col + 1, ++row, 2, 1);\n uiStatus.setContent(uistatusgrid);\n }",
"@FXML private void handleExaminar() {\r\n \tDirectoryChooser dc = new DirectoryChooser();\r\n \tdc.setTitle(\"Examinar archivos\");\r\n \t\r\n \t\r\n \tFile dir = dc.showDialog(null); \r\n \t\r\n \tif(dir != null) {\r\n \t\tpath = dir.getAbsolutePath().replace('\\\\', '/');\r\n \t\ttext_examinar.setText(path);\r\n \t}\r\n \t\r\n \tlista_usuarios.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);\r\n \tlista_usuarios.setMouseTransparent( false );\r\n \tlista_usuarios.setFocusTraversable( true );\r\n }",
"@FXML\n public void editRuleFile(ActionEvent event) throws IOException {\n RuleFileEditorGUI ruleFileEditor = new RuleFileEditorGUI();\n ruleFileEditor.start(new Stage());\n \n }",
"private void buildFileMenu(){\n //Create a Save menu item\n saveItem = new JMenuItem(\"Save\");\n saveItem.setMnemonic(KeyEvent.VK_S);\n saveItem.addActionListener(new SaveListener());\n \n //Create a Load menu item\n loadItem = new JMenuItem(\"Load\");\n loadItem.setMnemonic(KeyEvent.VK_L);\n loadItem.addActionListener(new LoadListener());\n\n //Create an Exit menu item\n exitItem = new JMenuItem(\"Exit\");\n exitItem.setMnemonic(KeyEvent.VK_X);\n exitItem.addActionListener(new ExitListener());\n \n //Create a JMenu object for the file menu\n fileMenu = new JMenu(\"File\");\n fileMenu.setMnemonic(KeyEvent.VK_F);\n \n //Add the items to the menu\n fileMenu.add(saveItem);\n fileMenu.add(loadItem);\n fileMenu.add(exitItem);\n }",
"@FXML\n public void Save_List(ActionEvent actionEvent) {\n }",
"@FXML\n\tprivate void initialize() {\n\n\t\thelp.setOnAction(new EventHandler<ActionEvent>() {\n\n\t\t\t@Override\n\t\t\tpublic void handle(ActionEvent event) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tlogger.info(\"click rootstage's help button\");\n\t\t\t\tshowRootDocumentScreen(ID_HELP);\n\t\t\t}\n\t\t});\n\t\tcomparator.setOnAction(new EventHandler<ActionEvent>() {\n\n\t\t\t@Override\n\t\t\tpublic void handle(ActionEvent event) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tlogger.info(\"click rootstage's comparator button\");\n\t\t\t\tshowRootDocumentScreen(ID_COMPARATOR);\n\t\t\t}\n\t\t});\n\t\tsetting.setOnAction(new EventHandler<ActionEvent>() {\n\n\t\t\t@Override\n\t\t\tpublic void handle(ActionEvent event) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tlogger.info(\"click rootstage's setting button\");\n\t\t\t\tshowRootDocumentScreen(ID_SETTING);\n\t\t\t}\n\t\t});\n\t\tsubmitButton.setOnAction(new EventHandler<ActionEvent>() {\n\n\t\t\t@Override\n\t\t\tpublic void handle(ActionEvent event) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tlogger.info(\"click rootstage's submit button\");\n\n\t\t\t\tScreensContainer container = new ScreensContainer();\n\t\t\t\tcontainer.registerScreen(ID_SHOWPROBLEM, file_showproblem);\n\t\t\t\tcontainer.registerScreen(ID_SUBMITCODE, file_submitcode);\n\n\t\t\t\tStage dialogStage = new Stage();\n\t\t\t\tdialogStage.setTitle(\"在线提交\");\n\t\t\t\tdialogStage.initModality(Modality.WINDOW_MODAL);\n\t\t\t\tdialogStage.initOwner(rootLayout.getScene().getWindow());\n\n\t\t\t\tScene scene = new Scene(container);\n\t\t\t\tdialogStage.setScene(scene);\n\t\t\t\tcontainer.setScreen(ID_SHOWPROBLEM);\n\n\t\t\t\tdialogStage.showAndWait();\n\n\t\t\t}\n\t\t});\n\t\ttabPane.setTabClosingPolicy(TabPane.TabClosingPolicy.SELECTED_TAB);\n\t}",
"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 }",
"@FXML\n private void selectPath(MouseEvent mouseEvent) {\n\n DirectoryChooser directoryChooser = new DirectoryChooser();\n File selectedDirectory = directoryChooser.showDialog(getStage(mouseEvent));\n if (selectedDirectory != null){\n pathTextField.setText(selectedDirectory.getPath());\n }\n\n }",
"@Override\n public void start(Stage primaryStage) throws Exception {\n String filePath = null;\n\n // 2,3: export statements\n Boolean exportBits = false;\n Boolean exportPNGs = false;\n\n // check command line args\n if(commandLineArgs.length > 0) {\n if(commandLineArgs[0].equals(\"-h\") || commandLineArgs[0].equals(\"--help\")) {\n syntaxMessage();\n System.exit(0);\n }\n\n File f = new File(commandLineArgs[0]);\n\n if (f.exists() && !f.isDirectory()) {\n filePath = commandLineArgs[0];\n } else {\n System.out.println(\"File '\" + commandLineArgs[0] + \"' does not exist.\");\n System.out.println(\"Use -h | --help to show the command line help.\");\n System.exit(1);\n }\n\n for(int i = 1; i < commandLineArgs.length; i++) {\n if(commandLineArgs[i].equals(\"-eb\") || commandLineArgs[i].equals(\"--export-bits\")) {\n exportBits = true;\n }\n else if(commandLineArgs[i].equals(\"-epngs\") || commandLineArgs[i].equals(\"--export-pngs\")) {\n exportPNGs = true;\n } else {\n System.out.println(\"Unknown command line argument '\" + commandLineArgs[i] + \"'.\");\n System.out.println(\"Use -h | --help to show the command line help.\");\n System.exit(1);\n }\n }\n }\n\n FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource(\"view/mainWindow.fxml\"));\n Parent root = fxmlLoader.load();\n\n Model model = new Model();\n Preferences userPreferences = Preferences.userNodeForPackage(this.getClass());\n\n Controller controller = fxmlLoader.getController();\n controller.initModelViewController(model);\n controller.setStage(primaryStage);\n\n int stageWidth = userPreferences.getInt(\"stageWidth\", 2*ConfiguratorTab.CANVAS_PADDING+2*ConfiguratorTab.PE_DRAW_SIZE+3*ConfiguratorTab.INTER_PE_DISTANCE+10);\n int stageHeight = userPreferences.getInt(\"stageHeight\", 2*ConfiguratorTab.CANVAS_PADDING+2*ConfiguratorTab.PE_DRAW_SIZE+2*ConfiguratorTab.INTER_PE_DISTANCE+110);\n\n primaryStage.setTitle(\"CRC Configurator\");\n primaryStage.getIcons().add(new Image(\"icon/icon_512x512.png\"));\n\n primaryStage.setWidth(stageWidth);\n primaryStage.setHeight(stageHeight);\n primaryStage.setScene(new Scene(root, stageWidth, stageHeight));\n\n primaryStage.setOnCloseRequest(event -> {\n // save stage width and height\n userPreferences.putInt(\"stageWidth\", (int) primaryStage.getWidth());\n userPreferences.putInt(\"stageHeight\", (int) primaryStage.getHeight());\n // quit application\n controller.quitApplication();\n });\n\n if(!exportBits && !exportPNGs) {\n primaryStage.show();\n }\n\n // open file from file path given from the command line\n if(filePath != null) {\n File crcDescriptionFile = new File(filePath);\n controller.openCrcDescriptionFile(crcDescriptionFile);\n\n if(exportBits) {\n ExportBitsText exportBitsText = new ExportBitsText();\n System.out.println(exportBitsText.getText(model.getCrc(), false, Configuration.ConfigurationType.NONE, 0));\n }\n\n if(exportPNGs) {\n List<Tab> tabs = controller.getTabPane().getTabs();\n\n for(Tab tab : tabs) {\n ConfiguratorTab configuratorTab = (ConfiguratorTab) tab;\n controller.getTabPane().getSelectionModel().select(configuratorTab);\n configuratorTab.update();\n\n String pngFileName = new String(crcDescriptionFile.getName().replace(\".json\", \"\") + \"_\" + configuratorTab.getText().toLowerCase().replace(' ', '_') + \".png\");\n\n File pngFile = new File(pngFileName);\n\n Canvas canvas = configuratorTab.getCanvas();\n try {\n WritableImage writableImage = new WritableImage((int) canvas.getWidth(), (int) canvas.getHeight());\n canvas.snapshot(null, writableImage);\n RenderedImage renderedImage = SwingFXUtils.fromFXImage(writableImage, null);\n ImageIO.write(renderedImage, \"png\", pngFile);\n } catch (Exception e) {\n System.out.println(e.getMessage());\n }\n }\n }\n\n if(exportBits || exportPNGs) {\n System.exit(0);\n }\n }\n }",
"private void setUpMenuBar_FileMenu(){\r\n\t\t// Add the file menu.\r\n\t\tthis.fileMenu = new JMenu(STR_FILE);\r\n\t\tthis.openMenuItem = new JMenuItem(STR_OPEN);\r\n\t\tthis.openMenuItem2 = new JMenuItem(STR_OPEN2);\r\n\t\tthis.resetMenuItem = new JMenuItem(STR_RESET);\r\n\t\tthis.saveMenuItem = new JMenuItem(STR_SAVE);\r\n\t\tthis.saveAsMenuItem = new JMenuItem(STR_SAVEAS);\r\n\t\tthis.exitMenuItem = new JMenuItem(STR_EXIT);\r\n\t\t\r\n\t\t// Add the action listeners for the file menu.\r\n\t\tthis.openMenuItem.addActionListener(this);\r\n\t\tthis.openMenuItem2.addActionListener(this);\r\n\t\tthis.resetMenuItem.addActionListener(this);\r\n\t\tthis.saveMenuItem.addActionListener(this);\r\n\t\tthis.saveAsMenuItem.addActionListener(this);\r\n\t\tthis.exitMenuItem.addActionListener(this);\r\n\t\t\r\n\t\t// Add the menu items to the file menu.\r\n\t\tthis.fileMenu.add(openMenuItem);\r\n\t\tthis.fileMenu.add(openMenuItem2);\r\n\t\tthis.fileMenu.add(resetMenuItem);\r\n\t\tthis.fileMenu.addSeparator();\r\n\t\tthis.fileMenu.add(saveMenuItem);\r\n\t\tthis.fileMenu.add(saveAsMenuItem);\r\n\t\tthis.fileMenu.addSeparator();\r\n\t\tthis.fileMenu.add(exitMenuItem);\r\n\t\tthis.menuBar.add(fileMenu);\r\n\t}",
"@FXML \r\n private void handleIrConfiguracion() {\r\n \ttry {\r\n\t\t\tmain.mostrarVistaConfiguracion();\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n }",
"@FXML\n private void eventAction(ActionEvent event) throws IOException {\n \n CambiarVentana ventana = new CambiarVentana();\n Object evt = event.getSource();\n \n if(evt.equals(miVerAlumnos)) {\n ventana.cargarEnVentanaMenuItemAlumnos(\"/vista/AlumnosFXML.fxml\", btnInsertar);\n }\n \n else if(evt.equals(miVerEmpresas)) {\n ventana.cargarEnVentanaMenuItemAlumnos(\"/vista/EmpresasFXML.fxml\", btnInsertar);\n }\n \n else if(evt.equals(miVerCursos)) {\n ventana.cargarEnVentanaMenuItemAlumnos(\"/vista/CursosFXML.fxml\", btnInsertar);\n }\n \n else if(evt.equals(miVerOposiciones)) {\n ventana.cargarEnVentanaMenuItemAlumnos(\"/vista/OposicionesFXML.fxml\", btnInsertar);\n }\n \n else if(evt.equals(miInsertarFP)) {\n ventana.cargarEnVentanaMenuItemAlumnos(\"/vista/InsertarFPFXML.fxml\", btnInsertar);\n }\n \n else if(evt.equals(btnInsertar)) {\n String nombre = txtNombre.getText().toUpperCase();\n Object objetoAmbito = cbbxAmbito.getValue();\n String ambito;\n if(objetoAmbito != null) {\n ambito = objetoAmbito.toString().toUpperCase();\n }\n else {\n ambito = \"\";\n }\n String duracionTexto = txtDuracion.getText();\n int duracion;\n if(duracionTexto.equals(\"\")) {\n duracion = 0;\n }\n else {\n duracion = Integer.parseInt(duracionTexto);\n }\n if(!nombre.equals(\"\") && objetoAmbito != null) {\n int estado = Curso.comprobarNombresYFamilias(con, nombre, ambito);\n if(estado == 1) {\n Curso.insertarCurso(con, nombre, ambito, duracion);\n JOptionPane.showMessageDialog(null, \"CURSO introducido con éxito\");\n vaciarCampos();\n ventana.cargarEnVentana(\"/vista/InsertarCursoFXML.fxml\", event);\n }\n else {\n JOptionPane.showMessageDialog(null, \"NOMBRE repetido\");\n }\n }\n else {\n JOptionPane.showMessageDialog(null, \"El NOMBRE y la FAMILIA PROFESIONAL son campos obligatorios\");\n }\n }\n \n else if(evt.equals(btnCancelar)) {\n ventana.cargarEnVentana(\"/vista/CursosFXML.fxml\", event);\n }\n }",
"public void handleModifyParts()\n {\n FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource(\"/UI/Views/parts.fxml\"));\n Parent root = null;\n try {\n root = (Parent) fxmlLoader.load();\n\n // Get controller and configure controller settings\n PartController partController = fxmlLoader.getController();\n\n if (getPartToModify() != null)\n {\n partController.setModifyParts(true);\n partController.setPartToModify(getPartToModify());\n partController.setInventory(inventory);\n partController.setHomeController(this);\n\n // Spin up part form\n Stage stage = new Stage();\n stage.initModality(Modality.APPLICATION_MODAL);\n stage.initStyle(StageStyle.DECORATED);\n stage.setTitle(\"Modify Parts\");\n stage.setScene(new Scene(root));\n stage.show();\n\n }\n else {\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(\"Input Invalid\");\n alert.setHeaderText(\"No part was selected!\");\n alert.setContentText(\"Please select a part to modify from the part table!\");\n alert.show();\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"@FXML\n private void eventAction(ActionEvent event) throws IOException {\n \n CambiarVentana ventana = new CambiarVentana();\n Object evt = event.getSource();\n \n if(evt.equals(miVerAlumnos)) {\n ventana.cargarEnVentanaMenuItemAlumnos(\"/vista/AlumnosFXML.fxml\", btnBuscar);\n }\n \n else if(evt.equals(miVerEmpresas)) {\n ventana.cargarEnVentanaMenuItemAlumnos(\"/vista/EmpresasFXML.fxml\", btnBuscar);\n }\n \n else if(evt.equals(miVerCursos)) {\n ventana.cargarEnVentanaMenuItemAlumnos(\"/vista/CursosFXML.fxml\", btnBuscar);\n }\n \n else if(evt.equals(miVerOposiciones)) {\n ventana.cargarEnVentanaMenuItemAlumnos(\"/vista/OposicionesFXML.fxml\", btnBuscar);\n }\n \n else if(evt.equals(miInsertarFP)) {\n ventana.cargarEnVentanaMenuItemAlumnos(\"/vista/InsertarFPFXML.fxml\", btnBuscar);\n }\n \n else if(evt.equals(miAlumnosCurso)) {\n estado = 1;\n curso = tblCursos.getSelectionModel().getSelectedItem();\n ventana.cargarEnVentanaMenuItemAlumnos(\"/vista/AlumnosCursoFXML.fxml\", tblCursos);\n }\n \n else if(evt.equals(btnBuscar)) {\n listaCursos.clear();\n Object objetoNombre = cbbxNombre.getSelectionModel().getSelectedItem();\n String nombre;\n if(objetoNombre == null) {\n nombre = \"\";\n }\n else {\n nombre = objetoNombre.toString();\n }\n Object objetoAmbito = cbbxAmbito.getSelectionModel().getSelectedItem();\n String ambito;\n if(objetoAmbito == null) {\n ambito = \"\";\n }\n else {\n ambito = objetoAmbito.toString();\n }\n String duraciontexto = txtDuracion.getText();\n int duracion;\n if(duraciontexto.equals(\"\")) {\n duracion = 0;\n }\n else {\n duracion = Integer.parseInt(duraciontexto);\n }\n if(!nombre.equals(\"\")) {\n Curso.buscarCursoPorNombre(con, listaCursos, nombre);\n }\n else if(!ambito.equals(\"\")) {\n Curso.buscarCursoPorAmbito(con, listaCursos, ambito);\n }\n else if(!duraciontexto.equals(\"\")) {\n Curso.buscarCursoPorDuracion(con, listaCursos, duracion);\n }\n enlazarListadoTabla();\n }\n \n else if(evt.equals(btnCancelar)) {\n ventana.cargarEnVentana(\"/vista/CursosFXML.fxml\", event);\n }\n }",
"private MenuBar setUpMenuBox(Stage primaryStage) {\n\n MenuBar menuBar = new MenuBar();\n\n Menu file = new Menu(\"File\");\n MenuItem save = new MenuItem(\"Save\");\n MenuItem load = new MenuItem(\"Load\");\n MenuItem clear = new MenuItem(\"Clear\");\n file.getItems().add(save);\n file.getItems().add(load);\n file.getItems().add(clear);\n\n save.setOnAction((ActionEvent e) -> { // Define action for save button\n Stage saveStage = new Stage();\n FileChooser chooser = new FileChooser();\n chooser.getExtensionFilters().add(new ExtensionFilter(\"Text File\", \"*.txt\"));\n File saveFile = chooser.showSaveDialog(saveStage);\n if (saveFile != null) {\n socialNetwork.saveToFile(saveFile);\n ((Labeled) ((VBox) statsBox.getChildren().get(0)).getChildren().get(1))\n .setText(\"Save file written succesfully\");\n }\n }); // End defining save action\n\n clear.setOnAction((ActionEvent e) -> { // Define action for clear button\n this.clear();\n }); // End defining action for clear button\n\n load.setOnAction((ActionEvent e) -> { // Define action for load button\n Stage loadStage = new Stage();\n FileChooser chooser = new FileChooser();\n chooser.getExtensionFilters().add(new ExtensionFilter(\"Text File\", \"*.txt\"));\n File loadFile = chooser.showOpenDialog(loadStage);\n if (loadFile != null) {\n socialNetwork.setActiveUser(null);\n socialNetwork.loadFromFile(loadFile);\n ((Labeled) ((VBox) statsBox.getChildren().get(0)).getChildren().get(1))\n .setText(\"File loaded succesfully\");\n\n if (!socialNetwork.getAllUsersInNetwork().isEmpty()) { // Set an active user\n for (Person user : socialNetwork.getAllUsersInNetwork()) { // Populate user list\n if (!userList.getItems().contains(user.getName())) {\n userList.getItems().add(user.getName());\n }\n }\n\n\n if (socialNetwork.getActiveUser() != null) {\n this.activeUser = socialNetwork.getActiveUser();\n }\n if (activeUser == null) {\n Person[] a = new Person[1];\n activeUser = socialNetwork.getAllUsersInNetwork().toArray(a)[0];\n }\n updateCounts();\n updateGraph();\n }\n\n }\n\n }); // End defining load action\n\n menuBar.getMenus().add(file);\n return menuBar;\n\n }",
"private void initComponents() {\n\n fileChooser\t\t\t= new javax.swing.JFileChooser();\n jScrollPane1 \t\t= new javax.swing.JScrollPane();\n editorTextArea \t\t= new javax.swing.JTextArea();\n jToolBar1 \t\t\t= new javax.swing.JToolBar();\n abrirArchivoButton \t= new javax.swing.JButton();\n SalirButton \t\t= new javax.swing.JButton();\n jMenuBar1 \t\t\t= new javax.swing.JMenuBar();\n jMenu1 \t\t\t\t= new javax.swing.JMenu();\n abrirMenuItem \t\t= new javax.swing.JMenuItem();\n salirMenuItem \t\t= new javax.swing.JMenuItem();\n\n\n fileChooser.setFileFilter(new MiFiltroArchivo());\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n editorTextArea.setColumns(20);\n editorTextArea.setRows(5);\n jScrollPane1.setViewportView(editorTextArea);\n\n jToolBar1.setRollover(true);\n\n abrirArchivoButton.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"./abrir grande.png\"))); // NOI18N\n abrirArchivoButton.setFocusable(false);\n abrirArchivoButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n abrirArchivoButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n abrirArchivoButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n abrirMenuItemActionPerformed(evt);\n }\n });\n \n jToolBar1.add(abrirArchivoButton);\n\n SalirButton.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"./salir grande.png\"))); // NOI18N\n SalirButton.setFocusable(false);\n SalirButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n SalirButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n SalirButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n salirMenuItemActionPerformed(evt);\n }\n });\n jToolBar1.add(SalirButton);\n\n jMenu1.setText(\"Archivo\");\n\n abrirMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.CTRL_MASK));\n abrirMenuItem.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"./abrir chico.png\"))); // NOI18N\n abrirMenuItem.setText(\"Abrir\");\n abrirMenuItem.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n abrirMenuItemActionPerformed(evt);\n }\n });\n jMenu1.add(abrirMenuItem);\n\n salirMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK));\n salirMenuItem.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"./salir chico.png\"))); // NOI18N\n salirMenuItem.setText(\"Salir\");\n salirMenuItem.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n salirMenuItemActionPerformed(evt);\n }\n });\n jMenu1.add(salirMenuItem);\n\n jMenuBar1.add(jMenu1);\n\n setJMenuBar(jMenuBar1);\n \n codeTextArea = new JTextArea();\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n layout.setHorizontalGroup(\n \tlayout.createParallelGroup(Alignment.LEADING)\n \t\t.addGroup(layout.createSequentialGroup()\n \t\t\t.addContainerGap()\n \t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n \t\t\t\t.addComponent(codeTextArea, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE)\n \t\t\t\t.addComponent(jScrollPane1, GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE)\n \t\t\t\t.addComponent(jToolBar1, GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE))\n \t\t\t.addContainerGap())\n );\n layout.setVerticalGroup(\n \tlayout.createParallelGroup(Alignment.LEADING)\n \t\t.addGroup(layout.createSequentialGroup()\n \t\t\t.addComponent(jToolBar1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n \t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n \t\t\t.addComponent(jScrollPane1, GroupLayout.DEFAULT_SIZE, 282, Short.MAX_VALUE)\n \t\t\t.addGap(18)\n \t\t\t.addComponent(codeTextArea, GroupLayout.PREFERRED_SIZE, 215, GroupLayout.PREFERRED_SIZE)\n \t\t\t.addContainerGap())\n );\n getContentPane().setLayout(layout);\n \n this.methodsList = new JList<String>();\n \n this.methodsList.addListSelectionListener(new ListSelectionListener() {\n\t\t\t\n \t// Esta funcion se va a ejecutar cada vez que se cambie el estado\n \t// de seleccion de la list.\n\t\t\t@Override\n\t\t\tpublic void valueChanged(ListSelectionEvent e) {\n\t\t\t\tint selectedIndex = methodsList.getSelectedIndex();\n\t\t\t\t\n\t\t\t\tif (selectedIndex == -1) {\n\t\t\t\t\t// Si es -1, es porque no hay nada seleccionado\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// En este caso ya sabemos que hay algo que esta \n\t\t\t\t// seleccionado, de modo que podemos obtener el metodo seleccionado!\n\t\t\t\tMethod selectedMethod = methodFinder.getMethods().get(selectedIndex);\n\t\t\t\t\n\t\t\t\tservicios = new ArrayList<CodeInspectionService>();\n\t\t\t\t\n\t\t\t\t// Agregamos todos los servicios que necesitamos para analizar el codigo.\n\t\t\t\t// Cada vez que el programa pase por una linea, la enviará\n\t\t\t\t// a todos los servicios que esten registrados.\n\t\t\t\t// Los servicios entonces van a procesar esa linea y van a registrar\n\t\t\t\t// los resultados en un objeto CodeMetric.\n\t\t\t\t\n\t\t\t\t// Con este servicio contamos las lineas de codigo.\n\t\t\t\tservicios.add(new CodeLinesNumberInspectionService());\n\t\t\t\t\n\t\t\t\t// Contamos las lineas comentadas\n\t\t\t\tservicios.add(new CommentedLinesInspectionService());\n\t\t\t\t\n\t\t\t\t// Contamos la complejidad ciclomatica\n\t\t\t\tservicios.add(new CyclomaticComplexityInspectionService());\n\t\t\t\t\n\t\t\t\t// Contamos Halstead (?) quizas esto tengamos que separarlo en \n\t\t\t\t// otros servicios mas pequeños, porque hay varias metricas de halstead\n\t\t\t\tservicios.add(new HalsteadInspectionService());\n\t\t\t\t\n\t\t\t\t// Contamos el Fan In del metodo seleccionado\n\t\t\t\t// Fan in es la cantidad de veces que ese metodo\n\t\t\t\t// es invocado desde afuera\n\t\t\t\tservicios.add(new FanInInspectionService(methodFinder.getMethods(), selectedMethod));\n\t\t\t\t\n\t\t\t\t// Contamos el Fan Out del metodo seleccionado\n\t\t\t\t// Fan out es la cantidad de veces que el metodo seleccionado\n\t\t\t\t// llama a otros metodos.\n\t\t\t\tservicios.add(new FanOutInspectionService(methodFinder.getMethods(), selectedMethod));\n\t\t\t\t\n\t\t\t\tIterator<String> methodLinesIterator = selectedMethod.getLines().iterator();\n\t\t\t\twhile(methodLinesIterator.hasNext()) {\n\t\t\t\t\tString line = methodLinesIterator.next();\n\t\t\t\t\tfor (CodeInspectionService servicio : servicios) {\n\t\t\t\t\t\tservicio.analyzeLine(line);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tStringBuffer sb = new StringBuffer();\n\t\t\t\tfor (CodeInspectionService servicio : servicios) {\n\t\t\t\t\tCodeMetric metrica = servicio.getMetric();\n\t\t\t\t\tsb.append(metrica.getName() + \": \" + metrica.getValue() + \"\\n\");\n\t\t\t\t}\n\t\t\t\teditorTextArea.setText(sb.toString());\n\t\t\t\t\n\t\t\t\t// Imprimimos el codigo en pantalla\n\t\t\t\t// para mostrar el metodo que estamos analizando.\n\t\t\t\tcodeTextArea.setText(selectedMethod.toString());\n\t\t\t\t\n\t\t\t}\n\t\t});\n \n jScrollPane1.setColumnHeaderView(methodsList);\n\n pack();\n }",
"public FileMenuEventHandler(TextEditorGUI frame) {\n\t\tthis.frame = frame;\n\t}",
"@FXML\n public void IngredBrowseBtnClicked(){\n subMenuDisplay(IngredientsSubMenu);\n IngredientsBrowsePane.toFront();\n MenuPane.toFront();\n loadIngredients();\n //clear the ingredient Browse Fields\n clearIngredientBrowseFields();\n }",
"@FXML\n public void Load_List(ActionEvent actionEvent) {\n }",
"@FXML\r\n\tprotected void handleSetPhotoButtonAction(final ActionEvent event) {\r\n\t\tFileChooser fileChooser = new FileChooser();\r\n\t\tFile file = fileChooser.showOpenDialog(layout.getScene().getWindow());\r\n\t\ttry {\r\n\t\t\tInputStream stream = new BufferedInputStream(new FileInputStream(file));\r\n\t\t\tphoto.setImage(new Image(stream));\r\n\t\t\tstream.close();\r\n\t\t\tcontact.setPhoto(file);\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\tlog.error(\"Couldn't find the file: \" + file);\r\n\t\t} catch (IOException e) {\r\n\t\t\tlog.error(\"Error accessing the file: \" + file);\r\n\t\t}\r\n\t}",
"private void helperDisplayProjectFiles ()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tString[] fileNameList = DataController.scenarioGetFileNames();\r\n\r\n\t\t\tmainFormLink.getComponentPanelLeft().getComponentComboboxFileName().removeAllItems();\r\n\r\n\t\t\tfor (int i = 0; i < fileNameList.length; i++)\r\n\t\t\t{\r\n\t\t\t\tmainFormLink.getComponentPanelLeft().getComponentComboboxFileName().addItem(fileNameList[i]);\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}",
"@FXML\n public void Modify_Item(ActionEvent actionEvent) {\n try {\n FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource(\"ModifyItemlist.fxml\"));\n Parent root1 = (Parent) fxmlLoader.load();\n Stage stage = new Stage();\n stage.initModality(Modality.APPLICATION_MODAL);\n stage.initStyle(StageStyle.UNDECORATED);\n stage.setTitle(\"New Item\");\n stage.setScene(new Scene(root1));\n stage.show();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"@FXML\n public void exportShoppingList(){\n\n //set up the file chooser window with title and allowable file extensions\n FileChooser saveFileWindow = new FileChooser();\n saveFileWindow.getExtensionFilters().addAll(\n new FileChooser.ExtensionFilter(\"Text Documents (*.txt)\", \"*.txt\"),\n new FileChooser.ExtensionFilter(\"All files\", \"*.*\"));\n saveFileWindow.setTitle(\"Save Shopping List\");\n\n //open the file chooser\n File saveFile = saveFileWindow.showSaveDialog(PlannerPlanPane.getScene().getWindow());\n //if a file is choosen\n if (saveFile != null){\n //get file path\n String fileName = saveFile.getPath();\n try{\n //run static method to save the shopping list as a text file\n ExportShoppingList.writeToTextFile(shoppingListIngredients, fileName,\n settings.getGeneratedShoppingListDateAsString());\n } catch (Exception e){\n //problem saving the shopping list\n System.out.println(\"Problem saving shopping list to text file\");\n plannerBox.errorDiaglogBox(\"Saving Shopping List\", \"There was an issue saving the \" +\n \"shopping list to a text file it maynot have saved\");\n }\n } else {\n //If the file chooser is cancelled\n System.out.println(\"No file selected\");\n }\n }",
"@FXML\r\n public void open(ActionEvent actionEvent) {\r\n FileChooser fileChooser = new FileChooser();\r\n fileChooser.setTitle(\"File Chooser\");\r\n fileChooser.getExtensionFilters().add(new FileChooser.ExtensionFilter(\r\n \"Dot Files\", \"*.dot\"));\r\n try {\r\n File file = fileChooser.showOpenDialog(null);\r\n Path path = file.toPath();\r\n originalPicture = new Picture(new ArrayList<>());\r\n originalPicture.load(path);\r\n picture = originalPicture;\r\n clearCanvas(canvas);\r\n picture.drawDots(canvas);\r\n picture.drawLines(canvas);\r\n draw.setDisable(false);\r\n save.setDisable(false);\r\n updateNumDotsLabel();\r\n } catch(IOException e) {\r\n ALERT.setTitle(\"Error Dialog\");\r\n ALERT.setHeaderText(\"File Load Error\");\r\n ALERT.setContentText(\"Error Loading File\");\r\n ALERT.showAndWait();\r\n } catch(InputMismatchException | NullPointerException |\r\n NumberFormatException | IndexOutOfBoundsException e) {\r\n ALERT.setTitle(\"Error Dialog\");\r\n ALERT.setHeaderText(\"File Load Error\");\r\n ALERT.setContentText(\"File Data Incorrectly Formatted\");\r\n ALERT.showAndWait();\r\n }\r\n }",
"@FXML\n\tpublic void newFile() {\n\t\tuserText.clear();\n\t\tfile = null;\n\t}",
"private void jFileChooser1PropertyChange(java.beans.PropertyChangeEvent evt) {\n System.out.println(\"----------------------------------------------------\");\r\n path = \"\"+ jFileChooser1.getSelectedFile();\r\n pathTextField.setText(path);\r\n pathTextField.setToolTipText(path);\r\n }",
"void setupTreeViewButtons() throws IOException {\n add_group_button1.setGraphic(getGraphic(ADD_GROUP_BUTTON_FILE));\n add_note_button1.setGraphic(getGraphic(ADD_NOTE_BUTTON_FILE));\n remove_button1.setGraphic(getGraphic(REMOVE_BUTTON_FILE));\n rename_button1.setGraphic(getGraphic(RENAME_BUTTON_FILE));\n\n Tooltip add_group_tooltip = new Tooltip(\"Add group\");\n Tooltip add_note_tooltip = new Tooltip(\"Add note\");\n Tooltip remove_tooltip = new Tooltip(\"Remove group / note\");\n Tooltip rename_tooltip = new Tooltip(\"Rename group / note\");\n\n add_group_button1.setTooltip(add_group_tooltip);\n add_note_button1.setTooltip(add_note_tooltip);\n remove_button1.setTooltip(remove_tooltip);\n rename_button1.setTooltip(rename_tooltip);\n\n add_group_button1.setOnAction(arg0 -> addItem(ElementType.DIRECTORY));\n add_note_button1.setOnAction(arg0 -> addItem(ElementType.FILE));\n remove_button1.setOnAction(arg0 -> {\n TreeItem<FileTree> item = note_tree.getSelectionModel().getSelectedItem();\n\n if (note_tree.getRoot() == item) {\n Helpers.alertWarning(\"Root journal tree element cannot be deleted!\");\n return;\n }\n\n TreeItem<FileTree> parent_item = item.getParent();\n FileTree tree = item.getValue();\n FileTree parent_tree = parent_item.getValue();\n\n // Remove from TreeView\n parent_item.getChildren().remove(item);\n\n // Remove files\n try {\n tree.delete(app_state);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n // Remove from parent tree\n parent_tree.descendants.remove(tree);\n });\n rename_button1.setOnAction(arg0 -> {\n TreeItem<FileTree> target = note_tree.getSelectionModel().getSelectedItem();\n note_tree.setEditable(true);\n note_tree.edit(target);\n note_tree.setEditable(false);\n });\n\n setTreeViewButtonsDisabled(true);\n }",
"@Override\n public void initialize(URL url, ResourceBundle rb) {\n this.treeController = new FXMLAllTrees(interactions, edit, menus, trees);\n this.treeController.start();\n this.drawingController = new FXMLAllDrawings(interactions, edit, menus, tabs);\n this.drawingController.start();\n suggestionsController = new SuggestionsController(edit, suggestions);\n suggestionsController.start();\n\n upButton.setOnAction(event -> {\n interactions.navigateUp();\n event.consume();\n });\n downButton.setOnAction(event -> {\n interactions.navigateDown();\n event.consume();\n });\n\n newMenuItem.setOnAction(event -> {\n if (interactions.checkSave(\"Save before closing?\")) {\n String now = ISO8601.now();\n edit.clear(now);\n }\n event.consume();\n });\n openMenuItem.setOnAction(event -> {\n if (interactions.checkSave(\"Save before closing?\")) {\n interactions.tryLoadChooser(upButton.getScene().getWindow(), edit);\n }\n event.consume();\n });\n revertMenuItem.setOnAction(event -> {\n Optional<RecordStorage> dir = edit.getStorage().getChild();\n if (dir.isPresent()) {\n if (interactions.checkSave(\"Save before reloading?\")) {\n try {\n edit.load(dir.get(), ISO8601.now());\n } catch (IOException ex) {\n LOG.log(Level.SEVERE, null, ex);\n }\n }\n }\n event.consume();\n });\n ContextMenus.initPerInstanceSubmenu(openRecentMenu,\n () -> RecentFiles.getRecentFiles(),\n path -> new MenuItem(path.getFileName().toString()),\n (event, path) -> {\n if (interactions.checkSave(\"Save before closing?\")) {\n interactions.tryLoad(edit, CSVStorage.forPath(path));\n }\n event.consume();\n },\n Optional.empty());\n exploreMenuItem.setOnAction(event -> {\n Optional<RecordStorage> directory = edit.getStorage().getChild();\n if (directory.isPresent() && directory.get() instanceof FileStorage) {\n FileStorage fileStorage = (FileStorage) directory.get();\n try {\n ProcessBuilder builder = new ProcessBuilder();\n builder.command(\"nautilus\", fileStorage.getPath().toString());\n builder.directory(fileStorage.getPath().toFile());\n builder.inheritIO();\n builder.start();\n } catch (IOException ex) {\n try {\n /*\n * I'm hitting a bug where this call hangs the whole\n * application on Ubuntu, so we only do this as a\n * fallback when nautilus is not available.\n */\n Desktop.getDesktop().open(fileStorage.getPath().toFile());\n } catch (IOException ex2) {\n ex2.addSuppressed(ex);\n LOG.log(Level.WARNING, null, ex2);\n }\n }\n } else {\n try {\n ProcessBuilder builder = new ProcessBuilder();\n builder.command(\"nautilus\");\n builder.inheritIO();\n builder.start();\n } catch (IOException ex) {\n try {\n /*\n * I'm hitting a bug where this call hangs the whole\n * application on Ubuntu, so we only do this as a\n * fallback when nautilus is not available.\n */\n Desktop.getDesktop().open(Paths.get(\".\").toFile());\n } catch (IOException ex2) {\n ex2.addSuppressed(ex);\n LOG.log(Level.WARNING, null, ex2);\n }\n }\n }\n event.consume();\n });\n Runnable updateExploreMenuItemSensitivity = () -> {\n exploreMenuItem.setDisable(\n !edit.getStorage().getChild().isPresent());\n };\n edit.subscribe(updateExploreMenuItemSensitivity);\n updateExploreMenuItemSensitivity.run();\n\n saveMenuItem.setOnAction(event -> {\n interactions.trySave();\n event.consume();\n });\n exitMenuItem.setOnAction(event -> {\n interactions.tryExit();\n event.consume();\n });\n undoMenuItem.setOnAction(event -> {\n edit.undo();\n event.consume();\n });\n redoMenuItem.setOnAction(event -> {\n edit.redo();\n event.consume();\n });\n\n upMenuItem.setOnAction(event -> {\n interactions.navigateUp();\n event.consume();\n });\n downMenuItem.setOnAction(event -> {\n interactions.navigateDown();\n event.consume();\n });\n\n aboutMenuItem.setOnAction(event -> {\n Parent root;\n try {\n URL resource = getClass().getResource(\"/fxml/About.fxml\");\n root = FXMLLoader.load(resource);\n Stage stage = new Stage();\n stage.setTitle(\"About\");\n stage.setScene(new Scene(root, 450, 450));\n stage.show();\n } catch (RuntimeException | IOException ex) {\n LOG.log(Level.SEVERE, null, ex);\n }\n });\n\n versionMenuController = new VersionMenuController(\n edit, diffBranchMenu, diffVersionMenu,\n versionsMenu, diffNoneMenuItem);\n versionMenuController.start();\n\n commitMenuItem.setOnAction(event -> {\n if (interactions.checkSave(\"Save before committing?\")) {\n TextInputDialog dialog = new TextInputDialog();\n dialog.setTitle(\"Commit changes\");\n dialog.setHeaderText(\"Enter Commit Message\");\n\n Optional<String> interactionResult = dialog.showAndWait();\n if (interactionResult.isPresent()) {\n try {\n edit.getStorage().getChild().ifPresent(storage -> {\n try {\n storage.commit(interactionResult.get());\n } catch (IOException ex) {\n throw new UncheckedIOException(ex);\n }\n });\n } catch (UncheckedIOException ex) {\n LOG.log(Level.SEVERE, null, ex.getCause());\n }\n }\n }\n event.consume();\n });\n Runnable updateCommitMenuItemSensitivity = () -> {\n commitMenuItem.setDisable(\n !edit.getStorage().getChild().map(RecordStorage::canCommit).orElse(false));\n };\n edit.subscribe(updateCommitMenuItemSensitivity);\n updateCommitMenuItemSensitivity.run();\n\n edit.subscribe(buttonDisable);\n buttonDisable.run();\n }",
"@Override\r\n public void actionPerformed( ItemActionEvent<File> event )\r\n {\n }",
"@FXML\n void initialize() {\n\n\n\n Configuration.setCellValueFactory(new PropertyValueFactory<ConfData,String>(\"Configuration\"));\n\n ConfTable.setItems(getConfDataTable());\n\n InstallKey.setOnAction(event ->\n\n SetTabVisible()\n //System.out.println(\"Hello\")\n );\n SetNewKey.setOnAction(event ->\n SetTabVisible()\n //System.out.println(\"Hello world\")\n );\n\n\n SetTabVisible();\n\n }",
"@FXML\n public void ballot_import(ActionEvent e)throws IOException\n {\n //checks the voting status\n if(voting_state==1)\n {\n a=new Alert(AlertType.ERROR);\n a.setContentText(\"You Cannot Import Ballots During Voting !\");\n a.show();\n }\n //if not started voting the ballot file will imported\n else\n {\n //setting file chooser for get text file\n FileChooser fc = new FileChooser();\n Stage filechooser=new Stage();\n Button select = new Button(\"Select File\");\n select.setOnAction(f -> {\n File Ballotpaper = fc.showOpenDialog(filechooser);\n });\n Node node = (Node) e.getSource();\n //allows only .txt files to import\n fc.getExtensionFilters().addAll(new FileChooser.ExtensionFilter(\"Text Files\", \"*.txt\"));\n File selectedFile =fc.showOpenDialog(node.getScene().getWindow());\n if (selectedFile != null)\n {\n if (selectedFile.exists())\n {\n //if file selected the data will read line by line and put in hashmap\n try\n {\n File Ballot_File = new File(selectedFile.getPath());\n Scanner Ballot_Reader = new Scanner(Ballot_File);\n while (Ballot_Reader.hasNextLine())\n {\n //split line by '|' character and stored in local string array\n String[] ballot = Ballot_Reader.nextLine().split(\"\\\\|\");\n //System.out.println(ballot[0]+\" k \"+ballot[1]);\n Ballot bal = new Ballot(ballot[0], ballot[1]);\n allBallots.put(ballot[0], bal);\n }\n a = new Alert(AlertType.INFORMATION);\n a.setContentText(\"Successfully Imported !\");\n a.show();\n Ballot_Reader.close();\n }\n catch (FileNotFoundException ex)\n {\n a = new Alert(AlertType.ERROR);\n a.setContentText(ex.getMessage());\n a.show();\n }\n }\n }\n }\n }",
"@FXML\r\n\tprivate void envoyerFichier()\r\n\t{\r\n\t\tclient.startSendFile(textFieldFichier.getText());\r\n\t}",
"@FXML \n\tprivate void handleUserDefinedCH0() throws Exception {\n\t\tif(userDefinedButtonCH0.isSelected()){\n\t\t\t//Open a file chooser\n\t\t\tFileChooser fileChooser = new FileChooser();\n\t\t\t//ÎĵµÀàÐ͹ýÂËÆ÷\n\t\t\tExtensionFilter extFilter = new ExtensionFilter(\"wve files (*.wve)\", \"*.wve\");\n\t\t\tfileChooser.getExtensionFilters().add(extFilter);\n\t\t\tfileChooser.showOpenDialog(mainApp.getPrimaryStage());\n\t\t\t\n\t\t\t//check data\n\t\t}\n\t}",
"@FXML\n public void browseButtonAction(ActionEvent event) {\n try{\n JFileChooser chooser = new JFileChooser();\n chooser.setDialogTitle(\"Choose file to play...\"); // setting title of title bar //\n chooser.showOpenDialog(null);\n songFile = chooser.getSelectedFile();\n playButtonAction();\n }\n catch(Exception e){ \n nowPlaying.setText(\"No file choosen\");\n }\n }",
"@FXML\n public void initialize() {\n addModLabel.setText(PassableData.getPartTitle());\n if(PassableData.isModifyPart() && PassableData.getPartData() != null){\n populateForm();\n } else {\n partId.setText(Controller.createPartId());\n }\n changeVarLabel();\n }",
"@Override\n public void initialize(URL url, ResourceBundle rb) {\n \n try {\n VBox box = FXMLLoader.load(getClass().getResource(\"/vista/DrawerPrincipal.fxml\"));\n menuDrawer.setSidePane(box);\n menuDrawer.setDisable(true);\n } catch (IOException ex) {\n Dialogo dialogo = new Dialogo(Alert.AlertType.ERROR,\n \"Servidor no disponible, intente más tarde\", \"Error\", ButtonType.OK);\n dialogo.show();\n ex.printStackTrace();\n }\n \n menuIcon.addEventHandler(MouseEvent.MOUSE_CLICKED, (e) -> {\n menuDrawer.open();\n menuDrawer.setDisable(false);\n menuIcon.setVisible(false);\n });\n \n tfNombre.textProperty().addListener(new ChangeListener<String>() {\n @Override\n public void changed(ObservableValue<? extends String> observable, \n String oldValue, String newValue) {\n if(newValue.matches(\"[0-9]\")){\n tfNombre.setText(oldValue);\n }\n }\n });\n \n tfApellidoPaterno.textProperty().addListener(new ChangeListener<String>() {\n @Override\n public void changed(ObservableValue<? extends String> observable, String oldValue, \n String newValue) {\n if(tfApellidoPaterno.getText().length() >= 45){\n tfApellidoPaterno.setText(tfApellidoPaterno.getText().substring(0, 45));\n }\n }\n });\n \n tfApellidoMaterno.textProperty().addListener(new ChangeListener<String>() {\n @Override\n public void changed(ObservableValue<? extends String> observable, \n String oldValue, String newValue) {\n if(tfApellidoMaterno.getText().length() >= 45){\n tfApellidoMaterno.setText(tfApellidoMaterno.getText().substring(0, 45));\n }\n }\n });\n \n tfCorreoElectronico.textProperty().addListener(new ChangeListener<String>() {\n @Override\n public void changed(ObservableValue<? extends String> observable, \n String oldValue, String newValue) {\n if(tfCorreoElectronico.getText().length() >= 45){\n tfCorreoElectronico.setText(tfCorreoElectronico.getText().substring(0, 45));\n }\n }\n });\n \n tfMatricula.textProperty().addListener(new ChangeListener<String>() {\n @Override\n public void changed(ObservableValue<? extends String> observable, \n String oldValue, String newValue) {\n if(tfMatricula.getText().length() >= 9){\n tfMatricula.setText(tfMatricula.getText().substring(0, 9));\n }\n }\n \n });\n \n tfBusqueda.textProperty().addListener(new ChangeListener<String>(){\n @Override\n public void changed(ObservableValue<? extends String> observable, \n String oldValue, String newValue) {\n if(tfBusqueda.getText().length() >= 9){\n tfBusqueda.setText(tfBusqueda.getText().substring(0, 9));\n btnBuscar.setDisable(false);\n } else {\n btnBuscar.setDisable(true);\n btnInscribir.setDisable(true);\n }\n }\n });\n \n labelCorreo.textProperty().addListener(new ChangeListener<String>(){\n @Override\n public void changed(ObservableValue<? extends String> observable, \n String oldValue, String newValue) {\n if(!labelCorreo.getText().isEmpty() && !labelNombre.getText().isEmpty()){\n btnInscribir.setDisable(false);\n btnLimpiar.setDisable(false);\n llenarComboCurso();\n } else {\n btnInscribir.setDisable(true);\n btnLimpiar.setDisable(true);\n }\n }\n });\n \n llenarComboPeriodo();\n llenarComboCurso();\n }",
"public JMenu getFileMenu() {\n return fileMenu;\n }",
"@Override\n public void start(Stage stage) throws Exception {\n\n this.stage = stage;\n log.info(\"Inside Start \");\n PropertiesManager pm = new PropertiesManager();\n currentLocale = Locale.getDefault();\n //loads properties\n ConfigBean cb = pm.loadTextProperties(\"src/main/resources\", \"configuration\");\n log.info(\"Loaded Properties \");\n\n //if file was loaded properly, open the main controller\n if (cb != null) {\n FXMLLoader loader = new FXMLLoader();\n loader.setResources(ResourceBundle.getBundle(\"Bundle\", currentLocale));\n URL path2 = Paths.get(\"src/main/resources/fxml/main.fxml\").toUri().toURL();\n loader.setLocation(path2);\n stage.getIcons().add(\n new Image(MainApp.class\n .getResourceAsStream(\"/images/email.png\")));\n\n Scene scene2 = new Scene(loader.load());\n\n stage.setTitle(\"Jag Client\");\n stage.setResizable(false);\n stage.setScene(scene2);\n stage.show();\n } else { \n //if file was not loaded properly and information was incorrect then\n //load config form\n URL path = Paths.get(\"src/main/resources/fxml/config.fxml\").toUri().toURL();\n FXMLLoader fxmlloader = new FXMLLoader();\n fxmlloader.setLocation(path);\n\n fxmlloader.setResources(ResourceBundle.getBundle(\"Bundle\", currentLocale));\n\n Scene scene = new Scene(fxmlloader.load());\n\n stage.setTitle(\"Config\");\n stage.setResizable(false);\n stage.setScene(scene);\n stage.show();\n\n }\n\n }",
"public void handleAddParts()\n {\n FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource(\"/UI/Views/parts.fxml\"));\n Parent root = null;\n try {\n root = (Parent) fxmlLoader.load();\n\n // Get controller and configure controller settings\n PartController partController = fxmlLoader.getController();\n partController.setModifyParts(false);\n partController.setInventory(inventory);\n partController.setHomeController(this);\n\n // Spin up part form\n Stage stage = new Stage();\n stage.initModality(Modality.APPLICATION_MODAL);\n stage.initStyle(StageStyle.DECORATED);\n stage.setTitle(\"Add Parts\");\n stage.setScene(new Scene(root));\n stage.show();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"private void createFXScene() {\n try {\n Parent root = FXMLLoader.load(getClass().getResource(\"toolBarFXML.fxml\"));\n Scene scene = new Scene(root, Color.LIGHTGREY);\n fxPanel.setScene(scene);\n } catch (IOException e) {\n Exceptions.printStackTrace(e);\n }\n\n }",
"public FilePanel() {\n\t\tsuper();\n\t\tinitialize();\n\t}",
"private void setTree() throws IOException {\n TreeItem<File> root = new TreeItem<>();\n dirFolders.setRoot(buildTree(model.DirectoryManager.getTree(), root));\n dirFolders.setRoot(root.getChildren().get(0));\n\n // format cellFactory\n // we want to show file name in UI although treeView stores File object\n // Add directory logo if the file is a directory\n // Add photo thumbnail if the file is a photo\n dirFolders.setCellFactory(\n new Callback<TreeView<File>, TreeCell<File>>() {\n @Override\n public TreeCell<File> call(TreeView<File> param) {\n return new TreeCell<File>() {\n @Override\n protected void updateItem(File item, boolean empty) {\n super.updateItem(item, empty);\n if (item != null) {\n if (item.isDirectory()) {\n setGraphic(\n new ImageView(\n new Image(getClass().getResourceAsStream(\"/views/folder.png\"))));\n setDisclosureNode(null);\n File[] fileList = item.listFiles();\n if (fileList != null) {\n if (fileList.length == 0) {\n setDisable(true);\n }\n }\n } else {\n ImageView image = new ImageView(\"File:\" + item.getPath());\n image.setFitHeight(32);\n image.setFitWidth(36);\n setGraphic(image);\n }\n setText(item.getName());\n }\n }\n };\n }\n });\n\n // handle onClickAction\n dirFolders\n .getSelectionModel()\n .selectedItemProperty()\n .addListener(\n (observable, oldValue, newValue) -> {\n if (!dirFolders.getSelectionModel().getSelectedItem().getValue().isDirectory()) {\n model.User.setPhoto(\n model.PhotoManager.getPhoto(\n dirFolders.getSelectionModel().getSelectedItem().getValue().getPath()));\n try {\n loadNextScene(rootPane, \"/views/focusPhotoPane.fxml\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n } else {\n Stage curStage = (Stage) rootPane.getScene().getWindow();\n File selectedDirectory =\n dirFolders.getSelectionModel().getSelectedItem().getValue();\n if (selectedDirectory != null) {\n Directory dir =\n DirectoryManager.getCurrentDirectory(selectedDirectory.getPath());\n if (dir != null) {\n model.User.setGalleryPhotos(dir.getPhotos());\n fadeOutEvent();\n }\n } else {\n curStage.show();\n }\n }\n });\n }",
"@FXML\n private void openFile() {\n try {\n \tFile file = new File(filmTable.getSelectionModel().getSelectedItem().getLocation());\n desktop.open(file);\n } catch (IOException ex) {\n \tex.printStackTrace();\n }\n }",
"@FXML\n void goToChooseImagePage(ActionEvent event) {\n try {\n // Create a FXML loader for loading the choose image FXML file.\n FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource(\"Avatar.fxml\"));\n\n BorderPane chooseImagePage = (BorderPane) fxmlLoader.load();\n Scene chooseImagePageScene = new Scene(chooseImagePage, Main.LARGE_WINDOW_WIDTH, Main.LARGE_WINDOW_HEIGHT);\n Stage chooseImagePageStage = new Stage();\n\n chooseImagePageStage.setScene(chooseImagePageScene);\n chooseImagePageStage.setTitle(Main.CHOOSE_IMAGE_PAGE_WINDOW_TITLE);\n chooseImagePageStage.initModality(Modality.APPLICATION_MODAL);\n // Show the choose image scene and wait for it to be closed\n chooseImagePageStage.showAndWait();\n } catch (IOException e) {\n e.printStackTrace();\n // Quit the program (with an error code)\n System.exit(-1);\n }\n }",
"protected void initializeFileMenu() {\n\t\tfinal JMenu fileMenu = new JMenu(\"File\");\n\t\tthis.add(fileMenu);\n\t\t// Status\n\t\tfinal JMenuItem sysStatusItem = new JMenuItem();\n\t\tsysStatusItem.setAction(this.commands.findById(CmdStatus.DEFAULT_ID));\n\t\tsysStatusItem.setAccelerator(KeyStroke.getKeyStroke('S',\n\t\t\t\tInputEvent.CTRL_DOWN_MASK));\n\t\tfileMenu.add(sysStatusItem);\n\t\t// Log\n\t\tfinal JMenuItem sysLogItem = new JMenuItem();\n\t\tsysLogItem.setAction(this.commands.findById(CmdLog.DEFAULT_ID));\n\t\tsysLogItem.setAccelerator(KeyStroke.getKeyStroke('L',\n\t\t\t\tInputEvent.CTRL_DOWN_MASK));\n\t\tfileMenu.add(sysLogItem);\n\t\t// Separator\n\t\tfileMenu.add(new JSeparator());\n\t\t// Exit\n\t\tfinal JMenuItem exitItem = new JMenuItem(\"Exit\");\n\t\texitItem.setAction(this.commands.findById(CmdExit.DEFAULT_ID));\n\t\texitItem.setAccelerator(KeyStroke.getKeyStroke('Q',\n\t\t\t\tInputEvent.CTRL_DOWN_MASK));\n\t\tfileMenu.add(exitItem);\n\t}",
"protected void createParameterPanel() {\n \n Collection_Button = new KButtonPanel(0, 0, 0, 0, 1, \n KButtonPanel.HORIZONTAL_RIGHT);\n Collection_Button.addSingleButton(\"...\", \n KeyEvent.VK_C, true, true, \"CollectionButton\", this,\n \"Click this button to select the collection file.\"); \n \n SourceDirectory_Button = new KButtonPanel(0, 0, 0, 0, 1,\n KButtonPanel.HORIZONTAL_RIGHT);\n SourceDirectory_Button.addSingleButton(\"...\",\n KeyEvent.VK_R, true, true, \"SourceDirectoryButton\", this,\n \"Click this button to select the Reuters-21578 file directory.\");\n \n IncludeSubdirectories_CheckBox = new KCheckBox(\n \"Include Subdirectories\", false, true, \n \"IncludeSubdirectories\", this, KeyEvent.VK_I, \n \"If this box is checked, files will be search in subdirectories \"\n + \"of Reuters-21578 directory.\");\n\n if (CastParameter != null) {\n Collection_Text = new KTextField(CastParameter\n .getCollectionFileName(), 30);\n SourceDirectory_Text = new KTextField(CastParameter\n .getSourceDirectory(), 30);\n FileNameFilter_Text = new KTextField(CastParameter\n .getFileNameFilter(), 30);\n TopicOfCollection_Text = new KTextField(CastParameter\n .getTopicOfCollection(), 30);\n if (CastParameter.includeSubdirectories()) {\n IncludeSubdirectories_CheckBox.setSelected(true);\n }\n else {\n IncludeSubdirectories_CheckBox.setSelected(false);\n }\n }\n else {\n Collection_Text = new KTextField(DiasdemProject.getProperty(\n \"DEFAULT_COLLECTION_FILE\"), 30);\n SourceDirectory_Text = new KTextField(DiasdemProject.getProperty(\n \"DEFAULT_REUTERS_21578_FILE_DIRECTORY\"), 30);\n FileNameFilter_Text = new KTextField(\".sgm\", 30);\n TopicOfCollection_Text = new KTextField(DiasdemProject.getProperty(\n \"DEFAULT_REUTERS_21578_COLLECTION_TOPIC\"), 30);\n }\n Collection_Text.setCaretAtEnding();\n SourceDirectory_Text.setCaretAtEnding();\n FileNameFilter_Text.setCaretAtEnding();\n TopicOfCollection_Text.setCaretAtEnding();\n \n Parameter_Panel = new KGridBagPanel(0, 0, 0, 0);\n Parameter_Panel.startFocusForwarding(Collection_Text);\n \n Parameter_Panel.addLabel(\"Collection File:\", 0, 0, KeyEvent.VK_C,\n Collection_Button.getDefaultButton(), true,\n \"Task input: This collection file contains references \" +\n \"to all DIAsDEM documents.\");\n Parameter_Panel.addBlankColumn(1, 0, 12);\n Parameter_Panel.addComponent(Collection_Text, 2, 0);\n Parameter_Panel.addBlankColumn(3, 0, 12);\n Parameter_Panel.addKButtonPanel(Collection_Button, 4, 0);\n Parameter_Panel.addBlankRow(0, 1, 11, this.getPreferredSizeX());\n Parameter_Panel.addLabel(\"Reuters-21578 Directory:\", 0, 2, KeyEvent.VK_R,\n SourceDirectory_Button.getDefaultButton(), true,\n \"Task input: This directory must contain \" +\n \"original Reuters-21578 SGML files to be imported.\");\n Parameter_Panel.addComponent(SourceDirectory_Text, 2, 2);\n Parameter_Panel.addKButtonPanel(SourceDirectory_Button, 4, 2);\n Parameter_Panel.addBlankRow(0, 3, 11);\n Parameter_Panel.addComponent( IncludeSubdirectories_CheckBox, 2, 4,\n new Insets(0, 0, 0, 0), 3, 1);\n Parameter_Panel.addBlankRow(0, 5, 11);\n Parameter_Panel.addLabel(\"File Name Extension:\", 0, 6, KeyEvent.VK_N,\n FileNameFilter_Text, true,\n \"Task input: Reuters-21578 files to be imported \" +\n \"must have this file name extension.\");\n Parameter_Panel.addComponent( FileNameFilter_Text, 2, 6,\n new Insets(0, 0, 0, 0), 3, 1);\n Parameter_Panel.addBlankRow(0, 7, 11);\n Parameter_Panel.addLabel(\"Topic of Collection:\", 0, 8, KeyEvent.VK_T,\n TopicOfCollection_Text, true,\n \"Task input: Reuters-21578 news to be imported \" +\n \"must have this topic (e.g., earn).\");\n Parameter_Panel.addComponent( TopicOfCollection_Text, 2, 8,\n new Insets(0, 0, 0, 0), 3, 1);\n \n this.removeAll();\n this.validate();\n this.addNorth(Parameter_Panel);\n this.validate();\n this.setComponentStatus();\n \n }",
"public void openUserSettings() {\n\t\ttry {\n\t\t\tFXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource(\"/UserSettingsView.fxml\"));\n\t\t\tfxmlLoader.setResources(bundle);\n\t\t\tParent root1 = (Parent) fxmlLoader.load();\n\t\t\tStage stage = new Stage();\n\t\t\tUserSettingsController usc = fxmlLoader.getController();\n\t\t\tusc.setMainController(this);\n\t\t\tstage.initModality(Modality.APPLICATION_MODAL);\n\t\t\t// stage.initStyle(StageStyle.UNDECORATED);\n\t\t\tstage.setTitle(bundle.getString(\"uSHeaderLabel\"));\n\t\t\tstage.setScene(new Scene(root1));\n\t\t\tstage.show();\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"@FXML void initialize() // This method automatically called after the constructor.\n {\n System.out.println(\"Asserting controls...\");\n try\n {\n assert trackNameTextField != null : \"Can't find trackNameTextField\";\n assert albumNameTextField != null : \"Can't find albumNameTextField\";\n assert artistNameTextField != null : \"Can't find artistNameTextField\";\n assert pathTextField != null : \"Can't find pathTextField\";\n assert genreChoiceBox != null : \"Can't find genreChoiceBox\";\n assert saveButton != null : \"Can't find saveButton\";\n assert cancelButton != null : \"Can't find cancelButton\";\n assert browseButton != null : \"Can't find browseButton\";\n\n }\n catch (AssertionError ae)\n {\n System.out.println(\"FXML assertion failure: \" + ae.getMessage());\n Application.terminate();\n }\n // Next, load the list of track from the database and populate the listView.\n System.out.println(\"Populating scene with items from the database...\"); \n @SuppressWarnings(\"unchecked\")\n List<Genre> targetList = genreChoiceBox.getItems(); // Grab a reference to the listView's current item list.\n Genre.readAll(targetList); \n genreChoiceBox.getSelectionModel().selectFirst();\n }",
"@FXML\n void handleLocals(ActionEvent event) {\n\n }",
"@FXML public void handleImportButton() {\n\t\tSystem.out.println(\"Import Button Clicked!\");\n\t\tFileChooser fileChooser = new FileChooser();\n\t\tfileChooser.getExtensionFilters().addAll(new ExtensionFilter(\"SENTA features selection\", \"*.sfs\"), new ExtensionFilter(\"All files\", \"*.*\"));\n\t\tfileChooser.setTitle(\"Please specify which file you want to import\");\n\t\ttry {\n\t\t\t\tString fileToOpen = fileChooser.showOpenDialog(Main.primaryStage).getPath();\n\t\t\t\tif (ConfirmBox.display(\"Import features configuration?\", \"Are you sure you want to import the selected set of features?\")) {\n\t\t\t\t\tReader.importFeatures(fileToOpen);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tMain.root = FXMLLoader.load(getClass().getResource(\"/windows/main/SelectBasicFeaturesWindow.fxml\"));\n\t\t\t\tMain.primaryStage.setScene(new Scene(Main.root, 800, 600));\n\t\t\t\tMain.primaryStage.show();\n\t\t\t\t\n\t\t} catch (NullPointerException exepction) {\n\t\t\tSystem.out.println(exepction.getMessage());\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t}",
"@FXML void onActionSavePart(ActionEvent event) throws IOException{\n if(partIsValid()){\r\n int id = Inventory.incrementPartID();\r\n String name = partName.getText();\r\n int inventory = Integer.parseInt(partInv.getText());\r\n Double price = Double.parseDouble(partPrice.getText());\r\n int max = Integer.parseInt(partMax.getText());\r\n int min = Integer.parseInt(partMin.getText());\r\n String companyName = companyNameField.getText();\r\n \r\n \r\n if(this.partToggleGroup.getSelectedToggle().equals(this.inHouseRadioButton)){\r\n int machineID = Integer.parseInt(companyNameField.getText());\r\n Inventory.addPart(new InHouse(id, name, price, inventory, min, max, machineID)); \r\n } else {\r\n Inventory.addPart(new Outsourced(id, name, price, inventory, min, max, companyName));\r\n }\r\n \r\n // Clearing the partIDCount variable\r\n Inventory.clearAmountOfParts();\r\n \r\n // Now we want to be able to go back to the main menu\r\n Parent AddPartViewParent = FXMLLoader.load(getClass().getResource(\"FXMLDocument.fxml\"));\r\n Scene AddPartScene = new Scene(AddPartViewParent);\r\n\r\n // Now we need to get the Stage information\r\n Stage window = (Stage)((Node)event.getSource()).getScene().getWindow();\r\n window.setScene(AddPartScene);\r\n window.show();\r\n }\r\n }",
"@FXML\n public void Save_All_Lists(ActionEvent actionEvent) {\n }",
"@FXML\n private void initialize() {\n \n }",
"private void setupMenuItems() {\n\t\taboutMenu.setOnAction(event -> {\n\t\t\tAnchorPane root;\n\t\t\ttry {\n\t\t\t\troot = FXMLLoader.load(getClass().getResource(\"about.fxml\"));\n\n\t\t\t\tStage stage = new Stage();\n\t\t\t\tstage.setScene(new Scene(root));\n\t\t\t\tstage.setTitle(\"About\");\n\t\t\t\tstage.show();\n\t\t\t} catch (Exception e) {\n\t\t\t\tlog.error(\"Error loading About Window - \" + e.getMessage());\n\t\t\t}\n\t\t});\n\n\t\texitMenu.setOnAction(event -> {\n\t\t\tPlatform.runLater(new Runnable() {\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tPlatform.exit();\n\t\t\t\t\tlog.debug(\"Window closed\");\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\tloadMenu.setOnAction(event -> loadFile(true));\n\n\t\tsaveMenu.setOnAction(event -> Main.serializeItems());\n\n\t\tgroupByMenu.setOnAction(event -> {\n\t\t\tOptional<String> sortOption = Alerter.getChoiceDialog(\"Sorting\", null, \"Select how you want to group: \");\n\t\t\tsortOption.ifPresent(letter -> groupItems(letter));\n\t\t});\n\n\t\tupdateAllMenu.setOnAction(event -> {\n\t\t\tnew Thread(new Task<Void>() {\n\t\t\t\t@Override\n\t\t\t\tprotected Void call() throws Exception {\n\t\t\t\t\tlog.debug(\"UpdateAll Thread Triggered\");\n\n\t\t\t\t\titemsMap.forEach((a, b) -> {\n\t\t\t\t\t\tupdateItem(b);\n\t\t\t\t\t});\n\n\t\t\t\t\tupdateList();\n\t\t\t\t\tMain.serializeItems();\n\n\t\t\t\t\tlog.debug(\"UpdateAll Thread terminated successfully\");\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}).start();\n\t\t});\n\n\t\tupdateMenu.setOnAction(event -> {\n\t\t\tif (!listView.getSelectionModel().isEmpty()) {\n\t\t\t\tItemBox itemBox = listView.getSelectionModel().getSelectedItem();\n\t\t\t\tupdateItem(itemBox);\n\t\t\t} else {\n\t\t\t\tAlert alert = Alerter.getAlert(AlertType.INFORMATION, \"No Item selected\", null,\n\t\t\t\t\t\t\"Please select the Item you want to update!\");\n\t\t\t\talert.showAndWait();\n\t\t\t\tlog.debug(\"Info Popup triggered, No item selected\");\n\t\t\t}\n\t\t});\n\n\t\tdeleteMenu.setOnAction(event -> {\n\t\t\tItemBox rem = itemsMap.remove(listView.getSelectionModel().getSelectedItem().getGtin());\n\t\t\tlog.info(\"Item: \" + rem.getName() + \" removed\");\n\t\t\tupdateList();\n\t\t});\n\n\t\trepeatMenu.setOnAction(event -> {\n\t\t\tif (lastCommand != null) {\n\t\t\t\tString[] props = lastCommand.split(\" \");\n\t\t\t\tlog.info(\"Repeat called with: \" + lastCommand);\n\n\t\t\t\tswitch (props[0]) {\n\t\t\t\tcase \"ADD\":\n\t\t\t\t\taddItem(props[1]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"RM\":\n\t\t\t\t\tremoveItem(props[1]);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tprintMenu.setOnAction(event -> {\n\t\t\tprintOut(PrintOutType.OVERVIEW);\n\t\t});\n\n\t\tprintShoppingMenu.setOnAction(event -> {\n\t\t\tprintOut(PrintOutType.SHOPPING);\n\t\t});\n\n\t}",
"private void buildUI() {\n\n fxUtils = FXUtils.getShared();\n int rowCount = 0;\n\n\t\toutputTab = new Tab(\"Output\");\n\n\t\toutputPane = new GridPane();\n\t\tfxUtils.applyStyle(outputPane);\n\n\t\topenOutputDataButton = new Button(\"Save Output\");\n\t\tTooltip openOutputDataButtonTip \n = new Tooltip(\"Specify the Output File Name and Location\");\n Tooltip.install(openOutputDataButton, openOutputDataButtonTip);\n openOutputDataButton.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent evt) {\n saveOutputFile();\n\t\t } // end handle method\n\t\t}); // end event handler\n\t\toutputPane.add(openOutputDataButton, 0, rowCount, 1, 1);\n\t\topenOutputDataButton.setMaxWidth(Double.MAX_VALUE);\n\t\tGridPane.setHgrow(openOutputDataButton, Priority.SOMETIMES);\n openOutputDataButton.setDisable (true);\n\n\t\trowCount++;\n\n\t\topenOutputDataLabel = new Label(\"Output Data Destination\");\n\t\tfxUtils.applyHeadingStyle(openOutputDataLabel);\n\t\toutputPane.add(openOutputDataLabel, 0, rowCount, 1, 1);\n\t\topenOutputDataLabel.setMaxWidth(Double.MAX_VALUE);\n\t\tGridPane.setHgrow(openOutputDataLabel, Priority.SOMETIMES);\n\n\t\toutputDictionaryLabel = new Label(\"Data Dictionary Output\");\n\t\tfxUtils.applyHeadingStyle(outputDictionaryLabel);\n\t\toutputPane.add(outputDictionaryLabel, 1, rowCount, 1, 1);\n\t\toutputDictionaryLabel.setMaxWidth(Double.MAX_VALUE);\n\t\tGridPane.setHgrow(outputDictionaryLabel, Priority.SOMETIMES);\n\n\t\trowCount++;\n\n\t\topenOutputDataName = new Label();\n\t\tfxUtils.applyHeadingStyle(openOutputDataName);\n\t\toutputPane.add(openOutputDataName, 0, rowCount, 1, 1);\n\t\topenOutputDataName.setMaxWidth(Double.MAX_VALUE);\n\t\tGridPane.setHgrow(openOutputDataName, Priority.SOMETIMES);\n\n\t\toutputDictionaryCkBox = new CheckBox(\"Save Companion Dictionary?\");\n outputDictionaryCkBox.setSelected (false);\n usingDictionary = false;\n outputDictionaryCkBox.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent evt) {\n usingDictionary = outputDictionaryCkBox.isSelected();\n setDictionaryImplications();\n\t\t } // end handle method\n\t\t}); // end event handler\n\t\toutputPane.add(outputDictionaryCkBox, 1, rowCount, 1, 1);\n\t\toutputDictionaryCkBox.setMaxWidth(Double.MAX_VALUE);\n\t\tGridPane.setHgrow(outputDictionaryCkBox, Priority.SOMETIMES);\n\n\t\toutputPlaceHolder = new Label(\" \");\n\t\toutputPane.add(outputPlaceHolder, 2, rowCount, 1, 1);\n\t\toutputPlaceHolder.setMaxWidth(Double.MAX_VALUE);\n\t\tGridPane.setHgrow(outputPlaceHolder, Priority.SOMETIMES);\n\n\t\trowCount++;\n\n\t\toutputTab.setContent(outputPane);\n\t\toutputTab.setClosable(false);\n }",
"@FXML\n public void editDescription(ActionEvent actionEvent) {\n\n }",
"@FXML\n public void editRuleFilePath(ActionEvent event) throws IOException {\n FileChooser chooser = new FileChooser();\n //Create filter for just rule files.\n\t\tFileChooser.ExtensionFilter filter = new FileChooser.ExtensionFilter(\"Rule files\", \"*.rules\");\n\t\tchooser.getExtensionFilters().add(filter);\n chooser.setTitle(\"Open Rule File\");\n File path = chooser.showOpenDialog(new Stage());\n\n if (path != null) {\n //get string path of file selected\n String pathString = path.getAbsolutePath();\n DetectionHandler.setPATH_TO_RULES(pathString);\n System.out.println(\"Set new rule file.\");\n pathString = getShortenedPath(pathString);\n rulePathLabel.setText(pathString);\n }\n }"
] | [
"0.6803898",
"0.6755291",
"0.6581194",
"0.654627",
"0.64601535",
"0.6448161",
"0.6385787",
"0.6379826",
"0.634414",
"0.6282102",
"0.6260705",
"0.62264454",
"0.6138206",
"0.60863376",
"0.6074205",
"0.6052809",
"0.60347784",
"0.60315335",
"0.6023058",
"0.60188746",
"0.6008105",
"0.59970486",
"0.5987733",
"0.5968763",
"0.5954927",
"0.5951227",
"0.5932194",
"0.58584344",
"0.58429384",
"0.5839459",
"0.5831722",
"0.582632",
"0.58050156",
"0.5803188",
"0.5802249",
"0.57936317",
"0.57931644",
"0.57886255",
"0.57879764",
"0.57836574",
"0.57788277",
"0.57711786",
"0.5765247",
"0.5742995",
"0.5733158",
"0.57269955",
"0.5723438",
"0.5720818",
"0.5717625",
"0.57166797",
"0.571201",
"0.5705361",
"0.5703439",
"0.5703197",
"0.56946313",
"0.5689482",
"0.56869346",
"0.56837386",
"0.56396526",
"0.56370485",
"0.563537",
"0.5632915",
"0.56280047",
"0.5609552",
"0.5602912",
"0.5602886",
"0.5600614",
"0.5598634",
"0.559808",
"0.55942917",
"0.5592539",
"0.55922467",
"0.5591806",
"0.55914503",
"0.5588744",
"0.55868745",
"0.55795777",
"0.5578294",
"0.55773354",
"0.55772746",
"0.5577235",
"0.5571024",
"0.55696523",
"0.556411",
"0.55621845",
"0.55580807",
"0.55568004",
"0.5552119",
"0.55460155",
"0.5543574",
"0.5543411",
"0.55418885",
"0.55418646",
"0.55318004",
"0.5525681",
"0.55250233",
"0.5520072",
"0.5518142",
"0.5516645",
"0.55117536"
] | 0.5636223 | 60 |
private DeptTableModel model; Creates new form MasterDept | public MasterDept() {
initComponents();
setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("/Images/icon.png")));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic Department getModel() {\n\t\treturn department;\r\n\t}",
"public Departments getDeptTable();",
"public void setDeptTable(Departments value);",
"@Override\n\t\t\t\tpublic TableModel getModel() {\n\t\t\t\t\treturn model;\n\t\t\t\t}",
"public formArticulo() {\r\n initComponents();\r\n this.tableModel = (javax.swing.table.DefaultTableModel)tblArt.getModel();\r\n }",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jTabbedPane1 = new javax.swing.JTabbedPane();\n jPanel1 = new javax.swing.JPanel();\n jScrollPane1 = new javax.swing.JScrollPane();\n tbl_dep_dpts = new javax.swing.JTable();\n jPanel3 = new javax.swing.JPanel();\n jLabel1 = new javax.swing.JLabel();\n c_dep_codigo = new javax.swing.JTextField();\n jLabel2 = new javax.swing.JLabel();\n c_dep_nome = new javax.swing.JTextField();\n btn_dep_salvar = new javax.swing.JButton();\n btn_dep_cancelar = new javax.swing.JButton();\n btn_dep_novo = new javax.swing.JButton();\n btn_dep_editar = new javax.swing.JButton();\n btn_dep_excluir = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n tbl_dep_dpts.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"CPF/CNPJ\", \"Nome\"\n }\n ) {\n Class[] types = new Class [] {\n java.lang.Integer.class, java.lang.String.class\n };\n boolean[] canEdit = new boolean [] {\n true, false\n };\n\n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n jScrollPane1.setViewportView(tbl_dep_dpts);\n if (tbl_dep_dpts.getColumnModel().getColumnCount() > 0) {\n tbl_dep_dpts.getColumnModel().getColumn(0).setPreferredWidth(50);\n tbl_dep_dpts.getColumnModel().getColumn(1).setPreferredWidth(200);\n }\n\n jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)), \"Departamento\"));\n\n jLabel1.setText(\"CPF/CNPJ\");\n\n c_dep_codigo.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n c_dep_codigoActionPerformed(evt);\n }\n });\n\n jLabel2.setText(\"Nome:\");\n\n btn_dep_salvar.setText(\"Salvar\");\n btn_dep_salvar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btn_dep_salvarActionPerformed(evt);\n }\n });\n\n btn_dep_cancelar.setText(\"Cancelar\");\n btn_dep_cancelar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btn_dep_cancelarActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);\n jPanel3.setLayout(jPanel3Layout);\n jPanel3Layout.setHorizontalGroup(\n jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel3Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel2)\n .addComponent(jLabel1))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(c_dep_nome)\n .addGroup(jPanel3Layout.createSequentialGroup()\n .addComponent(c_dep_codigo, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 0, Short.MAX_VALUE)))\n .addContainerGap())\n .addGroup(jPanel3Layout.createSequentialGroup()\n .addGap(62, 62, 62)\n .addComponent(btn_dep_salvar, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(btn_dep_cancelar)\n .addContainerGap(374, Short.MAX_VALUE))\n );\n jPanel3Layout.setVerticalGroup(\n jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel3Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel1)\n .addComponent(c_dep_codigo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel2)\n .addComponent(c_dep_nome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(btn_dep_salvar)\n .addComponent(btn_dep_cancelar))\n .addContainerGap(12, Short.MAX_VALUE))\n );\n\n btn_dep_novo.setText(\"Novo\");\n btn_dep_novo.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btn_dep_novoActionPerformed(evt);\n }\n });\n\n btn_dep_editar.setText(\"Editar\");\n\n btn_dep_excluir.setText(\"Excluir\");\n btn_dep_excluir.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btn_dep_excluirActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(btn_dep_novo, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(btn_dep_editar, javax.swing.GroupLayout.PREFERRED_SIZE, 94, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(btn_dep_excluir, javax.swing.GroupLayout.DEFAULT_SIZE, 438, Short.MAX_VALUE))))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(48, 48, 48)\n .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))\n .addContainerGap())\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(8, 8, 8)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(btn_dep_novo)\n .addComponent(btn_dep_editar)\n .addComponent(btn_dep_excluir))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 11, Short.MAX_VALUE)\n .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap())\n );\n\n jTabbedPane1.addTab(\"Funcionarios\", jPanel1);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jTabbedPane1)\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jTabbedPane1)\n .addContainerGap())\n );\n\n pack();\n }",
"private void initComponents()//GEN-BEGIN:initComponents\n {\n\n jScrollPane1 = new javax.swing.JScrollPane();\n scheduleTable = new javax.swing.JTable();\n selectDepartmentLabel = new javax.swing.JLabel();\n jLabel1 = new javax.swing.JLabel();\n viewScheduleButton = new javax.swing.JButton();\n DepartComboBox = new javax.swing.JComboBox<>();\n stageComboBox = new javax.swing.JComboBox<>();\n\n setBackground(new java.awt.Color(245, 245, 245));\n setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());\n\n scheduleTable.setFont(new java.awt.Font(\"Trebuchet MS\", 0, 18)); // NOI18N\n scheduleTable.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][]\n {\n {null, null, null, null, null, null, null, null, null},\n {null, null, null, null, null, null, null, null, null},\n {null, null, null, null, null, null, null, null, null},\n {null, null, null, null, null, null, null, null, null},\n {null, null, null, null, null, null, null, null, null}\n },\n new String []\n {\n \"Time Slot\", \"First\", \"\", \"Second\", \"\", \"Third\", \"\", \"Fourth\", \"\"\n }\n )\n {\n Class[] types = new Class []\n {\n java.lang.String.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class\n };\n boolean[] canEdit = new boolean []\n {\n false, false, false, false, false, false, true, true, true\n };\n\n public Class getColumnClass(int columnIndex)\n {\n return types [columnIndex];\n }\n\n public boolean isCellEditable(int rowIndex, int columnIndex)\n {\n return canEdit [columnIndex];\n }\n });\n scheduleTable.setCellSelectionEnabled(true);\n scheduleTable.setFillsViewportHeight(true);\n scheduleTable.setGridColor(new java.awt.Color(102, 102, 102));\n scheduleTable.setIntercellSpacing(new java.awt.Dimension(2, 0));\n scheduleTable.setRowHeight(24);\n scheduleTable.setSelectionBackground(new java.awt.Color(0, 153, 204));\n scheduleTable.setShowHorizontalLines(false);\n scheduleTable.setShowVerticalLines(false);\n jScrollPane1.setViewportView(scheduleTable);\n if (scheduleTable.getColumnModel().getColumnCount() > 0)\n {\n scheduleTable.getColumnModel().getColumn(0).setHeaderValue(\"Time Slot\");\n scheduleTable.getColumnModel().getColumn(1).setHeaderValue(\"First\");\n scheduleTable.getColumnModel().getColumn(2).setHeaderValue(\"\");\n scheduleTable.getColumnModel().getColumn(3).setHeaderValue(\"Second\");\n scheduleTable.getColumnModel().getColumn(4).setHeaderValue(\"\");\n scheduleTable.getColumnModel().getColumn(5).setHeaderValue(\"Third\");\n scheduleTable.getColumnModel().getColumn(6).setHeaderValue(\"\");\n scheduleTable.getColumnModel().getColumn(7).setHeaderValue(\"Fourth\");\n scheduleTable.getColumnModel().getColumn(8).setHeaderValue(\"\");\n }\n\n add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 160, 1112, 492));\n\n selectDepartmentLabel.setFont(new java.awt.Font(\"Trebuchet MS\", 0, 14)); // NOI18N\n selectDepartmentLabel.setText(\"Select Department:\");\n add(selectDepartmentLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 40, 135, 36));\n\n jLabel1.setFont(new java.awt.Font(\"Trebuchet MS\", 0, 14)); // NOI18N\n jLabel1.setText(\"Select Stage:\");\n add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(430, 40, 137, 37));\n\n viewScheduleButton.setFont(new java.awt.Font(\"Trebuchet MS\", 0, 14)); // NOI18N\n viewScheduleButton.setText(\"View Schedule\");\n viewScheduleButton.addActionListener(new java.awt.event.ActionListener()\n {\n public void actionPerformed(java.awt.event.ActionEvent evt)\n {\n viewScheduleButtonActionPerformed(evt);\n }\n });\n add(viewScheduleButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(880, 60, 185, 37));\n\n DepartComboBox.setBackground(new java.awt.Color(255, 255, 255));\n DepartComboBox.setFont(new java.awt.Font(\"Trebuchet MS\", 0, 18)); // NOI18N\n DepartComboBox.addActionListener(new java.awt.event.ActionListener()\n {\n public void actionPerformed(java.awt.event.ActionEvent evt)\n {\n DepartComboBoxActionPerformed(evt);\n }\n });\n add(DepartComboBox, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 70, 290, 50));\n\n stageComboBox.setBackground(new java.awt.Color(255, 255, 255));\n stageComboBox.setFont(new java.awt.Font(\"Trebuchet MS\", 0, 18)); // NOI18N\n stageComboBox.addActionListener(new java.awt.event.ActionListener()\n {\n public void actionPerformed(java.awt.event.ActionEvent evt)\n {\n stageComboBoxActionPerformed(evt);\n }\n });\n add(stageComboBox, new org.netbeans.lib.awtextra.AbsoluteConstraints(430, 70, 310, 50));\n }",
"public CampTableModel() {\n setColumnIdentifiers(new Object[] { Text.CAMP_ID.text(), Text.CAMP_LOCATION.text(), Text.CAMP_NAME.text() });\n }",
"private void Table()\n{\n Object [] Kolom = {\"Nama\", \"No. Telp\", \"Kota Asal\"};\n Table = new DefaultTableModel(null, Kolom);\n Tabel.setModel(Table);\n}",
"public VentanaEmpleado()\n\t{\n\t\tinitComponents();\n\t\tm = ( DefaultTableModel ) tblEmpleado.getModel();\n\n\t\tcargarTablaDesdeBD();\n\t}",
"private TableModel getTableModelProduto() {\n\t\tString[] columnNames = { \"cod_p\", \"cod_barra\", \"categoria\", \"descricao\", \"unidade\", \"custo\", \"marge_lucro\" };\n\n\t\tObject[][] data = new Object[listaP.size()][7];\n\t\tfor (int i = 0; i < listaP.size(); i++) {\n\t\t\tint j = 0;\n\t\t\tdata[i][j++] = Long.valueOf(listaP.get(i).getCod());\n\t\t\tdata[i][j++] = listaP.get(i).getCodBarra();\n\t\t\tdata[i][j++] = listaP.get(i).getCategoria();\n\t\t\tdata[i][j++] = listaP.get(i).getDescricao();\n\t\t\tdata[i][j++] = listaP.get(i).getUnidade();\n\t\t\tdata[i][j++] = listaP.get(i).getCusto();\n\t\t\tdata[i][j++] = listaP.get(i).getMargenLucro();\n\t\t}\n\t\treturn new DefaultTableModel(data, columnNames);\n\t}",
"@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tnew DeptView().init();\r\n\t\t\t}",
"public TestFrame() {\n\n final String[] columnNames = {\"Nombre\",\n \"Apellido\",\n \"webeo\",\n \"Años de Practica\",\n \"Soltero(a)\"};\n final Object[][] data = {\n\n {\"Lhucas\", \"Huml\",\n \"Patinar\", new Integer(3), new Boolean(true)},\n {\"Kathya\", \"Walrath\",\n \"Escalar\", new Integer(2), new Boolean(false)},\n {\"Marcus\", \"Andrews\",\n \"Correr\", new Integer(7), new Boolean(true)},\n {\"Angela\", \"Lalth\",\n \"Nadar\", new Integer(4), new Boolean(false)}\n };\n\n Vector dataV1 = new Vector();\n dataV1.add(\"XXXX\");\n dataV1.add(\"YYYY\");\n dataV1.add(\"JJJJ\");\n\n Vector dataV2 = new Vector();\n dataV2.add(\"XX2XX\");\n dataV2.add(\"Y2YYY\");\n dataV2.add(\"J2JJJ\");\n\n List dataF = new ArrayList();\n dataF.add(dataV1);\n dataF.add(dataV2);\n\n /*Vector dataC = new Vector();\n dataC.add(\"1\");\n dataC.add(\"2\");\n dataC.add(\"J23JJJ\");\n\n //model = new ModeloDatosTabla(data, true);\n model = new TableModel_1_1(dataC, dataF);\n model2 = new TableModel(columnNames, data, false);\n*/\n\n\n\n initComponents();\n\n\n }",
"private TableModel getTabelaProduto() {\r\n\t\tString[] columnNames = { \"id_c\", \"nome\", \"telefone\", \"endereco\", \"cidade\", \"estado\", \"email\", \"genero\" };\r\n\r\n\t\tObject[][] dados = new Object[listacliente.size()][8];\r\n\t\tfor (int i = 0; i < listacliente.size(); i++) {\r\n\t\t\tint x = 0;\r\n\t\t\tdados[i][x++] = listacliente.get(i).getId();\r\n\t\t\tdados[i][x++] = listacliente.get(i).getNome();\r\n\t\t\tdados[i][x++] = listacliente.get(i).getTelefone();\r\n\t\t\tdados[i][x++] = listacliente.get(i).getEndereco();\r\n\t\t\tdados[i][x++] = listacliente.get(i).getCidade();\r\n\t\t\tdados[i][x++] = listacliente.get(i).getEstado().getNome();\r\n\t\t\tdados[i][x++] = listacliente.get(i).getEmail();\r\n\t\t\tdados[i][x++] = listacliente.get(i).getGenero().getNome();\r\n\t\t}\r\n\r\n\t\treturn new DefaultTableModel(dados, columnNames);\r\n\r\n\t}",
"public DefaultTableModel pedidosListado(){\r\n List<Pedido> lista =pedidos.listarPedidos();\r\n return Convertidor.PedidoToTableModelMin(lista);\r\n }",
"public AddStudent(Frame frame, boolean model, Department depart) {\n \n this.depart = depart;\n \n initComponents();\n }",
"@Override\n\tpublic void setDept(Dept dept) {\n\t\tsuper.setDept(dept);\n\t}",
"public Depart getModel() {\n\t\treturn dep;\n\t}",
"public frmListarPedido(ArrayList<Pedido> pedd) {\n initComponents();\n listaPedidos = pedd;\n DefaultTableModel modelo = (DefaultTableModel)TablePedidos.getModel();\n for (int i = 0; i < listaPedidos.size(); i++){\n modelo.addRow(new String[] {String.valueOf(listaPedidos.get(i).getNumero()),\n listaPedidos.get(i).getCliente().getNome(),\n String.valueOf(listaPedidos.get(i).getData().getDia())\n +\"/\"+String.valueOf(listaPedidos.get(i).getData().getMes())\n +\"/\"+String.valueOf(listaPedidos.get(i).getData().getAno()),\n String.valueOf(listaPedidos.get(i).getTotalPedido())});\n }\n }",
"private CdeTableModel GetCdeTableModel() {\n\t\treturn (CdeTableModel) panelCde.getPanelTableCde().getTable().getModel();\n\t}",
"public static void updateDept() {\n\t}",
"public Formulario() {\n initComponents();\n modelo = (DefaultTableModel) jTable2.getModel();\n }",
"public Book() {\n initComponents();\n table1 = (DefaultTableModel) travellers.getModel();\n }",
"@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tif(e.getActionCommand() == \"Login\"){\r\n\t\t\tlogin();\r\n\t\t}\r\n\t\telse\r\n\t\t\tif(e.getActionCommand() == \"jBSearch\"){\r\n\t\t\t\tsearch();\r\n\t\t\t}\r\n\t\telse\r\n\t\tif(e.getActionCommand() == \"displayDepartment\"){\r\n\t\t\tview.setCardLayout(\"File Display\");\r\n\t\t\tString toDisplay = \"\";\r\n\t\t\tfor(int i=0; i < model.getDepartments().size(); i++){\r\n\t\t\t\ttoDisplay += model.getDepartments().get(i).getDepartment();\r\n\t\t\t}\r\n\t\t\tview.setjTFileDisplay(toDisplay);\r\n\t\t}\r\n\t\telse\r\n\t\tif(e.getActionCommand() == \"addDepartment\"){\r\n\t\t\tview.setCardLayout(\"Add Department\");\r\n\t\t}\r\n\t\telse\r\n\t\tif(e.getActionCommand() == \"jBAddDepartment\"){\r\n\t\t\tString name = view.getjTName();\r\n\t\t\tString type = view.getjTType();\r\n\t\t\tString web_address = view.getjTWeb();\r\n\t\t\tString username = view.getjTUsername();\r\n\t\t\tString password = view.getjTPassword();\r\n\t\t\t\r\n\t\t\tDepartment dep = new Department(name, type, web_address, username, password);\r\n\t\t\t\r\n\t\t\tmodel.addObject(dep, model.getDepartments());\r\n\t\t\tview.refreshAddDepartment();\r\n\t\t}\r\n\t\telse\r\n\t\tif(e.getActionCommand() == \"editDepartment\"){\r\n\t\t\tdepartmentsEditJComboBox();\r\n\t\t\tview.setCardLayout(\"Edit Department\");\r\n\t\t}\r\n\t\telse\r\n\t\tif(e.getActionCommand() == \"toEditDepartment\"){\r\n\t\t\tString tofind = (String) view.getjCBEditDepartment().getSelectedItem();\r\n\t\t\tDepartment department = model.findObject(tofind, model.getDepartments());\r\n\t\t\tview.editDepartment(department.getName(), department.getType(), department.getWebAddress(), department.getUsername(), department.getPassword());\r\n\t\t}\r\n\t\telse\r\n\t\tif(e.getActionCommand() == \"jBEditDepartment\"){\r\n\t\t\tString name = view.getjTName2();\r\n\t\t\tString type = view.getjTType2();\r\n\t\t\tString web_address = view.getjTWeb2();\r\n\t\t\tString username = view.getjTUsername2();\r\n\t\t\tString password = view.getjTPassword2();\r\n\t\t\t\r\n\t\t\tDepartment dep = new Department(name, type, web_address, username, password);\r\n\t\t\t\r\n\t\t\tString department = (String) view.getjCBEditDepartment().getSelectedItem();\r\n\t\t\tfor(int i = 0; i < model.getDepartments().size(); i++){\r\n\t\t\t\tif(model.getDepartments().get(i).getName().equals(department)){\r\n\t\t\t\t\tthis.model.editObject(i, dep, model.getDepartments());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tview.refreshEditDepartment();\r\n\t\t}\r\n\t\telse\r\n\t\t\tif(e.getActionCommand() == \"jBRemoveDepartment\"){\r\n\t\t\t\tString toRemove = (String) view.getjCBEditDepartment().getSelectedItem();\r\n\t\t\t\tDepartment department = model.findObject(toRemove, model.getDepartments());\r\n\t\t\t\tthis.model.removeObject(department, model.getDepartments());\r\n\t\t\t}\r\n\t\telse\r\n\t\tif(e.getActionCommand() == \"displayLecturer\"){\r\n\t\t\tview.setCardLayout(\"File Display\");\r\n\t\t\tString toDisplay = \"\";\r\n\t\t\t\r\n\t\t\tif(model.getSecretaryLogin() == true){\r\n\t\t\t\tString currentDepartment = model.getUser().getName();\r\n\t\t\t\t\r\n\t\t\t\tfor(int i=0; i < model.getLecturers().size(); i++){\r\n\t\t\t\t\tif(model.getLecturers().get(i).getDepartment().equals(currentDepartment)){\r\n\t\t\t\t\t\tLecturers l = model.getLecturers().get(i);\r\n\t\t\t\t\t\tif(l instanceof PartTime){\r\n\t\t\t\t\t\t\ttoDisplay += model.getLecturers().get(i).getLecturer() + \"Hourly rate: \" + ((PartTime) model.getLecturers().get(i)).getHourlyRate() + \"\\n\\n\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if (l instanceof FullTime){\r\n\t\t\t\t\t\t\ttoDisplay += model.getLecturers().get(i).getLecturer() + \"Salary: \" + ((FullTime) model.getLecturers().get(i)).getSalary() + \"\\n\\n\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if (l instanceof Contract){\r\n\t\t\t\t\t\t\ttoDisplay += model.getLecturers().get(i).getLecturer() + \"Salary: \" + ((Contract) model.getLecturers().get(i)).getSalary() + \"\\nFinish date: \" + ((Contract) model.getLecturers().get(i)).getFinishDate() + \"\\n\\n\";\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}\r\n\t\t\telse {\r\n\t\t\t\tfor(int i=0; i < model.getLecturers().size(); i++){\r\n\t\t\t\t\tLecturers l = model.getLecturers().get(i);\r\n\t\t\t\t\tif(l instanceof PartTime){\r\n\t\t\t\t\t\ttoDisplay += model.getLecturers().get(i).getLecturer() + \"Hourly rate: \" + ((PartTime) model.getLecturers().get(i)).getHourlyRate() + \"\\n\\n\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (l instanceof FullTime){\r\n\t\t\t\t\t\ttoDisplay += model.getLecturers().get(i).getLecturer() + \"Salary: \" + ((FullTime) model.getLecturers().get(i)).getSalary() + \"\\n\\n\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (l instanceof Contract){\r\n\t\t\t\t\t\ttoDisplay += model.getLecturers().get(i).getLecturer() + \"Salary: \" + ((Contract) model.getLecturers().get(i)).getSalary() + \"\\nFinish date: \" + ((Contract) model.getLecturers().get(i)).getFinishDate() + \"\\n\\n\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tview.setjTFileDisplay(toDisplay);\r\n\t\t}\r\n\t\telse\r\n\t\tif(e.getActionCommand() == \"addLecturer\"){\r\n\t\t\tview.setCardLayout(\"Add Lecturer\");\r\n\t\t\tdepartmentsJComboBox();\r\n\t\t}\r\n\t\telse\r\n\t\tif(e.getActionCommand() == \"Submit Lecturer\"){\r\n\t\t\tint staff_id = view.getjTId();\r\n\t\t\tString name = view.getjTLecturerName();\r\n\t\t\tString address = view.getjTAddress();\r\n\t\t\tString phone = view.getjTPhone();\r\n\t\t\tString email = view.getjTEmail();\r\n\t\t\tString start_date = view.getjTStartDate();\r\n\t\t\tString department = (String) view.getjCBDepartment().getSelectedItem();\r\n\t\t\t\r\n\t\t\tString type = view.getLecturerType();\r\n\t\t\tif(type == \"Part-Time\"){\r\n\t\t\t\tdouble hourly_rate = view.getjTSalary();\r\n\t\t\t\tPartTime partT = new PartTime(staff_id, type, name, address, phone, email, start_date, department, hourly_rate);\r\n\t\t\t\tthis.model.addObject(partT, this.model.getLecturers());\r\n\t\t\t}\r\n\t\t\telse if(type == \"Full-Time\"){\r\n\t\t\t\tdouble salary = view.getjTSalary();\r\n\t\t\t\tFullTime fullT = new FullTime(staff_id, type, name, address, phone, email, start_date, department, salary);\r\n\t\t\t\tthis.model.addObject(fullT, this.model.getLecturers());\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse if(type == \"Contract\"){\r\n\t\t\t\tdouble salary = view.getjTSalary();\r\n\t\t\t\tString finish_date = view.getjTEndDate();\r\n\t\t\t\tContract contract = new Contract(staff_id, type, name, address, phone, email, start_date, department, salary, finish_date);\r\n\t\t\t\tthis.model.addObject(contract, this.model.getLecturers());\r\n\t\t\t}\r\n\t\t\tview.refreshAddLecturer();\r\n\t\t}\r\n\t\tif(e.getActionCommand() == \"editLecturer\"){\r\n\t\t\tview.setCardLayout(\"Edit Lecturer\");\r\n\t\t\tlecturersJComboBox();\r\n\t\t\tlecturerDepartment();\r\n\t\t}\r\n\t\telse\r\n\t\tif(e.getActionCommand() == \"toEditLecturer\"){\r\n\t\t\tString tofind = (String) view.getjCBLectureId().getSelectedItem();\r\n\t\t\tLecturers lecturer = model.findObject(tofind, model.getLecturers());\r\n\t\t\t\r\n\t\t\tif(lecturer instanceof PartTime){\r\n\t\t\t\tview.editLecturer(lecturer.getName(), lecturer.getAddress(), lecturer.getPhone(), lecturer.getEmail(), lecturer.getStartDate(), ((PartTime) lecturer).getHourlyRate(), \"\", lecturer.getDepartment());\r\n\t\t\t}\r\n\t\t\telse if(lecturer instanceof FullTime){\r\n\t\t\t\tview.editLecturer(lecturer.getName(), lecturer.getAddress(), lecturer.getPhone(), lecturer.getEmail(), lecturer.getStartDate(), ((FullTime) lecturer).getSalary(), \"\", lecturer.getDepartment());\r\n\t\t\t}\r\n\t\t\telse if(lecturer instanceof Contract){\r\n\t\t\t\tview.editLecturer(lecturer.getName(), lecturer.getAddress(), lecturer.getPhone(), lecturer.getEmail(), lecturer.getStartDate(), ((Contract) lecturer).getSalary(), ((Contract) lecturer).getFinishDate(), lecturer.getDepartment());\r\n\t\t\t}\t\t\t\t\t\r\n\t\t}\r\n\t\telse\r\n\t\tif(e.getActionCommand() == \"jBEditLecturer\"){\r\n\t\t\tString name = view.getjTLecturerName2();\r\n\t\t\tString address = view.getjTAddress2();\r\n\t\t\tString phone = view.getjTPhone2();\r\n\t\t\tString email = view.getjTEmail2();\r\n\t\t\tString start_date = view.getjTStartDate2();\r\n\t\t\tString department = (String) view.getjCBDepartmentEditL().getSelectedItem();\r\n\t\t\t\r\n\t\t\tString lecturer = (String) view.getjCBLectureId().getSelectedItem();\r\n\t\t\tint staff_id = Integer.parseInt(lecturer);\r\n\t\t\tfor(int i = 0; i < model.getLecturers().size(); i++){\r\n\t\t\t\tif(model.getLecturers().get(i).getID() == Integer.parseInt(lecturer)){\r\n\t\t\t\t\tif(model.getLecturers().get(i).getLecturerType().equals(\"Part-Time\")){\r\n\t\t\t\t\t\tdouble hourly_rate = view.getjTSalary2();\r\n\t\t\t\t\t\tPartTime partT = new PartTime(model.getLecturers().get(i).getID(), \"Part-Time\", name, address, phone, email, start_date, department, hourly_rate);\r\n\t\t\t\t\t\tthis.model.editObject(i, partT, model.getLecturers());\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(model.getLecturers().get(i).getLecturerType().equals(\"Full-Time\")){\r\n\t\t\t\t\t\tdouble salary = view.getjTSalary2();\r\n\t\t\t\t\t\tFullTime fullT = new FullTime(model.getLecturers().get(i).getID(), \"Full-Time\", name, address, phone, email, start_date, department, salary);\r\n\t\t\t\t\t\tthis.model.editObject(i, fullT, model.getLecturers());\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(model.getLecturers().get(i).getLecturerType().equals(\"Contract\")){\r\n\t\t\t\t\t\tdouble salary = view.getjTSalary2();\r\n\t\t\t\t\t\tString finish_date = view.getjTEndDate2();\r\n\t\t\t\t\t\tContract contract = new Contract(model.getLecturers().get(i).getID(), \"Contract\", name, address, phone, email, start_date, department, salary, finish_date);\r\n\t\t\t\t\t\tthis.model.editObject(i, contract, model.getLecturers());\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\telse\r\n\t\tif(e.getActionCommand() == \"jBRemoveLecturer\"){\r\n\t\t\tString toRemove = (String) view.getjCBLectureId().getSelectedItem();\r\n\t\t\tLecturers lecturer = model.findObject(toRemove, model.getLecturers());\r\n\t\t\tthis.model.removeObject(lecturer, model.getLecturers());\r\n\t\t}\r\n\t\telse\r\n\t\tif(e.getActionCommand() == \"Exit\"){\r\n\t\t\tmodel.writeObjects(\"Departments.dat\", model.getDepartments());\r\n\t\t\tmodel.writeObjects(\"Lecturers.dat\", model.getLecturers());\r\n\t\t\tSystem.out.println(\"logout\");\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\t\t\r\n\t}",
"@Override\n public void actionPerformed(ActionEvent e) {\n try{\n if(e.getActionCommand().equalsIgnoreCase(\"comboDepartmentName\")){\n Object[][] departmentdata= issueReturnModel.getRespectiveDepartment(mainview.getUserId());\n JComboBox dep = (JComboBox)e.getSource();\n if(dep.getSelectedItem().equals(\"SELECT\")){\n issueReturnView.setDepartmentId(0);\n issueReturnView.refreshJTable(new DefaultTableModel());\n \n }\n else{\n for(Object[] dat:departmentdata){\n if(dat[1].equals(dep.getSelectedItem())){\n issueReturnView.setDepartmentId(Integer.parseInt(dat[0].toString()));\n //loading the repective item according to department \n issueReturnView.refreshJTable(issueReturnModel.getResturantItemList(issueReturnView.getDepartmentId()));\n break;\n \n }\n }\n }\n }\n }\n catch(Exception se){\n JOptionPane.showMessageDialog(issueReturnView, se+\"from ComboListener\"+getClass().getName());\n }\n }",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jScrollPane1 = new javax.swing.JScrollPane();\n jTblDptos = new javax.swing.JTable();\n jSeparator1 = new javax.swing.JSeparator();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jBtnAgregar = new javax.swing.JButton();\n jBtnVer = new javax.swing.JButton();\n jBtnEliminar = new javax.swing.JButton();\n jBtnAdicionar = new javax.swing.JButton();\n jTexCodigo = new javax.swing.JTextField();\n jTexNombre = new javax.swing.JTextField();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n setTitle(\"CRUD Departamentos\");\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\n jTblDptos.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null}\n },\n new String [] {\n \"Title 1\", \"Title 2\", \"Title 3\", \"Title 4\"\n }\n ));\n jScrollPane1.setViewportView(jTblDptos);\n\n jLabel1.setText(\"Código:\");\n\n jLabel2.setText(\"Nombre:\");\n\n jBtnAgregar.setText(\"Agregar Dpto\");\n\n jBtnVer.setText(\"Ver Dpto\");\n jBtnVer.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jBtnVerActionPerformed(evt);\n }\n });\n\n jBtnEliminar.setText(\"Eliminar Dpto\");\n jBtnEliminar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jBtnEliminarActionPerformed(evt);\n }\n });\n\n jBtnAdicionar.setText(\"Adicionar Dpto\");\n jBtnAdicionar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jBtnAdicionarActionPerformed(evt);\n }\n });\n\n jTexCodigo.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jTexCodigoActionPerformed(evt);\n }\n });\n jTexCodigo.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyTyped(java.awt.event.KeyEvent evt) {\n jTexCodigoKeyTyped(evt);\n }\n });\n\n jTexNombre.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyTyped(java.awt.event.KeyEvent evt) {\n jTexNombreKeyTyped(evt);\n }\n });\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(jSeparator1)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jTexNombre, javax.swing.GroupLayout.PREFERRED_SIZE, 253, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jTexCodigo, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGap(0, 366, Short.MAX_VALUE))))\n .addGroup(layout.createSequentialGroup()\n .addGap(71, 71, 71)\n .addComponent(jBtnVer)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jBtnAdicionar)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jBtnAgregar, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jBtnEliminar)\n .addGap(0, 0, Short.MAX_VALUE)))\n .addContainerGap())\n );\n\n layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jBtnAdicionar, jBtnAgregar, jBtnEliminar, jBtnVer});\n\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel1)\n .addComponent(jTexCodigo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel2)\n .addComponent(jTexNombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 5, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jBtnVer)\n .addComponent(jBtnAdicionar)\n .addComponent(jBtnAgregar)\n .addComponent(jBtnEliminar))\n .addContainerGap(16, Short.MAX_VALUE))\n );\n\n pack();\n }",
"@Override\n\tpublic Dept getDept() {\n\t\treturn super.getDept();\n\t}",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n p_staffs = new javax.swing.JPanel();\n jPanel2 = new javax.swing.JPanel();\n jLabel18 = new javax.swing.JLabel();\n jTextField1 = new javax.swing.JTextField();\n jLabel3 = new javax.swing.JLabel();\n jScrollPane2 = new javax.swing.JScrollPane();\n jTable2 = new javax.swing.JTable();\n jLabel1 = new javax.swing.JLabel();\n jTextField2 = new javax.swing.JTextField();\n jButton6 = new javax.swing.JButton();\n jButton7 = new javax.swing.JButton();\n jButton8 = new javax.swing.JButton();\n jPanel4 = new javax.swing.JPanel();\n jLabel28 = new javax.swing.JLabel();\n viewby = new javax.swing.JComboBox();\n jScrollPane1 = new javax.swing.JScrollPane();\n jTable1 = new javax.swing.JTable();\n jLabel2 = new javax.swing.JLabel();\n jTextField3 = new javax.swing.JTextField();\n jButton1 = new javax.swing.JButton();\n jButton2 = new javax.swing.JButton();\n jButton3 = new javax.swing.JButton();\n\n p_staffs.setBackground(new java.awt.Color(255, 255, 255));\n\n jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, \"Department\", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font(\"Segoe UI\", 0, 15), new java.awt.Color(0, 0, 255))); // NOI18N\n jPanel2.setOpaque(false);\n\n jLabel18.setFont(new java.awt.Font(\"Segoe UI\", 0, 14)); // NOI18N\n jLabel18.setText(\"Department Name\");\n\n jTextField1.setFont(new java.awt.Font(\"Segoe UI\", 0, 14)); // NOI18N\n\n jTable2.setFont(new java.awt.Font(\"Segoe UI\", 0, 14)); // NOI18N\n jTable2.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null},\n {null, null, null},\n {null, null, null},\n {null, null, null}\n },\n new String [] {\n \"No\", \"Department Name\", \"C.O.D\"\n }\n ) {\n boolean[] canEdit = new boolean [] {\n false, true, false\n };\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n jScrollPane2.setViewportView(jTable2);\n\n jLabel1.setText(\"COD\");\n\n jTextField2.setFont(new java.awt.Font(\"Segoe UI\", 0, 14)); // NOI18N\n\n jButton6.setFont(new java.awt.Font(\"Segoe UI\", 0, 14)); // NOI18N\n jButton6.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/icons/Add_25px.png\"))); // NOI18N\n jButton6.setText(\"Add\");\n jButton6.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton6ActionPerformed(evt);\n }\n });\n\n jButton7.setFont(new java.awt.Font(\"Segoe UI\", 0, 14)); // NOI18N\n jButton7.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/icons/Approve and Update_25px.png\"))); // NOI18N\n jButton7.setText(\"Update\");\n\n jButton8.setFont(new java.awt.Font(\"Segoe UI\", 0, 14)); // NOI18N\n jButton8.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/icons/Delete_35px.png\"))); // NOI18N\n jButton8.setText(\"Delete\");\n\n javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);\n jPanel2.setLayout(jPanel2Layout);\n jPanel2Layout.setHorizontalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addGap(14, 14, 14)\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addGap(10, 10, 10)\n .addComponent(jLabel18, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGap(25, 25, 25)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addComponent(jTextField1)\n .addGap(3, 3, 3))\n .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 230, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(0, 0, Short.MAX_VALUE))\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addGap(24, 24, 24)\n .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 320, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addGap(144, 144, 144)\n .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 240, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addGap(54, 54, 54)\n .addComponent(jButton6)\n .addGap(29, 29, 29)\n .addComponent(jButton7)\n .addGap(33, 33, 33)\n .addComponent(jButton8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n jPanel2Layout.setVerticalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addGap(11, 11, 11)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addGap(1, 1, 1)\n .addComponent(jTextField1))\n .addComponent(jLabel18, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(26, 26, 26)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addGap(10, 10, 10)\n .addComponent(jLabel1))\n .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(30, 30, 30)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jButton6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jButton7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jButton8, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))\n .addGap(27, 27, 27)\n .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 180, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(150, 150, 150)\n .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE))\n );\n\n jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(null, \"Department Courses\", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font(\"Segoe UI\", 0, 15), new java.awt.Color(0, 51, 204))); // NOI18N\n jPanel4.setOpaque(false);\n\n jLabel28.setFont(new java.awt.Font(\"Segoe UI\", 0, 14)); // NOI18N\n jLabel28.setText(\"Department\");\n\n viewby.setFont(new java.awt.Font(\"Segoe UI\", 0, 14)); // NOI18N\n viewby.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseReleased(java.awt.event.MouseEvent evt) {\n viewbyMouseReleased(evt);\n }\n });\n\n jTable1.setFont(new java.awt.Font(\"Segoe UI\", 0, 14)); // NOI18N\n jTable1.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"NO\", \"Course\"\n }\n ));\n jTable1.setGridColor(new java.awt.Color(255, 255, 0));\n jTable1.setIntercellSpacing(new java.awt.Dimension(2, 2));\n jTable1.setOpaque(false);\n jTable1.setRowHeight(25);\n jScrollPane1.setViewportView(jTable1);\n\n jLabel2.setFont(new java.awt.Font(\"Segoe UI\", 0, 14)); // NOI18N\n jLabel2.setText(\"Add Course\");\n\n jTextField3.setFont(new java.awt.Font(\"Segoe UI\", 0, 14)); // NOI18N\n\n jButton1.setFont(new java.awt.Font(\"Segoe UI\", 0, 14)); // NOI18N\n jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/icons/Add_25px.png\"))); // NOI18N\n jButton1.setText(\"Add\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n jButton2.setFont(new java.awt.Font(\"Segoe UI\", 0, 14)); // NOI18N\n jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/icons/Approve and Update_25px.png\"))); // NOI18N\n jButton2.setText(\"Update\");\n\n jButton3.setFont(new java.awt.Font(\"Segoe UI\", 0, 14)); // NOI18N\n jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/icons/Delete_35px.png\"))); // NOI18N\n jButton3.setText(\"Delete\");\n\n javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);\n jPanel4.setLayout(jPanel4Layout);\n jPanel4Layout.setHorizontalGroup(\n jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel4Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 488, Short.MAX_VALUE)\n .addGroup(jPanel4Layout.createSequentialGroup()\n .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel28, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(jPanel4Layout.createSequentialGroup()\n .addComponent(jButton1)\n .addGap(37, 37, 37)\n .addComponent(jButton2)))\n .addGap(29, 29, 29)\n .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jButton3)\n .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(viewby, 0, 158, Short.MAX_VALUE)\n .addComponent(jTextField3)))\n .addGap(0, 0, Short.MAX_VALUE)))\n .addContainerGap())\n );\n jPanel4Layout.setVerticalGroup(\n jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel4Layout.createSequentialGroup()\n .addGap(38, 38, 38)\n .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel28)\n .addComponent(viewby, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(26, 26, 26)\n .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel2)\n .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 35, Short.MAX_VALUE)\n .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jButton1)\n .addComponent(jButton2)\n .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(32, 32, 32)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(22, 22, 22))\n );\n\n javax.swing.GroupLayout p_staffsLayout = new javax.swing.GroupLayout(p_staffs);\n p_staffs.setLayout(p_staffsLayout);\n p_staffsLayout.setHorizontalGroup(\n p_staffsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(p_staffsLayout.createSequentialGroup()\n .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGap(14, 14, 14)\n .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addContainerGap())\n );\n p_staffsLayout.setVerticalGroup(\n p_staffsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(p_staffsLayout.createSequentialGroup()\n .addGap(26, 26, 26)\n .addGroup(p_staffsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addContainerGap())\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(p_staffs, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(p_staffs, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n }",
"public PanelTableProduct(JTable tProductos, ArrayList productList) {\n\n // ToolsInterface\n InterfaceTools tools = new InterfaceTools();\n\n ModelTableProduct tmodel = new ModelTableProduct(productList);\n tProductos.setModel(tmodel);\n\n /// PanelTableProduct model = new PanelTableProduct();\n\n\n // BaseDatosProducto baseDatos = new BaseDatosProducto();\n\n // Modificar encabezado\n tProductos.getTableHeader().setReorderingAllowed(false);\n\n tProductos.getTableHeader().setBackground(tools.getColorThree());\n tProductos.getTableHeader().setForeground(tools.getColorFour());\n\n\n tProductos.getTableHeader().setFont(new Font(\"Arial\",Font.PLAIN,14));\n // tProductos.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\n tProductos.setSelectionBackground(tools.getColorOne());\n\n\n // tProductos.setEnabled(false);\n tProductos.setRowHeight(20);\n\n\n // Alinear a la Izquierda columna precios e inventario\n\n DefaultTableCellRenderer alignRight = new DefaultTableCellRenderer();\n alignRight.setHorizontalAlignment(SwingConstants.RIGHT);\n tProductos.getColumnModel().getColumn(1).setCellRenderer(alignRight);\n tProductos.getColumnModel().getColumn(2).setCellRenderer(alignRight);\n\n // Edición de celdas\n\n JScrollPane scrollPane = new JScrollPane(tProductos);\n\n scrollPane.setPreferredSize(new Dimension(450,363));\n scrollPane.setViewportView(tProductos);\n\n\n add(scrollPane);\n\n }",
"@Override\n\tpublic Employee getModel() {\n\t\treturn employee;\n\t}",
"public DefaultTableModel getModelo(){\n\n\t\treturn modelo;\n\n\t}",
"public DebtTableModel(Model model) {\n this.model = model;\n this.suggestions = model.getDebtRepaymentSuggestions();\n }",
"public DefaultTableModel armarModelo() {\r\n\t\tString columnNames[] = {\"Posici\\u00F3n\", \"Jugador\", \"Puntaje Total\", \"Partidas Jugadas\", \"Partidas Ganadas\", \"Prom. PPP\"};\r\n\t\t@SuppressWarnings(\"serial\")\r\n\t\tDefaultTableModel model = new DefaultTableModel(columnNames, 0) {\r\n\t\t\t@Override\r\n\t\t\tpublic boolean isCellEditable(int row, int column) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t};\r\n\t\tint pos = 0;\r\n\t\tfor(Jugador jugador : this.ranking.getListaJugadores()) {\r\n\t\t\tpos++;\r\n\t\t\tif(!jugador.getUsuario().equals(this.principal.getCliente().getUsuario()))\r\n\t\t\t\tmodel.addRow(new Object[]{pos, jugador.getUsuario(), jugador.getpuntajeTotal(), jugador.getJugados(), jugador.getGanados(), jugador.getPromPPP()});\r\n\t\t\telse\r\n\t\t\t\tmodel.addRow(new Object[]{this.principal.getMiPosicionRanking(), jugador.getUsuario(), jugador.getpuntajeTotal(), jugador.getJugados(), jugador.getGanados(), jugador.getPromPPP()});\r\n\t\t}\r\n\t\treturn model;\r\n\t}",
"public GestorDeConseptos() {\n initComponents();\n service=new InformeService(); \n m=new ConseptoTableModel();\n this.jTable1.setModel(m);\n cuentas=new Vector<ConseptoEnCuenta>();\n }",
"public Practice_JTable() {\n initComponents();\n }",
"public jpQLHoKhau() {\n initComponents();\n tableModel = (DefaultTableModel) tblDG.getModel();\n tableModel2 = (DefaultTableModel) tblTP.getModel();\n fillTblDG();\n fillTblTP();\n }",
"public void crearModelo() {\n modeloagr = new DefaultTableModel(null, columnasAgr) {\n public boolean isCellEditable(int fila, int columna) {\n return false;\n }\n };\n tbl.llenarTabla(AgendarA.tblAgricultor, modeloagr, columnasAgr.length, \"SELECT idPersonalExterno,cedula,CONCAT(nombres,' ',apellidos),municipios.nombre,telefono,telefono2,telefono3 FROM personalexterno,municipios WHERE tipo='agricultor' AND personalexterno.idMunicipio=municipios.idMunicipio\");\n tbl.alinearHeaderTable(AgendarA.tblAgricultor, headerColumnas);\n tbl.alinearCamposTable(AgendarA.tblAgricultor, camposColumnas);\n tbl.rowNumberTabel(AgendarA.tblAgricultor);\n }",
"public TableModel getModel() {\n return model;\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 void setDepartment(Department d) {\r\n department = d;\r\n }",
"public TabellaModel() {\r\n lista = new Lista();\r\n elenco = new Vector<Persona>();\r\n elenco =lista.getElenco();\r\n values = new String[elenco.size()][3];\r\n Iterator<Persona> iterator = elenco.iterator();\r\n while (iterator.hasNext()) {\r\n\t\t\tfor (int i = 0; i < elenco.size(); i++) {\r\n\t\t\t\tpersona = new Persona();\r\n\t\t\t\tpersona = (Persona) iterator.next();\r\n\t\t\t\tvalues[i][0] = persona.getNome();\r\n\t\t\t\tvalues[i][1] = persona.getCognome();\r\n\t\t\t\tvalues[i][2] = persona.getTelefono();\t\r\n\t\t\t}\r\n\t\t}\r\n setDataVector(values, columnNames);\t\r\n }",
"@Override\n\tpublic CalEntity getModel() {\n\t\treturn model;\n\t}",
"public void tabelaktivitas() {\n DefaultTableModel tbl= new DefaultTableModel();\n tbl.addColumn(\"Group\");\n tbl.addColumn(\"Compart\");\n tbl.addColumn(\"Activity\");\n tbl.addColumn(\"HA\");\n tbl.addColumn(\"Harga\");\n tbl.addColumn(\"Total\");\n tblaktivitas.setModel(tbl);\n try{\n java.sql.Statement statement=(java.sql.Statement)conek.GetConnection().createStatement();\n ResultSet res=statement.executeQuery(\"select * from tblaktivitas\");\n while(res.next())\n {\n tbl.addRow(new Object[]{\n res.getString(\"nama_grup\"),\n res.getString(\"compart\"),\n res.getString(\"pekerjaan\"),\n res.getInt(\"ha\"),\n res.getInt(\"harga\"),\n res.getInt(\"total\")\n });\n tblaktivitas.setModel(tbl); \n }\n }catch (Exception e){\n JOptionPane.showMessageDialog(rootPane,\"Salah\");\n }\n }",
"private void prepareTable() {\n TeamsRepository tr = new TeamsRepository();\n //ka uradim ovo dle odma mi samo inicijalizuje tabelu\n// tblTeams.setModel(new TeamsTableModel(tr.getTeams()));\n// ni ovaj kod mi nista nije radio\n// TeamsTableModel ttm = new TeamsTableModel(tr.getTeams());\n TableColumnModel tcm = tblTeams.getColumnModel();\n TableColumn tc = tcm.getColumn(1);\n TableCellEditor tce = new DefaultCellEditor(getComboBox());\n tc.setCellEditor(tce);\n }",
"public SeePatientListPanel_EN() {\n // <editor-fold defaultstate=\"collapsed\" desc=\"Initialize variables\">\n patientListTableModel_EN = new MyUneditableTableModel(\n new String[]{\"Patient ID\", \"Last name\", \"First name\"},\n 0) //<editor-fold defaultstate=\"collapsed\" desc=\"set column classes\">\n {\n @Override\n public Class getColumnClass(int col) {\n return java.lang.String.class;\n }\n } //</editor-fold>\n ;\n\n patientDetailsTableModel_EN = new MyUneditableTableModel(\n new String[]{\"Index\", \"Surgery\", \"Pathology\", \"Doctor\", \"Medical Leader\", \"Admission date\", \"Scheduled date\", \"Scheduled\", \"Completed\"},\n 0) //<editor-fold defaultstate=\"collapsed\" desc=\"set column classes\">\n {\n @Override\n public Class getColumnClass(int col) {\n String name = patientDetailsTableModel_EN.getColumnName(col);\n\n if (name.equals(\"Admission date\") || name.equals(\"Scheduled date\")) {\n return Date.class;\n } else {\n return java.lang.String.class;\n }\n }\n } //</editor-fold>\n ;\n\n //</editor-fold>\n initComponents();\n\n // <editor-fold defaultstate=\"collapsed\" desc=\"Update the datas on combo box\">\n updateMedicList();\n medicComboBox.setSelectedIndex(0);\n\n TableRowSorter<MyUneditableTableModel> sorter = new TableRowSorter<>(patientListTableModel_EN);\n patientListTable.setRowSorter(sorter);\n sorter.setSortable(0, false);\n //</editor-fold>\n }",
"public String GetDept()\r\n {\r\n return Department;\r\n }",
"public void setDept(String dept) {\n this.dept = dept;\n }",
"private EstabelecimentoTable() {\n\t\t\t}",
"@Override\n\tpublic EmpVo getModel() {\n\t\tSystem.out.println(\"get Method\");\n\t\t\n\t\treturn bean;\n\t}",
"public void PreencherTabela2() throws SQLException {\n\n String[] colunas = new String[]{\"ID do Pedido\", \"Numero Grafica\", \"Data Emissao\",\"Boleto\"};\n ArrayList dados = new ArrayList();\n Connection connection = ConnectionFactory.getConnection();\n PedidoDAO pedidoDAO = new PedidoDAO(connection);\n ModeloPedido modeloPedido = new ModeloPedido();\n modeloPedido = pedidoDAO.buscaPorId(idPedidoClasse);\n SimpleDateFormat format = new SimpleDateFormat(\"dd/MM/yyyy\");\n\n dados.add(new Object[]{modeloPedido.getId(), modeloPedido.getNumeroGrafica(), format.format(modeloPedido.getDataEmissao()), modeloPedido.isBoleto()});\n\n ModeloTabela modelo = new ModeloTabela(dados, colunas);\n\n jTablePedido.setModel(modelo);\n jTablePedido.setRowSorter(new TableRowSorter(modelo));\n jTablePedido.getColumnModel().getColumn(0).setPreferredWidth(2);\n jTablePedido.getColumnModel().getColumn(0).setResizable(false);\n jTablePedido.getColumnModel().getColumn(1).setPreferredWidth(20);\n jTablePedido.getColumnModel().getColumn(1).setResizable(false);\n\n jTablePedido.getTableHeader().setReorderingAllowed(false);\n connection.close();\n }",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n lblViewDrugGuidelines = new javax.swing.JLabel();\n lblPharmaceuticalCompany = new javax.swing.JLabel();\n cmbPharmaceuticalCompany = new javax.swing.JComboBox();\n lblPharmaceuticalCompanyId = new javax.swing.JLabel();\n lblId = new javax.swing.JLabel();\n jScrollPane1 = new javax.swing.JScrollPane();\n tblDrugList = new javax.swing.JTable();\n lblDrugList = new javax.swing.JLabel();\n btnViewDrugDetails = new javax.swing.JButton();\n btnBack = new javax.swing.JButton();\n\n lblViewDrugGuidelines.setText(\"View Drug Guidelines\");\n\n lblPharmaceuticalCompany.setText(\"Pharmaceutical Company\");\n\n cmbPharmaceuticalCompany.setModel(new javax.swing.DefaultComboBoxModel(new String[] { \"Item 1\", \"Item 2\", \"Item 3\", \"Item 4\" }));\n cmbPharmaceuticalCompany.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n cmbPharmaceuticalCompanyActionPerformed(evt);\n }\n });\n\n lblPharmaceuticalCompanyId.setText(\"Pharmaceutical Company ID\");\n\n tblDrugList.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null},\n {null, null},\n {null, null},\n {null, null}\n },\n new String [] {\n \"Drug ID\", \"Drug Name\"\n }\n ) {\n boolean[] canEdit = new boolean [] {\n false, false\n };\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n jScrollPane1.setViewportView(tblDrugList);\n if (tblDrugList.getColumnModel().getColumnCount() > 0) {\n tblDrugList.getColumnModel().getColumn(0).setResizable(false);\n tblDrugList.getColumnModel().getColumn(1).setResizable(false);\n }\n\n lblDrugList.setText(\"Drug List\");\n\n btnViewDrugDetails.setText(\"View Drug Details\");\n btnViewDrugDetails.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnViewDrugDetailsActionPerformed(evt);\n }\n });\n\n btnBack.setText(\"<<Back\");\n btnBack.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnBackActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(280, 280, 280)\n .addComponent(lblViewDrugGuidelines))\n .addGroup(layout.createSequentialGroup()\n .addGap(126, 126, 126)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(lblPharmaceuticalCompany)\n .addComponent(lblPharmaceuticalCompanyId))\n .addGap(97, 97, 97)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(lblId)\n .addComponent(cmbPharmaceuticalCompany, javax.swing.GroupLayout.PREFERRED_SIZE, 149, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGroup(layout.createSequentialGroup()\n .addGap(107, 107, 107)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(lblDrugList)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addGroup(layout.createSequentialGroup()\n .addGap(18, 18, 18)\n .addComponent(btnBack)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(btnViewDrugDetails)))\n .addContainerGap(157, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(22, 22, 22)\n .addComponent(lblViewDrugGuidelines)\n .addGap(49, 49, 49)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(lblPharmaceuticalCompany)\n .addComponent(cmbPharmaceuticalCompany, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(lblPharmaceuticalCompanyId)\n .addComponent(lblId))\n .addGap(29, 29, 29)\n .addComponent(lblDrugList)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 59, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(btnViewDrugDetails)\n .addGap(50, 50, 50))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(btnBack)\n .addGap(33, 33, 33))))\n );\n }",
"public Controlador(Vista view, Modelo model){\r\n \r\n //Se igualan las propiedades\r\n this.view = view;\r\n this.model = model;\r\n this.view.btnGuardar.addActionListener(this);\r\n \r\n //se iguala el modelo de la tabla\r\n table = new DefaultTableModel();\r\n view.tablaResultado.setModel(table);\r\n \r\n //nombre para la columna de la tabla\r\n table.addColumn(\"Listado\"); \r\n \r\n }",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jScrollPane1 = new javax.swing.JScrollPane();\n tabela_produto_vedas = new javax.swing.JTable();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n setTitle(\"Tabela de Produtos\");\n\n tabela_produto_vedas.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"Id Produto\", \"Referencia\", \"Modelo\", \"Marca\", \"Tamanho\", \"Quantidade\", \"Cor\", \"Valor Compra\", \"Valor Venda\"\n }\n ) {\n boolean[] canEdit = new boolean [] {\n false, false, false, false, false, false, false, false, false\n };\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n tabela_produto_vedas.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyPressed(java.awt.event.KeyEvent evt) {\n tabela_produto_vedasKeyPressed(evt);\n }\n });\n jScrollPane1.setViewportView(tabela_produto_vedas);\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(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 900, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 484, javax.swing.GroupLayout.PREFERRED_SIZE)\n );\n\n setSize(new java.awt.Dimension(918, 531));\n setLocationRelativeTo(null);\n }",
"public QDeptEmp() {\n this(DSL.name(\"dept_emp\"), null);\n }",
"public addConstructor() {\n\n\n \n initComponents();\n\n DefaultTableModel dt = (DefaultTableModel) tble.getModel();\n dt.setRowCount(0);\n\n try{\n Statement state = DB.getCon().createStatement();\n ResultSet rset = state.executeQuery(\"SELECT * FROM contractor \");\n\n while(rset.next()){\n Vector v = new Vector();\n v.add(rset.getString(\"ContractorID\"));\n v.add(rset.getString(\"CompanyName\"));\n v.add(rset.getString(\"CompanyAddress\"));\n\n dt.addRow(v);\n }\n } catch(Exception e) {\n System.out.println(e);\n }\n\n\n }",
"public frmAdministracion() {\n initComponents();\n skin();\n DaoAdministracion da = new DaoAdministracion();\n da.setAdministracion(txtMedioAdministracion.getText());\n tblAdministracion.setModel(da.listar());\n\n }",
"ReturnTable(TableModel dm) {\n super(dm);\n }",
"@Override\n\tpublic College getModel() {\n\t\treturn college;\n\t}",
"@Override\r\n\tpublic Object getModel() {\n\t\treturn this.roomcalander;\r\n\t}",
"@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 jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n firstNameText = new javax.swing.JTextField();\n lastNameText = new javax.swing.JTextField();\n deptCombox = new javax.swing.JComboBox();\n jScrollPane1 = new javax.swing.JScrollPane();\n employeeTable = new javax.swing.JTable();\n createEmployeeButton = new javax.swing.JButton();\n removeEmployeeButton = new javax.swing.JButton();\n passwordText = new javax.swing.JPasswordField();\n jLabel5 = new javax.swing.JLabel();\n jLabel6 = new javax.swing.JLabel();\n confirmPasswordText = new javax.swing.JPasswordField();\n jLabel7 = new javax.swing.JLabel();\n jLabelUserName = new javax.swing.JLabel();\n updateEmployeeInfoButton = new javax.swing.JButton();\n backButton = new javax.swing.JButton();\n jLabel9 = new javax.swing.JLabel();\n dateChooserCombo1 = new datechooser.beans.DateChooserCombo();\n\n jLabel1.setFont(new java.awt.Font(\"Lucida Grande\", 1, 18)); // NOI18N\n jLabel1.setText(\"Manage Employee\");\n\n jLabel2.setText(\"First Name\");\n\n jLabel3.setText(\"Last Name\");\n\n jLabel4.setText(\"Department\");\n\n firstNameText.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusLost(java.awt.event.FocusEvent evt) {\n firstNameTextFocusLost(evt);\n }\n });\n\n lastNameText.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusLost(java.awt.event.FocusEvent evt) {\n lastNameTextFocusLost(evt);\n }\n });\n\n deptCombox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { \"Item 1\", \"Item 2\", \"Item 3\", \"Item 4\" }));\n deptCombox.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n deptComboxActionPerformed(evt);\n }\n });\n\n employeeTable.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null},\n {null, null},\n {null, null},\n {null, null}\n },\n new String [] {\n \"Employee ID\", \"Name\"\n }\n ));\n jScrollPane1.setViewportView(employeeTable);\n\n createEmployeeButton.setText(\"Create Employee\");\n createEmployeeButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n createEmployeeButtonActionPerformed(evt);\n }\n });\n\n removeEmployeeButton.setText(\"Remove Employee\");\n removeEmployeeButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n removeEmployeeButtonActionPerformed(evt);\n }\n });\n\n jLabel5.setText(\"Password\");\n\n jLabel6.setText(\"User Name\");\n\n jLabel7.setText(\"Confirm Password\");\n\n updateEmployeeInfoButton.setText(\"Update Employee Infomation\");\n updateEmployeeInfoButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n updateEmployeeInfoButtonActionPerformed(evt);\n }\n });\n\n backButton.setText(\"<<Back\");\n backButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n backButtonActionPerformed(evt);\n }\n });\n\n jLabel9.setText(\"Birthday\");\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()\n .addGap(203, 203, 203)\n .addComponent(jLabel1))\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()\n .addGap(64, 64, 64)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(layout.createSequentialGroup()\n .addComponent(removeEmployeeButton)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(updateEmployeeInfoButton))\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 416, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addGap(0, 0, Short.MAX_VALUE))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(45, 45, 45)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(createEmployeeButton)\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel2)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel9)\n .addComponent(jLabel3)))\n .addGap(35, 35, 35)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(dateChooserCombo1, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(lastNameText, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(firstNameText, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(26, 26, 26)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel7)\n .addComponent(jLabel6)\n .addComponent(jLabel5))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(passwordText, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabelUserName, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addComponent(confirmPasswordText, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addComponent(backButton, javax.swing.GroupLayout.Alignment.LEADING)))\n .addGroup(layout.createSequentialGroup()\n .addGap(155, 155, 155)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel4)\n .addGroup(layout.createSequentialGroup()\n .addGap(115, 115, 115)\n .addComponent(deptCombox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))))\n .addContainerGap(55, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(21, 21, 21)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel1)\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel4)\n .addComponent(deptCombox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(26, 26, 26)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(removeEmployeeButton)\n .addComponent(updateEmployeeInfoButton))\n .addGap(29, 29, 29)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel2)\n .addComponent(firstNameText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel3)\n .addComponent(lastNameText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel6)\n .addGap(17, 17, 17)\n .addComponent(jLabel5))))\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabelUserName, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(12, 12, 12)\n .addComponent(passwordText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(confirmPasswordText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel7)\n .addComponent(jLabel9)))\n .addComponent(dateChooserCombo1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(31, 31, 31)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(createEmployeeButton)\n .addComponent(backButton))\n .addContainerGap(60, Short.MAX_VALUE))\n );\n }",
"public PromocionTableModel() {\n \n //Establecemos la sentencia SQL que vamos a ejecutar\n super(\"SELECT ID_PROMOCION , NOMBRE, DESCUENTO FROM PROMOCION\");\n \n }",
"CrmDept selectByPrimaryKey(String deptCode);",
"public DefaultTableModel pedidosMesero(){\r\n List<Pedido> lista =pedidos.listarPedidoTerminado();\r\n return Convertidor.PedidoToTableModelMin(lista);\r\n }",
"public AdminView() {\n initComponents();\n \n staffTbl.setSelectionMode(\n ListSelectionModel.SINGLE_SELECTION);\n rentalTbl.setSelectionMode(\n ListSelectionModel.SINGLE_SELECTION);\n carTbl.setSelectionMode(\n ListSelectionModel.SINGLE_SELECTION);\n carClassTbl.setSelectionMode(\n ListSelectionModel.SINGLE_SELECTION);\n }",
"public DeviceProgressPanel() {\n super();\n\n this.mdlCtrlr = new ProgTableController();\n this.tblDacqStatus = new JTable( this.mdlCtrlr );\n this.paneTblScrollr = new JScrollPane( this.tblDacqStatus );\n \n this.txtDaqStatus = new JTextField();\n\n// this.setViewportView( this.tblDacqStatus );\n this.buildViewPane();\n }",
"public String getDept() {\n return dept;\n }",
"public String getDept() {\n return dept;\n }",
"private MarkovTableModel populateMarkovTableModel(List<SurveyColumnValuesGrouping> surveyGroups){\n MarkovTableModel myModel;\n \n if(this.currentMarkovChain.getMarkovChainTableCells().size() > 0){\n myModel = populateExistingMarkovTableModel(surveyGroups);\n } else{\n myModel = populateNewMarkovTableModel(surveyGroups);\n }\n return myModel;\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 jScrollPane1 = new javax.swing.JScrollPane();\n tblEmp = new javax.swing.JTable();\n txtUser = new javax.swing.JTextField();\n txtPass = new javax.swing.JTextField();\n txtFullname = new javax.swing.JTextField();\n txtAge = new javax.swing.JTextField();\n txtAddress = new javax.swing.JTextField();\n txtPhone = new javax.swing.JTextField();\n cboDep = new javax.swing.JComboBox();\n cboProject = new javax.swing.JComboBox();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n jLabel6 = new javax.swing.JLabel();\n jLabel7 = new javax.swing.JLabel();\n jLabel8 = new javax.swing.JLabel();\n jLabel9 = new javax.swing.JLabel();\n btnAdd = new javax.swing.JButton();\n btnUpdate = new javax.swing.JButton();\n btnDelete = new javax.swing.JButton();\n lblWellcome = new javax.swing.JLabel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setTitle(\"Quản lý dự án\");\n\n jLabel1.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n jLabel1.setText(\"Xin chào: \");\n\n tblEmp.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n tblEmpMouseClicked(evt);\n }\n });\n jScrollPane1.setViewportView(tblEmp);\n\n jLabel2.setText(\"User:\");\n\n jLabel3.setText(\"Password:\");\n\n jLabel4.setText(\"Full name:\");\n\n jLabel5.setText(\"Age:\");\n\n jLabel6.setText(\"Address:\");\n\n jLabel7.setText(\"Phone:\");\n\n jLabel8.setText(\"Department:\");\n\n jLabel9.setText(\"Project:\");\n\n btnAdd.setText(\"Add new\");\n btnAdd.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnAddActionPerformed(evt);\n }\n });\n\n btnUpdate.setText(\"Update\");\n btnUpdate.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnUpdateActionPerformed(evt);\n }\n });\n\n btnDelete.setText(\"Delete\");\n btnDelete.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnDeleteActionPerformed(evt);\n }\n });\n\n lblWellcome.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n lblWellcome.setForeground(new java.awt.Color(255, 0, 51));\n lblWellcome.setText(\"jindo\");\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 741, Short.MAX_VALUE)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel1)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(lblWellcome))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGap(1, 1, 1))\n .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(txtUser, javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE)\n .addComponent(txtPass, javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE)\n .addComponent(txtFullname, javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGap(20, 20, 20))\n .addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGap(9, 9, 9)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(txtAge, javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE)\n .addComponent(txtAddress, javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE)\n .addComponent(txtPhone))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGap(23, 23, 23)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(cboProject, 0, 155, Short.MAX_VALUE)\n .addComponent(cboDep, 0, 155, Short.MAX_VALUE)))\n .addGroup(layout.createSequentialGroup()\n .addComponent(btnAdd)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(btnUpdate)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(btnDelete)))))\n .addGap(75, 75, 75)))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(12, 12, 12)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel1)\n .addComponent(lblWellcome))\n .addGap(18, 18, 18)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 143, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(txtAge, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(cboDep, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel5)\n .addComponent(jLabel8))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(txtAddress, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(cboProject, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel6)\n .addComponent(jLabel9))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(txtPhone, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel7)))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(txtUser, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel2))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(txtPass, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel3))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(txtFullname, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel4))))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 31, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(btnAdd)\n .addComponent(btnUpdate)\n .addComponent(btnDelete))\n .addGap(20, 20, 20))\n );\n\n pack();\n }",
"public Faculty() {\n initComponents();\n Show_Facultyc_In_JTable();\n }",
"public String getDeptName() {\r\n return deptName;\r\n }",
"private DefaultTableModel createModel() {\n List list = getDefaultInitialData();//obtenemos toda la lista a mostrar\n Vector data = new Vector();//vector tabla\n if (list != null) {\n for (Object o : list) {\n Vector columnas = new Vector();//columnas para llenar la tabla\n //lenar el vector columna\n Object object = null;\n for (Object x : title) {\n try {\n object = o.getClass().getMethod(\"get\" + convertir(x.toString()), new Class[]{}).invoke(o);\n columnas.add(object);\n } catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {\n Logger.getLogger(JCAbstractXTable.class.getName()).log(Level.SEVERE, null, e);\n }\n }\n data.add(columnas);\n }\n }\n return new DefaultTableModel(data, nameColumn());\n }",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jPanel1 = new javax.swing.JPanel();\n idLabel = new javax.swing.JLabel();\n nameLabel = new javax.swing.JLabel();\n idField = new javax.swing.JTextField();\n nameField = new javax.swing.JTextField();\n saveButton = new javax.swing.JButton();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jSeparator1 = new javax.swing.JSeparator();\n jLabel3 = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n jButton1 = new javax.swing.JButton();\n jLabel5 = new javax.swing.JLabel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n idLabel.setFont(new java.awt.Font(\"Tahoma\", 0, 13)); // NOI18N\n idLabel.setText(\"Department ID\");\n\n nameLabel.setFont(new java.awt.Font(\"Tahoma\", 0, 13)); // NOI18N\n nameLabel.setText(\"Department Name\");\n\n saveButton.setText(\"Save\");\n saveButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n saveButtonActionPerformed(evt);\n }\n });\n\n jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Images/logo.png\"))); // NOI18N\n\n jLabel2.setFont(new java.awt.Font(\"Tahoma\", 0, 22)); // NOI18N\n jLabel2.setText(\"Department Master\");\n\n jLabel3.setText(\"FORM\");\n\n jLabel4.setFont(new java.awt.Font(\"Tahoma\", 2, 11)); // NOI18N\n jLabel4.setText(\"insert new department's data below\");\n\n jButton1.setText(\"View\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n jLabel5.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Images/corner.png\"))); // NOI18N\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel1)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jLabel2)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jLabel3)\n .addGap(0, 0, Short.MAX_VALUE))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addContainerGap(15, Short.MAX_VALUE)\n .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 181, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 266, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(61, 61, 61)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(idLabel)\n .addComponent(nameLabel))\n .addGap(26, 26, 26)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(nameField, javax.swing.GroupLayout.PREFERRED_SIZE, 185, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(idField, javax.swing.GroupLayout.PREFERRED_SIZE, 185, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(saveButton)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jButton1)))\n .addGap(0, 0, Short.MAX_VALUE)))\n .addContainerGap())\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addGap(0, 0, Short.MAX_VALUE)\n .addComponent(jLabel5))\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel1)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel2)\n .addComponent(jLabel3)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel4)\n .addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(idLabel)\n .addComponent(idField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(nameLabel)\n .addComponent(nameField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(saveButton)\n .addComponent(jButton1))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jLabel5))\n );\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(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGap(0, 0, 0))\n );\n\n pack();\n }",
"public Modello() {\r\n super();\r\n initComponents();\r\n setModalita(APPEND_QUERY);\r\n setFrameTable(tabModello);\r\n setNomeTabella(\"vmodello\");\r\n tMarcaDescrizione.setEnabled(false);\r\n }",
"public Reporte4() {\n initComponents();\n modelo = new DefaultTableModel();\n modelo.addColumn(\"id_partidos\");\n modelo.addColumn(\"equipo_local\");\n modelo.addColumn(\"equipo_visitante\");\n modelo.addColumn(\"estadio\");\n modelo.addColumn(\"fecha\");\n modelo.addColumn(\"marcador_local\");\n modelo.addColumn(\"marcador_visitante\");\n // jPanel2.setVisible(false);\n // jPanel3.setVisible(false);\n //jPanel4.setVisible(false);\n //modelo.addColumn(\"Año escolar\");\n this.jTable1.setModel(modelo);\n CargarBD();\n }",
"public NuevoPrestamo() {\n initComponents();\n \n modeloHer = new DefaultTableModel();\n modeloPer = new DefaultTableModel();\n herramientasTable.setModel(modeloHer);\n personalTable.setModel(modeloPer);\n modeloHer.setColumnIdentifiers(titulosHer);\n modeloPer.setColumnIdentifiers(titulosPer);\n \n try {\n herramientas = herImp.lista_herramientas();\n for(Herramienta her : herramientas){\n Object[]o = new Object[4];\n o[0] = her.getCodigoProducto();\n o[1] = her.getNombre();\n o[2] = her.getDescripcion();\n o[3] = her.getCantidadDisponible();\n \n modeloHer.addRow(o);\n }\n } catch (Exception e) {\n System.out.println(\"Error al mostrar las herramientas en la tabla\");\n }\n \n try {\n listaPersonal = perImp.lista_personal();\n for(Personal per : listaPersonal){\n Object[]o = new Object[3];\n o[0] = per.getNombre();\n o[1] = per.getArea();\n o[2] = per.getPuesto();\n \n modeloPer.addRow(o);\n }\n } catch (Exception e) {\n System.out.println(\"Error al mostrar el personal en la tabla\");\n }\n \n }",
"private void srediTabelu() {\n ModelTabeleStavka mts = new ModelTabeleStavka();\n mts.setLista(n.getLista());\n tblStavka.setModel(mts);\n }",
"public DepartmentModel getDepartmentKey()\r\n\t{\r\n\t\treturn this.m_departmentKey;\r\n\t}",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n btnQuan = new javax.swing.JButton();\n btnSetValue = new javax.swing.JButton();\n jScrollPane1 = new javax.swing.JScrollPane();\n tblVac = new javax.swing.JTable();\n btnVaccine = new javax.swing.JButton();\n jScrollPane3 = new javax.swing.JScrollPane();\n tblEntVac = new javax.swing.JTable();\n\n btnQuan.setText(\"Set Quantity of Vaccines\");\n btnQuan.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnQuanActionPerformed(evt);\n }\n });\n\n btnSetValue.setText(\"Set Quantity\");\n btnSetValue.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnSetValueActionPerformed(evt);\n }\n });\n\n tblVac.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"Vac Name\"\n }\n ) {\n Class[] types = new Class [] {\n java.lang.String.class\n };\n boolean[] canEdit = new boolean [] {\n false\n };\n\n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n jScrollPane1.setViewportView(tblVac);\n if (tblVac.getColumnModel().getColumnCount() > 0) {\n tblVac.getColumnModel().getColumn(0).setResizable(false);\n }\n\n btnVaccine.setText(\"See Vaccines\");\n btnVaccine.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnVaccineActionPerformed(evt);\n }\n });\n\n tblEntVac.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"Name\", \"Vaccines\", \"Quantity\"\n }\n ) {\n boolean[] canEdit = new boolean [] {\n false, false, false\n };\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n jScrollPane3.setViewportView(tblEntVac);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(49, 49, 49)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 464, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(67, Short.MAX_VALUE))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 232, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createSequentialGroup()\n .addComponent(btnVaccine)\n .addGap(40, 40, 40)\n .addComponent(btnSetValue)))\n .addGap(0, 0, Short.MAX_VALUE))))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(29, 29, 29)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(28, 28, 28)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(btnVaccine)\n .addComponent(btnSetValue))\n .addGap(91, 91, 91)\n .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(134, Short.MAX_VALUE))\n );\n }",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jPanel1 = new javax.swing.JPanel();\n jScrollPane1 = new javax.swing.JScrollPane();\n tblEMP = new javax.swing.JTable();\n jLabel1 = new javax.swing.JLabel();\n jButton1 = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n\n jPanel1.setBackground(new java.awt.Color(255, 255, 255));\n\n tblEMP.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null, null, null},\n {null, null, null, null, null, null},\n {null, null, null, null, null, null},\n {null, null, null, null, null, null}\n },\n new String [] {\n \"Id\", \"Nombres\", \"Apellidos\", \"Identidad\", \"Cargo\", \"Sueldo\"\n }\n ));\n jScrollPane1.setViewportView(tblEMP);\n\n jLabel1.setFont(new java.awt.Font(\"Tahoma\", 0, 18)); // NOI18N\n jLabel1.setText(\"Selecciones un empleado\");\n\n jButton1.setText(\"SELECCIONAR\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap())\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addComponent(jLabel1)\n .addGap(124, 124, 124))))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(181, 181, 181)\n .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 0, Short.MAX_VALUE))\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel1)\n .addGap(30, 30, 30)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 151, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(46, 46, 46)\n .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(31, Short.MAX_VALUE))\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 0, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 0, Short.MAX_VALUE))\n );\n\n pack();\n }",
"public RequiredTimeTable getRoomSharingTable(Collection departments) {\n \t\treturn new RequiredTimeTable(getRoomSharingModel(null, departments)); //all editable\n \t}",
"private void carregarTabela() {\n try {\n\n Vector<String> cabecalho = new Vector();\n cabecalho.add(\"Id\");\n cabecalho.add(\"Nome\");\n cabecalho.add(\"Telefone\");\n cabecalho.add(\"Titular\");\n cabecalho.add(\"Data de Nascimento\");\n\n Vector detalhe = new Vector();\n\n for (Dependente dependente : new NDependente().listar()) {\n Vector<String> linha = new Vector();\n\n linha.add(dependente.getId() + \"\");\n linha.add(dependente.getNome());\n linha.add(dependente.getTelefone());\n linha.add(new NCliente().consultar(dependente.getCliente_id()).getNome());\n linha.add(dependente.getDataNascimento().toString());\n detalhe.add(linha);\n\n }\n\n tblDependentes.setModel(new DefaultTableModel(detalhe, cabecalho));\n\n } catch (Exception e) {\n JOptionPane.showMessageDialog(this, e.getMessage());\n }\n\n }",
"public RentAdmin() {\n initComponents();\n TB_Transaksi.setModel(new CrudTransaksi().tampil());\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 jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n desplegableTipoEmpanada = new javax.swing.JComboBox<>();\n jLabel4 = new javax.swing.JLabel();\n campoCantidadEmpanada = new javax.swing.JTextField();\n botonAgregarEmpanada = new javax.swing.JButton();\n jLabel5 = new javax.swing.JLabel();\n jLabel6 = new javax.swing.JLabel();\n jLabel7 = new javax.swing.JLabel();\n desplegableBebidas = new javax.swing.JComboBox<>();\n jLabel8 = new javax.swing.JLabel();\n desplegableVolumen = new javax.swing.JComboBox<>();\n botonAgregarBebida = new javax.swing.JButton();\n jScrollPane1 = new javax.swing.JScrollPane();\n tablaDetalle = new javax.swing.JTable();\n botonQuitarProducto = new javax.swing.JButton();\n jLabel9 = new javax.swing.JLabel();\n campoTotal = new javax.swing.JTextField();\n jButton1 = new javax.swing.JButton();\n botonConfirmarPedido = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jLabel1.setFont(new java.awt.Font(\"Dialog\", 1, 18)); // NOI18N\n jLabel1.setText(\"Agregar Productos\");\n\n jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/imagenes/empanada.png\"))); // NOI18N\n\n jLabel3.setText(\"Empanadas\");\n\n jLabel4.setText(\"cantidad\");\n\n botonAgregarEmpanada.setText(\"Agregar Empanada\");\n\n jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/imagenes/bebida.png\"))); // NOI18N\n\n jLabel7.setText(\"bebida\");\n\n jLabel8.setText(\"Volumen\");\n\n botonAgregarBebida.setText(\"Agregar Bebida\");\n\n tablaDetalle.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null}\n },\n new String [] {\n \"Title 1\", \"Title 2\", \"Title 3\", \"Title 4\"\n }\n ));\n jScrollPane1.setViewportView(tablaDetalle);\n\n botonQuitarProducto.setText(\"Quitar Producto\");\n\n jLabel9.setText(\"total\");\n\n campoTotal.setEditable(false);\n\n jButton1.setText(\"Cancelar\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n botonConfirmarPedido.setText(\"Confirmar Pedido\");\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(layout.createSequentialGroup()\n .addComponent(botonAgregarEmpanada)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(botonAgregarBebida))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel3)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(desplegableTipoEmpanada, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel4)\n .addGap(30, 30, 30)\n .addComponent(campoCantidadEmpanada)))\n .addGap(27, 27, 27)\n .addComponent(jLabel5)\n .addGap(18, 18, 18)\n .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(18, 18, 18)\n .addComponent(jLabel7)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(desplegableBebidas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jLabel8)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(desplegableVolumen, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))))))\n .addGroup(layout.createSequentialGroup()\n .addGap(68, 68, 68)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 531, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createSequentialGroup()\n .addComponent(botonQuitarProducto)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jLabel9)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(campoTotal, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)))))\n .addContainerGap(49, Short.MAX_VALUE))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addGap(0, 0, Short.MAX_VALUE)\n .addComponent(jButton1)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(botonConfirmarPedido)\n .addGap(41, 41, 41))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel1)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel5)\n .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGroup(layout.createSequentialGroup()\n .addGap(22, 22, 22)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel3)\n .addComponent(desplegableTipoEmpanada, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel4)\n .addComponent(campoCantidadEmpanada, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGroup(layout.createSequentialGroup()\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jLabel6))\n .addGroup(layout.createSequentialGroup()\n .addGap(16, 16, 16)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel7)\n .addComponent(desplegableBebidas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel8)\n .addComponent(desplegableVolumen, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(botonAgregarEmpanada)\n .addComponent(botonAgregarBebida))\n .addGap(29, 29, 29)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(botonQuitarProducto)\n .addComponent(jLabel9)\n .addComponent(campoTotal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(29, 29, 29)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jButton1)\n .addComponent(botonConfirmarPedido))\n .addContainerGap(41, Short.MAX_VALUE))\n );\n\n pack();\n }",
"public JP1Table( TableModel model )\n {\n super( model );\n setSelectionMode( ListSelectionModel.SINGLE_SELECTION );\n // getSelectionModel().addListSelectionListener( this );\n setCellSelectionEnabled( true );\n setSurrendersFocusOnKeystroke( true );\n setAutoResizeMode( JTable.AUTO_RESIZE_LAST_COLUMN );\n tableHeader.setReorderingAllowed( false );\n DefaultCellEditor e = ( DefaultCellEditor )getDefaultEditor( String.class );\n new TextPopupMenu( ( JTextComponent )e.getComponent() );\n }",
"private void popuniTabelu() {\n try {\n List<PutnikEntity> putnici=Controller.vratiSvePutnike();\n TableModel tm=new PutnikTableModel(putnici);\n jtblPutnici.setModel(tm);\n } catch (Exception ex) {\n Logger.getLogger(FIzaberiLet.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel3 = new javax.swing.JLabel();\n viewDateAtual = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n jTextField1 = new javax.swing.JTextField();\n jLabel15 = new javax.swing.JLabel();\n jTextField7 = new javax.swing.JTextField();\n jButton1 = new javax.swing.JButton();\n jButton2 = new javax.swing.JButton();\n jButton3 = new javax.swing.JButton();\n jLabel17 = new javax.swing.JLabel();\n jScrollPane1 = new javax.swing.JScrollPane();\n tabProdVen = new javax.swing.JTable();\n addProd = new javax.swing.JButton();\n jButton4 = new javax.swing.JButton();\n bPesquisa = new javax.swing.JButton();\n jLabel1 = new javax.swing.JLabel();\n jComboBox2 = new javax.swing.JComboBox<>();\n\n setClosable(true);\n setForeground(java.awt.Color.black);\n setIconifiable(true);\n setMaximizable(true);\n setResizable(true);\n setTitle(\"Venda\");\n\n jLabel3.setText(\"Data:\");\n\n jLabel5.setText(\"Cliente:\");\n\n jTextField1.setText(\"Nome do cliente\");\n jTextField1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jTextField1ActionPerformed(evt);\n }\n });\n\n jLabel15.setText(\"Valor Total:\");\n\n jTextField7.setText(\"R$:\");\n\n jButton1.setText(\"Salvar\");\n\n jButton2.setText(\"Limpar\");\n\n jButton3.setText(\"Cancelar\");\n\n jLabel17.setText(\"VENDA\");\n\n tabProdVen.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"Produto\", \"Quantidade\", \"Unidade\", \"Valor\"\n }\n ));\n tabProdVen.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));\n jScrollPane1.setViewportView(tabProdVen);\n\n jButton4.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton4ActionPerformed(evt);\n }\n });\n\n bPesquisa.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n bPesquisaActionPerformed(evt);\n }\n });\n\n jLabel1.setText(\"Forma de pagamento:\");\n\n jComboBox2.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"Dinheiro\", \"Crédito\", \"Débito\", \"Cheque\" }));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jButton1)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jButton2)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jButton3))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel3)\n .addComponent(jLabel5))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(72, 72, 72)\n .addComponent(viewDateAtual, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 314, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bPesquisa, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)))))\n .addGap(0, 0, Short.MAX_VALUE))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 389, Short.MAX_VALUE)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel1)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jComboBox2, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jLabel15)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addContainerGap())))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(176, 176, 176)\n .addComponent(jLabel17))\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(addProd, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel17, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(viewDateAtual, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel5))\n .addComponent(bPesquisa, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGap(18, 18, 18)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 159, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jButton4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(addProd))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 27, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel15)\n .addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel1)\n .addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(42, 42, 42)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(23, 23, 23))\n );\n\n pack();\n }",
"public void SetModel() {\n try {\n con = dc.connect();\n tb_User.setModel(user_model);\n stmt2 = con.createStatement();\n vtdata_user = new Vector();\n vtcolumn_user = new Vector();\n\n //Add Header for User Table Model\n vtcolumn_user.add(\"UserName\");\n vtcolumn_user.add(\"Full Name\");\n vtcolumn_user.add(\"Email\");\n vtcolumn_user.add(\"Birthday\");\n vtcolumn_user.add(\"Gender\");\n vtcolumn_user.add(\"Phone\");\n String sqlUser = \"select UserName,u_name,Email,BirthDate,Gender,Phone from tblUsers\";\n ResultSet rsUser = stmt2.executeQuery(sqlUser);\n\n\n\n while (rsUser.next()) {\n\n Vector temp = new Vector();\n\n temp.add(rsUser.getString(1));\n temp.add(rsUser.getString(2));\n temp.add(rsUser.getString(3));\n // temp.add(rsUser.getDate(\"BirthDate\"));\n\n temp.add(formatDate.format(rsUser.getDate(4)));\n boolean gender = rsUser.getBoolean(5);\n\n\n if (gender == true) {\n temp.add(\"Male\");\n }\n\n if (gender == false) {\n temp.add(\"Female\");\n }\n temp.add(rsUser.getString(6));\n vtdata_user.add(temp);\n }\n\n\n user_model = new DefaultTableModel(vtdata_user, vtcolumn_user) {\n\n @Override\n public boolean isCellEditable(int row, int column) {\n return false;\n }\n };\n tb_User.setModel(user_model);\n\n dc.disconnect(rsUser);\n dc.disconnect(stmt2);\n dc.disconnect(con);\n } catch (SQLException ex) {\n Logger.getLogger(UserManagement.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"public void updateTable() {\n\t\ttable.getSelectionModel().removeListSelectionListener(lsl);\n\t\tdtm = new DefaultTableModel();\n\t\td = new Diet();\n\t\tdtm.addColumn(\"Id\");\n\t\tdtm.addColumn(\"Meal Id\");\n\t\tdtm.addColumn(\"Meal Type\");\n\t\tdtm.addColumn(\"Food Name\");\n\t\tdtm.addColumn(\"Food Type\");\n\t\tdtm.addColumn(\"Food Category\");\n\t\tdtm.addColumn(\"Ready Time\");\n\t\tdtm.addColumn(\"Calories (g)\");\t\t\n\t\tdtm.addColumn(\"Protein (g)\");\n\t\tdtm.addColumn(\"Fat (g)\");\n\t\tdtm.addColumn(\"Carbohydrates\");\n\t\tdtm.addColumn(\"VitaminA\");\n\t\tdtm.addColumn(\"VitaminC\");\n\t\tdtm.addColumn(\"Calcium\");\n\t\tdtm.addColumn(\"Iron\");\n\t\tdtm.addColumn(\"Author\");\n\t\tArrayList<Diet> dietList = dI.getDietList();\n\t\tif(isOrder && orderby!=\"\")\n\t\t{\t\t\t\n\t\t\tSystem.out.println(\"entering ----------------\"+orderby);\n\t\t\tdietList=dI.getDietOrderedList(type,orderby);\n\t\t\tfor (Diet d : dietList) {\t\n\t\t\t\tSystem.out.println(d.getId()+\" ------ \"+d.getCalories());\n\t\t\t}\n\t\t}\n\t\tif(isFiltered)\n\t\t{\n\t\t\tif(mealtypeSel!=\"\")\n\t\t\tdietList=dI.getFilteredMealTypeList(mealtypeSel);\n\t\t\tif(foodtypeSel!=\"\")\n\t\t\t\tdietList=dI.getFilteredFoodTypeList(foodtypeSel);\n\t\t\tif(authorSel!=\"\")\n\t\t\t\tdietList=dI.getFilteredauthorList(authorSel);\n\t\t\tif(foodCategorySel!=\"\")\n\t\t\t\tdietList=dI.getFilterFoodCategoryList(foodCategorySel);\n\t\t\t\n\t\t}\n\t\t\n\t\tfor (Diet d : dietList) {\t\n\t\t\tdtm.addRow(d.getVector());\n\t\t}\n\t\ttable.setModel(dtm);\n\n\t\ttable.getSelectionModel().addListSelectionListener(lsl);\n\n\t}",
"public void atualizarTabelaRespostas(){\n resposta = new Resposta(); \n\n try{\n if(txtIdPergunta.getText().isEmpty()){\n listaRespostas = respostaDao.ListaResposta(0);\n \n }else{\n listaRespostas = respostaDao.ListaResposta(Integer.parseInt(txtIdPergunta.getText()));\n \n }\n }catch (SQLException ex){\n Logger.getLogger(PerguntaView.class.getName()).log(Level.SEVERE, null, ex);\n } \nString dados [][] = new String[listaRespostas.size()][0];\nint i = 0;\nfor(Resposta resposta : listaRespostas){\n dados[i][0] = String.valueOf(resposta.getId());\n dados[i][1] = resposta.getDescricao();\n \n i++;\n}\nString tituloColuna[] ={\"ID Resposta\", \"Resposta\"};\nDefaultTableModel tabelaresposta = new DefaultTableModel();\ntabelaresposta.setDataVector(dados, tituloColuna);\n \n\n tabela_respostas.setModel(new DefaultTableModel(dados, tituloColuna){\n boolean[] canEdit = new boolean[]{\n false, false};\n \n public boolean isCellEditable(int rowIndex, int columnIndex){\n return canEdit[columnIndex];\n }\n \n\n });\ntabela_respostas.getColumnModel().getColumn(0).setPreferredWidth(100);\ntabela_respostas.getColumnModel().getColumn(1).setPreferredWidth(400);\n\nDefaultTableCellRenderer alinhamentoCentro = new DefaultTableCellRenderer();\nalinhamentoCentro.setHorizontalAlignment(SwingConstants.CENTER);\n\n\ntabela_respostas.getColumnModel().getColumn(0).setCellRenderer(alinhamentoCentro);\n\n\ntabela_respostas.setRowHeight(25);\ntabela_respostas.updateUI();\n }",
"public Departement() {\n\t\t// TODO Auto-generated constructor stub\n\t}",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jScrollPane1 = new javax.swing.JScrollPane();\n tblTasks = new javax.swing.JTable();\n comboDeriverMan = new javax.swing.JComboBox<>();\n btnDistribute = new javax.swing.JButton();\n\n setBackground(new java.awt.Color(255, 255, 255));\n\n tblTasks.setFont(new java.awt.Font(\"Yu Gothic\", 1, 18)); // NOI18N\n tblTasks.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null, null, null},\n {null, null, null, null, null, null},\n {null, null, null, null, null, null},\n {null, null, null, null, null, null}\n },\n new String [] {\n \"ID\", \"Sender\", \"Receiver\", \"DeliveryMan\", \"Product\", \"Status\"\n }\n ));\n tblTasks.setIntercellSpacing(new java.awt.Dimension(0, 0));\n tblTasks.setRowHeight(25);\n tblTasks.setSelectionBackground(new java.awt.Color(102, 204, 255));\n tblTasks.setShowVerticalLines(false);\n jScrollPane1.setViewportView(tblTasks);\n\n comboDeriverMan.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"Item 1\", \"Item 2\", \"Item 3\", \"Item 4\" }));\n\n btnDistribute.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));\n btnDistribute.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnDistributeActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(313, 313, 313)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(157, 157, 157)\n .addComponent(btnDistribute, javax.swing.GroupLayout.PREFERRED_SIZE, 189, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(comboDeriverMan, javax.swing.GroupLayout.PREFERRED_SIZE, 195, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(137, 137, 137))\n .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 1124, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(163, 163, 163))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(139, 139, 139)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 240, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(195, 195, 195)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(btnDistribute, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(comboDeriverMan, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap(285, Short.MAX_VALUE))\n );\n }",
"public void LlenarPagos(){\n datos=new DefaultTableModel();\n LlenarModelo();\n this.TablaPagos.setModel(datos);\n }",
"public DataTableModel() {\n super();\n LanguageObservable.getInstance().attach(this);\n setLocalizedResourceBundle(\"ch.ethz.origo.jerpa.jerpalang.perspective.ededb.EDEDB\");\n initColumns();\n data = new LinkedList<DataRowModel>();\n }",
"public ProjectTableModel(ArrayList<Project> prjs) {\n\t\t\tint rows = prjs.size();\n\t\t\t\n\t\t\tObject[][] data = null;\n\t\t\tString[] colNames = null;\n\t\t\tObject[] delOpt = new Object[rows];\n\t\t\t\n\t\t\tif(rows > 0) {\n\t\t\t\tif(prjs.get(0) instanceof OngoingProject) {\n\t\t\t\t\tdata = new Object[rows][ONGOING_COL_NAMES.length];\n\t\t\t\t\tcolNames = ONGOING_COL_NAMES;\n\t\t\t\t} else if(prjs.get(0) instanceof FinishedProject) {\n\t\t\t\t\tdata = new Object[rows][FINISHED_COL_NAMES.length];\n\t\t\t\t\tcolNames = FINISHED_COL_NAMES;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfor(int i=0;i<rows;i++) {\n\t\t\t\tdata[i] = prjs.get(i).toTable();\n\t\t\t\tdelOpt[i] = new Boolean(true);\n\t\t\t}\n\t\t\t\n\t\t\tsuper.setDataVector(data, (Object[]) colNames);\n\t\t\tthis.addColumn(\"\", delOpt);\n\t\t\t\t\t\n\t\t}",
"public void setDept(springboot_academic_system.department.DatabaseDepartment dept) {\n this.dept = dept;\n this.deptName = dept.getDeptName();\n }",
"public void setDepartment(Department department) {\n this.department = department;\n }",
"@Override\n\tpublic MenuModel getModel() {\n\t\treturn mm;\n\t}",
"public DebugTableModel() {\r\n }",
"public Produk() {\n initComponents();\n kosong();\n model = new DefaultTableModel();\n this.tbProduk.setModel(model);\n model.addColumn(\"ID\");\n model.addColumn(\"Kategori\");\n model.addColumn(\"Merk\");\n model.addColumn(\"Warna\");\n model.addColumn(\"Ukuran\");\n model.addColumn(\"Harga\");\n ambil_data_tabel();\n \n model2 = new DefaultTableModel ();\n tb_customer.setModel(model2);\n model2.addColumn(\"ID\");\n model2.addColumn(\"Nama\");\n model2.addColumn(\"Alamat\");\n model2.addColumn(\"Telepon\");\n getData();\n }",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n buttonGroup_Tipo_Pedido = new javax.swing.ButtonGroup();\n jPanel1 = new javax.swing.JPanel();\n jScrollPane1 = new javax.swing.JScrollPane();\n jTable_MaisPedidos = new javax.swing.JTable();\n jPanel2 = new javax.swing.JPanel();\n jScrollPane2 = new javax.swing.JScrollPane();\n jTable_MaisVendidas = new javax.swing.JTable();\n btn_Listar = new javax.swing.JButton();\n jLabel1 = new javax.swing.JLabel();\n txt_data_entrega = new javax.swing.JFormattedTextField();\n jCheckBox_PRIORIDADE = new javax.swing.JCheckBox();\n jPanel3 = new javax.swing.JPanel();\n jScrollPane3 = new javax.swing.JScrollPane();\n jTable_Cortado = new javax.swing.JTable();\n jRadioButton_div = new javax.swing.JRadioButton();\n jRadioButton_especial = new javax.swing.JRadioButton();\n jRadioButton_todos = new javax.swing.JRadioButton();\n jPanel4 = new javax.swing.JPanel();\n jScrollPane4 = new javax.swing.JScrollPane();\n jTable_Saldo = new javax.swing.JTable();\n jPanel5 = new javax.swing.JPanel();\n jScrollPane5 = new javax.swing.JScrollPane();\n jTable_Saldo_Montado = new javax.swing.JTable();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setTitle(\"CONSULTAR ORDEM DE CORTE\");\n setBounds(new java.awt.Rectangle(590, 0, 0, 0));\n\n jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(\"REF EM MAIS PEDIDOS\"));\n\n jTable_MaisPedidos.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null},\n {null, null, null},\n {null, null, null},\n {null, null, null}\n },\n new String [] {\n \"REF\", \"QTD_PEDIDOS\", \"PRIORIDADE\"\n }\n ));\n jScrollPane1.setViewportView(jTable_MaisPedidos);\n //ordenando cliacando nas tabelas\n jTable_MaisPedidos.setAutoCreateRowSorter(true);\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 218, javax.swing.GroupLayout.PREFERRED_SIZE)\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 296, Short.MAX_VALUE)\n );\n\n jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(\"REF MAIS VENDIDAS\"));\n\n jTable_MaisVendidas.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null},\n {null, null, null},\n {null, null, null},\n {null, null, null}\n },\n new String [] {\n \"REF\", \"TOTAL VENDIDO\", \"PRIORIDADE\"\n }\n ));\n jScrollPane2.setViewportView(jTable_MaisVendidas);\n if (jTable_MaisVendidas.getColumnModel().getColumnCount() > 0) {\n jTable_MaisVendidas.getColumnModel().getColumn(2).setHeaderValue(\"PRIORIDADE\");\n }\n //ordenando cliacando nas tabelas\n jTable_MaisVendidas.setAutoCreateRowSorter(true);\n\n javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);\n jPanel2.setLayout(jPanel2Layout);\n jPanel2Layout.setHorizontalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 220, javax.swing.GroupLayout.PREFERRED_SIZE)\n );\n jPanel2Layout.setVerticalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)\n );\n\n btn_Listar.setText(\"LISTAR\");\n btn_Listar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btn_ListarActionPerformed(evt);\n }\n });\n\n jLabel1.setText(\"DATA DE ENTREGA:\");\n\n try {\n txt_data_entrega.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter(\"##/##/####\")));\n } catch (java.text.ParseException ex) {\n ex.printStackTrace();\n }\n\n jCheckBox_PRIORIDADE.setText(\"PRIORIDADE\");\n jCheckBox_PRIORIDADE.setEnabled(false);\n jCheckBox_PRIORIDADE.setFocusable(false);\n\n jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(\"REF CORTADO\"));\n\n jTable_Cortado.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null},\n {null, null},\n {null, null},\n {null, null}\n },\n new String [] {\n \"REF\", \"TOTAL CORTADO\"\n }\n ));\n jScrollPane3.setViewportView(jTable_Cortado);\n //ordenando cliacando nas tabelas\n jTable_Cortado.setAutoCreateRowSorter(true);\n\n javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);\n jPanel3.setLayout(jPanel3Layout);\n jPanel3Layout.setHorizontalGroup(\n jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 220, javax.swing.GroupLayout.PREFERRED_SIZE)\n );\n jPanel3Layout.setVerticalGroup(\n jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)\n );\n\n buttonGroup_Tipo_Pedido.add(jRadioButton_div);\n jRadioButton_div.setSelected(true);\n jRadioButton_div.setText(\"DIV\");\n\n buttonGroup_Tipo_Pedido.add(jRadioButton_especial);\n jRadioButton_especial.setText(\"ESPECIAL\");\n\n buttonGroup_Tipo_Pedido.add(jRadioButton_todos);\n jRadioButton_todos.setText(\"TODOS\");\n\n jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(\"SALDO VENDA - CORTE\"));\n\n jTable_Saldo.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null},\n {null, null},\n {null, null},\n {null, null}\n },\n new String [] {\n \"REF\", \"SALDO\"\n }\n ));\n jScrollPane4.setViewportView(jTable_Saldo);\n //ordenando cliacando nas tabelas\n jTable_Saldo.setAutoCreateRowSorter(true);\n\n javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);\n jPanel4.setLayout(jPanel4Layout);\n jPanel4Layout.setHorizontalGroup(\n jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 220, javax.swing.GroupLayout.PREFERRED_SIZE)\n );\n jPanel4Layout.setVerticalGroup(\n jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 296, Short.MAX_VALUE)\n );\n\n jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(\"SALDO VENDA - MONTADO\"));\n\n jTable_Saldo_Montado.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null},\n {null, null},\n {null, null},\n {null, null}\n },\n new String [] {\n \"REF\", \"SALDO\"\n }\n ));\n jScrollPane5.setViewportView(jTable_Saldo_Montado);\n\n javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);\n jPanel5.setLayout(jPanel5Layout);\n jPanel5Layout.setHorizontalGroup(\n jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 220, javax.swing.GroupLayout.PREFERRED_SIZE)\n );\n jPanel5Layout.setVerticalGroup(\n jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jRadioButton_div)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jRadioButton_especial)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jRadioButton_todos))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel1)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(txt_data_entrega, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jCheckBox_PRIORIDADE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(btn_Listar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel1)\n .addComponent(txt_data_entrega, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(btn_Listar)\n .addComponent(jCheckBox_PRIORIDADE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jRadioButton_div)\n .addComponent(jRadioButton_todos)\n .addComponent(jRadioButton_especial))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jPanel3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))\n );\n\n jCheckBox_PRIORIDADE.setVisible(false);\n\n pack();\n }"
] | [
"0.6784922",
"0.6742098",
"0.66929495",
"0.5928076",
"0.58705956",
"0.5848291",
"0.58359706",
"0.5803542",
"0.57672024",
"0.576508",
"0.5762371",
"0.57432014",
"0.57335985",
"0.57211965",
"0.57180965",
"0.5709673",
"0.56549037",
"0.56547934",
"0.5640543",
"0.563881",
"0.5633337",
"0.5627214",
"0.56211627",
"0.5621034",
"0.56158644",
"0.5612266",
"0.5612248",
"0.5609042",
"0.55913484",
"0.55868185",
"0.55424947",
"0.55085593",
"0.550805",
"0.54999924",
"0.5499777",
"0.54966295",
"0.5494903",
"0.5491043",
"0.5489641",
"0.54859775",
"0.5477906",
"0.547323",
"0.5459932",
"0.5457472",
"0.5455091",
"0.5442821",
"0.5428426",
"0.54210037",
"0.5417072",
"0.5414765",
"0.5414649",
"0.54045343",
"0.54013145",
"0.5400934",
"0.53980905",
"0.53978246",
"0.53934735",
"0.53925085",
"0.53894603",
"0.5385347",
"0.5384712",
"0.5381726",
"0.5380726",
"0.53761643",
"0.53736055",
"0.53725123",
"0.53725123",
"0.53722686",
"0.5365412",
"0.5364958",
"0.5363314",
"0.53588665",
"0.5358042",
"0.53571355",
"0.535362",
"0.5353598",
"0.5353462",
"0.5353127",
"0.53526837",
"0.5352045",
"0.53391606",
"0.5332627",
"0.5330417",
"0.5330067",
"0.5327651",
"0.53222805",
"0.532144",
"0.5306813",
"0.5303738",
"0.52947825",
"0.5291347",
"0.52896535",
"0.5285728",
"0.52823204",
"0.5281139",
"0.527853",
"0.52784276",
"0.5270991",
"0.52653",
"0.52652514",
"0.5265039"
] | 0.0 | -1 |
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor. | @SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
idLabel = new javax.swing.JLabel();
nameLabel = new javax.swing.JLabel();
idField = new javax.swing.JTextField();
nameField = new javax.swing.JTextField();
saveButton = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jSeparator1 = new javax.swing.JSeparator();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
jLabel5 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
idLabel.setFont(new java.awt.Font("Tahoma", 0, 13)); // NOI18N
idLabel.setText("Department ID");
nameLabel.setFont(new java.awt.Font("Tahoma", 0, 13)); // NOI18N
nameLabel.setText("Department Name");
saveButton.setText("Save");
saveButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
saveButtonActionPerformed(evt);
}
});
jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/logo.png"))); // NOI18N
jLabel2.setFont(new java.awt.Font("Tahoma", 0, 22)); // NOI18N
jLabel2.setText("Department Master");
jLabel3.setText("FORM");
jLabel4.setFont(new java.awt.Font("Tahoma", 2, 11)); // NOI18N
jLabel4.setText("insert new department's data below");
jButton1.setText("View");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jLabel5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/corner.png"))); // NOI18N
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel3)
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap(15, Short.MAX_VALUE)
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 181, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 266, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(61, 61, 61)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(idLabel)
.addComponent(nameLabel))
.addGap(26, 26, 26)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(nameField, javax.swing.GroupLayout.PREFERRED_SIZE, 185, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(idField, javax.swing.GroupLayout.PREFERRED_SIZE, 185, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(saveButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton1)))
.addGap(0, 0, Short.MAX_VALUE)))
.addContainerGap())
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(jLabel5))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel1)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(jLabel3)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel4)
.addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(idLabel)
.addComponent(idField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(nameLabel)
.addComponent(nameField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(saveButton)
.addComponent(jButton1))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel5))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGap(0, 0, 0))
);
pack();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Form() {\n initComponents();\n }",
"public MainForm() {\n initComponents();\n }",
"public MainForm() {\n initComponents();\n }",
"public MainForm() {\n initComponents();\n }",
"public frmRectangulo() {\n initComponents();\n }",
"public form() {\n initComponents();\n }",
"public AdjointForm() {\n initComponents();\n setDefaultCloseOperation(HIDE_ON_CLOSE);\n }",
"public FormListRemarking() {\n initComponents();\n }",
"public MainForm() {\n initComponents();\n \n }",
"public FormPemilihan() {\n initComponents();\n }",
"public GUIForm() { \n initComponents();\n }",
"public FrameForm() {\n initComponents();\n }",
"public TorneoForm() {\n initComponents();\n }",
"public FormCompra() {\n initComponents();\n }",
"public muveletek() {\n initComponents();\n }",
"public Interfax_D() {\n initComponents();\n }",
"public quanlixe_form() {\n initComponents();\n }",
"public SettingsForm() {\n initComponents();\n }",
"public RegistrationForm() {\n initComponents();\n this.setLocationRelativeTo(null);\n }",
"public Soru1() {\n initComponents();\n }",
"public FMainForm() {\n initComponents();\n this.setResizable(false);\n setLocationRelativeTo(null);\n }",
"public soal2GUI() {\n initComponents();\n }",
"public EindopdrachtGUI() {\n initComponents();\n }",
"public MechanicForm() {\n initComponents();\n }",
"public AddDocumentLineForm(java.awt.Frame parent) {\n super(parent);\n initComponents();\n myInit();\n }",
"public BloodDonationGUI() {\n initComponents();\n }",
"public quotaGUI() {\n initComponents();\n }",
"public Customer_Form() {\n initComponents();\n setSize(890,740);\n \n \n }",
"public PatientUI() {\n initComponents();\n }",
"public myForm() {\n\t\t\tinitComponents();\n\t\t}",
"public Oddeven() {\n initComponents();\n }",
"public intrebarea() {\n initComponents();\n }",
"public Magasin() {\n initComponents();\n }",
"public RadioUI()\n {\n initComponents();\n }",
"public NewCustomerGUI() {\n initComponents();\n }",
"public ZobrazUdalost() {\n initComponents();\n }",
"public FormUtama() {\n initComponents();\n }",
"public p0() {\n initComponents();\n }",
"public INFORMACION() {\n initComponents();\n this.setLocationRelativeTo(null); \n }",
"public ProgramForm() {\n setLookAndFeel();\n initComponents();\n }",
"public AmountReleasedCommentsForm() {\r\n initComponents();\r\n }",
"public form2() {\n initComponents();\n }",
"public MainForm() {\n\t\tsuper(\"Hospital\", List.IMPLICIT);\n\n\t\tstartComponents();\n\t}",
"public LixeiraForm() {\n initComponents();\n setLocationRelativeTo(null);\n }",
"public kunde() {\n initComponents();\n }",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n setRequestFocusEnabled(false);\n setVerifyInputWhenFocusTarget(false);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 465, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 357, Short.MAX_VALUE)\n );\n }",
"public MusteriEkle() {\n initComponents();\n }",
"public frmMain() {\n initComponents();\n }",
"public frmMain() {\n initComponents();\n }",
"public DESHBORDPANAL() {\n initComponents();\n }",
"public GUIForm() {\n initComponents();\n inputField.setText(NO_FILE_SELECTED);\n outputField.setText(NO_FILE_SELECTED);\n progressLabel.setBackground(INFO);\n progressLabel.setText(SELECT_FILE);\n }",
"public frmVenda() {\n initComponents();\n }",
"public Botonera() {\n initComponents();\n }",
"public FrmMenu() {\n initComponents();\n }",
"public OffertoryGUI() {\n initComponents();\n setTypes();\n }",
"public JFFornecedores() {\n initComponents();\n }",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setBackground(new java.awt.Color(255, 255, 255));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 983, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 769, Short.MAX_VALUE)\n );\n\n pack();\n }",
"public EnterDetailsGUI() {\n initComponents();\n }",
"public vpemesanan1() {\n initComponents();\n }",
"public Kost() {\n initComponents();\n }",
"public FormHorarioSSE() {\n initComponents();\n }",
"public UploadForm() {\n initComponents();\n }",
"public frmacceso() {\n initComponents();\n }",
"public HW3() {\n initComponents();\n }",
"public Managing_Staff_Main_Form() {\n initComponents();\n }",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n getContentPane().setLayout(null);\n\n pack();\n }",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n }",
"public sinavlar2() {\n initComponents();\n }",
"public P0405() {\n initComponents();\n }",
"public IssueBookForm() {\n initComponents();\n }",
"public MiFrame2() {\n initComponents();\n }",
"public Choose1() {\n initComponents();\n }",
"public MainForm() {\n initComponents();\n\n String oldAuthor = prefs.get(\"AUTHOR\", \"\");\n if(oldAuthor != null) {\n this.authorTextField.setText(oldAuthor);\n }\n String oldBook = prefs.get(\"BOOK\", \"\");\n if(oldBook != null) {\n this.bookTextField.setText(oldBook);\n }\n String oldDisc = prefs.get(\"DISC\", \"\");\n if(oldDisc != null) {\n try {\n int oldDiscNum = Integer.parseInt(oldDisc);\n oldDiscNum++;\n this.discNumberTextField.setText(Integer.toString(oldDiscNum));\n } catch (Exception ex) {\n this.discNumberTextField.setText(oldDisc);\n }\n this.bookTextField.setText(oldBook);\n }\n\n\n }",
"public GUI_StudentInfo() {\n initComponents();\n }",
"public Lihat_Dokter_Keseluruhan() {\n initComponents();\n }",
"public JFrmPrincipal() {\n initComponents();\n }",
"public bt526() {\n initComponents();\n }",
"public Pemilihan_Dokter() {\n initComponents();\n }",
"public Ablak() {\n initComponents();\n }",
"@Override\n\tprotected void initUi() {\n\t\t\n\t}",
"@SuppressWarnings(\"unchecked\")\n\t// <editor-fold defaultstate=\"collapsed\" desc=\"Generated\n\t// Code\">//GEN-BEGIN:initComponents\n\tprivate void initComponents() {\n\n\t\tlabel1 = new java.awt.Label();\n\t\tlabel2 = new java.awt.Label();\n\t\tlabel3 = new java.awt.Label();\n\t\tlabel4 = new java.awt.Label();\n\t\tlabel5 = new java.awt.Label();\n\t\tlabel6 = new java.awt.Label();\n\t\tlabel7 = new java.awt.Label();\n\t\tlabel8 = new java.awt.Label();\n\t\tlabel9 = new java.awt.Label();\n\t\tlabel10 = new java.awt.Label();\n\t\ttextField1 = new java.awt.TextField();\n\t\ttextField2 = new java.awt.TextField();\n\t\tlabel14 = new java.awt.Label();\n\t\tlabel15 = new java.awt.Label();\n\t\tlabel16 = new java.awt.Label();\n\t\ttextField3 = new java.awt.TextField();\n\t\ttextField4 = new java.awt.TextField();\n\t\ttextField5 = new java.awt.TextField();\n\t\tlabel17 = new java.awt.Label();\n\t\tlabel18 = new java.awt.Label();\n\t\tlabel19 = new java.awt.Label();\n\t\tlabel20 = new java.awt.Label();\n\t\tlabel21 = new java.awt.Label();\n\t\tlabel22 = new java.awt.Label();\n\t\ttextField6 = new java.awt.TextField();\n\t\ttextField7 = new java.awt.TextField();\n\t\ttextField8 = new java.awt.TextField();\n\t\tlabel23 = new java.awt.Label();\n\t\ttextField9 = new java.awt.TextField();\n\t\ttextField10 = new java.awt.TextField();\n\t\ttextField11 = new java.awt.TextField();\n\t\ttextField12 = new java.awt.TextField();\n\t\tlabel24 = new java.awt.Label();\n\t\tlabel25 = new java.awt.Label();\n\t\tlabel26 = new java.awt.Label();\n\t\tlabel27 = new java.awt.Label();\n\t\tlabel28 = new java.awt.Label();\n\t\tlabel30 = new java.awt.Label();\n\t\tlabel31 = new java.awt.Label();\n\t\tlabel32 = new java.awt.Label();\n\t\tjButton1 = new javax.swing.JButton();\n\n\t\tlabel1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel1.setText(\"It seems that some of the buttons on the ATM machine are not working!\");\n\n\t\tlabel2.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel2.setText(\"Unfortunately these numbers are exactly what Professor has to use to type in his password.\");\n\n\t\tlabel3.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel3.setText(\n\t\t\t\t\"If you want to eat tonight, you have to help him out and construct the numbers of the password with the working buttons and math operators.\");\n\n\t\tlabel4.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tlabel4.setText(\"Denver's Password: 2792\");\n\n\t\tlabel5.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel5.setText(\"import java.util.Scanner;\\n\");\n\n\t\tlabel6.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel6.setText(\"public class ATM{\");\n\n\t\tlabel7.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel7.setText(\"public static void main(String[] args){\");\n\n\t\tlabel8.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel8.setText(\"System.out.print(\");\n\n\t\tlabel9.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel9.setText(\" -\");\n\n\t\tlabel10.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel10.setText(\");\");\n\n\t\ttextField1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\ttextField1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tlabel14.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel14.setText(\"System.out.print( (\");\n\n\t\tlabel15.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel15.setText(\"System.out.print(\");\n\n\t\tlabel16.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel16.setText(\"System.out.print( ( (\");\n\n\t\tlabel17.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel17.setText(\")\");\n\n\t\tlabel18.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel18.setText(\" +\");\n\n\t\tlabel19.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel19.setText(\");\");\n\n\t\tlabel20.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel20.setText(\" /\");\n\n\t\tlabel21.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel21.setText(\" %\");\n\n\t\tlabel22.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel22.setText(\" +\");\n\n\t\tlabel23.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel23.setText(\");\");\n\n\t\tlabel24.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel24.setText(\" +\");\n\n\t\tlabel25.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel25.setText(\" /\");\n\n\t\tlabel26.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel26.setText(\" *\");\n\n\t\tlabel27.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));\n\t\tlabel27.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel27.setText(\")\");\n\n\t\tlabel28.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel28.setText(\")\");\n\n\t\tlabel30.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel30.setText(\"}\");\n\n\t\tlabel31.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel31.setText(\"}\");\n\n\t\tlabel32.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel32.setText(\");\");\n\n\t\tjButton1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tjButton1.setText(\"Check\");\n\t\tjButton1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\tjButton1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tjavax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n\t\tlayout.setHorizontalGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(28).addGroup(layout\n\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING).addComponent(getDoneButton()).addComponent(jButton1)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, 774, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addGap(92).addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15, GroupLayout.PREFERRED_SIZE, 145,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(2)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(37))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(174)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(7)))\n\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label23, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20).addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(23).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel10, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16, GroupLayout.PREFERRED_SIZE, 177,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));\n\t\tlayout.setVerticalGroup(\n\t\t\t\tlayout.createParallelGroup(Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap()\n\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup().addGroup(layout.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(19)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(78)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(76)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(75)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tShort.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(27))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel23,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(29)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))))\n\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t.addGap(30)\n\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(25)\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(26).addComponent(jButton1).addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(getDoneButton()).addContainerGap(23, Short.MAX_VALUE)));\n\t\tthis.setLayout(layout);\n\n\t\tlabel16.getAccessibleContext().setAccessibleName(\"System.out.print( ( (\");\n\t\tlabel17.getAccessibleContext().setAccessibleName(\"\");\n\t\tlabel18.getAccessibleContext().setAccessibleName(\" +\");\n\t}",
"public Pregunta23() {\n initComponents();\n }",
"public FormMenuUser() {\n super(\"Form Menu User\");\n initComponents();\n }",
"public AvtekOkno() {\n initComponents();\n }",
"public busdet() {\n initComponents();\n }",
"public ViewPrescriptionForm() {\n initComponents();\n }",
"public Ventaform() {\n initComponents();\n }",
"public Kuis2() {\n initComponents();\n }",
"public CreateAccount_GUI() {\n initComponents();\n }",
"public POS1() {\n initComponents();\n }",
"public Carrera() {\n initComponents();\n }",
"public EqGUI() {\n initComponents();\n }",
"public JFriau() {\n initComponents();\n this.setLocationRelativeTo(null);\n this.setTitle(\"BuNus - Budaya Nusantara\");\n }",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setBackground(new java.awt.Color(204, 204, 204));\n setMinimumSize(new java.awt.Dimension(1, 1));\n setPreferredSize(new java.awt.Dimension(760, 402));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 750, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n }",
"public nokno() {\n initComponents();\n }",
"public dokter() {\n initComponents();\n }",
"public ConverterGUI() {\n initComponents();\n }",
"public hitungan() {\n initComponents();\n }",
"public Modify() {\n initComponents();\n }",
"public frmAddIncidencias() {\n initComponents();\n }",
"public FP_Calculator_GUI() {\n initComponents();\n \n setVisible(true);\n }"
] | [
"0.73191476",
"0.72906625",
"0.72906625",
"0.72906625",
"0.72860986",
"0.7248112",
"0.7213479",
"0.72078276",
"0.7195841",
"0.71899796",
"0.71840525",
"0.7158498",
"0.71477973",
"0.7092748",
"0.70800966",
"0.70558053",
"0.69871384",
"0.69773406",
"0.69548076",
"0.69533914",
"0.6944929",
"0.6942576",
"0.69355655",
"0.6931378",
"0.6927896",
"0.69248974",
"0.6924723",
"0.69116884",
"0.6910487",
"0.6892381",
"0.68921053",
"0.6890637",
"0.68896896",
"0.68881863",
"0.68826133",
"0.68815064",
"0.6881078",
"0.68771756",
"0.6875212",
"0.68744373",
"0.68711984",
"0.6858978",
"0.68558776",
"0.6855172",
"0.6854685",
"0.685434",
"0.68525875",
"0.6851834",
"0.6851834",
"0.684266",
"0.6836586",
"0.6836431",
"0.6828333",
"0.68276715",
"0.68262815",
"0.6823921",
"0.682295",
"0.68167603",
"0.68164384",
"0.6809564",
"0.68086857",
"0.6807804",
"0.6807734",
"0.68067646",
"0.6802192",
"0.67943805",
"0.67934304",
"0.6791657",
"0.6789546",
"0.6789006",
"0.67878324",
"0.67877173",
"0.6781847",
"0.6765398",
"0.6765197",
"0.6764246",
"0.6756036",
"0.6755023",
"0.6751404",
"0.67508715",
"0.6743043",
"0.67387456",
"0.6736752",
"0.67356426",
"0.6732893",
"0.6726715",
"0.6726464",
"0.67196447",
"0.67157453",
"0.6714399",
"0.67140275",
"0.6708251",
"0.6707117",
"0.670393",
"0.6700697",
"0.66995865",
"0.66989213",
"0.6697588",
"0.66939527",
"0.66908985",
"0.668935"
] | 0.0 | -1 |
Basic Operation > Get number of integers in myList: my_get_length | public <T> int my_get_length(int index) throws myException{
int count = 0;
myNode current = null;
while(!current.getInfo()){
current.getLeft();
count++;
}
for(int i = 0; i < count; i++) {
this.push(current.setInfo(i));
}
return count;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int length()\n {\n if(integerList == null)\n return 0;\n else\n return integerList.length;\n }",
"public int size(){\n\t\tListUtilities start = this.returnToStart();\n\t\tint count = 1;\n\t\twhile(start.nextNum != null){\n\t\t\tcount++;\n\t\t\tstart = start.nextNum;\n\t\t}\n\t\treturn count;\n\t}",
"@Test\n public void getSizeOfList() {\n List<Integer> list = new ArrayList<>();\n list.add(1);\n list.add(2);\n list.add(3);\n list.add(4);\n\n assertEquals(4, list.size());\n }",
"int getListSize(int list) {\n\t\treturn m_lists.getField(list, 4);\n\t}",
"int getListCount();",
"public static int listLength( IntNode head ) {\r\n\t\tint answer = 0;\r\n\t\tfor (IntNode cursor = head; cursor != null; cursor = cursor.link) {\r\n\t\t\tanswer++;\r\n\t\t}\r\n\t\treturn answer;\r\n\t}",
"public int len() {\n\t\tint i = 0;\n\t\tif(stringList != null) {\n\t\t\tIterator iterator = stringList.iterator();\n\t\t\twhile(iterator.hasNext()) {\n\t\t\t\titerator.next();\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\t\treturn i;\n\t}",
"public int size() {\n//\t\tint rtn = 0;\n//\t\tfor (ListNode p = myHead; p != null; p = p.myNext) {\n//\t\t\trtn++;\t\n//\t\t}\n//\t\treturn rtn;\n\t\treturn mySize;\n\t}",
"int length() {\n return this.myArrayList.size();\n }",
"public static <AnyType> int listSize(LinkedList<AnyType> theList) {\n LinkedListIterator<AnyType> itr;\n int size = 0;\n\n for (itr = theList.first(); itr.isValid(); itr.advance()) {\n size++;\n }\n\n return size;\n }",
"public int ListLength(){\n int j = 0;\n // Get index of the first element with value\n int i = StaticLinkList[MAXSIZE-1].cur;\n while (i!=0)\n {\n i = StaticLinkList[i].cur;\n j++;\n }\n return j;\n }",
"public int getSize(){\n\t\tint size = list.size();\n\t\treturn size;\n\n\t}",
"public int listSize(){\r\n return counter;\r\n }",
"Long getNumberOfElement();",
"public int size() {\n\t\tint numElements = 0;\n\t\tfor (int i = 0; i < this.size; i++) {\n\t\t\tif (list[i] != null) {\n\t\t\t\tnumElements++;\n\t\t\t}\n\t\t}\n\t\treturn numElements;\n\t}",
"private int sizeOfList(Student [] list) {\r\n\t\t\r\n\t\tint size = 0;\r\n\t\tStudent sizechecker;\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\twhile (true) {\r\n\t\t\t\t\r\n\t\t\t\tsizechecker = list[size];\r\n\t\t\t\tsize++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e) { \r\n\t\t \r\n\t\t}\r\n\t\t\r\n\t\treturn size;\r\n\t}",
"@Contract(pure = true)\n public static <E> int listLength(Node<E> head) {\n Node<E> cursor;\n int answer;\n\n answer = 0;\n for (cursor = head; cursor != null; cursor = cursor.getNext()) { answer++; }\n return answer;\n }",
"public int size() {\n int counter = 1;\n Lista iter = new Lista(this);\n while (iter.next != null) {\n iter = iter.next;\n counter += 1;\n }\n return counter;\n }",
"public int size()\n\t{\n\t\treturn list.size();\n\t}",
"public int size()\n\t{\n\t\treturn list.size();\n\t}",
"Integer size();",
"Integer size();",
"public int size() {\n\t return list.size();\n }",
"public int size(){\n\t\treturn list.size();\n\t}",
"public int size(){\n\t\treturn list.size();\n\t}",
"public static <C> int LENGTH(LIST<C> L) {\n if ( isNull( L ) ) {\n return 0;\n }\n return L.list.size();\n }",
"public int size() {\n\t\tint rtn = 0;\n\t\tfor (ListNode p = myHead; p != null; p = p.myNext) {\n\t\t\trtn++;\n\t\t}\n\t\tthis.mySize = rtn;\n\t\treturn rtn;\n\t}",
"public int size() {\n\t\treturn list.size();\n\t}",
"public int size()\n {\n return list.size();\n }",
"public int size(){\n return list.size();\n }",
"public static int length(Object value) {\n\t\tif (isList(value)) {\n\t\t\treturn Array.getLength(value);\n\t\t}\n\t\treturn 0;\n\t}",
"@Override\n public int size() {\n\n Node nodePointer = listHead;\n int size = 0;\n while (nodePointer != null) {\n size += 1;\n nodePointer = nodePointer.next;\n }\n return size;\n }",
"public int size()\n { \t\n \t//initialize a counter to measure the size of the list\n int sizeVar = 0;\n //create local node variable to update in while loop\n LinkedListNode<T> localNode = getFirstNode();\n \n //update counter while there are still nodes\n while(localNode != null)\n {\n sizeVar += 1;\n localNode = localNode.getNext();\n }\n \n return sizeVar;\n }",
"public int getSize() \r\n {\r\n return list.size();\r\n }",
"public int size()\n\t{\n\t\treturn listSize;\n\t}",
"public int size() {\n return list.size();\n }",
"public int size(){\n\n \treturn list.size();\n\n }",
"public org.python.types.Int __len__();",
"public int sizeOf();",
"public int getSize() {\n return list.size();\n }",
"public int getListSize() {\n return listSize;\n }",
"public int length(){\r\n int counter = 0;\r\n ListNode c = head;\r\n while(c != null){\r\n c = c.getLink();\r\n counter++;\r\n }\r\n return counter;\r\n }",
"public int getSize()\n\t{\n\t\t// returns n, the number of strings in the list: O(n).\n\t\tint count = 0;\n \t\tnode p = head; \n\t\twhile (p != null)\n \t\t{\n \t\tcount ++;\n \t\tp = p.next;\n \t\t}\n \t\treturn count;\n\t}",
"public int getListCount() {\n return list_.size();\n }",
"public int length(){\n\t\tint length = 0;\n\t\tListNode temp = firstNode;\n\t\twhile(temp!=null){\n\t\t\tlength++;\n\t\t\ttemp = temp.getNextNode();\n\t\t}\n\n\t\treturn length;\n\t}",
"@Override\n\tpublic int size() {\n\t\t\n\t\treturn list.size();\n\t}",
"int getNumItems();",
"public int getMaxListLength();",
"public abstract Integer getNumberOfElements();",
"long size();",
"long size();",
"long size();",
"long size();",
"public int size() {\n return list.size();\n }",
"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}",
"public int size(){\n\t\tListMapEntry temp = first;\n\t\tint c=0;\n\t\twhile(temp!=null){\n\t\t\tc++;\n\t\t\ttemp = temp.getNext();\n\t\t}\n\t\treturn c;\n\t}",
"public int size()\n {\n if(_list!=null)\n return _list.size();\n return 0;\n }",
"public int getNumberOfElements();",
"public int getSizeList(){\r\n\t\tint size;\r\n\t\tif (arrayWordsList != null )\r\n\t\t\tsize = arrayWordsList.length;\r\n\t\telse\r\n\t\t\tsize = 0;\r\n\t\t\r\n\t\treturn size;\r\n\t}",
"public int getListCount() {\n return list_.size();\n }",
"public int length() {\n\n\t\treturn numItems;\n\n\t}",
"int getItemsCount();",
"int getItemsCount();",
"@Test\r\n\tvoid testSize2() {\r\n\t\tSimpleList test = new SimpleList();\r\n\t\ttest.append(1);\r\n\t\ttest.append(2);\r\n\t\ttest.append(3);\r\n\t\ttest.append(4);\r\n\t\ttest.append(5);\r\n\t\ttest.append(6);\r\n\t\ttest.append(7);\r\n\t\ttest.append(8);\r\n\t\ttest.append(9);\r\n\t\ttest.append(10);\r\n\t\ttest.append(11);\r\n\t\tint output = test.size();\r\n\t\tassertEquals(15, output);\r\n\t}",
"public synchronized int size(){\n return list.size();\n }",
"public int get_size();",
"public int get_size();",
"public int size() {\n ListNode current = front;\n int size = 0;\n while (current != null) {\n size += 1;\n current = current.next;\n }\n return size;\n }",
"public int length() {\n int ret_val = 1;\n LinkedList i = this;\n\n while (i.next != null) {\n i = i.next;\n ret_val++;\n }\n return ret_val;\n }",
"static int getCapacity(List al) throws Exception {\n Field field = ArrayList.class.getDeclaredField(\"elementData\");\n field.setAccessible(true);\n return ((Object[]) field.get(al)).length;\n }",
"int size()\n\t{\n\t\t//Get the reference of the head of the Linked list\n\t\tNode ref = head;\n\t\t\n\t\t//Initialize the counter to -1\n\t\tint count = -1;\n\t\t\n\t\t//Count the number of elements of the Linked List\n\t\twhile(ref != null)\n\t\t{\n\t\t\tcount++;\n\t\t\tref = ref.next;\n\t\t}\n\t\t\n\t\t//Return the number of elements as the size of the Linked List\n\t\treturn count;\n\t}",
"public int getSize () {\n return this.list.size();\n }",
"@Override\n public int size() {\n return list.size();\n }",
"public int size(){\n int size = 0;\n for(LinkedList<E> item : this.data){\n size += item.size();\n }\n return size;\n }",
"public int length() {\n return numberOfItems;\n }",
"public int findLength(ListNode head){\n\n int len = 0;\n ListNode curr = head;\n while(curr != null){\n curr = curr.next;\n len++;\n }\n\n return len;\n }",
"public int getNumberOfEntries();",
"public int getSize()\n {\n return pList.size();\n }",
"@Test\r\n\tvoid testCount() {\r\n\t\tSimpleList test = new SimpleList();\r\n\t\ttest.add(7);\r\n\t\ttest.add(10);\r\n\t\ttest.add(9);\r\n\t\tint output = test.count();\r\n\t\tassertEquals(3, output);\r\n\t}",
"public int size() {\r\n if (NumItems > Integer.MAX_VALUE) {\r\n return Integer.MAX_VALUE;\r\n }\r\n return NumItems;\r\n }",
"private int kiemtrasopt (List list){\n int dem = list.size();\n return dem;\n }",
"int getIdsCount();",
"public int size() {\n\t\tint count = 0;\n\t\tListNode current = front;\n\t\twhile (current != null) {\n\t\t\tcurrent = current.next;\n\t\t\tcount++;\n\t\t}\n\t\treturn count;\n\t}",
"public int numItemInList() {\n return nextindex - startIndex;\n }",
"@Override\n\tpublic int getSize()\n\t{\n\t\treturn list.size();\n\t}",
"public int size() {\n\t\tint size = 0;\n\t\tfor (List<?> list : lists) size += list.size();\n\t\treturn size;\n\t}",
"@Override\n public int size() {\n if(isEmpty()){ //if list is empty, size is 0\n return 0;\n }\n /*int size = 1; //if list is not empty, then we have at least one element in it\n DLNode<T> current = last; //a reference, pointing to the last element\n while(current.prev != null){\n current = current.prev;\n size++;\n }*/\n \n int count = 0;\n DLNode<T> p = first;\n while (p != null){\n count++;\n p = p.next;\n }\n //return size;\n return count;\n }",
"int getListSnIdCount();",
"public int int_length() {\n return int_size();\n }",
"public int length(){\n\t\tint cnt = 0;\n\t\tNode temp = this.head;\n\t\twhile(temp != null){\n\t\t\ttemp = temp.next;\n\t\t\tcnt++;\n\t\t}\n\t\treturn cnt;\n\t}",
"public int printLength(ListNode head) {\n\t\tif (head == null) {\n\t\t\tSystem.out.println(\"Empty List\");\n\t\t}\n\t\tint count = 0;\n\t\tListNode current = head;\n\t\twhile (current != null) {\n\t\t\tcurrent = current.next;\n\t\t\tcount++;\n\t\t}\n\t\t//System.out.println(\"Length of Linked List is : \" + count);\n\t\treturn count;\n\t}",
"public int size()\r\n {\r\n return nItems;\r\n }",
"public int getListSize() {\n return getRootNode().getItems().size();\n }",
"public int getLength() {\n return collection.size();\n }",
"private static int carCount(List<UsedCar> carList) {\n int i = 0;\n for (Car count : carList) {\n i++;\n }\n return i; // returns i+1 to accommodate for list starting at zero\n }",
"int getInCount();",
"public int size() {\n return lists.getSize();\n }",
"public int size();",
"public int size();",
"public int size();",
"public int size();"
] | [
"0.77141964",
"0.740894",
"0.7287384",
"0.7184048",
"0.71727693",
"0.71159214",
"0.7067542",
"0.6998058",
"0.6989763",
"0.69875705",
"0.6986345",
"0.6947774",
"0.6904299",
"0.68951005",
"0.6890195",
"0.6839519",
"0.6813864",
"0.6802476",
"0.67960405",
"0.67960405",
"0.67883116",
"0.67883116",
"0.67790824",
"0.6768017",
"0.6768017",
"0.6749696",
"0.6724562",
"0.6715627",
"0.67126006",
"0.6711868",
"0.6711355",
"0.67074656",
"0.66988254",
"0.66841424",
"0.6681706",
"0.66742164",
"0.6670343",
"0.6667596",
"0.66405886",
"0.66382265",
"0.6609418",
"0.6602319",
"0.65993124",
"0.65954447",
"0.6582929",
"0.6581291",
"0.6576719",
"0.6568928",
"0.6550699",
"0.6548398",
"0.6548398",
"0.6548398",
"0.6548398",
"0.6543337",
"0.65267813",
"0.650096",
"0.64982486",
"0.6494757",
"0.6476928",
"0.64721715",
"0.64659506",
"0.6454885",
"0.6454885",
"0.6449884",
"0.64464176",
"0.6434342",
"0.6434342",
"0.6432349",
"0.6430546",
"0.64270705",
"0.6421531",
"0.6420909",
"0.64205545",
"0.6404276",
"0.63983226",
"0.63981634",
"0.6384279",
"0.6380306",
"0.6375623",
"0.63716495",
"0.63688815",
"0.63543034",
"0.6348232",
"0.6345869",
"0.6344291",
"0.6343422",
"0.63415927",
"0.63259625",
"0.63032734",
"0.62931836",
"0.62918353",
"0.62908274",
"0.62886214",
"0.6284401",
"0.62737054",
"0.62714946",
"0.6271118",
"0.626497",
"0.626497",
"0.626497",
"0.626497"
] | 0.0 | -1 |
Basic Operation > Get integer of myList at a concrete index: my_get_element | public <T> Object my_get_element(int index) throws myException{
if (index < 0){
return null;
}
myNode current = null;
if (Lnode != null) {
current = Lnode.getLeft();
for (int i = 0; i < index; i++) {
if (current.getLeft() == null)
return null;
current = current.getLeft();
}
return current.getInfo();
}else{
current = Rnode.getRight();for (int i = 0; i < index; i++) {
if (current.getRight() == null)
return null;
current = current.getRight();
}
return current.getInfo();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"T getElementFromIndex(int index) throws ListException;",
"public Integer get(int index){\n return list.get(index);\n }",
"public int get(int index);",
"@Override\n\tpublic E get(int idx) {\n\t\tE element = null;\n\t\tif (idx < 0 || idx >= size)\n\t\t\tthrow new IndexOutOfBoundsException();\n\t\telement = list[idx];\n\t\treturn element;\n\t}",
"public int get(int i)\n {\n if(integerList != null)\n return integerList[i];\n else\n return -1;\n }",
"Object getElementAt(int index);",
"abstract int get(int index);",
"public long getElem(int index) {\r\n return a[index];\r\n }",
"public T getByIndex(int index) {\n\n return this.myList[index];\n }",
"int getIndexOfElement(T value);",
"@Override\n\tpublic E get(int i) {\n\t\tif (i < 0 || i >= this.numberOfElements) {\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\telse {\n\t\t\treturn this.arrayList[i];\n\t\t}\n\t}",
"E get(int i) throws IndexOutOfBoundsException;",
"@Override\n public int element() {\n isEmptyList();\n return first.value;\n }",
"public int get(int i) throws ArrayIndexOutOfBoundsException {\n if (i >= 0 && i < count) {\n return list[i];\n } else {\n throw new ArrayIndexOutOfBoundsException();\n }\n }",
"public E get(int i) {\n\t\tif (size == 0) {\n\t\t\tthrow new IllegalArgumentException(\"List is empty, cannot retrieve item.\");\n\t\t}\n\n\t\tif (i < 0 || i >= size) {\n\t\t\tthrow new IndexOutOfBoundsException(\"Requested index is out of bounds.\");\n\t\t}\n\n\t\treturn list[i];\n\n\t}",
"public int getIntLE(int index)\r\n/* 383: */ {\r\n/* 384:397 */ ensureAccessible();\r\n/* 385:398 */ return _getIntLE(index);\r\n/* 386: */ }",
"public E getElement(int index) {\t//O(1)\r\n\t\t//checks if the index is valid\r\n\t\tif (index>=0 && index<size)\r\n\t\t\treturn (E) list[index];\t//returns element at particular index\r\n\t\treturn null;\r\n\t}",
"private static void retriveElementInArrayList() {\n\t\tLinkedList<Integer> list = new LinkedList<Integer>();\n\t\tlist.add(10);\n\t\tlist.add(20);\n\t\tlist.add(30);\n\t\tlist.add(40);\n\t\tlist.add(50);\n\t\tSystem.out.println(\"LinkedList is : \" + list);\n\t\tSystem.out.println(list.get(3));\n\n\t}",
"int get(int idx);",
"@Override\n\tpublic Consultation getElementAt(int arg0) {\n\t\treturn listaConsultatii.get(arg0);\n\t}",
"public Object elementAt(int index);",
"public int getElementAtIndex(int index){\r\n return mArray[index];\r\n }",
"int getItem(int index);",
"E get( int index );",
"@Override\n public final Integer get(final int index) {\n if (!checkRange(index)) {\n throw new IndexOutOfBoundsException();\n } else {\n return arrayList[index];\n }\n }",
"public RTWElementRef getAsElement(int i);",
"Object get(int index);",
"Object get(int index);",
"public int getElementAt(int i)\n\t{\n\t\tint elem = 0;\n\t\tint index = -1;\n\t\tSinglyLinkedListNode nextNode = head;\n\t\tSinglyLinkedListNode prevNode = null;\n\t\tif((i < 0 || i >= size()))\n\t\t{\n\t\t\treturn -1;\n\t\t}\n\t\twhile(true)\n\t\t{\n\t\t\tindex = index + 1;\n\t\t\tif(index == i)\n\t\t\t{\n\t\t\t\telem = nextNode.getData();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tprevNode = nextNode;\n\t\t\t\tnextNode = prevNode.getNext();\n\t\t\t}\n\t\t}\t\t\n\t\treturn elem;\n\t}",
"public Item get(int i);",
"int getItems(int index);",
"public E get(int index) { \n return (E)list[index];\n }",
"public static int get(int indexInList, boolean useRankedList)\n\t{\n\t\tif (useRankedList)\n\t\t{\n\t\t\treturn indexInList;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn -1 - indexInList;\n\t\t}\n\t}",
"public Object get(int index);",
"public Object get(int index);",
"@Override\n\tpublic T get(int indice) {\n\t\tif (indice >= 0 && indice < tamanho) {\n\t\t\treturn elementosDaLista[indice];\n\t\t}\n\t\treturn null;\n\t}",
"public int getIndexOfElement(Object... value);",
"private static int getDigit(ArrayList<Integer> num, int index) {\n return index < num.size() ? num.get(index) : 0;\n }",
"public DomainElement elementForIndex(int index);",
"@Override\n public T get(int index) {\n return list.get(index);\n }",
"Object getArrayElement(int index);",
"Object getArrayElement(int index);",
"public Object elementAt(int n) {\r\n\t\treturn elements.get(n);\r\n\t}",
"Object get(int i);",
"public Object get(int i)\n {\n if(_list!=null)\n return _list.get(i);\n return null;\n }",
"public int getElementIndex(T content) throws IllegalArgumentException {\n throw new IllegalArgumentException(\"Methode getElementIndex: Dieses Objekt ist nicht in der Liste\");\n }",
"public T get(int i);",
"public E get(int index) {\n return this.elements[index];\n }",
"public int getIndex();",
"public int getIndex();",
"public int getIndex();",
"public int get(int index) {\n\t checkIndex(index);\n\t return elementData[index];\n\t }",
"@Override\r\n\tpublic T get(int index) {\n\t\treturn this._list.get(index);\r\n\t}",
"public T get(int index) {\n return this.list[index];\n }",
"public E get(int i) {\n\n\t if (i < 0 && i > num_elements)\n\t return null;\n\t \n\t return(elements[i]);\n\t }",
"@Test\n public void getByIndex(){\n List <String> list = new ArrayList<>();\n list.add(\"hola\");\n list.add(\"tdd\");\n list.add(\"test\");\n\n assertEquals(\"tdd\",list.get(1));\n }",
"@SuppressWarnings(\"unchecked\")\n public E get(int index) {\n checkIndex(index);\n return (E) list[index];\n }",
"public E get(int index) {\n\t\tif (index < 0 || index >= size()) {\n\t\t\tthrow new IndexOutOfBoundsException(\"Index is out of bounds\");\n\t\t} else {\n\t\t\treturn list[index];\n\t\t}\n\t}",
"int getFirst(int list) {\n\t\treturn m_lists.getField(list, 0);\n\t}",
"public T get(int index);",
"public T get(int index);",
"public T get(int index);",
"public T get(int aIndex);",
"int getPosition(Object elementID) throws Exception;",
"public Object get(int index) \r\n throws ListIndexOutOfBoundsException {\r\n\t\t\t\t\tif (index >= 0 && index <= numItems) { // If statement to catch out of bounds exception\r\n\t\t\t\t\t\t Node curr = head; // states curr is at head posistion\r\n\t\t\t\t\t\t for (int i = 1; i < index; i++) { // for loop to get to the current posistion that is equivelnt to i\r\n\t\t\t\t\t\t\t curr = curr.getNext();\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t return curr.getItem(); // returns item in current node\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t throw new ListIndexOutOfBoundsException (\"List index out of bounds\"); // else throws an index out of bounds exception\r\n\t\t\t\t\t}\r\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();",
"T get(int index);",
"T get(int index);",
"T get(int index);",
"T get(int index);",
"T get(int index);",
"public E get(int index)\r\n {\r\n checkValidIndex(index);\r\n return listIterator(index).next();\r\n }",
"public E get(int index);",
"public int index();",
"public int getElem(int n){\n return this._elems.get(n);\n }",
"private E getElement(int index) {\n if (index >= contents.size()) {\n return null;\n } else {\n return contents.get(index);\n }\n }",
"@SuppressWarnings(\"unchecked\")\n public T get(int i) {\n if (i < 0 || i >= size) // if there is no index i in list\n throw new IndexOutOfBoundsException(\"Treated index: \" + i + \" | Size of the Dynamic Array \" + size()); // cause IndexOutOfBoundException\n return (T) elements[i]; // return element with index i\n }",
"public abstract T get(int index);",
"int index();",
"public abstract E get(int index);",
"@Test\n public void elementLocationTestIterative() {\n int elementNumber = 3;\n System.out.println(nthToLastReturnIterative(list.getHead(), elementNumber).getElement());\n }",
"@Override\n public E element(int index)\n throws SequenceException {\n if (index < 0) {\n throw new SequenceException(\"Indexed Element out of Range\");\n }\n\n // We need to chain down the list until we reach the indexed\n // position\n\n Node nodePointer = listHead;\n int i = 0;\n while (i < index) {\n if (nodePointer.next == null) {\n throw new SequenceException(\"Indexed Element out of Range\");\n } else {\n nodePointer = nodePointer.next;\n i += 1;\n }\n }\n\n return nodePointer.datum;\n }",
"public int get(int index) {\n if (index < 0 || index > size) return -1;\n ListNode curr = head;\n for (int i = 0; i < index; i++) {\n curr = curr.next;\n }\n return curr.val;\n }",
"@Override\n public T get(int index){\n if(isEmpty() || index > size() || index < 0){//if list is empty or given index is invalid, provide error message\n throw new IndexOutOfBoundsException();\n }\n \n DLNode<T> current = first;//a reference pointing to the first node\n for (int i = 0; i < index; i++) {//find the required index using a loop\n current = current.next;\n }\n return current.elem;//return element at the specified index\n }",
"int getListSnId(int index);",
"public T get(int index) {\n return list.get(index);\n }",
"public int get(int index) {\n if (index >= this.size || index < 0) {\n return -1;\n }\n\n ListNode curr = this.head;\n\n for (int i = 0; i < index + 1; ++i) {\n curr = curr.next;\n }\n return curr.val;\n }",
"T get(int i);"
] | [
"0.75697213",
"0.73234695",
"0.70761216",
"0.6992229",
"0.69773835",
"0.6961875",
"0.68777096",
"0.6854547",
"0.683246",
"0.68111956",
"0.6780082",
"0.6737489",
"0.67043155",
"0.6692978",
"0.6626815",
"0.6604613",
"0.6578244",
"0.6563679",
"0.65628725",
"0.65546393",
"0.6542884",
"0.65113467",
"0.64957196",
"0.64760846",
"0.6475813",
"0.64740115",
"0.6473721",
"0.6473721",
"0.6463388",
"0.6462396",
"0.64616895",
"0.64577574",
"0.64529127",
"0.6448617",
"0.6448617",
"0.64459753",
"0.64245427",
"0.64044553",
"0.6399094",
"0.6376684",
"0.63761944",
"0.63761944",
"0.6372919",
"0.63655466",
"0.63605684",
"0.63553166",
"0.63527703",
"0.6347463",
"0.6332058",
"0.6332058",
"0.6332058",
"0.6331664",
"0.6321046",
"0.63105774",
"0.6308304",
"0.62954646",
"0.6284135",
"0.6281262",
"0.6276242",
"0.6275687",
"0.6275687",
"0.6275687",
"0.6274701",
"0.6264109",
"0.6252337",
"0.624946",
"0.624946",
"0.624946",
"0.624946",
"0.624946",
"0.624946",
"0.624946",
"0.624946",
"0.624946",
"0.624946",
"0.624946",
"0.624946",
"0.624946",
"0.62481755",
"0.62481755",
"0.62481755",
"0.62481755",
"0.62481755",
"0.6220525",
"0.6217764",
"0.6194382",
"0.619062",
"0.6186838",
"0.61800456",
"0.6159689",
"0.61569995",
"0.6156172",
"0.6156121",
"0.6153939",
"0.6151778",
"0.61511654",
"0.6150762",
"0.6149821",
"0.61331207",
"0.61285526"
] | 0.61438394 | 98 |
Basic Operation > Add integer to myList at a concrete index: my_add_element | public void my_add_element(int index,myNode T ,myNode newnode) throws myException{
if (Lnode == null) {
Lnode = new myNode(newnode);
}
myNode temp = new myNode(newnode);
myNode current = Lnode;
if (current != null ){
while(current.getLeft() != null){
current = current.getLeft();
}
current.setLeft(temp);
while(current.getRight() != null){
current = current.getRight();
}
current.setRight(temp);
}
counterNo++;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void add(int element);",
"void add(int index, Object element);",
"void add(int index, T element);",
"void add(int index, T element);",
"public abstract void add(T element, int index);",
"public void addElement(Integer e){\n list.add(e);\n }",
"public void addElement(Integer elem){\n\t\tlist.add(elem);\n\t}",
"void addAll(intList list, int index) throws IllegalAccessException;",
"public void add(int index, E element);",
"private void testAddAtIndex(){\n System.out.println(\"------ TESTING : add(int index, int element) ------\");\n try{\n // The insertion will add values to the front\n // the sequence should be iSize-1....,1,0\n for(int i = 0; i < iSize ; i++){\n if(!iTestList.add(0,i))\n throw new RuntimeException(\"FAILED -> add(index,element) not working correctly\");\n }\n // we should test the out of edge cases\n // if we try the following code and the return value is true or if the\n // program crashes then there is a problem\n if(iTestList.add(iSize+10, 999 )){\n throw new RuntimeException(\"FAILED -> index should not be > SIZE\");\n }\n if(iTestList.add(-2,999 )){\n throw new RuntimeException(\"FAILED -> index should not be < 0\");\n }\n }catch(Exception e){\n System.out.println(e.getMessage());\n }\n }",
"public void add(T element, int pos);",
"@Override\n\tpublic void add(int idx, E element) {\n\t\tif (element == null)\n\t\t\tthrow new NullPointerException();\n\t\tif (idx < 0 || idx > size())\n\t\t\tthrow new IndexOutOfBoundsException();\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tif (element.equals(list[i]))\n\t\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\t// Element is added to the end of the list\n\t\tif (idx == size)\n\t\t\tlist[idx] = element;\n\n\t\t// Element is added at the beginning or middle\n\t\telse {\n\t\t\tfor (int i = size; i > idx; i--) {\n\t\t\t\tlist[i] = list[i - 1];\n\t\t\t}\n\t\t\tlist[idx] = element;\n\t\t}\n\n\t\tsize++;\n\t\tif (size == list.length)\n\t\t\tgrowArray();\n\n\t}",
"int addElement(int list, int data) {\n\t\treturn insertElement(list, -1, data);\n\t}",
"@Override\n\tpublic void add(int index, Object e) throws IndexOutOfBoundsException\n\t{\n\t\t//just to check if the index is valid\n\t\tif ( index < 0 || index > size )\n \t\tthrow new IndexOutOfBoundsException();\n\t\t//check arraylist size\n\t\tif (size == myArray.length)\n\t\t\tresizeUp();\n\t\t//move all the proceeding elements to make room for the desired element\n\t\tfor ( int i = size; i > index; i-- )\n \t\tmyArray[i] = myArray[i-1];\n \t//plug the element\n\t\tmyArray[index] = e;\n \t++this.size;\n\n\t\t\n\t}",
"void add(int i , E e) throws IndexOutOfBoundsException;",
"void add(int i, E e) throws IndexOutOfBoundsException;",
"private static void addAtTest( int addAt\n , int value\n ) {\n list.add( addAt, value);\n System.out.println(\n \"insert \" + value\n + \" at position \" + addAt\n + \", resulting in \" + list.size() + \" elements:\"\n + System.lineSeparator()\n + list\n + System.lineSeparator()\n );\n }",
"public void add(int index, Type t);",
"public abstract void add(int index, E e);",
"public void add(int i, T t) {\n if (size == elements.length) // checks potential overflow\n ensureCapacity(); // increase capacity\n size++; // increment size of list\n if (i < 0 || i >= size) // if there is no index i in list\n throw new IndexOutOfBoundsException(\"Treated index: \" + i + \" | Size of the Dynamic Array \" + size()); // cause IndexOutOfBoundException\n for (int j = size - 1; j > i; j--) { // treat elements of list with indexes in range [i+1, n]\n elements[j] = elements[j - 1]; // element shifts to right\n }\n elements[i] = t; // store element at index i\n }",
"public void add(int index, Object value) {\n if (index > _size) {\n throw new ListIndexOutOfBoundsException(\"Error\");\n }\n ListNode node = new ListNode(value);\n if (index == 0) {\n node.next = start;\n start = node;\n } else {\n ListNode prev = start;\n for (int i = 0; i<index - 1; i++ ) {\n prev = prev.next;\n }\n ListNode temp = prev.next;\n prev.next = node;\n node.next = temp;\n } \n _size++;\n }",
"@Override\n public void add(int index, T t) {\n checkIfArrayFull();\n\n if(index >= arrayList.length) {\n System.out.println(\"The index is out of bounds for this list\");\n System.exit(-1);\n }\n\n Object ob = arrayList[index];\n arrayList[index] = t;\n\n Object ob2;\n\n /*The loop cycles through the array starting at index. ob2 is given the value of arrayList at i+1 position.\n The arrayList at i+1 position is assigned the value of ob. Then the ob variable is assigned the value of ob2. */\n for(int i = index; i < arrayList.length - 1; i++) {\n ob2 = arrayList[i+1];\n arrayList[i+1] = ob;\n ob = ob2;\n }\n\n elementsInArray++;\n }",
"@Override\n public void add(int index, int element) {\n Entry newElement = new Entry(element);\n Entry tmp = getEntry(index);\n newElement.next = tmp;\n newElement.previous = tmp.previous;\n tmp.previous.next = newElement;\n tmp.previous = newElement;\n size++;\n }",
"public DoublyLinkedListHeader addObject(DoublyLinkedListHeader list) {\r\n\t\tSystem.out.println(\"Enter an index!\");\r\n\t\tint index = scanInt();\r\n\t\tSystem.out.println(\"Enter the Integer Object!\");\r\n\t\tInteger obj = scanInt();\r\n\t\tif(!list.insert(obj, index)) {\r\n\t\t\tSystem.out.println(\"Invalid Index! The list is not modified\");\r\n\t\t}\r\n\t\telse {\r\n\t\t\tSystem.out.println(\"The list has been modified!\");\r\n\t\t}\r\n\t\treturn list;\r\n\t}",
"void add(int index, int value) {\n int[] newItems = new int[size++];\n\n System.arraycopy(items, 0, newItems, 0, index);\n\n newItems[index] = value;\n\n System.arraycopy(items, index, newItems, index + 1, items.length - index);\n\n items = newItems;\n }",
"public static void insert(ArrayList<Integer> list, int x)\n{\n // Your code here\n list.add(x);\n}",
"@Override\r\n public void add(int index, E element) {\r\n if (index < 0 || index > size) {\r\n throw new IndexOutOfBoundsException();\r\n\r\n }\r\n for (int i = 0; i < size; i++) {\r\n if (get(i).equals(element)) {\r\n throw new IllegalArgumentException();\r\n }\r\n }\r\n\r\n LinkedListIterator it = new LinkedListIterator(index);\r\n it.add(element);\r\n\r\n }",
"public void add(int index, Object item)\n {\n items[index] = item;\n numItems++;\n }",
"private void testAdd(){\n System.out.println(\"------ TESTING: add(int element) -----\");\n try{\n // add values to list, the sequence is 0,1,....,iSize-1\n for(int i = 0; i < iSize; i++) {\n // if the add method returns false the program did not work correctly\n if (!iTestList.add(i))\n throw new RuntimeException(\"FAILED -> failed to add value to list\");\n }\n }catch(RuntimeException e){\n System.out.print(e.getMessage());\n }\n }",
"public int addItem(Item i);",
"public void add(int index, E e) {\n resize();\n for(int i = size-1; i >= index; i--) {\n list[i+1] = list[i];\n }\n list[index] = e;\n size++;\n }",
"void add(int idx, float incr);",
"public void add(int index, int value) {\n\t\t\tif(index < 0 || index > size) {\n\t\t\t\tthrow new IndexOutOfBoundsException(\"index\" + index);\n\t\t\t}\n\t\t\tensureCapacity(size + 1);\n\t\t\tfor(int i = size; i > index; i--) {\n\t\t\t\telementData[size] = elementData[i - 1];\n\t\t\t}\n\t\t\telementData[index] = value;\n\t\t\tsize++;\n\t\t}",
"@Override // com.google.android.gms.internal.firebase_ml.zzsq, java.util.List, java.util.AbstractList\n public final /* synthetic */ void add(int i, Long l) {\n zzk(i, l.longValue());\n }",
"public void add(T element, int index) {\n int counter = 0;\n Node<T> newNode = new Node(element);\n Node<T> current = itsFirstNode;\n\t\tif (current == null) {\n\t\t\tthrow new NoSuchElementException(\"Beyond size of list or list empty\");\n\t\t}\n\t\twhile (current.getNextNode() != null ) {\n\t\t\tif ((counter == index - 1) || (index == 0)) {\n\t\t\t\tbreak;\n\t\t\t}\t\n\t\t\tcurrent = current.getNextNode();\n\t\t\tcounter++;\n\t\t}\n\t\ttry {\n\t\t\tif (index == 0) {\n\t\t\t\taddAsFirst(newNode);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewNode.setNextNode(current.getNextNode());\n\t\t\t\t(newNode.getNextNode()).setPriorNode(newNode);\n\t\t\t\tcurrent.setNextNode(newNode);\n\t\t\t\tnewNode.setPriorNode(current);\n\t\t\t}\n\t\t}\n\t\tcatch (NullPointerException e) {\n\t\t\t// NullPointer is fine\n\t\t}\n size++;\n }",
"public void add(int value) {\n\t \tensureCapacity(size+ 1);\n\t \telementData[size] = value;\n\t \tsize++;\n\t }",
"public int add(E value) {\r\n int index = items.size();\r\n items.add(value);\r\n return index;\r\n }",
"void insert(int index, T value) throws ListException;",
"public void add(int index, E x) {\n\t\tif (index < 0 || index > mSize) // == mSize allowed\n\t\t\tthrow new IndexOutOfBoundsException();\n\n\t\tif (size() == 0)\n\t\t\taddFirst(x);\n\t\telse {\n\t\t\taddBefore(getNode(index, 0, size()), x);\n\t\t\tmSize++;\n\t\t\tmodCount++;\n\t\t}\n\t}",
"public void add(int index, E obj)\r\n {\r\n listIterator(index).add(obj);\r\n }",
"@Override\n public void add(int index, E value) {\n this.rangeCheck(index);\n if (this.values.length == this.index) {\n this.grow();\n }\n this.modCount++;\n System.arraycopy(this.values, index, this.values, index + 1, this.size() - index);\n this.values[index] = value;\n this.index++;\n }",
"private void addCardValue(ArrayList<Integer> myList, int value)\n {\n for (int i = 0; i < myList.size(); i++)\n myList.set(i, myList.get(i) + value);\n }",
"public void addValue(List<Integer> list, int number) {\n list.add(number);\n System.out.println(list);\n }",
"public void addElement(int element) {\n \tif(element > 0) {\n \tarray[head++] = element;\n \t}else {\n \t\tthrow new RuntimeException(\"Invalid element to add\");\n \t}\n }",
"public void add(int index, Object element) {\n\n\t\tif (element == null) {\n\t\t\tthrow new IllegalArgumentException(\"ArrayList cannot contain null.\");\n\t\t}\n\t\tif (index < 0 || index > this.size) {\n\t\t\tthrow new IndexOutOfBoundsException(\"the index [\" + index\n\t\t\t\t\t+ \"] is not valid for this list with the size [\"\n\t\t\t\t\t+ this.size + \"].\");\n\t\t}\n\t\tif (this.size >= this.storedObjects.length) {\n\t\t\tincreaseCapacity();\n\t\t}\n\t\t// shift all following elements one position to the back:\n\t\tfor (int i = this.size; i > index; i--) {\n\t\t\tthis.storedObjects[i] = this.storedObjects[i - 1];\n\t\t}\n\t\t// insert the given element:\n\t\tthis.storedObjects[index] = element;\n\t\tthis.size++;\n\t}",
"public void add(int toBeAdded) {\n\t\tif (this.myCount==this.myValues.length){\n\t\t\tSystem.err.println(\"No more space in array\");\n\t\t\tSystem.exit(1);\n\t\t}\n \tthis.myValues[this.myCount] = toBeAdded;\n this.myCount++;\n }",
"public void add(E s,int index) {\t//O(n)\r\n\t\t//checks if the index is valid\r\n\t\tif(index>=0 && index<=size) {\t//index is valid\r\n\t\t\t//checks if there is any space left in the array\r\n\t\t\tif(size>=capacity)\r\n\t\t\t\tresize(this.capacity*2);\t//increases size of the array\r\n\t\t\tfor (int k=size-1; k>=index;k--) {\t//shifting element\r\n\t\t\t\tlist[k+1]=list[k];\r\n\t\t\t}\r\n\t\t\tlist[index]=s;\t//add element to the index\r\n\t\t\tsize++;\t//increases size\r\n\t\t} else {\t//index is not valid\r\n\t\t\tSystem.out.println(\"index \"+index+\" is out or range!\");\r\n\t\t}\r\n\t}",
"void addAll(intList list) throws IllegalAccessException;",
"public void addElement(int index, TLProperty element);",
"public void testAddIndex() {\r\n list.add(\"B\");\r\n list.add(0, \"A\");\r\n assertEquals(\"A\", list.get(0));\r\n assertEquals(2, list.size());\r\n list.add(2, \"D\");\r\n assertEquals(\"D\", list.get(2));\r\n list.add(2, \"C\");\r\n assertEquals(\"C\", list.get(2));\r\n }",
"public void add(T value) {\n extend();\n this.list[size]=value;\n this.size++;\n }",
"public void add(NestedInteger ni) {\n this.list.add(ni);\n }",
"public void add(int index, Object element) {\r\n addBefore(element, (index == size ? header : entry(index)));\r\n }",
"public void add(T data, int index) {\n\t\tif (index < 0 || index > this.size) {\n\t\t\tthrow new ArrayIndexOutOfBoundsException();\n\t\t} else if (index == size) {\n\t\t\tthis.add(data);\n\t\t} else if (index == 0) {\n\t\t\tthis.addFirst(data);\n\t\t} else {\n\t\t\tListNode<T> previousElement = goToIndex(index - 1);\n\t\t\tListNode<T> currentElement = goToIndex(index);\n\t\t\tListNode<T> newElement = new ListNode<T>(data, currentElement);\n\t\t\tpreviousElement.setNext(newElement);\n\t\t\tthis.size++;\n\t\t}\n\t}",
"@Override\r\n\tpublic void AddItem(int n) {\n\t\tSystem.out.println(\"ADDED:\" + n);\r\n\r\n\t}",
"public void addAtIndex(int index, int val) {\n if (index > size) return;\n //Add at head\n if (index <= 0) {\n addAtHead(val);\n }\n //Add at end\n else if (index == size) {\n addAtTail(val);\n } else {\n ListNode newNode = new ListNode(val);\n ListNode curr = head;\n //Add somewhere in between\n for (int i = 0; i < index - 1; i++) {\n curr = curr.next;\n }\n newNode.next = curr.next;\n curr.next = newNode;\n size++;\n }\n }",
"public void add(Object x, int index) {\n\tint counter = 0;\n\twhile (counter < _size) {\n\t if (get(counter) == x) {\n\t\thelpAdd( x, index);\n\t }\n\t counter +=1;\n\t}\n\tadd(x);\n\t\n }",
"public Boolean add(Integer i) {\n return list.add(i);\n }",
"public @Override void add(int index, E element) {\n \tNode n = index == size ? sentinel : getNode(index);\n \tnew Node(n.pred, element);\n }",
"public void insertElementAt(Object obj, int index);",
"@Test\r\n\tpublic void testAddByIndex() {\r\n\t\tlist.add(3, new Munitions(3, 4, \"ferrum\"));\r\n\t\tlist.add(5, new Munitions(34, 4, \"iron\"));\r\n\t\tAssert.assertEquals(17, list.size());\r\n\t\tAssert.assertTrue(list.get(3).equals(new Munitions(3, 4, \"ferrum\")));\r\n\t}",
"public void add(int v) {\n if (empty) {\n x = v;\n empty = false;\n }\n else {\n if (next == null) {\n next = new Lista(v);\n }\n else {\n Lista iter = new Lista(this);\n while (iter.next != null) {\n iter = iter.next;\n }\n iter.next = new Lista(v);\n } \n }\n }",
"void add(T element);",
"void add(T element);",
"public void add(T element);",
"public void add(T element);",
"@Override\r\n\tpublic int add() {\n\t\treturn 0;\r\n\t}",
"public void add (T element);",
"@Override\n\tpublic void add(int n) {\n\t\tvalues[size] = n; //add value to the list\n\t\tsize++; //increment size\n\t\tif (size == values.length){ //if the list is full expand it\n\t\t\tresize();\n\t\t}\n\t}",
"public void add(NestedInteger ni);",
"public void add (int index, E item)\n {\n if (index < 0 || index > size) {\n throw new\n IndexOutOfBoundsException(Integer.toString(index));\n }\n if (index == 0)\n addFirst(item);\n else {\n Node<E> node = getNode(index - 1);\n addAfter(node, item);\n }\n }",
"@Test\n public void testAdd_After_Add() {\n OasisList<Integer> baseList = new SegmentedOasisList<>();\n baseList.addAll(Arrays.asList(1, 2, 6, 8));\n\n ListIterator<Integer> instance = baseList.listIterator();\n instance.next();\n instance.next();\n\n instance.add(3);\n instance.add(9);\n int expResult = 3;\n\n assertEquals(expResult, baseList.indexOf(9));\n }",
"@Override\n\tpublic int add() {\n\t\treturn 0;\n\t}",
"@Override\n\tpublic int add() {\n\t\treturn 0;\n\t}",
"@Override\n\tpublic int add() {\n\t\treturn 0;\n\t}",
"void add(I i);",
"public void addTo(Integer element, int i)\n\t\t{buckets.get(i).add(element);}",
"public void add(int index, T element)\r\n {\r\n Node<T> newNode = new Node<T>(element);\r\n Node<T> walker; // needed for traversing the list\r\n \r\n if ((index < 0) || (index > numElements))\r\n throw new IndexOutOfBoundsException(\r\n \"Illegal index \" + index + \" passed to add method.\\n\");\r\n\r\n if (front == null) // add to empty list\r\n { \r\n front = newNode;\r\n rear = newNode;\r\n }\r\n else if (index == 0) // add to front\r\n {\r\n newNode.next = front;\r\n front = newNode;\r\n }\r\n else if (index == size()) // add to rear\r\n {\r\n rear.next = newNode;\r\n rear = newNode;\r\n }\r\n else // add to interior part of list\r\n {\r\n walker = front; \r\n for (int i=0; i<(index-1); i++)\r\n {\r\n walker = walker.next;\r\n }\r\n newNode.next = walker.next;\r\n walker.next = newNode;\r\n }\r\n numElements++;\r\n }",
"@Override\r\n\tpublic void add(T element) {\n\t\tthis._list.add(element);\r\n\t}",
"public void addAtIndex(int index, int val) {\n if (index > this.size) {\n return;\n }\n\n if (index < 0) {\n index = 0;\n }\n\n ListNode pred = this.head;\n\n for (int i = 0; i < index; ++i) {\n pred = pred.next;\n }\n\n ListNode node = new ListNode(val);\n node.next = pred.next;\n pred.next = node;\n\n this.size++;\n }",
"void add(Object element);",
"@Override\n public void add(int index, T element) {\n Object[] newArray = new Object[size + 1];\n for (int i = 0; i < index; i++) {\n newArray[i] = data[i];\n }\n newArray[index] = element;\n for (int i = index + 1; i < newArray.length; i++) {\n newArray[i] = data[i - 1];\n }\n data = newArray;\n size++;\n }",
"@Override\n public void add(final int index, final T element) {\n this.checkIndexToAdd(index);\n\n if (this.size > this.data.length - 1) {\n this.doubleArraySizeBy(2);\n }\n\n for (int i = this.size; i > index; i--) {\n this.data[i] = this.data[i - 1];\n }\n\n this.data[index] = element;\n this.size++;\n }",
"public abstract void add(NestedInteger ni);",
"private static void testAdd(ArrayList list, int[] content) {\n System.out.print(\"Adding to the list: \");\n for (int index = 0; index < content[index]; index++) {\n list.addToEnd(content);\n } // end for\n System.out.println();\n displayList(list);\n }",
"public abstract void add(T element);",
"public abstract void add(T element);",
"@Override\n public void add(T element) {\n add(size(), element);\n }",
"@Override\n\tpublic void add(int idx, T obj) throws IndexOutOfBoundsException {\n\t\tboolean found = false;\n\t\tint n = 0;\n\t\tListNode tmp = new ListNode(obj);\n\t\tListNode current = head;\n\t\t\n\t\tif (idx < 0 || idx > size()) {\n\t\t\tthrow new IndexOutOfBoundsException();\n\t\t}\n\t\telse if (idx == 0) {\n\t\t\ttmp.next = head;\n\t\t\thead = tmp;\n\t\t\tsize++;\n\t\t}\n\t\telse {\n\t\t\twhile (!found) {\n\t\t\t\tif (n == idx - 1) {\n\t\t\t\t\ttmp.next = current.next;\n\t\t\t\t\tcurrent.next = tmp;\n\t\t\t\t\tfound = true;\n\t\t\t\t\tsize++;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tcurrent = current.next;\n\t\t\t\t\tn++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public void addAtIndex(int index, int val) {\n if (index < 0 || index > size) {\n return;\n }\n Node prev = dummyHead;\n for (int i = 0; i < index; i++) {\n prev = prev.next;\n }\n prev.next = new Node(val, prev.next);\n size++;\n }",
"void add(String name, int value);",
"IList<T> add(T t);",
"public void add(NestedInteger ni) {\n\t\tif (this.list == null) {\n\t\t\tthis.list = new ArrayList<>();\n\t\t}\n\t\tthis.list.add(ni);\n\t}",
"@Override\n public void add(int index, T elem) {\n if(index < 0 || index >= size()) {//if the required index is not valid, give error\n throw new IndexOutOfBoundsException();\n }\n //if we want to add at the beginning of the list\n if(index == 0) {\n prepend(elem); //reuse prepend method when adding at the start of list\n return;\n }\n //if we want to add inside the list\n DLNode<T> predecessor = first; //create a reference, point it to the first node\n for(int i = 0; i < index - 1; i++) {//locate the preceeding index of the required index\n predecessor = predecessor.next;\n \n }\n DLNode<T> successor = predecessor.next; //another reference, now points to the index we want to add the new node to\n \n DLNode<T> middle = new DLNode(elem, predecessor, successor);//create new node, it's previous node is predecessor, the one after it is successor\n predecessor.next = middle; //new node is assigned to the required index, after predecessor, before successor\n \n if(successor == null) {//if there's no node after the new node\n last = middle; //new node is the last one \n }\n else{ //if there is a successor node exist\n successor.prev = middle; //new node preceeds it's successor\n } \n \n }",
"public void add(int item) {\r\n if (!contains(item)) {\r\n items[NumItems++] = item;\r\n } else if (NumItems == MAX_LIST) {\r\n throw new ListFullException(\"List is full\");\r\n }\r\n }",
"public void add(int x)\n {\n int arrayLength = list.length; // get size of array\n if (length == arrayLength)\n {\n list = Arrays.copyOf(list, 100 + list.length);\n list[length] = x;\n length++;\n\n } else\n {\n list[length] = x;\n length++;\n }\n }",
"void add(int value);",
"public void insert(int index, T element);",
"public void insertElementAt(Object obj, int index)\n {\n try {element.insertElementAt(obj, index);}\n catch (Exception e) {\n throw new IllegalArgumentException\n (\"VectorLinearList.insertElementAt: \" +\n \"index must be between 0 and size\");\n }\n }",
"public void add(X elem);",
"public void insert(int newItem){\n itemArray[count] = newItem;\n count++;\n }"
] | [
"0.7931962",
"0.79313165",
"0.78400034",
"0.78400034",
"0.7721009",
"0.76992315",
"0.7590565",
"0.7585687",
"0.755562",
"0.73350763",
"0.7333357",
"0.7228858",
"0.7153846",
"0.7104197",
"0.7102065",
"0.70970285",
"0.70211065",
"0.69350696",
"0.69260854",
"0.6903533",
"0.6894546",
"0.6894337",
"0.68624586",
"0.67828625",
"0.6771969",
"0.6768748",
"0.6753111",
"0.67521125",
"0.6750587",
"0.6741356",
"0.673326",
"0.6723837",
"0.6721059",
"0.6709169",
"0.6695227",
"0.66947204",
"0.6683038",
"0.66801846",
"0.6667161",
"0.6629783",
"0.66137713",
"0.66044474",
"0.6603202",
"0.6601315",
"0.6597875",
"0.65842104",
"0.6554737",
"0.6548689",
"0.6527807",
"0.65200055",
"0.6510986",
"0.64988756",
"0.6496285",
"0.64832586",
"0.6476705",
"0.6472884",
"0.64687246",
"0.6461905",
"0.6459846",
"0.64528036",
"0.6449207",
"0.64437056",
"0.64370805",
"0.64370805",
"0.64273524",
"0.64273524",
"0.64207983",
"0.6413319",
"0.6408924",
"0.6408277",
"0.64071494",
"0.6395774",
"0.63858217",
"0.63858217",
"0.63858217",
"0.63841915",
"0.6383836",
"0.6381918",
"0.63569903",
"0.635663",
"0.6352106",
"0.63487697",
"0.6345389",
"0.6345277",
"0.6344878",
"0.63414764",
"0.63414764",
"0.6333672",
"0.63302124",
"0.6312943",
"0.6310928",
"0.6301746",
"0.6299257",
"0.6286856",
"0.6283248",
"0.62826383",
"0.62821674",
"0.6278355",
"0.6277279",
"0.6272342",
"0.6270624"
] | 0.0 | -1 |
Basic Operation > Remove index of myList: my_remove_element | public <T> void my_remove_element(int index) throws myException{
myNode current = Lnode;
for (int i =0; i< index;i++){
if (index < 0 || index > counterNo){
System.out.print("index out of bounds");
return;
}else if (current == null ){
System.out.print("This list is empty");
return;
}else if (i == index -1){
myNode<T>Lnode = current.getRight();
myNode<T>Rnode = current.getLeft();
Rnode.setRight(Rnode);
Lnode.setLeft(Lnode);
return;
}
}
current = current.getRight();
counterNo -= 1;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void removeElementAt(int index);",
"public void remove(int index);",
"void remove(int index);",
"void remove(int index);",
"void remove(int index);",
"void remove(int index);",
"void remove( int index );",
"@Test\r\n\tpublic void testRemoveByIndex() {\r\n\t\tAssert.assertNull(list.remove(100));\r\n\t\tAssert.assertTrue(list.get(5).equals(list.remove(5)));\r\n\t\tAssert.assertEquals(14, list.size());\r\n\t}",
"public void testRemoveIndex() {\r\n list.add(\"A\");\r\n list.add(\"B\");\r\n assertTrue(list.remove(0));\r\n assertEquals(1, list.size());\r\n list.add(\"B\");\r\n assertTrue(list.remove(0));\r\n assertEquals(1, list.size());\r\n }",
"void remove(int idx);",
"public E remove(int index);",
"public Object remove(int index){\n\t\tif(index < listSize){\n\t\t\tObject o = myArrayList[index];\n\t\t\tmyArrayList[index] = null;\n\t\t\tint temp = index;\n\t\t\twhile(temp < listSize){\n\t\t\t\tmyArrayList[temp] = myArrayList[temp+1];\n\t\t\t\tmyArrayList[temp+1] = 0;\n\t\t\t\ttemp++;\n\t\t\t}\n\t\t\tlistSize --;\n\t\t\treturn o;\n\t\t}else{\n\t\t\tthrow new ArrayIndexOutOfBoundsException();\n\t\t}\n\t}",
"abstract void remove(int index);",
"public void remove(int index) {\n for (int i = index; i < this.list.length-1; i++) {\n this.list[i]=this.list[i+1];\n }\n this.size--;\n }",
"public int remove(T element) {\n\n int index = -1;\n\n for (int i = 0; i < myList.length; i++) {\n if (myList[i].equals(element)) {\n index = i;\n break;\n }\n }\n\n if (index >= 0) {\n this.remove(index);\n }\n\n return index;\n }",
"public Type remove(int index);",
"T remove(int index);",
"T remove(int index);",
"public void remove(int index) {\n\n\t}",
"public T remove(int index) {\n\n if (index >= size) {\n throw new IndexOutOfBoundsException(\"Index: \" + index + \", Size: \" + size);\n }\n\n T oldValue = myList[index];\n int value = size - index - 1;\n\n if (value > 0) {\n System.arraycopy(myList, index + 1, myList, index, value);\n }\n System.out.println(\"one \" + size);\n myList[--size] = null;\n System.out.println(\"two \" + size);\n\n return oldValue;\n }",
"@Override\n\tpublic E remove(int idx) {\n\t\tif (idx < 0 || idx >= size())\n\t\t\tthrow new IndexOutOfBoundsException();\n\t\tE element = null;\n\t\telement = list[idx];\n\t\tif (idx == size - 1) {\n\t\t\tlist[idx] = null;\n\t\t} else {\n\t\t\tfor (int i = idx; i < size - 1; i++) {\n\t\t\t\tlist[i] = list[i + 1];\n\t\t\t}\n\t\t\tlist[size - 1] = null;\n\t\t}\n\t\tsize--;\n\t\treturn element;\n\t}",
"E remove(int i ) throws IndexOutOfBoundsException;",
"int remove(int idx);",
"E remove(int i) throws IndexOutOfBoundsException;",
"public abstract E remove(int index);",
"public abstract T remove(int index);",
"@Test\n public void deleteByIndex(){\n List <Integer> list = new ArrayList<>();\n list.add(1);\n list.add(2);\n list.add(3);\n list.add(4);\n list.add(5);\n assertEquals(1,(int)list.get(0));\n\n list.remove(0);\n assertEquals(2,(int)list.get(0));\n }",
"@ZenCodeType.Method\n default void remove(int index) {\n \n doesNot(\"support removal by index\");\n }",
"Object remove(int index) {\n return index >= 0 && index < this.length() ? this.myArrayList.remove(index) : null;\n }",
"public T remove(int index) {\n chk();\n return list.remove(index);\n }",
"public E remove(int index) {\n\t\tif (index < 0 || index >= this.size()) {\n\t\t\tthrow new IndexOutOfBoundsException(\"Index is out of bounds\");\n\t\t}\n\t\tE removed = get(index);\n\t\t// Loop to shift elements left\n\t\tfor (int i = index; i < size(); i++) {\n\t\t\tlist[i] = list[i + 1];\n\t\t}\n\t\treturn removed;\n\t}",
"@Override\r\n\tpublic void removeToIndex(int index) {\n\t}",
"public void removeElement() throws IndexOutOfBoundsException, UnsupportedOperationException {\n\t\tlist.remove(0);\n\t}",
"@Override\r\n\tpublic T remove(int index) {\n\t\treturn this._list.remove(index);\r\n\t}",
"public E remove(int index)\r\n {\r\n checkValidIndex(index);\r\n ListIterator<E> itr = listIterator(index);\r\n E result = itr.next();\r\n itr.remove();\r\n return result;\r\n }",
"@Override\n\tpublic void remove(int index) {\n\t\tListNode<L> current=this.first;\n\t\tif(index < 0 || index >= this.size) throw new IndexOutOfBoundsException();\n\t\tfor(int i=0;i<index;i++) {\n\t\t\tcurrent=current.next;\n\t\t}\n\t\tif (index == 0) {\n\t first = current.next;\n\t } else {\n\t current.previous.next = current.next;\n\t }\n\t this.size--;\n\t\tthis.modificationCount++;\n\t}",
"public E remove(int index) {\n\t\t// Code from Project 3\n\t\tE removed;\n\t\tif (index < 0 || index >= size()) {\n\t\t\tthrow new IndexOutOfBoundsException();\n\t\t}\n\t\t// Last element of list or list contain only 1 element\n\t\tif (index == size - 1) {\n\t\t\tremoved = elements[size - 1];\n\t\t\telements[size - 1] = null;\n\t\t\tsize--;\n\t\t\treturn (E) removed;\n\t\t} else {\n\t\t\t// remove mid or first element\n\t\t\tremoved = elements[index];\n\t\t\tfor (int i = index; i < size; i++) {\n\t\t\t\telements[i] = elements[i + 1];\n\t\t\t}\n\t\t\telements[size - 1] = null;\n\t\t\tsize--;\n\t\t\treturn (E) removed;\n\t\t}\n\t}",
"@Override\n public final Integer remove(final int index) {\n // Verify that the specified index is valid\n if (!checkRange(index)) {\n throw new IndexOutOfBoundsException();\n } else {\n final int temp = arrayList[index];\n // Shift all elements after the removed elements down\n for (int i = index; i < (size - 1); i++) {\n arrayList[i] = arrayList[i + 1];\n arrayList[i + 1] = 0;\n }\n size--;\n return temp;\n\n }\n }",
"public void remove(int index) {\n if (index >= _size) {\n throw new ListIndexOutOfBoundsException(\"Error\");\n }\n if (index==0) {\n start = start.next;\n } else {\n ListNode prev = start;\n for (int i = 0; i<index - 1; i++ ) {\n prev = prev.next;\n }\n prev.next = prev.next.next;\n }\n _size--;\n }",
"public void removeElementAt(int index)\n {\n try {element.removeElementAt(index);}\n catch (Exception e) {\n throw new IllegalArgumentException\n (\"VectorLinearList.removeElementAt: \" +\n \"index must be between 0 and size - 1\");\n }\n }",
"public native String removeItem(Number index);",
"public void removeAt(int pos)\n {\n for (int i = pos; i < length - 1; i++)\n {\n list[i] = list[i + 1];\n }\n length--;\n }",
"void delete(int index) throws ListException;",
"public void removeIndex(int i) {\n // YOUR CODE HERE\n }",
"public abstract void remove(int pos) throws IndexOutOfBoundsException;",
"public E remove(int index) {\n if(index > size) return null;\n E element = null;\n for(int i = index+1; i < size; i++) {\n list[i-1] = list[i];\n }\n list[size-1] = null;\n size--;\n return element;\n }",
"public void deleteFromIndex(int index) {\n int counter = 0;\n if (index < 0 || index > (this.size() - 1)) {\n throw new NoSuchElementException(\"No such element.\");\n }\n //trivial, use deleteFromStart() method\n if (index == 0) {\n deleteFromStart();\n }\n //if head==null, list is empty so no elements to delete\n else if (head == null) {\n System.out.println(\"List is empty, nothing to delete.\");\n }\n //Actual case\n else {\n Iterator2 i = new Iterator2();\n while (counter < (index)) {\n counter++;\n i.next();\n }\n //Sets link from \"previous\" element to the one following the index\n //Remove references from deleted object\n //Garbage collector takes it away\n i.previous.next = i.position.next;\n i.position = i.position.next;\n }\n //Decrement size of list\n size--;\n\n }",
"private void testRemove() {\n System.out.println(\"------ TESTING: remove(int index) -----\");\n try{\n for(int i = 0; i < iSize; i++){\n if(iTestList.remove(0) != i)\n throw new RuntimeException(\"FAILED -> remove not working correctly\");\n }\n\n iTestList.remove(-9);\n iTestList.remove(iSize+10);\n }catch(RuntimeException e){\n System.out.println(e.getMessage());\n }\n }",
"public void remove()\r\n { Exceptions.unmodifiable(\"list\"); }",
"public void removeItem(int idx)\n\t{\n\t\titemList.remove(idx);\n\t\t\n\t}",
"public void remove( int index ) {\n\tif (index > _lastPos)\n\t System.out.println(\"No meaningful value at index\");\n\telse {for (int i= index; i < _lastPos; i++){\n\t\t_data[i]= _data[i+1];\n\t }\n\t _size--;\n\t _lastPos--;\n\t}\n }",
"@Override\n\tpublic E remove(int index) {\n\t\treturn null;\n\t}",
"public void remove(int index)\n {\n numItems--;\n items[index] = null;\n }",
"public void remove(int element) {\r\n\t\tint i = find(element);\r\n\t\tlist[i] = -1;\r\n\t\tinsertionSort(list);\r\n\t\tcurrentPosition = i;\r\n\t}",
"private final void fastRemove(final int index) {\r\n\t\tfinal int numMoved = this.size - index - 1;\r\n\t\tif (numMoved > 0) {\r\n\t\t\tSystem.arraycopy( this.elementData, index + 1, this.elementData, index, numMoved );\r\n\t\t}\r\n\t\tthis.elementData[--this.size] = null; // Let gc do its work\r\n\t}",
"public void remove(int pos) throws IndexOutOfBoundsException {\n list.remove(pos);\n }",
"@Test\n public void testRemoveAt() {\n testAdd();\n list1.removeAt(3);\n assertEquals(8, list1.size());\n assertEquals(15.25, list1.get(4), 0);\n assertEquals(14.25, list1.get(3), 0);\n assertEquals(17.25, list1.get(5), 0);\n }",
"@Override\n // average-case complexity: O(n), since it always needs to shift n-amount\n // of element, where n is propotional to the list/input size\n public void remove(int index) {\n if (arr.length * SHRINK_THRESHOLD > size)\n arr = resize(arr, SHRINK_FACTOR);\n \n // remove the item at the specified index and shift everything right of\n // the given index 1 step to the left\n for (int i = index; i < size-1; i++) {\n arr[i] = arr[i+1];\n }\n // remove the previous last item and then decrement the size\n arr[--size] = null;\n }",
"public void remove(int index) {\n items.remove(index);\n }",
"@Override\n\tpublic E remove(int index) {\n\t\trangeCheck(index);\n\t\t\n\t\treturn remove(node(index));\n\t}",
"public void remove(int index) {\n\t\t\tcheckIndex(index);\n\t\t\tfor(int i = index; i < size - 1; i++) {\n\t\t\t\telementData[i] = elementData[i + 1];\n\t\t\t}\n\t\t}",
"public static native long RemoveAt(long lpjFbxArrayVector2, int pIndex);",
"public void remove(int index) throws ListException {\r\n\t\t//Check to make sure the index is in a valid location\r\n\t\tif (index >= 1 && index <= numItems+1) {\r\n\t\t\tDoublyNode prev = find(index-1);//Set the previous pointer to the item before the one to be removed\r\n\t\t\tDoublyNode next = find(index+1);//Set the next pointer to the item after the one to be removed\r\n\r\n\t\t\tprev.setNext(next);//Set the next pointer of the previous node\r\n\t\t\tnext.setPrev(prev);//Set the previous pointer of the next node\r\n\r\n\t\t\tnumItems--;//Decrement the number of items\r\n\t\t} \r\n\t\t//This will check if the user is trying to remove an item from an empty list\r\n\t\telse if(isEmpty()){\r\n\t\t\tthrow new ListException(\"Remove from empty list exception\");\r\n\t\t}\r\n\t\t//This will check if the user is trying to remove an item from the wrong index position\r\n\t\telse {\r\n\t\t\tthrow new ListException(\"List index out of bounds exception on remove: \" + index);\r\n\t\t}\r\n\t}",
"public void remove(int index) {\r\n\t\t//checks if the index is valid\r\n\t\tif(index>=0 && index<=size) {\r\n\t\t\tfor (int k=index;k<size;k++) {\t//shifting element\r\n\t\t\t\tlist[k]=list[k+1];\r\n\t\t\t}\r\n\t\t\tsize--;\t\t//decreases size\r\n\t\t\t//checks if the size of array is not 0 and less than 25% of the capacity of the array\r\n\t\t\tif (size!=0 && capacity/size >=4)\r\n\t\t\t\tresize(this.capacity/2);\t//decreasing size of array\r\n\t\t} else {\t//index is not valid\r\n\t\t\tSystem.out.println(\"index \"+index+\" is out or range!\");\r\n\t\t}\r\n\t}",
"@Test\n public void testRemoveAtIndexNoResize() {\n //No Resize\n for (int i = 0; i < 9; i++) {\n String input = String.format(\"b0%d\", i);\n list.addToBack(input);\n }\n list.removeAtIndex(4);\n int actualCapacity = ((Object[]) (list.getBackingArray())).length;\n Assert.assertEquals(\"The list resized when removing an element from a list while at capacity\",\n ArrayList.INITIAL_CAPACITY, actualCapacity);\n\n //With Resize\n list.addToBack(\"Filler1\");\n list.addToBack(\"Filler2\");\n list.addToBack(\"Filler3\");\n list.removeAtIndex(0);\n list.removeAtIndex(3);\n list.removeAtIndex(8);\n int newActualCapacity = ((Object[]) (list.getBackingArray())).length;\n Assert.assertEquals(\"The list resized when moving from above to below initial capacity.\",\n ArrayList.INITIAL_CAPACITY * 2, newActualCapacity);\n }",
"public T removeAt(int index) {\n if (index >= size || index < 0) throw new IndexOutOfBoundsException();\n T tempData = genericArrayList[index];\n T[] tempArrayList = (T[]) new Object[size - 1];\n for (int i = 0, j = 0; i < size; i++, j++) {\n if (i == index) j--; // skip over removeAtIndex by fixing j temporarily\n else tempArrayList[j] = genericArrayList[i];\n }\n genericArrayList = tempArrayList;\n capacity = --size;\n return tempData;\n }",
"@Test\n void testRemoveDeletesElement() {\n MyList l = new MyList();\n l.put(\"key\", \"value\");\n l.remove(\"key\");\n\n assertEquals(false, l.contains(\"key\"));\n }",
"public E remove (int index)\n { E item;\n if (index < 0 || index >= size) {\n throw new\n IndexOutOfBoundsException(Integer.toString(index));\n }\n if (index == 0)\n item = removeFirst( );\n else {\n Node<E> node = getNode(index - 1);\n item = removeAfter(node);\n }\n return item; // return the deleted value\n }",
"@Override\r\n\tpublic Score remove(int i) throws IndexOutOfBoundsException {\r\n\t\t//when i is less than zero or greater than size()-1\r\n\t\tif (i < 0 || i > size() - 1)\r\n\t\t\tthrow new IndexOutOfBoundsException();\r\n\t\tScore a = scoreList[i];\r\n\t\tfor (int j = i; j < numItems - 1; j++) {\r\n\t\t\tscoreList[j] = scoreList[j + 1];\r\n\t\t}\r\n\t\tnumItems--;\r\n\t\treturn a;\r\n\t}",
"public PersistentLinkedList<T> remove(int listIndex) {\n if (this.treeSize == 1) {\n PersistentLinkedList<T> out = this.setHelper(0, null);\n out.treeSize = 0;\n return out;\n }\n int treeIndex;\n if (listIndex == 0) {\n treeIndex = this.indexCorrespondingToTheFirstElement;\n } else if (listIndex == this.treeSize - 1) {\n treeIndex = this.indexCorrespondingToTheLatestElement;\n } else {\n treeIndex = searchIndex(listIndex);\n }\n\n Node<T> toBeRemoved = this.getHelper(treeIndex);\n PersistentLinkedList<T> newVersion = this\n .changeLinks(toBeRemoved.previousIndex, toBeRemoved.nextIndex);\n if (listIndex == 0) {\n newVersion.indexCorrespondingToTheFirstElement = toBeRemoved.nextIndex;\n } else if (listIndex == this.treeSize - 1) {\n newVersion.indexCorrespondingToTheLatestElement = toBeRemoved.previousIndex;\n }\n\n if (treeIndex == this.treeSize - 1) {\n if (treeIndex != 0) {\n newVersion = newVersion.pop();\n while (newVersion.unusedTreeIndices.contains(newVersion.treeSize - 1)) {\n newVersion.changeUnusedIndices(newVersion.treeSize - 1, true);\n newVersion = newVersion.pop();\n }\n } else {\n newVersion.treeSize--;\n }\n return newVersion;\n } //else\n\n PersistentLinkedList<T> newVersion2 = newVersion.setHelper(treeIndex, null);\n newVersion2.changeUnusedIndices(treeIndex, false);\n return newVersion2;\n }",
"private void deleteElement(int index) {\n Object[] first = new Object[index];\n System.arraycopy(this.container, 0, first, 0, index);\n\n Object[] second = new Object[this.container.length - index - 1];\n System.arraycopy(this.container, index + 1, second, 0, second.length);\n\n this.container = new Object[this.container.length];\n System.arraycopy(first, 0, this.container, 0, first.length);\n System.arraycopy(second, 0, this.container, index, second.length);\n\n this.position--;\n }",
"@Override\n public E remove(int index) {\n // todo: Students must code\n int pos = calculate(index);\n\n E temp = data[pos];\n data[pos] = null;\n if(pos == head)\n head = (head+1) % data.length;\n else if(pos == tail)\n tail = (tail-1) % data.length;\n else {\n // shift all array contents after pos left 1\n for(int i = pos; i < (pos + curSize-index-1); i++)\n data[calculate(i)] = data[calculate(i+1)];\n tail = (tail-1) % data.length;\n }\n curSize--;\n return temp;\n }",
"public void removeIt() { \n\t\t\tcollection.remove(currIndex);\n\t\t\tcurrIndex--;\n\t\t}",
"@Override\n public T remove(int index) {\n T removed = array[index];\n for (int i = index + 1; i < array.length; i++) {\n array[i] = array[i + 1];\n }\n this.size = size - 1;\n return removed;\n }",
"public T remove(int index) {\n return null;\n }",
"private void removeFriendList(int index) {\n ensureFriendListIsMutable();\n friendList_.remove(index);\n }",
"void remove(int index)\n\t{\n\t\t//Get the reference of the head of the Linked list\n\t\tNode ref = head;\n\t\t\n\t\t//Initialize the counter to -1\n\t\tint count = -1;\n\t\t\n\t\t//Traverse the Linked List until the Node with position (index - 1) is reached\n\t\twhile(count != index - 1)\n\t\t{\n\t\t\tcount++;\n\t\t\tref = ref.next;\n\t\t}\n\t\t\n\t\t//Assign the reference of the next Node after the Node at position index to refNext\n\t\tNode refNext = ref.next.next;\n\t\t\n\t\t//Assign the refNext as the next Node after the Node at position (index - 1) \n\t\tref.next = refNext;\n\t}",
"@Override\n\tpublic T remove(int idx) throws IndexOutOfBoundsException {\n\t\tint n = 0;\n\t\tboolean found = false;\n\t\tListNode current = head;\n\t\tListNode retNode = null;\n\t\t\n\t\tif (idx < 0 || idx > size()) {\n\t\t\tthrow new IndexOutOfBoundsException();\n\t\t}\n\t\telse if (idx == 0) {\n\t\t\tretNode = current;\n\t\t\thead = current.next;\n\t\t\tsize--;\n\t\t}\n\t\telse {\n\t\t\twhile (!found) {\n\t\t\t\tif (n == idx - 1) {\n\t\t\t\t\tretNode = current.next;\n\t\t\t\t\tcurrent.next = current.next.next;\n\t\t\t\t\tfound = true;\n\t\t\t\t\tsize--;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tcurrent = current.next;\n\t\t\t\t\tn++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn retNode.datum;\n\t}",
"@Override\r\n public Copiable deleteAt(int index) throws IndexRangeException {\r\n if (count == 0) {\r\n throw new IndexRangeException(-1, -1, index);\r\n }\r\n if (index >= 0 && index <= count - 1) {\r\n Copiable temp = list[index];\r\n int shift = 0;\r\n for (int i = index; i < list.length - 1; i++) {\r\n list[i] = list[i + 1];\r\n shift++;\r\n }\r\n list[index + shift] = null;\r\n count--;\r\n return temp;\r\n } else {\r\n throw new IndexRangeException(0, count - 1, index);\r\n }\r\n }",
"public Item removeAt(int index) {\n // check if DList is empty:\n if(isEmpty()) throw new NoSuchElementException(\"Failed to perform removeAt operation because the DList instance is empty!\");\n // check if index is within the valid range\n if (index<0 || index>size-1) throw new IndexOutOfBoundsException(\"Failed to removeAt because \"+index+\" index is out of bounds!\");\n if(index==0) return removeFirst();\n if(index==size-1) return removeLast();\n\n Node current = getNodeAt(index);\n Item item = current.data;\n\n Node prevNode = current.prev;\n Node nextNode = current.next;\n\n prevNode.next = nextNode;\n nextNode.prev = prevNode;\n current.next = null;\n current.prev = null;\n \n size--;\n return item;\n }",
"public void remove(int index)\r\n\t{\r\n\t\tif(index<0 || index >=n)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Invalid index\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tfor(int i=index;i<n;i++)\r\n\t\t\t{\r\n\t\t\t\ta[i]=a[i+1];\r\n\t\t\t}\r\n\t\t\tn--;\r\n\t\t}\t\t\r\n\t}",
"@Override\n public int remove(int index) {\n checkIndex(index);\n Entry tmp = getEntry(index);\n int result = tmp.value;\n tmp.previous.next = tmp.next;\n tmp.next.previous = tmp.previous;\n size--;\n return result;\n }",
"@Override\n\tpublic T remove(int index) {\n\t\t// TODO check if index is withing the correct range\n\t\t// If not, return null\n\t\t// otherwise , do the same as above\n\t\tif (index >= 0 && index < size) {\n\t\t\tT item = data[index];\n\t \t\tfor(int i=index;i<size-1;i++)\n\t \t\t\tdata[i] = data[i+1];\n\t \t\tsize--;\n\t \t\treturn item;\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\n\t}",
"public void removeIndex(int i)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_element(INDEX$12, i);\r\n }\r\n }",
"public void clearListNotIndex(){\n for(int z=0; z<list.length; z++){\n list [z] = 0;\n }\n }",
"public Object remove (int i)\r\n {\r\n }",
"public E remove(int index)\n {\n if (index >= 0 && index < size) {\n E temp = data[index]; // element to return\n\n // shift all elements to the right down by 1 index\n for (int i = index; i < size - 1; i++)\n data[i] = data[i+1];\n \n size--;\n return temp;\n } else\n throw new NoSuchElementException();\n }",
"void remove(int index) {\n\t\tfor (int i = index; i < array.length - 1; i++) {\n\t\t\tarray[i] = array[i + 1];\n\t\t}\n\t\tint[] temp = new int[array.length - 1];\n\t\tfor (int i = 0; i < array.length - 1; i++) {\n\t\t\ttemp[i] = array[i];\n\t\t}\n\t\tint lastValue = array[array.length - 1];// index starts @ 0, so its the\n\t\t\t\t\t\t\t\t\t\t\t\t// array.length - 1 to account\n\t\t\t\t\t\t\t\t\t\t\t\t// for the 0\n\t\tarray = temp;\n\n\t}",
"@Test\r\n public void testRemoveIdx() {\r\n\r\n TestingTypeList test = new TestingTypeList();\r\n\r\n try {\r\n test.removeTestingTypeAt(0);\r\n fail();\r\n } catch (Exception e) {\r\n assertEquals(0, test.size());\r\n }\r\n\r\n test.addTestingType(\"TestType1\", \"test1\");\r\n test.addTestingType(\"TestType2\", \"test2\");\r\n test.addTestingType(\"TestType3\", \"test3\");\r\n test.addTestingType(\"TestType4\", \"test4\");\r\n test.addTestingType(\"TestType5\", \"test5\");\r\n test.addTestingType(\"TestType6\", \"test6\");\r\n test.addTestingType(\"TestType7\", \"test7\");\r\n\r\n assertEquals(\"TestType4\", test.removeTestingTypeAt(3).getName());\r\n\r\n try {\r\n test.removeTestingTypeAt(6);\r\n fail();\r\n } catch (Exception e) {\r\n assertEquals(6, test.size());\r\n }\r\n\r\n }",
"@Override\n public synchronized E remove(int index) {\n E result = this.get(index);\n if (index < this.size() - 1) {\n System.arraycopy(this.container, index + 1, this.container, index, this.size() - (index + 1));\n }\n this.container[--this.pointer] = null;\n return result;\n }",
"public U remove(int idx){\r\n\t \tif ((idx < 0)|| (idx > numElems-1))\r\n\t \t\tthrow new IndexOutOfBoundsException();\r\n\t \tint i = idx;\r\n\t \t@SuppressWarnings(\"unchecked\")\r\n\t\t\tU data = (U) array[i];\r\n\t \t//Same shift algorithm as other remove method\r\n\t \twhile(i<numElems-1){\r\n\t \t\tarray[i]= array[i+1];\r\n\t \t\ti++;\r\n\t \t}\r\n\t \t//Not sure if needed: set last element to null after shift\r\n\t \tarray[numElems-1] = null;\r\n\t \tnumElems--;\r\n\t \treturn data;\r\n\t }",
"@Test\r\n\tpublic void testRemoveInt() {\r\n\t\tll.add(t1);\r\n\t\tll.add(t2);\r\n\t\tll.add(t3);\r\n\t\tll.add(t4);\r\n\t\tll.add(t5);\r\n\t\tassertEquals(5, ll.size());\r\n\t\t// order of list: [0: t1, 1: t2, 2: t3, 3: t4, 4: t5]\r\n\t\t\r\n\t\ttry {\r\n\t\t\tll.remove(-1);\r\n\t\t\tfail();\r\n\t\t} catch (IndexOutOfBoundsException e) {\r\n\t\t\tassertEquals(5, ll.size());\r\n\t\t}\r\n\t\t\r\n\t\ttry {\r\n\t\t\tll.remove(5);\r\n\t\t\tfail();\r\n\t\t} catch (IndexOutOfBoundsException e) {\r\n\t\t\tassertEquals(5, ll.size());\r\n\t\t}\r\n\t\t\r\n\t\tll.remove(0);\r\n\t\tassertEquals(4, ll.size());\r\n\t\tassertEquals(t2, ll.get(0));\r\n\t\t// order of list: [0: t2, 1: t3, 2: t4, 3: t5]\r\n\t\t\r\n\t\tll.remove(ll.size() - 1);\r\n\t\tassertEquals(3, ll.size());\r\n\t\tassertEquals(t4, ll.get(2));\r\n\t\t// order of list: [0: t2, 1: t3, 2: t4]\r\n\t\t\r\n\t\tll.remove(1);\r\n\t\tassertEquals(2, ll.size());\r\n\t\tassertEquals(t2, ll.get(0));\r\n\t\tassertEquals(t4, ll.get(1));\r\n\t\t// order of list: [0: t2, 1: t4]\r\n\t\t\r\n\t\tll.remove(0);\r\n\t\tassertEquals(1, ll.size());\r\n\t\tassertEquals(t4, ll.get(0));\r\n\t\t// order of list: [0: t4]\r\n\t\t\r\n\t\tll.remove(0);\r\n\t\tassertEquals(0, ll.size());\r\n\t}",
"void remove (int offset, int size);",
"void removeAt(final int removeIndex) {\n final Object[] items = this.items;\n if (removeIndex == takeIndex) {\n items[takeIndex] = null;\n if (++takeIndex == items.length) takeIndex = 0;\n count--;\n } else {\n final int putIndex = this.putIndex;\n for (int i = removeIndex;;) {\n int next = i + 1;\n if (next == items.length) next = 0;\n if (next != putIndex) {\n items[i] = items[next];\n i = next;\n } else {\n items[i] = null;\n this.putIndex = i;\n break;\n }\n }\n count--;\n }\n notFull.signal();\n }",
"public void remove() {\n elements[index] = null;\n size--;\n next();\n }",
"public int removeByIndex(int removeIndex) \n\t{\n\t\tif (removeIndex < arraySize && removeIndex > -1)\n\t\t{\n\t\t\tint element = array[removeIndex];\n\t\t\tfor (int index = removeIndex + 1; index < arraySize; index++)\n\t\t\t{\n\t\t\t\tarray[index - 1] = array[index];\n\t\t\t}\n\t\t\tarraySize--;\n\t\t\treturn element;\n\t\t}\t\n\t\tSystem.out.println(\"Syntax error, element not found.\");\n\t\treturn -1;\n\t\n\t}",
"public int remove(int index) {\n // Gracefully handle items beyond end\n final int size = mItems.size();\n index = constrain(index, 0, size - 1);\n\n mItems.remove(index);\n return index;\n }",
"public void removeObject(int i);",
"@Override\n public E remove(int index) {\n\t E first = _store[index];\n\t _store[index] = null;\n\t for( int i = index; i< _size-1;i++) {\n\t\t _store[i]=_store[i+1];\n\t }\n\t_store[_size-1]=null;\n\t _size -=1;\n\t \n\t\t \n\treturn first;\n }",
"private T remove(int idx) {\n if (head == null) {\n throw new IllegalArgumentException(\"The list is empty\");\n }\n if (idx < 0 || idx > size - 1) {\n throw new IndexOutOfBoundsException();\n }\n\n // now the idx is valid\n // if we only have one element\n if (head.prev == null) {\n T ret = (T) head.val;\n head = null;\n tail = null;\n size = 0;\n return ret;\n }\n\n // we have more than one element\n int k = idx;\n ListNode curr = tail;\n while (k-- > 0) {\n curr = curr.next;\n }\n\n T ret = (T) curr.val;\n\n // now we need to remove this curr\n // curr is tail\n if (curr.prev == null) {\n tail = curr.next;\n tail.prev = null;\n }\n // curr is head\n else if (curr.next == null) {\n head = curr.prev;\n head.next = null;\n }\n // curr is in the middle\n else {\n curr.prev.next = curr.next;\n curr.next.prev = curr.prev;\n }\n\n curr.prev = null;\n curr.next = null;\n size--;\n return ret;\n }"
] | [
"0.7994699",
"0.7810898",
"0.78073955",
"0.78073955",
"0.78073955",
"0.78073955",
"0.7807332",
"0.7704101",
"0.7667972",
"0.7624221",
"0.7612805",
"0.7608481",
"0.75779927",
"0.75522816",
"0.75070184",
"0.74957585",
"0.74560297",
"0.74560297",
"0.7446564",
"0.74329454",
"0.74178433",
"0.740872",
"0.7395218",
"0.73699856",
"0.73638004",
"0.7357393",
"0.73163545",
"0.7280722",
"0.72517073",
"0.7209764",
"0.71984804",
"0.7193568",
"0.71747315",
"0.71431667",
"0.71332604",
"0.7115285",
"0.7100446",
"0.7082119",
"0.70706224",
"0.7029552",
"0.70156986",
"0.70092994",
"0.6999245",
"0.6991541",
"0.6977046",
"0.6961082",
"0.6933806",
"0.69176495",
"0.6908963",
"0.689548",
"0.68805707",
"0.6877348",
"0.6871966",
"0.686353",
"0.6863146",
"0.6847716",
"0.68072456",
"0.67888844",
"0.6772961",
"0.6770367",
"0.67413217",
"0.6729917",
"0.66700935",
"0.6646009",
"0.6644565",
"0.66391164",
"0.66376096",
"0.6636044",
"0.6628356",
"0.66283417",
"0.66235197",
"0.6615395",
"0.66140765",
"0.6613742",
"0.66027576",
"0.6595757",
"0.65884304",
"0.65879583",
"0.6579056",
"0.65690565",
"0.6565173",
"0.6562996",
"0.65598786",
"0.6558585",
"0.65581137",
"0.65532005",
"0.6551651",
"0.6542737",
"0.6538861",
"0.6538016",
"0.6514587",
"0.6513678",
"0.65052223",
"0.6501517",
"0.6499273",
"0.64897424",
"0.6487498",
"0.64874744",
"0.6479952",
"0.647323"
] | 0.7412996 | 21 |
The specified backbone distance tolerance value. | public int getBackboneDistanceTolerance() {
return backboneDistanceTolerance;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public double getTolerance() {\n\treturn tolerance;\n }",
"public double tolerance() {return tolerance;}",
"public static double computeTolerance(vtkCanvas canvas, double tolerance)\n\t{\n\t\tdouble[] range = canvas.GetRenderer().GetActiveCamera().GetClippingRange();\n\t\tdouble n = range[0];\n\t\tdouble f = range[1];\n\t\tdouble distance = canvas.GetRenderer().GetActiveCamera().GetDistance();\n\t\t\n\t\tdouble distanceTolerance = tolerance * (f - n);\n\n\t\t// Compute the z of the focal point (point of interest)\n\t\tdouble d1 = eyeZToNormalizedEyeZ(distance, n, f);\n\n\t\t// Compute the z of the distance tolerance\n\t\t// If we are before the far we take distance + distanceTolerance else we take -\n\t\tdouble d2 = (distance + distanceTolerance < f) ? distance + distanceTolerance : distance - distanceTolerance;\n\t\td2 = eyeZToNormalizedEyeZ(d2, n, f);\n\n\t\t// Compute the delta tolerance for the z-buffer value\n\t\treturn Math.abs(d1 - d2);\n\t}",
"public void setTolerance(double tolerance) {\n\tthis.tolerance = tolerance;\n }",
"@Override\r\n protected double getToleranceForAssertions(final double longitude, final double latitude) {\r\n final double delta = abs(longitude - centralMeridian)/2 +\r\n abs(latitude - latitudeOfOrigin);\r\n if (delta > 40) {\r\n return 0.5;\r\n }\r\n if (delta > 15) {\r\n return 0.1;\r\n }\r\n return super.getToleranceForAssertions(longitude, latitude);\r\n }",
"public int getSideChainDistanceTolerance() {\n return sideChainDistanceTolerance;\n }",
"public synchronized void setTargetTolerance(double tolerance)\n {\n this.tolerance = tolerance;\n }",
"public double getVertexTolerance() {\n return vertexTolerance;\n }",
"@DBField\n public void setDistance(float distance){\n this.distance = distance;\n }",
"public int getAngleTolerance() {\n return angleTolerance;\n }",
"public void setVarimaxTolerance(double tolerance){\n this.varimaxTolerance = tolerance;\n }",
"double getDistance();",
"public void setDistance(float dist);",
"public float getDistance();",
"public DraggableBehavior setSnapTolerance(int snapTolerance)\n\t{\n\t\tthis.options.put(\"snapTolerance\", snapTolerance);\n\t\treturn this;\n\t}",
"public void setDistance(int value) {\n this.distance = value;\n }",
"public float getTheDistance(){\n\t\t\n\t\tdistance = sonic.getDistance();\n\t\tSystem.out.println(\"value:\"+ distance);\n\t\t//considering the test results we see after 23 cm we see the +1cm precision and below 23cm we see + 5cm range \n\t\tif (distance<=25){\n\t\treturn (distance-7);\n\t\t}\n\t\telse{return (distance-3);}\n\t}",
"public float getDistance()\n {\n return distance_slider.getValue() / DISTANCE_SCALE_FACTOR;\n }",
"public double getDistance()\n {\n return Math.abs(getDifference());\n }",
"void setDistanceInKm(float distanceInKm);",
"float getFocusDistancePref(boolean is_target_distance);",
"public float getDistance() {\n return distance;\n }",
"public double getVertexTolerance2() {\n return vertexTolerance2;\n }",
"public static double getTolerance(vtkRenderer renderer, int pixelSize)\n\t{\n\t\tint[] size = renderer.GetSize();\n\t\t// The diagonal of the renderer\n\t\tdouble diagonal = Math.sqrt(size[0]*size[0] + size[1]*size[1]);\n\t\n\t\treturn ((double) pixelSize) / (diagonal * 2.);\n\t}",
"public float getDistance() {\r\n return distance;\r\n }",
"public double getDistance () {\n return distance;\n }",
"private String GetTolerance(int Value)\n {\n if (Value == 0)\n return \"+5% de tolerancia\";\n else\n return \"+10% de tolerancia\";\n }",
"public void setDistance(float distance) {\n this.distance = distance;\n }",
"public float getDistance() {\n return distance;\n }",
"public void testGetDistancedoubledouble() {\r\n\t\tCircleArc2D arc = new CircleArc2D(new Point2D(0, 0), 10, 0, PI/2);\r\n\t\tassertEquals(arc.distance(0, 0), 10, Shape2D.ACCURACY);\r\n\t\tassertEquals(arc.distance(10, 0), 0, Shape2D.ACCURACY);\r\n\t\tassertEquals(arc.distance(0, 10), 0, Shape2D.ACCURACY);\r\n\t\tassertEquals(arc.distance(10, -10), 10, Shape2D.ACCURACY);\t\t\r\n\t\tassertEquals(arc.distance(10, 10), (10*(Math.sqrt(2)-1)), Shape2D.ACCURACY);\t\t\r\n\t}",
"public static double getTargetDistance(double value) {\n double distance;\n if (value < 0)\n distance = -1.0;\n\n if (value >= 0 && value < 150)\n distance = -1.0;\n else if (value >= 150 && value < 300)\n distance = 0.0;\n else\n distance = 1.0;\n\n return distance;\n }",
"public void setDistance(double distance) {\r\n this.distance = distance;\r\n }",
"public double getDistance(){\n\t\treturn this.distance;\n\t}",
"public double getTOL() {\n return TOL;\n }",
"double getDistanceInMiles();",
"public void setPredictedDistance(double val) {\r\n predictedDistance = val;\r\n }",
"public double getDistance() {\n return distance;\n }",
"public void testDistanceTo() {\n City boston = new City(\"Boston\", 42.3601, -71, 1);\n City austin = new City(\"Austin\", 30.26, -97, 2);\n\n assertEquals(2674.2603695871003, boston.distanceTo(austin));\n assertEquals(2674.2603695871003, austin.distanceTo(boston));\n }",
"public void setDistanceFunction(DistanceFunction distanceFunction);",
"public void setDistance(double distance) {\n this.distance = distance;\n }",
"public void setDistance(double distance) {\n this.distance = distance;\n }",
"public double getDistance() {\r\n return this.distance;\r\n }",
"@SuppressWarnings(\"unused\")\n double getDistanceCloseToGoal() {\n return mDistanceCloseToGoal;\n }",
"public void setDistance(double distance) {\r\n\t\tthis.distance = distance;\r\n\t}",
"public double getDistance() {\n\t\treturn distance;\n\t}",
"public double getDistance() {\n\t\treturn distance;\n\t}",
"private float checkDistance(float d) {\r\n if (d < 0) {\r\n return 0f;\r\n }\r\n if (d > 1) {\r\n return 1f;\r\n }\r\n return d;\r\n }",
"public int compareDistance(Route r2) {\n return this.distance - r2.distance;\n }",
"public void driveToDistance(double distance) {\n //TODO\n }",
"public float getDistance() {\n shouldUpdateDistance = true;\n if (shouldUpdateDistance) {\n distance = getDistance(createSuggestedWindowFilter());\n shouldUpdateDistance = false;\n }\n return distance;\n }",
"public double getDistance() {\n return this.distance;\n }",
"public final float getDistance() {\n return distance;\n }",
"public double getDistance(){\n return sensor.getVoltage()*100/2.54 - 12;\n }",
"private float updateTolerance(\n MultipleNodesExtractorIx pageExt,\n Set<String> ids, float tolerance) throws ParserException {\n \n float oldTolerance = -1;\n \n if(ids.isEmpty()) {\n return oldTolerance;\n }\n\n for(String id:ids) {\n\n NodeExtractorIx nodeExt = pageExt.getExtractor(id);\n NodeVisitingFilterIx visitingFilter = nodeExt.getFilter();\n TagLocatorIx tagLocator = visitingFilter.getTagLocator();\n if(tagLocator != null) {\n oldTolerance = tagLocator.getTolerance();\n tagLocator.setTolerance(tolerance);\n }\n }\n\nXLogger.getInstance().log(Level.FINER, \"Updated tolerance from {0} to {1}\", \n this.getClass(), oldTolerance, tolerance);\n\n \n return oldTolerance;\n }",
"@Override\n public void testIncreasingTolerance() {\n doTestIncreasingTolerance(Decimal64Field.getInstance(), 1.3, 1.0e-12);\n }",
"Execution getClosestDistance();",
"public double getDist() {\n return distance;\n }",
"public void getMissDistance() {\n missDistance = targetDistance - projDistance;\n }",
"public void setDistance(int d) {\r\n\t\tdistance = d;\r\n\t}",
"private static boolean _close(Option<Double> a, Option<Double> b, Double tolerance) {\n return a.flatMap(a0 -> b.map(b0 -> Math.abs(a0 - b0) <= tolerance)).getOrElse(false);\n }",
"public double distance() {\n return distance;\n }",
"public double distance() {\n return distance;\n }",
"public static double deadband(double input, double tolerance){\n\t\tif(Math.abs(input) < tolerance){\n\t\t\treturn 0;\n\t\t}\n\t\telse{\n\t\t\treturn input;\n\t\t}\t\n\t}",
"public void setDistance(double distance) {\n\t\tthis.distance = distance;\n\t}",
"public double\ntValue(double distance)\n{\n\treturn (distance/this.length());\n}",
"public void setDistance( float distance )\n {\n distance = Math.abs(distance);\n if ( distance == 0 )\n distance = 1;\n distance_slider.setValue( (int)(DISTANCE_SCALE_FACTOR * distance) );\n }",
"public AbsoluteTimedTolerance(double toleranceDist, double minTime) {\n\t\t\tsuper(minTime);\n\t\t\tm_toleranceDist = toleranceDist;\n\t\t}",
"public ForwardRateVolatilitySurfaceCurvature(final double tolerance) {\n\t\tsuper();\n\n\t\tthis.tolerance = tolerance;\n\t}",
"public double distance(){\n return DistanceTraveled;\n }",
"public Vector3D getDistance()\n\t{\n\t\treturn distance;\n\t}",
"public Distance getDistance() {\n return distance;\n }",
"double getSquareDistance();",
"public void setColorToleranceBlue(double tolerance) {\n //Reset the detector first\n blueDetector = new ColorBlobDetector(Constants.COLOR_BLUE_LOWER, Constants.COLOR_BLUE_UPPER);\n double[] center = blueDetector.getColorCenter().getScalar().val;\n double[] radius = blueDetector.getColorRadius().val;\n radius = getColorWithTolerance(radius, tolerance);\n Scalar lower = new Scalar(center[0] - radius[0], center[1] - radius[1], center[2] - radius[2]);\n Scalar upper = new Scalar(center[0] + radius[0], center[1] + radius[1], center[2] + radius[2]);\n blueDetector = new ColorBlobDetector(new ColorHSV(lower), new ColorHSV(upper));\n }",
"public abstract double GetDistance();",
"public boolean levenshteinDistanceMatch(String first,String second,double tolerance)\n\t{\n\t\tboolean result = false;\n\t\t\n\t\tdouble score = matchingScore(first, second);\n\t\t\n\t\tif(score <= tolerance)\n\t\t{\n\t\t\tscore = Math.floor(score*100)/100;\n\t\t\ttolList.add(score);\n\t\t\tresult = true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tresult = false;\n\t\t}\n\t\t\n\t\treturn result;\n\t}",
"public double getMinimumDistance() { return minDistance; }",
"public double getDistance() { \n\t\treturn Math.pow(input.getAverageVoltage(), exp) * mul; \n\t}",
"public int getDistance() {\r\n\t\treturn distance;\r\n\t}",
"public int getDistance() {\r\n\t\treturn distance;\r\n\t}",
"public final void setDistance(float distance) {\n this.distance = distance;\n }",
"public int distance() {\n return distance;\n }",
"public double getDist(){\n double dist=0;\n double DA = 0;\n double minDist = this.getMotors()[0].getTargetPosition();\n for(int i =0;i<this.getMotors().length;i++) {\n double current = this.getMotors()[i].getCurrentPosition();\n double target = this.getMotors()[i].getTargetPosition();\n DA = Math.abs(target) - Math.abs(current);\n dist = target - current;\n if(Math.abs(DA)<Math.abs(minDist)){\n minDist = dist;\n }\n }\n return (minDist);\n }",
"public int getDistance() {\n return distance;\n }",
"public int getDistance() {\n return distance;\n }",
"@Test\n\tpublic void evalCrispDistanceWithFuzzyNumberOverlap2(){\n\t\tFuzzySet res = cs4.distance(dfn3);\n\t\tassertTrue(res instanceof FuzzyInterval);\n\t\tFuzzyInterval fuzzyRes = (FuzzyInterval)res;\n\t\t//Puntos limite\n\t\tassertTrue(fuzzyRes.getMembershipValue(0)==1);\n\t\tassertTrue(fuzzyRes.getMembershipValue(1)==1);\n\t\tassertTrue(fuzzyRes.getMembershipValue(2)==0);\n\t\t//Valores exteriores\n\t\tassertTrue(fuzzyRes.getMembershipValue(3)==0);\n\t\tassertTrue(fuzzyRes.getMembershipValue(-1)==0);\n\t}",
"private double getDistance() {\n\t\tfinal double h2 = 86.7;\n\t\t// h1: height of top of camera\n\t\tfinal double h1 = 17.6;\n\n\t\t// a1: angle of camera (relative to chasis)\n\t\tfinal double a1 = 36.175;\n\t\t// a2: angle of target relative to a1\n\t\tfinal double a2 = ty.getDouble(0.0);\n\n\t\t// distance: distance from camera to base of target\n\t\tfinal double distance = ((h2 - h1) / Math.tan(Math.toRadians(a1 + a2)));\n\n\t\tfinal double d = Math.sqrt(Math.pow(h2 - h1, 2) + Math.pow(distance, 2));\n\t\tSmartDashboard.putNumber(\"Py Distance\", d);\n\n\t\treturn (distance);\n\n\t}",
"public void setColorToleranceRed(double tolerance) {\n //Reset the detector first\n redDetector = new ColorBlobDetector(Constants.COLOR_RED_LOWER, Constants.COLOR_RED_UPPER);\n double[] center = redDetector.getColorCenter().getScalar().val;\n double[] radius = redDetector.getColorRadius().val;\n radius = getColorWithTolerance(radius, tolerance);\n Scalar lower = new Scalar(center[0] - radius[0], center[1] - radius[1], center[2] - radius[2]);\n Scalar upper = new Scalar(center[0] + radius[0], center[1] + radius[1], center[2] + radius[2]);\n redDetector = new ColorBlobDetector(new ColorHSV(lower), new ColorHSV(upper));\n }",
"public float getDistance(){\n\t\t\treturn s1.start.supportFinal.dot(normal);\n\t\t}",
"@Test\n\tpublic void evalCrispDistanceWithFuzzyNumberOverlap1(){\n\t\tFuzzySet res = cs4.distance(dfn2);\n\t\tassertTrue(res instanceof FuzzyInterval);\n\t\tFuzzyInterval fuzzyRes = (FuzzyInterval)res;\n\t\t//Puntos limite\n\t\tassertTrue(fuzzyRes.getMembershipValue(0)==1);\n\t\tassertTrue(fuzzyRes.getMembershipValue(1)==1);\n\t\tassertTrue(fuzzyRes.getMembershipValue(2)==1);\n\t\t//Valores extremos\n\t\tassertTrue(fuzzyRes.getMembershipValue(3)==0);\n\t\t//Valores exteriores\n\t\tassertTrue(fuzzyRes.getMembershipValue(3.1)==0);\n\t\tassertTrue(fuzzyRes.getMembershipValue(-1)==0);\n\t}",
"@Override\n public int compareTo(RouteNode o) {\n return Double.compare(this.estimatedDistanceToTarget, o.estimatedDistanceToTarget);\n }",
"private Distance(){}",
"public int getAbsoluteDistance() {\r\n\t\t\treturn Math.abs(distance);\r\n\t\t}",
"public void setViewDistance(float distance) { viewDistance = distance; }",
"@Test\n\tpublic void evalCrispDistanceWithFuzzyNumberOverlap4(){\n\t\tFuzzySet res = cs6.distance(dfn5);\n\t\tassertTrue(res instanceof FuzzyInterval);\n\t\tFuzzyInterval fuzzyRes = (FuzzyInterval)res;\n\t\t//Puntos limite\n\t\tassertTrue(fuzzyRes.getMembershipValue(1)==1);\n\t\tassertTrue(fuzzyRes.getMembershipValue(2)==1);\n\t\tassertTrue(fuzzyRes.getMembershipValue(3)==1);\n\t\t//Valores exteriores\n\t\tassertTrue(fuzzyRes.getMembershipValue(0)==0.5);\n\t\tassertTrue(fuzzyRes.getMembershipValue(3.5)==0.5);\n\t\tassertTrue(fuzzyRes.getMembershipValue(4)==0);\n\t}",
"public float getDistanceTo(DoGMaximum target)\n \t{\n \t\tif (target == null)\n \t\t\treturn Float.NaN;\n \t\t\n \t\tfloat difference = 0;\n \t\t\n\t\tdifference += Math.pow(this.x - target.x,2); \n\t\tdifference += Math.pow(this.y - target.y,2);\n\t\tdifference += Math.pow(this.z - target.z,2);\n\t\tdifference += Math.pow(this.sigma - target.sigma,2); \t\t\n \t\t\n\t\treturn (float)Math.sqrt(difference);\n \t}",
"@Test\n public void testGetPrecursorTolerance() {\n System.out.println(\"getPrecursorTolerance\");\n Data instance = null;\n double expResult = 0.0;\n double result = instance.getPrecursorTolerance();\n assertEquals(expResult, result, 0.0);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }",
"public double getDistanceCovored() {\n return distanceCovored;\n }",
"private double calculateEwaldCoefficient(double cutoffDistance, double tolerance)\n\t{\n\t\tint i,k;\n\t\tdouble x,xlo,xhi,y;\n\t\tdouble ratio;\n\t\tratio = tolerance + 1.0;\n\t\tx = 0.5;\n\t\ti = 0;\n\t\twhile (ratio >= tolerance){\n\t\t\ti = i + 1;\n\t\t\tx = 2.0 * x;\n\t\t\ty = x * cutoffDistance;\n\t\t\tratio = ErrorFunction.erfc(y) / cutoffDistance;\n\t\t}\n\t\t//use a binary search to refine the coefficient\n\t\tk = i + 60;\n\t\txlo = 0.0;\n\t\txhi = x;\n\t\tfor(i=0;i<k;i++){\n\t\t\tx = (xlo+xhi) / 2.0;\n\t\t\ty = x * cutoffDistance;\n\t\t\tratio = ErrorFunction.erfc(y) / cutoffDistance;\n\t\t\tif (ratio >= tolerance){\n\t\t\t\txlo = x;\n\t\t\t}\n\t\t\telse{\n\t\t\t\txhi = x;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"[SPMEList] Chose ewald coefficient of \"+x);\n\t\treturn x;\n\t}",
"public int getDistance() {\n\t\treturn distance;\n\t}",
"public float getDistanceFromBirth() {\n double dx = location.x - birthLocation.x;\n double dy = location.y - birthLocation.y;\n return (float) Math.sqrt(dx * dx + dy * dy);\n }"
] | [
"0.7119589",
"0.7038351",
"0.6843916",
"0.6731978",
"0.64380956",
"0.6080313",
"0.59133804",
"0.5808072",
"0.56700057",
"0.5653436",
"0.56021285",
"0.55862725",
"0.5548429",
"0.5548252",
"0.55394447",
"0.55145586",
"0.5445109",
"0.53938377",
"0.5379117",
"0.5376415",
"0.5373868",
"0.5353686",
"0.5332681",
"0.53198487",
"0.53198206",
"0.5296898",
"0.5284178",
"0.5278285",
"0.5272589",
"0.5267516",
"0.52598923",
"0.5254089",
"0.52529275",
"0.52321976",
"0.5230022",
"0.52175957",
"0.5203226",
"0.5198909",
"0.5170845",
"0.5156796",
"0.5156796",
"0.51353276",
"0.51154166",
"0.51124793",
"0.5110166",
"0.5110166",
"0.5103333",
"0.51008713",
"0.5093533",
"0.50858986",
"0.5073126",
"0.5072915",
"0.5069034",
"0.50519717",
"0.5050715",
"0.5043634",
"0.5036026",
"0.5026634",
"0.5021253",
"0.5004808",
"0.49999708",
"0.49999708",
"0.49870443",
"0.49843264",
"0.49826717",
"0.4981317",
"0.4977377",
"0.49726355",
"0.49566984",
"0.4955004",
"0.49454474",
"0.49389416",
"0.49377626",
"0.49267992",
"0.49001905",
"0.487503",
"0.48611784",
"0.48564896",
"0.48564896",
"0.48522615",
"0.48512906",
"0.4850987",
"0.48431095",
"0.48431095",
"0.48356694",
"0.48211488",
"0.48193872",
"0.48181653",
"0.48130086",
"0.4803803",
"0.4791277",
"0.4790719",
"0.47817495",
"0.4781267",
"0.47785723",
"0.47742838",
"0.476612",
"0.47548234",
"0.4750225",
"0.47422963"
] | 0.76731384 | 0 |
The specified sidechain distance tolerance value. | public int getSideChainDistanceTolerance() {
return sideChainDistanceTolerance;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public double tolerance() {return tolerance;}",
"public double getTolerance() {\n\treturn tolerance;\n }",
"public void setTolerance(double tolerance) {\n\tthis.tolerance = tolerance;\n }",
"public static double computeTolerance(vtkCanvas canvas, double tolerance)\n\t{\n\t\tdouble[] range = canvas.GetRenderer().GetActiveCamera().GetClippingRange();\n\t\tdouble n = range[0];\n\t\tdouble f = range[1];\n\t\tdouble distance = canvas.GetRenderer().GetActiveCamera().GetDistance();\n\t\t\n\t\tdouble distanceTolerance = tolerance * (f - n);\n\n\t\t// Compute the z of the focal point (point of interest)\n\t\tdouble d1 = eyeZToNormalizedEyeZ(distance, n, f);\n\n\t\t// Compute the z of the distance tolerance\n\t\t// If we are before the far we take distance + distanceTolerance else we take -\n\t\tdouble d2 = (distance + distanceTolerance < f) ? distance + distanceTolerance : distance - distanceTolerance;\n\t\td2 = eyeZToNormalizedEyeZ(d2, n, f);\n\n\t\t// Compute the delta tolerance for the z-buffer value\n\t\treturn Math.abs(d1 - d2);\n\t}",
"@Override\r\n protected double getToleranceForAssertions(final double longitude, final double latitude) {\r\n final double delta = abs(longitude - centralMeridian)/2 +\r\n abs(latitude - latitudeOfOrigin);\r\n if (delta > 40) {\r\n return 0.5;\r\n }\r\n if (delta > 15) {\r\n return 0.1;\r\n }\r\n return super.getToleranceForAssertions(longitude, latitude);\r\n }",
"public boolean levenshteinDistanceMatch(String first,String second,double tolerance)\n\t{\n\t\tboolean result = false;\n\t\t\n\t\tdouble score = matchingScore(first, second);\n\t\t\n\t\tif(score <= tolerance)\n\t\t{\n\t\t\tscore = Math.floor(score*100)/100;\n\t\t\ttolList.add(score);\n\t\t\tresult = true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tresult = false;\n\t\t}\n\t\t\n\t\treturn result;\n\t}",
"public synchronized void setTargetTolerance(double tolerance)\n {\n this.tolerance = tolerance;\n }",
"@Override\n public void testIncreasingTolerance() {\n doTestIncreasingTolerance(Decimal64Field.getInstance(), 1.3, 1.0e-12);\n }",
"double getDistance();",
"public void testGetDistancedoubledouble() {\r\n\t\tCircleArc2D arc = new CircleArc2D(new Point2D(0, 0), 10, 0, PI/2);\r\n\t\tassertEquals(arc.distance(0, 0), 10, Shape2D.ACCURACY);\r\n\t\tassertEquals(arc.distance(10, 0), 0, Shape2D.ACCURACY);\r\n\t\tassertEquals(arc.distance(0, 10), 0, Shape2D.ACCURACY);\r\n\t\tassertEquals(arc.distance(10, -10), 10, Shape2D.ACCURACY);\t\t\r\n\t\tassertEquals(arc.distance(10, 10), (10*(Math.sqrt(2)-1)), Shape2D.ACCURACY);\t\t\r\n\t}",
"private static boolean _close(Option<Double> a, Option<Double> b, Double tolerance) {\n return a.flatMap(a0 -> b.map(b0 -> Math.abs(a0 - b0) <= tolerance)).getOrElse(false);\n }",
"Execution getClosestDistance();",
"public static double deadband(double input, double tolerance){\n\t\tif(Math.abs(input) < tolerance){\n\t\t\treturn 0;\n\t\t}\n\t\telse{\n\t\t\treturn input;\n\t\t}\t\n\t}",
"private String GetTolerance(int Value)\n {\n if (Value == 0)\n return \"+5% de tolerancia\";\n else\n return \"+10% de tolerancia\";\n }",
"public int getBackboneDistanceTolerance() {\n return backboneDistanceTolerance;\n }",
"public double getVertexTolerance() {\n return vertexTolerance;\n }",
"public void setDistance(int value) {\n this.distance = value;\n }",
"public double getTOL() {\n return TOL;\n }",
"public void driveToDistance(double distance) {\n //TODO\n }",
"public void setDistance(float dist);",
"private double calculateEwaldCoefficient(double cutoffDistance, double tolerance)\n\t{\n\t\tint i,k;\n\t\tdouble x,xlo,xhi,y;\n\t\tdouble ratio;\n\t\tratio = tolerance + 1.0;\n\t\tx = 0.5;\n\t\ti = 0;\n\t\twhile (ratio >= tolerance){\n\t\t\ti = i + 1;\n\t\t\tx = 2.0 * x;\n\t\t\ty = x * cutoffDistance;\n\t\t\tratio = ErrorFunction.erfc(y) / cutoffDistance;\n\t\t}\n\t\t//use a binary search to refine the coefficient\n\t\tk = i + 60;\n\t\txlo = 0.0;\n\t\txhi = x;\n\t\tfor(i=0;i<k;i++){\n\t\t\tx = (xlo+xhi) / 2.0;\n\t\t\ty = x * cutoffDistance;\n\t\t\tratio = ErrorFunction.erfc(y) / cutoffDistance;\n\t\t\tif (ratio >= tolerance){\n\t\t\t\txlo = x;\n\t\t\t}\n\t\t\telse{\n\t\t\t\txhi = x;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"[SPMEList] Chose ewald coefficient of \"+x);\n\t\treturn x;\n\t}",
"public double getVertexTolerance2() {\n return vertexTolerance2;\n }",
"public void setVarimaxTolerance(double tolerance){\n this.varimaxTolerance = tolerance;\n }",
"@DBField\n public void setDistance(float distance){\n this.distance = distance;\n }",
"double getDistanceInMiles();",
"public int getAngleTolerance() {\n return angleTolerance;\n }",
"public float getDistance();",
"@Test\n public void testDistanceTo() {\n System.out.println(\"Testing distanceTo() for a range of different GPS coordinates\");\n double distancesExpected[] = {\n 786.3,\n 786.3,\n 786.3,\n 786.3,\n\t\t\t102.2,\n\t\t\t102.2,\n\t\t\t102.2,\n\t\t\t102.2\n };\n\t\t\n for (int i = 0; i < this.testCoordinates.length; i++) {\n double expResult = distancesExpected[i];\n double result = this.origin.distanceTo(this.testCoordinates[i]);\n\t\t\tSystem.out.println(\"Expected: \" + expResult + \", Actual: \" + result);\n assertEquals(expResult, result, 0.1);\n }\n }",
"@Test\n\tpublic void evalCrispDistanceWithFuzzyNumberOverlap2(){\n\t\tFuzzySet res = cs4.distance(dfn3);\n\t\tassertTrue(res instanceof FuzzyInterval);\n\t\tFuzzyInterval fuzzyRes = (FuzzyInterval)res;\n\t\t//Puntos limite\n\t\tassertTrue(fuzzyRes.getMembershipValue(0)==1);\n\t\tassertTrue(fuzzyRes.getMembershipValue(1)==1);\n\t\tassertTrue(fuzzyRes.getMembershipValue(2)==0);\n\t\t//Valores exteriores\n\t\tassertTrue(fuzzyRes.getMembershipValue(3)==0);\n\t\tassertTrue(fuzzyRes.getMembershipValue(-1)==0);\n\t}",
"public void setDistance(double distance) {\r\n this.distance = distance;\r\n }",
"public float getTheDistance(){\n\t\t\n\t\tdistance = sonic.getDistance();\n\t\tSystem.out.println(\"value:\"+ distance);\n\t\t//considering the test results we see after 23 cm we see the +1cm precision and below 23cm we see + 5cm range \n\t\tif (distance<=25){\n\t\treturn (distance-7);\n\t\t}\n\t\telse{return (distance-3);}\n\t}",
"@Test\r\n public void testGetDistanceOfRoute() {\r\n System.out.println(\"getDistanceOfRoute\");\r\n \r\n String name = \"KiwiLand\";\r\n List<String> _lstStr = Arrays.asList(\"AB5\", \"BC4\", \"CD8\", \"DC8\", \"DE6\", \"AD5\", \"CE2\", \"EB3\", \"AE7\");\r\n Compute instance = new Compute();\r\n instance.initLand(name, _lstStr);\r\n String _strRoute = \"A-B-C\";\r\n int expResult = 9; \r\n int result = instance.getDistanceOfRoute(_strRoute);\r\n assertEquals(expResult, result);\r\n _strRoute = \"A-D\";\r\n expResult = 5;\r\n result = instance.getDistanceOfRoute(_strRoute);\r\n assertEquals(expResult, result);\r\n _strRoute = \"A-D-C\";\r\n expResult = 13;\r\n result = instance.getDistanceOfRoute(_strRoute);\r\n assertEquals(expResult, result);\r\n _strRoute = \"A-E-B-C-D\";\r\n expResult = 22;\r\n result = instance.getDistanceOfRoute(_strRoute);\r\n assertEquals(expResult, result);\r\n _strRoute = \"A-E-D\";\r\n expResult = -1;\r\n result = instance.getDistanceOfRoute(_strRoute);\r\n assertEquals(expResult, result);\r\n \r\n\r\n }",
"@Test\n\tpublic void evalCrispDistanceWithFuzzyNumberOverlap1(){\n\t\tFuzzySet res = cs4.distance(dfn2);\n\t\tassertTrue(res instanceof FuzzyInterval);\n\t\tFuzzyInterval fuzzyRes = (FuzzyInterval)res;\n\t\t//Puntos limite\n\t\tassertTrue(fuzzyRes.getMembershipValue(0)==1);\n\t\tassertTrue(fuzzyRes.getMembershipValue(1)==1);\n\t\tassertTrue(fuzzyRes.getMembershipValue(2)==1);\n\t\t//Valores extremos\n\t\tassertTrue(fuzzyRes.getMembershipValue(3)==0);\n\t\t//Valores exteriores\n\t\tassertTrue(fuzzyRes.getMembershipValue(3.1)==0);\n\t\tassertTrue(fuzzyRes.getMembershipValue(-1)==0);\n\t}",
"double getSquareDistance();",
"public static double getTolerance(vtkRenderer renderer, int pixelSize)\n\t{\n\t\tint[] size = renderer.GetSize();\n\t\t// The diagonal of the renderer\n\t\tdouble diagonal = Math.sqrt(size[0]*size[0] + size[1]*size[1]);\n\t\n\t\treturn ((double) pixelSize) / (diagonal * 2.);\n\t}",
"public DraggableBehavior setSnapTolerance(int snapTolerance)\n\t{\n\t\tthis.options.put(\"snapTolerance\", snapTolerance);\n\t\treturn this;\n\t}",
"private float checkDistance(float d) {\r\n if (d < 0) {\r\n return 0f;\r\n }\r\n if (d > 1) {\r\n return 1f;\r\n }\r\n return d;\r\n }",
"public double getDistance()\n {\n return Math.abs(getDifference());\n }",
"public double getDistance () {\n return distance;\n }",
"private float updateTolerance(\n MultipleNodesExtractorIx pageExt,\n Set<String> ids, float tolerance) throws ParserException {\n \n float oldTolerance = -1;\n \n if(ids.isEmpty()) {\n return oldTolerance;\n }\n\n for(String id:ids) {\n\n NodeExtractorIx nodeExt = pageExt.getExtractor(id);\n NodeVisitingFilterIx visitingFilter = nodeExt.getFilter();\n TagLocatorIx tagLocator = visitingFilter.getTagLocator();\n if(tagLocator != null) {\n oldTolerance = tagLocator.getTolerance();\n tagLocator.setTolerance(tolerance);\n }\n }\n\nXLogger.getInstance().log(Level.FINER, \"Updated tolerance from {0} to {1}\", \n this.getClass(), oldTolerance, tolerance);\n\n \n return oldTolerance;\n }",
"public void testClosestApprochDist() {\r\n System.out.println(\"closestApprochDist\");\r\n\r\n ParametricLine2d other = new ParametricLine2d(new Point2d(), new Vector2d(0.0, 1.0));;\r\n ParametricLine2d instance = new ParametricLine2d();\r\n\r\n double expResult = 0.0;\r\n double result = instance.closestApprochDist(other);\r\n assertEquals(expResult, result);\r\n }",
"public void setDistanceFunction(DistanceFunction distanceFunction);",
"public static double getTargetDistance(double value) {\n double distance;\n if (value < 0)\n distance = -1.0;\n\n if (value >= 0 && value < 150)\n distance = -1.0;\n else if (value >= 150 && value < 300)\n distance = 0.0;\n else\n distance = 1.0;\n\n return distance;\n }",
"public void setDistance(double distance) {\n this.distance = distance;\n }",
"public void setDistance(double distance) {\n this.distance = distance;\n }",
"public double getLinkCapacityOverLinkBetween(int otherASN, Double bandwidthTolerance) {\n HashMap<Double, Double> bandwidthToleranceToLinkCapacities = this.linkCapacities.get(otherASN);\n if (bandwidthToleranceToLinkCapacities == null) {\n System.out.println(\"This link does not have a bandwidth tolerance to link capacity map.\");\n System.out.println(\"Returning 1.0 for link capacity.\");\n // This is clearly wrong until we figure out how many are null.\n return 1.0;\n }\n\n Double linkCapacity = bandwidthToleranceToLinkCapacities.get(bandwidthTolerance);\n\n if (linkCapacity == null) {\n System.out.println(\"This link does not have a bandwidth capacity.\");\n System.out.println(\"Returning 1.0 for link capacity.\");\n // This is clearly wrong until we figure out how many are null.\n return 1.0;\n }\n\n return linkCapacity;\n }",
"@Test\n public void testGetPrecursorTolerance() {\n System.out.println(\"getPrecursorTolerance\");\n Data instance = null;\n double expResult = 0.0;\n double result = instance.getPrecursorTolerance();\n assertEquals(expResult, result, 0.0);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }",
"public void testDistanceTo() {\n City boston = new City(\"Boston\", 42.3601, -71, 1);\n City austin = new City(\"Austin\", 30.26, -97, 2);\n\n assertEquals(2674.2603695871003, boston.distanceTo(austin));\n assertEquals(2674.2603695871003, austin.distanceTo(boston));\n }",
"void setDistanceInKm(float distanceInKm);",
"public static native void OpenMM_AmoebaVdwForce_setCutoffDistance(PointerByReference target, double distance);",
"public double getDistance() { \n\t\treturn Math.pow(input.getAverageVoltage(), exp) * mul; \n\t}",
"private boolean isInDistanceLimit(double distance) {\n return distance < distanceLimit;\n }",
"public double calculateExpectedDisagreement();",
"public void setDistance(float distance) {\n this.distance = distance;\n }",
"public double distance(){\n return DistanceTraveled;\n }",
"public void setDistance(double distance) {\r\n\t\tthis.distance = distance;\r\n\t}",
"public double getDistance(){\n\t\treturn this.distance;\n\t}",
"public void setDistance(int d) {\r\n\t\tdistance = d;\r\n\t}",
"public AbsoluteTimedTolerance(double toleranceDist, double minTime) {\n\t\t\tsuper(minTime);\n\t\t\tm_toleranceDist = toleranceDist;\n\t\t}",
"public void testClosestApprochDistSqr() {\r\n System.out.println(\"closestApprochDistSqr\");\r\n\r\n ParametricLine2d other = new ParametricLine2d(new Point2d(), new Vector2d(0.0, 1.0));\r\n ParametricLine2d instance = new ParametricLine2d();\r\n\r\n double expResult = 0.0;\r\n double result = instance.closestApprochDistSqr(other);\r\n assertEquals(expResult, result);\r\n }",
"public double getDistance() {\n return distance;\n }",
"@Test\n\tpublic void evalCrispDistanceWithFuzzyNumberOverlap4(){\n\t\tFuzzySet res = cs6.distance(dfn5);\n\t\tassertTrue(res instanceof FuzzyInterval);\n\t\tFuzzyInterval fuzzyRes = (FuzzyInterval)res;\n\t\t//Puntos limite\n\t\tassertTrue(fuzzyRes.getMembershipValue(1)==1);\n\t\tassertTrue(fuzzyRes.getMembershipValue(2)==1);\n\t\tassertTrue(fuzzyRes.getMembershipValue(3)==1);\n\t\t//Valores exteriores\n\t\tassertTrue(fuzzyRes.getMembershipValue(0)==0.5);\n\t\tassertTrue(fuzzyRes.getMembershipValue(3.5)==0.5);\n\t\tassertTrue(fuzzyRes.getMembershipValue(4)==0);\n\t}",
"public double getMaxSourceDistance();",
"private double lPDistance(Instance one, Instance two, int p_value) {\n\n double distanceSum = 0;\n\n for (int i = 0; i < one.numAttributes() - 1; i++) {\n distanceSum += Math.pow(Math.abs(one.value(i) - two.value(i)), p_value);\n }\n\n distanceSum = Math.pow(distanceSum, 1.0 / p_value); // Root in base P\n\n return distanceSum;\n\n }",
"private int getDistanceAsRange(double distance) {\n int div = (int) (distance * 1000 / slotDistanceRange);\n return (div * slotDistanceRange);\n }",
"public double getDistance(){\n return sensor.getVoltage()*100/2.54 - 12;\n }",
"@Test\r\n\tpublic void testDistancia0() \r\n\t{\r\n\t\tAssert.assertEquals(1.41, new Ponto(3,3).dist(new Ponto(4,2)), EPSILON);\r\n\t\tAssert.assertEquals(26.20, new Ponto(-7,-4).dist(new Ponto(17,6.5)), EPSILON);\t\r\n\t\tAssert.assertEquals(0.00, new Ponto(0,0).dist(new Ponto(0,0)), EPSILON);\t\r\n\t}",
"public double\ntValue(double distance)\n{\n\treturn (distance/this.length());\n}",
"Execution getFarthestDistance();",
"public void setDistance(double distance) {\n\t\tthis.distance = distance;\n\t}",
"public static double Ctolerance(double costC,double costS,double per)\r\n\t{\n\t\tdouble C=costC;\r\n\t\tdouble S=costS;\r\n\t\tdouble a=0.0;\r\n\t\tdouble b=0.0;\r\n\t\tdouble c=0.0;\r\n\t\tdouble Per=per;\r\n\t\ta=S;\r\n\t\tb=-(2*Per+1)*(C+S);\r\n\t\tc=C;\r\n\t\tdouble x1;\r\n\t\tdouble x2;\r\n\t\tx1=(-b+Math.sqrt(b*b-4*a*c))/(2*a);\r\n\t\tx2=(-b-Math.sqrt(b*b-4*a*c))/(2*a);\r\n\t\tif(x1<x2)\r\n\t\t\treturn x1;\r\n\t\telse \r\n\t\t\treturn x2;\r\n\t}",
"@Override\n\tpublic PredicateToken getDistancePredicate(SpatialOperatorName operator, Column targetColumn, GeometryObject geometry, double distance, boolean negate) {\n\t\treturn null;\n\t}",
"public void setMaxSourceDistance(double distance);",
"public static native void OpenMM_AmoebaMultipoleForce_setCutoffDistance(PointerByReference target, double distance);",
"public final flipsParser.distance_return distance() throws RecognitionException {\n flipsParser.distance_return retval = new flipsParser.distance_return();\n retval.start = input.LT(1);\n\n CommonTree root_0 = null;\n\n flipsParser.forwardBackwardDirection_return forwardBackwardDirection245 = null;\n\n flipsParser.distanceValue_return distanceValue246 = null;\n\n flipsParser.leftRightDirection_return leftRightDirection247 = null;\n\n flipsParser.distanceValue_return distanceValue248 = null;\n\n\n RewriteRuleSubtreeStream stream_leftRightDirection=new RewriteRuleSubtreeStream(adaptor,\"rule leftRightDirection\");\n RewriteRuleSubtreeStream stream_forwardBackwardDirection=new RewriteRuleSubtreeStream(adaptor,\"rule forwardBackwardDirection\");\n RewriteRuleSubtreeStream stream_distanceValue=new RewriteRuleSubtreeStream(adaptor,\"rule distanceValue\");\n try {\n // flips.g:395:2: ( ( forwardBackwardDirection )? distanceValue -> ^( DISTANCE RELATIVE X ( forwardBackwardDirection )? distanceValue ) | leftRightDirection distanceValue -> ^( DISTANCE RELATIVE Y leftRightDirection distanceValue ) )\n int alt105=2;\n int LA105_0 = input.LA(1);\n\n if ( ((LA105_0>=FloatingPointLiteral && LA105_0<=HexLiteral)||LA105_0==199||(LA105_0>=306 && LA105_0<=311)||(LA105_0>=340 && LA105_0<=341)) ) {\n alt105=1;\n }\n else if ( ((LA105_0>=312 && LA105_0<=317)) ) {\n alt105=2;\n }\n else {\n NoViableAltException nvae =\n new NoViableAltException(\"\", 105, 0, input);\n\n throw nvae;\n }\n switch (alt105) {\n case 1 :\n // flips.g:395:4: ( forwardBackwardDirection )? distanceValue\n {\n // flips.g:395:4: ( forwardBackwardDirection )?\n int alt104=2;\n int LA104_0 = input.LA(1);\n\n if ( (LA104_0==199||(LA104_0>=306 && LA104_0<=311)) ) {\n alt104=1;\n }\n switch (alt104) {\n case 1 :\n // flips.g:395:4: forwardBackwardDirection\n {\n pushFollow(FOLLOW_forwardBackwardDirection_in_distance2094);\n forwardBackwardDirection245=forwardBackwardDirection();\n\n state._fsp--;\n\n stream_forwardBackwardDirection.add(forwardBackwardDirection245.getTree());\n\n }\n break;\n\n }\n\n pushFollow(FOLLOW_distanceValue_in_distance2097);\n distanceValue246=distanceValue();\n\n state._fsp--;\n\n stream_distanceValue.add(distanceValue246.getTree());\n\n\n // AST REWRITE\n // elements: forwardBackwardDirection, distanceValue\n // token labels: \n // rule labels: retval\n // token list labels: \n // rule list labels: \n // wildcard labels: \n retval.tree = root_0;\n RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,\"rule retval\",retval!=null?retval.tree:null);\n\n root_0 = (CommonTree)adaptor.nil();\n // 396:2: -> ^( DISTANCE RELATIVE X ( forwardBackwardDirection )? distanceValue )\n {\n // flips.g:396:5: ^( DISTANCE RELATIVE X ( forwardBackwardDirection )? distanceValue )\n {\n CommonTree root_1 = (CommonTree)adaptor.nil();\n root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(DISTANCE, \"DISTANCE\"), root_1);\n\n adaptor.addChild(root_1, (CommonTree)adaptor.create(RELATIVE, \"RELATIVE\"));\n adaptor.addChild(root_1, (CommonTree)adaptor.create(X, \"X\"));\n // flips.g:396:27: ( forwardBackwardDirection )?\n if ( stream_forwardBackwardDirection.hasNext() ) {\n adaptor.addChild(root_1, stream_forwardBackwardDirection.nextTree());\n\n }\n stream_forwardBackwardDirection.reset();\n adaptor.addChild(root_1, stream_distanceValue.nextTree());\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:397:4: leftRightDirection distanceValue\n {\n pushFollow(FOLLOW_leftRightDirection_in_distance2118);\n leftRightDirection247=leftRightDirection();\n\n state._fsp--;\n\n stream_leftRightDirection.add(leftRightDirection247.getTree());\n pushFollow(FOLLOW_distanceValue_in_distance2120);\n distanceValue248=distanceValue();\n\n state._fsp--;\n\n stream_distanceValue.add(distanceValue248.getTree());\n\n\n // AST REWRITE\n // elements: distanceValue, leftRightDirection\n // token labels: \n // rule labels: retval\n // token list labels: \n // rule list labels: \n // wildcard labels: \n retval.tree = root_0;\n RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,\"rule retval\",retval!=null?retval.tree:null);\n\n root_0 = (CommonTree)adaptor.nil();\n // 398:2: -> ^( DISTANCE RELATIVE Y leftRightDirection distanceValue )\n {\n // flips.g:398:5: ^( DISTANCE RELATIVE Y leftRightDirection distanceValue )\n {\n CommonTree root_1 = (CommonTree)adaptor.nil();\n root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(DISTANCE, \"DISTANCE\"), root_1);\n\n adaptor.addChild(root_1, (CommonTree)adaptor.create(RELATIVE, \"RELATIVE\"));\n adaptor.addChild(root_1, (CommonTree)adaptor.create(Y, \"Y\"));\n adaptor.addChild(root_1, stream_leftRightDirection.nextTree());\n adaptor.addChild(root_1, stream_distanceValue.nextTree());\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 int euclideanDistance(DataValue<T> value1, DataValue<T> value2)\r\n\t{\n\t\tint difference = value1.difference(value2);\r\n\t\tdifference = difference * difference;\t\r\n\t\treturn (int) Math.sqrt(difference);\r\n\t}",
"public double getDistance() {\r\n return this.distance;\r\n }",
"float getFocusDistancePref(boolean is_target_distance);",
"public abstract double GetDistance();",
"public double getDistance() {\n\t\treturn distance;\n\t}",
"public double getDistance() {\n\t\treturn distance;\n\t}",
"@Test\n\tpublic void testGetDistance() {\n\t\t// Initialize 3 points\n\t\tPoint2D p1 = new Point2D.Double(1.848,8.331);\n\t\tPoint2D p2 = new Point2D.Double(10.241,9.463);\n\t\tPoint2D p3 = new Point2D.Double(8.889,2.456);\n\t\t\n\t\t// Initialized the Triangulate object and load points and radii\n\t\tTriangulate test = new Triangulate();\n\t\ttest.setPoints(p1, p2, p3);\n\t\tdouble err = 1e-4; \n\t\t\n\t\tdouble[] dist = test.getDistance();\n\t\tdouble actual1 = 8.4690;\n\t\tdouble actual2 = 7.1362;\n\t\tdouble actual3 = 9.1701;\n\t\t\n\t\tassertEquals(actual1, dist[0], err);\n\t\tassertEquals(actual2, dist[1], err);\n\t\tassertEquals(actual3, dist[2], err);\n\t}",
"public float getDistance() {\n return distance;\n }",
"@Override\n\tpublic double distance(Instance first, Instance second, double cutOffValue) {\n\t\treturn 0;\n\t}",
"private String doProtectionDistanceCheck(InterferenceLink il, boolean usePathFactor) {\n\t\tdouble simulationRadius = il.getInterferingLinkRelativePosition().getSimulationRadius();\n\t\tdouble pathDistanceFactor = 1.0, protectionDistance = 0;\n\t\tString msg = \"\";\n\t\tDistribution pd = il.getInterferingLinkRelativePosition().getProtectionDistance();\n\t\tDistribution pf = il.getInterferingLinkRelativePosition().getRelativeLocation().getPathDistanceFactor();\n\t\tif (!pd.getBounds().isBounded()) {\n\t\t\tmsg += \"<br/><br/>It is recommended to <strong>not</strong> use Gaussian or Rayleigh distributions for the Protection distance<br/>\" +\n\t\t\t\t\t\"due to the theoretically unlimited range of the simulated protection distances might conflict with the simulation radius.\";\n\t\t} else {\n\t\t\tprotectionDistance = pd.getBounds().getMax();\n\t\t}\n\t\tif (usePathFactor) {\n\t\t\tif (!pf.getBounds().isBounded()) {\n\t\t\t\tmsg += \"<br/><br/>It is recommended to <strong>not</strong> use Gaussian or Rayleigh distributions for the Path distance factor<br/>\" +\n\t\t\t\t\t\t\"due to the theoretically unlimited range of the simulated distances might conflict with propagation models.\";\n\t\t\t} else {\n\t\t\t\tpathDistanceFactor = pf.getBounds().getMax();\n\t\t\t}\n\t\t}\n\t\tif (pd.getBounds().isBounded() && pf.getBounds().isBounded()) {// checks only 'valid' distributions\n\t\t\tif (pathDistanceFactor * simulationRadius < protectionDistance) {\n\t\t\t\tmsg += \"SEAMCAT has detected that you have set your Protection distance (\" + protectionDistance + \" km) \" +\n\t\t\t\t\t\t\"larger than the Simulation radius (\" + (simulationRadius * pathDistanceFactor) + \" km). \" +\n\t\t\t\t\t\t\"<br/><strong>NOTE: This check takes account of the product of the 'Simulation radius' and the 'Path distance factor'</strong>. \";\n\t\t\t}\n\t\t}\n\t\treturn msg;\n\t}",
"public double getMinimumDistance() { return minDistance; }",
"private Distance(){}",
"public static double getPossibilityDegree(int distance) {\r\n\t\treturn DELTAS[distance];\r\n\t}",
"public float getDistance() {\r\n return distance;\r\n }",
"private void straightDistance(double distance) {\n\t\tdouble marginOfError = 0.3;// in inches\n\t\tdouble distanceTraveled = 0;// in inches\n\t\tdouble forwardSpeed = 0;\n\t\tdouble rightSpeed = 0;\n\t\tdouble leftSpeed = 0;\n\t\t// desiredAngle = maggie.getAngle();\n\t\tleftEncoder.reset();\n\t\trightEncoder.reset();\n\n\t\twhile (Math.abs(distanceTraveled - distance) > marginOfError && isEnabled() && isAutonomous()) {\n\t\t\tdistanceTraveled = kDriveToInches * ((-leftEncoder.get() + rightEncoder.get()) / 2);\n\t\t\tSmartDashboard.putNumber(\"distance Traveled\", distanceTraveled);\n\t\t\t// slowed down for now\n\t\t\tforwardSpeed = Math.atan(0.125 * (distance - distanceTraveled)) / (0.5 * Math.PI);//replace arctan with 1/(1+(1.0*e^(-1.0*x)))\n\t\t\t/*rightSpeed = forwardSpeed * (1 + (0.01 * (maggie.getAngle() - desiredAngle)));\n\t\t\tleftSpeed = forwardSpeed * (1 - 0.01 * (maggie.getAngle() - desiredAngle));*/\n\t\t\trobot.lDrive(leftSpeed);\n\t\t\trobot.rDrive(rightSpeed);\n\t\t\televator.update();\n\t\t\trobot.eDrive(elevator.motorMovement);\n\t\t\treportEncoder();\n\t\t}\n\t}",
"void addDistance(float distanceToAdd);",
"@Test\n\tpublic void evalCrispDistanceWithFuzzyNumberOverlap3(){\n\t\tFuzzySet res = cs1.distance(dfn4);\n\t\tassertTrue(res instanceof FuzzyInterval);\n\t\tFuzzyInterval fuzzyRes = (FuzzyInterval)res;\n\t\t//Puntos limite\n\t\tassertTrue(fuzzyRes.getMembershipValue(1)==1);\n\t\tassertTrue(fuzzyRes.getMembershipValue(3)==1);\n\t\tassertTrue(fuzzyRes.getMembershipValue(5)==0);\n\t\t//assertTrue(fuzzyRes.getMembershipValue(5)==0);\n\t\t//Valores exteriores\n\t\tassertTrue(fuzzyRes.getMembershipValue(6)==0);\n\t\tassertTrue(fuzzyRes.getMembershipValue(-1)==0);\n\t}",
"public void setDistanceToStart(double val) {\r\n startDistance = val;\r\n }",
"public double getDistance() {\n return this.distance;\n }",
"public double getDist() {\n return distance;\n }",
"@Test\n\tpublic void lineGetDistanceTest() {\n\t\tDouble distanceOfFirstLine = Math.sqrt((10 - 0) * (10 - 0) + (10 - 0) * (10 - 0));\n\n\t\tassertEquals(distanceOfFirstLine, firstLine.getDistance(), .0001d);\n\t\tassertNotEquals(Math.sqrt(2 * distanceOfFirstLine),\n\t\t\t\tfirstLine.getDistance(), .0001d);\n\t}",
"@Override\r\n\tpublic int compareTo(Candidate e) {\n\t double d = e.getDistance();\r\n\t \r\n\t if (this.getDistance() <= d) {\r\n\t return -1;\r\n\t }\r\n\t\r\n\t if (this.getDistance() > d) {\r\n\t return 1;\r\n\t }\r\n\t \r\n\t // Should not reach here \r\n\t return 0;\r\n\t}",
"public float getDistance() {\n return distance;\n }",
"public int compareDistance(Route r2) {\n return this.distance - r2.distance;\n }",
"@Test\n\tpublic void checkDistanceRouteAEBCD() {\n\t\tassertEquals(Trains.distanceRoute(\"A\", \"E\", \"B\", \"C\", \"D\"), \"22\");\n\t}"
] | [
"0.695717",
"0.67666274",
"0.64550686",
"0.64383924",
"0.6268123",
"0.57471514",
"0.57405955",
"0.56036645",
"0.55895096",
"0.5560739",
"0.5552942",
"0.5518844",
"0.54543567",
"0.54308075",
"0.54245716",
"0.5424434",
"0.541108",
"0.5401341",
"0.53967994",
"0.5384541",
"0.53101563",
"0.5291456",
"0.52708054",
"0.5247728",
"0.5240195",
"0.5214111",
"0.5209216",
"0.52019024",
"0.5187239",
"0.51710963",
"0.5164703",
"0.51578337",
"0.51566476",
"0.5153254",
"0.5141934",
"0.5139687",
"0.5131558",
"0.512901",
"0.5128517",
"0.51253086",
"0.5123384",
"0.5112819",
"0.51106673",
"0.5106523",
"0.5106523",
"0.5097034",
"0.50820225",
"0.5075776",
"0.50521594",
"0.5051957",
"0.50490046",
"0.50453293",
"0.5043924",
"0.50360614",
"0.5029345",
"0.50284183",
"0.5018209",
"0.50135994",
"0.5002733",
"0.49986765",
"0.4996068",
"0.49926716",
"0.49914256",
"0.49785107",
"0.49601367",
"0.49523196",
"0.49432483",
"0.4939083",
"0.492355",
"0.4921719",
"0.4915149",
"0.49055406",
"0.49051872",
"0.4904303",
"0.48970568",
"0.4891326",
"0.48913023",
"0.48908404",
"0.48813432",
"0.48796085",
"0.48796085",
"0.48739573",
"0.48670286",
"0.48630002",
"0.48608866",
"0.48590416",
"0.4854978",
"0.48525888",
"0.48519972",
"0.48448783",
"0.4844018",
"0.483796",
"0.48332787",
"0.48310745",
"0.4829028",
"0.4826419",
"0.48258597",
"0.48156595",
"0.4814502",
"0.481203"
] | 0.7520727 | 0 |
The specified angle tolerance value. | public int getAngleTolerance() {
return angleTolerance;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public double tolerance() {return tolerance;}",
"public void setTolerance(double tolerance) {\n\tthis.tolerance = tolerance;\n }",
"public double getTolerance() {\n\treturn tolerance;\n }",
"@Override\r\n protected double getToleranceForAssertions(final double longitude, final double latitude) {\r\n final double delta = abs(longitude - centralMeridian)/2 +\r\n abs(latitude - latitudeOfOrigin);\r\n if (delta > 40) {\r\n return 0.5;\r\n }\r\n if (delta > 15) {\r\n return 0.1;\r\n }\r\n return super.getToleranceForAssertions(longitude, latitude);\r\n }",
"default double constrainAngle( Figure f, double angle) {\n return translateAngle(f, angle, 0);\n }",
"public void setAngle( double a ) { angle = a; }",
"public synchronized void setTargetTolerance(double tolerance)\n {\n this.tolerance = tolerance;\n }",
"public void setVarimaxTolerance(double tolerance){\n this.varimaxTolerance = tolerance;\n }",
"@Override\n public void testIncreasingTolerance() {\n doTestIncreasingTolerance(Decimal64Field.getInstance(), 1.3, 1.0e-12);\n }",
"boolean needToAim(double angle);",
"double getAngle();",
"double getAngle();",
"private String GetTolerance(int Value)\n {\n if (Value == 0)\n return \"+5% de tolerancia\";\n else\n return \"+10% de tolerancia\";\n }",
"void setAngle(double angle);",
"public void goToAngle(){\n currentAngle = getAverageVoltage2(); \r\n if (Math.abs(elevationTarget - currentAngle) <= .1){//TODO: check angle\r\n off();\r\n // System.out.println(\"off\");\r\n } else if (elevationTarget > currentAngle && elevationTarget < maxLimit){\r\n raise();\r\n //System.out.println(\"raise\");\r\n } else if (elevationTarget < currentAngle && elevationTarget > minLimit){\r\n //System.out.println(\"lower\");\r\n } \r\n \r\n }",
"@org.junit.Test\n public void testTicksForDesiredAngle90From0() {\n int resultsTicks = SwerveDriveMath.ticksForDesiredAngle(testConfig,0, 90);\n assertEquals(90, resultsTicks);\n }",
"public static float standardizeAngle(float angle) {\n float result = modulo(angle, FastMath.TWO_PI);\n if (result >= FastMath.PI) {\n result -= FastMath.TWO_PI;\n }\n\n assert result >= -FastMath.PI : result;\n assert result < FastMath.PI : result;\n return result;\n }",
"public MoverToAngle(\n final double aTarget,\n final double aTargetTolerance,\n final PIDController aDistanceController,\n final PIDController aAngleController\n ) {\n mTargetAngle = aTarget;\n mTargetTolerance = aTargetTolerance;\n mDistanceController = aDistanceController;\n mDistanceController.reset();\n mAngleController = aAngleController;\n mAngleController.reset();\n \n mSpeed = 0;\n mTurnRate = 0;\n }",
"public static double computeTolerance(vtkCanvas canvas, double tolerance)\n\t{\n\t\tdouble[] range = canvas.GetRenderer().GetActiveCamera().GetClippingRange();\n\t\tdouble n = range[0];\n\t\tdouble f = range[1];\n\t\tdouble distance = canvas.GetRenderer().GetActiveCamera().GetDistance();\n\t\t\n\t\tdouble distanceTolerance = tolerance * (f - n);\n\n\t\t// Compute the z of the focal point (point of interest)\n\t\tdouble d1 = eyeZToNormalizedEyeZ(distance, n, f);\n\n\t\t// Compute the z of the distance tolerance\n\t\t// If we are before the far we take distance + distanceTolerance else we take -\n\t\tdouble d2 = (distance + distanceTolerance < f) ? distance + distanceTolerance : distance - distanceTolerance;\n\t\td2 = eyeZToNormalizedEyeZ(d2, n, f);\n\n\t\t// Compute the delta tolerance for the z-buffer value\n\t\treturn Math.abs(d1 - d2);\n\t}",
"public double getAngle();",
"public double findAngle() {\n return 0d;\n }",
"public void setPerihelionAngle(double value) {\n this.perihelionAngle = value;\n }",
"private static boolean _close(Option<Double> a, Option<Double> b, Double tolerance) {\n return a.flatMap(a0 -> b.map(b0 -> Math.abs(a0 - b0) <= tolerance)).getOrElse(false);\n }",
"@Test\r\n public void testCalculateAngle5() {\r\n System.out.println(\"calculateAngle5\");\r\n DialDraw instance = new TachometerDraw();\r\n instance.setValue(50);\r\n double expResult = Math.toRadians(90);\r\n double result = instance.calculateAngle();\r\n assertEquals(result, expResult, 0.0001);\r\n }",
"public double getAngle() { return angle; }",
"public static double bestDirTurn(double startAngle, double targetAngle) {\n double delta = (targetAngle - startAngle + 540) % 360 - 180;\n return delta;\n }",
"public void setAngle(double a) {\n\t\tangle= a;\n\t}",
"double adjust_angle_rotation(double angle) {\n double temp;\n temp=angle;\n if(temp>90) {\n temp=180-temp;\n }\n return temp;\n }",
"public void setAngle(final float angle);",
"public ForwardRateVolatilitySurfaceCurvature(final double tolerance) {\n\t\tsuper();\n\n\t\tthis.tolerance = tolerance;\n\t}",
"public static double angleApproach(double current, double wanted, double divide){\n\t\t//if (dirY(1, current - wanted) > 0)\n\t\t\treturn approach(current, wanted, divide);\n\t\t/*else\n\t\t\treturn approach(current, wanted - 360, divide);*/\n\t}",
"@org.junit.Test\n public void testTicksForDesiredAngle90From540() {\n int resultsTicks = SwerveDriveMath.ticksForDesiredAngle(testConfig,540, 90);\n\n // Shortest path is to go left 90 (360 + 90 = 460)\n assertEquals(450, resultsTicks);\n }",
"static double calcAngle(long val, long centerVal, double focalLen) {\n return Math.atan(((double)(val - centerVal)) / focalLen);\n }",
"private float calculateAngle() {\r\n\r\n\t\tdouble angleTemp = Math.atan2(Target.getY() - y, Target.getX() - x);\r\n\t\t// I needed to use wikipedia to get this i\r\n\t\t// did not learn this in math and needed\r\n\t\t// to use a couplle youtube tutorials to\r\n\t\t// find out how to do the math in java\r\n\t\t// aswell thank fully one had the exact\r\n\t\t// way of doing this\r\n\t\treturn (float) Math.toDegrees(angleTemp) + 90;\r\n\t}",
"public void setAngle(double angle) {\n this.angle = angle;\n }",
"public DraggableBehavior setSnapTolerance(int snapTolerance)\n\t{\n\t\tthis.options.put(\"snapTolerance\", snapTolerance);\n\t\treturn this;\n\t}",
"private double degToRadian(double angle)\n\t{\n\t\treturn angle/180*Math.PI;\n\t}",
"public int getAngle() {\r\n\t\treturn angle;\r\n\t}",
"public int getAngle() {\r\n return angle;\r\n }",
"@Override\n\tpublic boolean onTarget() {\n\t\treturn super.onTarget(mAngleTolerance);\n\t}",
"public double getAngle() {\n return angle;\n }",
"public double getAngle() {\n return angle;\n }",
"public int getAngle(){\n\t\treturn (int)angle;\n\t}",
"public double normalizeBearing( double angle )\n {\n while ( angle > 180 )\n {\n angle -= 360;\n }\n while ( angle < -180 )\n {\n angle += 360;\n }\n return angle;\n }",
"@Test\r\n public void testCalculateAngle1() {\r\n System.out.println(\"calculateAngle1\");\r\n DialDraw instance = new TachometerDraw();\r\n instance.setValue(36);\r\n double expResult = Math.toRadians(115.2);\r\n double result = instance.calculateAngle();\r\n assertEquals(result, expResult, 0.0001);\r\n }",
"public double getAngle ()\n {\n return angle_;\n }",
"public double getAngle() {\n\t\treturn angle;\n\t}",
"public double getAngle() {\n\t\treturn angle;\n\t}",
"public double getStartAngle();",
"public void setAngle(double angle)\n\t{\n\t\tthis.angle = angle;\n\t}",
"public double getTargetAngle(){\n return lastKnownAngle;\n }",
"protected int calcSignumWithAngle(Position moveablePos, Position positionBeforeEvasion, Float64Vector endPosLine,\r\n double testTurnAngle) {\n CalcSignumRes res = calcSignumRes(moveablePos, positionBeforeEvasion, endPosLine, testTurnAngle);\r\n\r\n // The angle after a turn with a positive number brings us closer to the\r\n // end-position-line -> positive signum\r\n return res.angleAfterTurnNegative > res.angleAfterTurnPositive ? 1 : -1;\r\n }",
"public void setAngle(double angle) {\n\t\tthis.angle = angle;\n\t}",
"EDataType getAngleDegrees();",
"public void setAngle(float angle){\n\n\t}",
"@Test\r\n public void testCalculateAngle4() {\r\n System.out.println(\"calculateAngle4\");\r\n DialDraw instance = new TachometerDraw();\r\n instance.setValue(90);\r\n double expResult = Math.toRadians(18);\r\n double result = instance.calculateAngle();\r\n assertEquals(result, expResult, 0.0001);\r\n }",
"public double getAngle() {\n try {\n switch(Coordinates.angleUnit()) {\n case Coordinates.RADIAN:\n\treturn Double.parseDouble(deg.getText().trim());\n case Coordinates.DEGRE:\n\treturn Math.PI * Double.parseDouble(deg.getText().trim()) / 180.0;\n case Coordinates.DEGMN:\n\tString d = deg.getText().trim();\n\tif(d.length() == 0)\n\t d = \"0\";\n\tString m = mn.getText().trim();\n\tif(m.length() == 0)\n\t m = \"0\";\n\treturn Coordinates.parseAngle(d + \"11\" + m + \"'\");\n case Coordinates.DEGMNSEC:\n\td = deg.getText().trim();\n\tif(d.length() == 0)\n\t d = \"0\";\n\tm = mn.getText().trim();\n\tif(m.length() == 0)\n\t m = \"0\";\n\tString s = sec.getText().trim();\n\tif(s.length() == 0)\n\t s = \"0\";\n\treturn Coordinates.parseAngle(d + \"11\" + m + \"'\" + s + \"\\\"\");\n }\n }\n catch(NumberFormatException e) {\n }\n return 0.0;\n }",
"public double getAngleAway(Point p) {\n if (Math.abs(p.getAngle() - getAngle()) <= 180)\n return p.getAngle() - getAngle();\n else if (p.getAngle() - getAngle() > 0)\n return p.getAngle() - getAngle() - 360;\n else\n return p.getAngle() - getAngle() + 360;\n }",
"public float getAngle() {\n return angle;\n }",
"void setAngle(int id, double value);",
"public void setAngle(int angle) {\r\n\t\tthis.angle = angle;\r\n\t}",
"public static double getAngle() {\n return NetworkTableInstance.getDefault().getTable(\"limelight\").getEntry(\"ts\").getDouble(0);\n }",
"public static int findAngleDelta(int start, int finish,int maxTurnRate){\n\t\tint difference = finish - start;\n\t\t\n\t\t\n\t\t\n\t\tif(difference < 0){\n\t\t\tif(difference < -180){\n\t\t\t\tif(difference < -360 + maxTurnRate)\n\t\t\t\t\treturn 360 + difference;\n\t\t\t\telse\n\t\t\t\t\treturn maxTurnRate;\n\t\t\t}else{\n\t\t\t\tif(difference > -maxTurnRate)\n\t\t\t\t\treturn difference;\n\t\t\t\telse \n\t\t\t\t\treturn -maxTurnRate;\n\t\t\t}\n\t\t\t\n\t\t}else{\n\t\t\tif(difference > 180){\n\t\t\t\tif(difference > 360 - maxTurnRate)\n\t\t\t\t\treturn difference - 360;\n\t\t\t\telse\n\t\t\t\t\treturn -maxTurnRate;\n\t\t\t}else{\n\t\t\t\tif(difference < maxTurnRate)\n\t\t\t\t\treturn difference;\n\t\t\t\telse\n\t\t\t\t\treturn maxTurnRate;\n\t\t\t}\n\t\t\t\n\t\t}\n\t}",
"public int angleOX() {\n if (B.getY() == A.getY()) {\r\n return 0;\r\n } else if (A.getX() == B.getX()) {\r\n return 90;\r\n }\r\n else {\r\n float fi = ((float) (B.getY() - A.getY()) / (B.getX() - A.getX()));\r\n if (fi<0){\r\n return (int)(fi*(-1));\r\n }\r\n else return (int)(fi);\r\n }\r\n }",
"@Test\r\n public void testCalculateAngle2() {\r\n System.out.println(\"calculateAngle2\");\r\n DialDraw instance = new TachometerDraw();\r\n instance.setValue(0);\r\n double expResult = Math.toRadians(180);\r\n double result = instance.calculateAngle();\r\n assertEquals(result, expResult, 0.0001);\r\n }",
"public void getOpeningAngle(int openingAngle)\n {\n this.openingAngle = openingAngle;\n }",
"public double getVertexTolerance() {\n return vertexTolerance;\n }",
"public void testGyroAngle(AnalogGyro gyro) {\n // Set angle\n for (int i = 0; i < 5; i++) {\n m_tpcam.getPan().set(0);\n Timer.delay(0.1);\n }\n\n Timer.delay(0.5);\n // Reset for setup\n gyro.reset();\n Timer.delay(0.5);\n\n // Perform test\n for (int i = 0; i < 53; i++) {\n m_tpcam.getPan().set(i / 100.0);\n Timer.delay(0.05);\n }\n Timer.delay(1.2);\n\n double angle = gyro.getAngle();\n\n double difference = TEST_ANGLE - angle;\n\n double diff = Math.abs(difference);\n\n assertEquals(errorMessage(diff, TEST_ANGLE), TEST_ANGLE, angle, 10);\n }",
"public float getAltitudeAngle()\n {\n return altitude_slider.getValue() / ANGLE_SCALE_FACTOR;\n }",
"public static double getAngle(double startAngle, double endAngle) {\n startAngle = normaliseAngle(startAngle);\n endAngle = normaliseAngle(endAngle);\n return Math.abs(Math.min(getAngle(startAngle, endAngle, true), getAngle(startAngle, endAngle, false)));\n }",
"public float calculateCelestialAngle(long par1, float par3)\n {\n return 0.5F;\n }",
"@Test\r\n public void testCalculateAngle3() {\r\n System.out.println(\"calculateAngle3\");\r\n DialDraw instance = new TachometerDraw();\r\n instance.setValue(100);\r\n double expResult = Math.toRadians(0);\r\n double result = instance.calculateAngle();\r\n assertEquals(result, expResult, 0.0001);\r\n }",
"public float getAngle() {\n return angle;\n }",
"public double getAngle()\n {\n return (AngleAverage);\n }",
"private double getGyroError(double targetAngle) {\n double error = targetAngle - imu.getAngularOrientation(AxesReference.INTRINSIC, AxesOrder.XZY, AngleUnit.DEGREES).thirdAngle;\n\n // keep the error on a range of -179 to 180\n while(opModeIsActive() && error > 180) error -= 360;\n while(opModeIsActive() && error <= -180) error += 360;\n\n return error;\n }",
"public void setBearing(double value) {\n\t\tthis.bearing = value;\n\t}",
"public void setRngBearing(double range, double bearing);",
"private boolean checkAngle() {\n\t\tint bornes = FILTER_BORNES;\n\t\treturn checkAngleBornes(angle, 0d, bornes) || checkAngleBornes(angle, 90d, bornes) || checkAngleBornes(angle, 180d, bornes);\n\t}",
"public double betweenAngle(Coordinates a, Coordinates b, Coordinates origin);",
"public double calculateExpectedDisagreement();",
"private double assertApproximation(IApproximator approx) {\r\n double a = approx.approximate(param);\r\n Assert.assertTrue(\"Not \" + minExpected + \"<=\" + a + \"<=\" + maxExpected + \" for \" + param, \r\n minExpected <= a && a <= maxExpected);\r\n return a;\r\n }",
"private float updateTolerance(\n MultipleNodesExtractorIx pageExt,\n Set<String> ids, float tolerance) throws ParserException {\n \n float oldTolerance = -1;\n \n if(ids.isEmpty()) {\n return oldTolerance;\n }\n\n for(String id:ids) {\n\n NodeExtractorIx nodeExt = pageExt.getExtractor(id);\n NodeVisitingFilterIx visitingFilter = nodeExt.getFilter();\n TagLocatorIx tagLocator = visitingFilter.getTagLocator();\n if(tagLocator != null) {\n oldTolerance = tagLocator.getTolerance();\n tagLocator.setTolerance(tolerance);\n }\n }\n\nXLogger.getInstance().log(Level.FINER, \"Updated tolerance from {0} to {1}\", \n this.getClass(), oldTolerance, tolerance);\n\n \n return oldTolerance;\n }",
"public void setInclination(double value) {\n this.inclination = value;\n }",
"@Test\n public void testFind_South() {\n\n double lat1 = 0.0;\n double lon1 = 0.0;\n double lat2 = -10.0;\n double lon2 = 0.0;\n double expResult = Math.toRadians(180);\n double result = Azimuth.find(lat1, lon1, lat2, lon2);\n assertEquals(expResult, result, 0.0);\n }",
"public static double deadband(double input, double tolerance){\n\t\tif(Math.abs(input) < tolerance){\n\t\t\treturn 0;\n\t\t}\n\t\telse{\n\t\t\treturn input;\n\t\t}\t\n\t}",
"double getCalibratedLevelAngle();",
"public double getTOL() {\n return TOL;\n }",
"public double findAngleOfAttack() {\n\t\tdouble dy = this.trailingPt.y - this.leadingPt.y; // trailingPt goes first since positive numbers are down\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// y-axis in Canvas\n\t\tdouble dx = this.leadingPt.x - this.trailingPt.x;\n\t\treturn Math.atan2(dy, dx);\n\t}",
"public double angle()\n {\n return Math.atan2(this.y, this.x);\n }",
"public double getAngle(){\n\t\treturn this.angle;\n\t}",
"private int getAttackAngle() {\n\t\treturn (160 - (level * 10));\n\t}",
"private static boolean planeAngleWithinTolerance(Vector3f norm1, Vector3f norm2) {\n\t\tfloat angle = (float)(Math.toDegrees(norm1.angle(norm2)));\n\t\treturn (angle <= PLANE_TOLERANCE || angle >= 180 - PLANE_TOLERANCE);\n\t}",
"public double getAngle() {\n\t\treturn 180 * (this.N - 2) / this.N;\n\t}",
"public double angle() {\n return Math.atan2(_y,_x);\n }",
"public int getOpeningAngle()\n {\n return this.openingAngle;\n }",
"@Test\n public void testBearingTo() {\n System.out.println(\"Testing bearingTo() for a range of different GPS coordinates\");\n double bearingsExpected[] = {\n Math.PI/4,//45 deg Unit Cirlce\n 7*Math.PI/4,//315 deg Unit Cirlce\n 5*Math.PI/4,//225 deg Unit Cirlce\n 3*Math.PI/4,//135 deg Unit Cirlce\n\t\t\tMath.PI/4,//45 deg Unit Cirlce\n 7*Math.PI/4,//315 deg Unit Cirlce\n 5*Math.PI/4,//225 deg Unit Cirlce\n 3*Math.PI/4,//135 deg Unit Cirlce\n };\n\t\t\n for (int i = 0; i < this.testCoordinates.length; i++) {\n double expResult = bearingsExpected[i];\n double result = this.origin.bearingTo(this.testCoordinates[i]);\n\t\t\tSystem.out.println(\"Expected: \" + expResult + \", Actual: \" + result);\n assertEquals(expResult, result, 0.001);\n }\n }",
"public double toAngle()\n\t{\n\t\treturn Math.toDegrees(Math.atan2(y, x));\n\t}",
"private double getAngle(double y, double x) {\n\t\tdouble angle = Math.atan2(y, x);\n\t\tif (angle < 0)\n\t\t\tangle += 2 * Math.PI;\n\t\treturn angle;\n\t}",
"AngleGreater createAngleGreater();",
"public static double convertAngle(double angle) {\n // Reuse convertDistance() for calculating correct angle\n return convertDistance(Math.PI * BASE_WIDTH * angle / 360.0);\n }"
] | [
"0.6606279",
"0.6359944",
"0.6199998",
"0.6150663",
"0.5658141",
"0.555413",
"0.5547633",
"0.54839504",
"0.54439265",
"0.5423014",
"0.5366946",
"0.5366946",
"0.53225094",
"0.5261602",
"0.52404505",
"0.5217417",
"0.5182146",
"0.5180581",
"0.5177018",
"0.5174776",
"0.5125099",
"0.51036876",
"0.5096029",
"0.5089074",
"0.508856",
"0.50721884",
"0.5047645",
"0.5047475",
"0.5030428",
"0.4999789",
"0.49943596",
"0.49683288",
"0.49669918",
"0.49653512",
"0.49433208",
"0.49269924",
"0.4917675",
"0.4875676",
"0.4865825",
"0.4861728",
"0.48611662",
"0.48611662",
"0.4856523",
"0.48533586",
"0.4842476",
"0.48419896",
"0.48397636",
"0.48397636",
"0.48374298",
"0.48310667",
"0.4831058",
"0.4815839",
"0.48121116",
"0.48080418",
"0.48021623",
"0.4801171",
"0.4800346",
"0.4790182",
"0.47897884",
"0.47886336",
"0.4787339",
"0.47863206",
"0.4783408",
"0.47797358",
"0.47783655",
"0.47532278",
"0.4742341",
"0.47417292",
"0.4740333",
"0.4730546",
"0.47270933",
"0.47247016",
"0.47245082",
"0.47208053",
"0.47159308",
"0.47086367",
"0.47053373",
"0.46959102",
"0.46957096",
"0.46833342",
"0.46799117",
"0.46655193",
"0.46607375",
"0.465509",
"0.4650944",
"0.4650066",
"0.46487662",
"0.46447754",
"0.4642108",
"0.4639121",
"0.4637714",
"0.4633257",
"0.4627206",
"0.4621625",
"0.4618854",
"0.46096316",
"0.46094126",
"0.46039855",
"0.4599132",
"0.45908782"
] | 0.76507646 | 0 |
At which score are hits filtered? | public double getScoreCutoff() {
return scoreCutoff;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected int hit() {\r\n\t\treturn hits;\r\n\t}",
"void collect(Object key, float score);",
"public List<OWLObject> search(OWLObject queryObj) {\n\t\tList<OWLObject> hits = new ArrayList<OWLObject>(maxHits);\n\t\tSystem.out.println(\"gettings atts for \"+queryObj+\" -- \"+simEngine.comparisonProperty);\n\t\tSet<OWLObject> atts = simEngine.getAttributeClosureFor(queryObj);\n\t\tSystem.out.println(\"all atts: \"+atts.size());\n\t\tif (atts.size() == 0)\n\t\t\treturn hits;\n\t\t\n\t\t// only compare using significant atts;\n\t\t// we don't do the same test on candidates as these will be removed by the\n\t\t// intersection operation. they will have a small effect on the score, as\n\t\t// we don't divide by the union, but instead the sum of sizes\n\t\tatts = filterNonSignificantAttributes(atts);\n\t\tSystem.out.println(\"filtered atts: \"+atts.size());\n\n\t\t//bloomFilter = new BloomFilter<OWLObject>(0.05, atts.size());\n\t\t//bloomFilter.addAll(atts);\n\t\t\t\t\n\t\tSortedMap<Integer,Set<OWLObject>> scoreCandidateMap = new TreeMap<Integer,Set<OWLObject>>();\n\t\t\n\t\tfor (OWLObject candidate : getCandidates()) {\n\t\t\tif (candidate.equals(queryObj))\n\t\t\t\tcontinue;\n\t\t\tSet<OWLObject> iAtts = simEngine.getAttributeClosureFor(candidate);\n\t\t\t//Set<OWLObject> iAtts = simEngine.getGraph().getAncestors(candidate);\n\n\t\t\tif (iAtts.size() == 0)\n\t\t\t\tcontinue;\n\t\t\tint cAttsSize = iAtts.size();\n\t\n\t\t\tiAtts.retainAll(atts);\n\t\t\t//Collection<OWLObject> iAtts = bloomFilter.intersection(cAtts);\n\t\t\t\n\t\t\t// simJ, one-sided, scaled by 1000\n\t\t\t// negate to ensure largest first\n\t\t\t//Integer score = - (iAtts.size() * 1000 / cAttsSize);\n\t\t\t\n\t\t\t// this biases us towards genes with large numbers of annotations,\n\t\t\t// but it is better at finding the models that share all features\n\t\t\tInteger score = - iAtts.size();\n\t\t\tif (!scoreCandidateMap.containsKey(score)) \n\t\t\t\tscoreCandidateMap.put(score, new HashSet<OWLObject>());\n\t\t\tscoreCandidateMap.get(score).add(candidate);\n\t\t\treporter.report(this,\"query_candidate_overlap_total\",queryObj,candidate,iAtts.size(),cAttsSize);\n\t\t}\n\t\t\n\t\tint n = 0;\n\t\tfor (Set<OWLObject> cs : scoreCandidateMap.values()) {\n\t\t\tn += cs.size();\n\t\t\thits.addAll(cs);\n\t\t}\n\t\t\n\t\tn = 0;\n\t\tfor (OWLObject hit : hits) {\n\t\t\tn++;\n\t\t\treporter.report(this,\"query_hit_rank_threshold\",queryObj,hit,n,maxHits);\n\t\t}\n\t\tif (hits.size() > maxHits)\n\t\t\thits = hits.subList(0, maxHits);\n\t\t\n\n\n\t\treturn hits;\n\t}",
"boolean isNearMatch(double score);",
"public void countHits() {\nif (this.hitpoints <= 0) {\nreturn;\n}\nthis.hitpoints = this.hitpoints - 1;\n}",
"long getHits();",
"Map<String, Long> hits();",
"Score getScores(int index);",
"@Override\n public void init(SearchHits hits) { \n\n \tint numFbDocs = 50;\n \tint numFbTerms = 20;\n \tdouble lambda = 1.0;\n \tdouble alpha = 5.0;\n \t\n if (paramTable.get(FB_DOCS) != null ) \n \tnumFbDocs = paramTable.get(FB_DOCS).intValue();\n if (paramTable.get(FB_TERMS) != null ) \n \tnumFbTerms = paramTable.get(FB_TERMS).intValue();\n if (paramTable.get(LAMBDA) != null ) \n \tlambda = paramTable.get(LAMBDA).doubleValue();\n if (paramTable.get(ALPHA) != null ) \n \talpha = paramTable.get(ALPHA).doubleValue(); \n \n if (hits.size() < numFbDocs) \n \tnumFbDocs = hits.size();\n \n SearchHits fbDocs = new SearchHits(hits.hits().subList(0, numFbDocs));\n FeedbackRelevanceModel rm = new FeedbackRelevanceModel();\n rm.setDocCount(numFbDocs);\n rm.setTermCount(numFbTerms);\n rm.setIndex(index);\n rm.setStopper(null);\n rm.setRes(fbDocs);\n rm.build(); \n \n FeatureVector rmVector = rm.asFeatureVector();\n rmVector.clip(numFbTerms);\n rmVector.normalize();\n \n TermTimeSeries ts = new TermTimeSeries(startTime, endTime, interval, \n \t\trm.asFeatureVector().getFeatures());\n \n for (SearchHit hit: hits.hits()) {\n \t\tlong docTime = TemporalScorer.getTime(hit);\n \t\tdouble score = hit.getScore();\n \t\tts.addDocument(docTime, score, hit.getFeatureVector());\n }\n \n RUtil rutil = new RUtil();\n \n double sdps =0;\n for (String term: rmVector.getFeatures()) {\n \tdouble[] tsw = ts.getTermFrequencies(term);\n \tif (sum(tsw) > 0) {\n \t\ttry {\n \t\t\tsdps += rutil.dps(tsw);\n \t\t} catch (Exception e) {\n \t\t\te.printStackTrace();\n \t\t}\n \t}\n } \n \n FeatureVector tsfv = new FeatureVector(null);\n for (String term: rmVector.getFeatures()) {\n \tdouble[] termts = ts.getTermFrequencies(term);\n \ttry {\n \t\tdouble dps = rutil.dps(termts)/sdps;\n \t\t\n \tdouble weight = Math.pow(dps, alpha) * Math.pow(rmVector.getFeatureWeight(term), (1-alpha));\n tsfv.addTerm(term, weight);\n \n \t} catch (Exception e) {\n \t\te.printStackTrace();\n \t}\n }\n tsfv.normalize();\n\n gQuery.getFeatureVector().normalize();\n FeatureVector fv =\n \t\tFeatureVector.interpolate(gQuery.getFeatureVector(), tsfv, lambda);\n gQuery.setFeatureVector(fv);\n \n System.out.println(rmVector.toString(10));\n System.out.println(tsfv.toString(10));\n System.out.println(fv.toString(10));\n rutil.close();\n \n }",
"float getScore();",
"float getScore();",
"public double getBestScore();",
"public void relevanceFeedback(PostingsList results, boolean[] docIsRelevant, Indexer indexer ) {\r\n// results contain the ranked list from the current search\r\n// docIsRelevant contains the users feedback on which of the 10 first hits are relevant\r\n\tdouble gamma = 0.0; // används ej, de orelevanta dokumenterna. städa upp queryn. Vad innehller de orelevanta dokumenterna för termer\r\n// dess termer tar vi bort från den relebanta.)\r\n\r\n\tdouble alfa = 0.8; // hur mycket litar på det gamla sökning innan feedback\r\n\tdouble beta = 0.6; // hur mycket hänsyn du ska ta till nya sökningen efter feedback \r\n\r\n\r\n\t/* \r\n\r\n\tAlgorithm: \r\n\tThe Rocchio algorithm is based on a method of relevance \r\n\tfeedback found in information retrieval systems\r\n\tThe algorithm is based on the assumption that most users \r\n\thave a general conception of which documents should be denoted \r\n\tas relevant or non-relevant.[1] Therefore, the user's search \r\n\tquery is revised to include an arbitrary percentage of relevant \r\n\tand non-relevant documents as a means of increasing the search \r\n\tengine's recall, and possibly the precision as well. The number \r\n\tof relevant and non-relevant documents allowed to enter a query \r\n\tis dictated by the weights of the a, b.\r\n\tthe associated weights (a, b) are responsible for shaping the \r\n\tmodified vector in a direction closer, or farther away, from the \r\n\toriginal query, related documents, and non-related documents.\r\n\r\n\r\n\r\n\tLimitations of rocchio:\r\n\t\tTherefore the two queries of \"Burma\" and \"Myanmar\" will \r\n\t\tappear much farther apart in the vector space model, \r\n\t\tthough they both contain similar origins\r\n\tWhy not use non-relevant documents:\r\n\t\tThough there are benefits to ranking documents as not-relevant, \r\n\t\ta relevant document ranking will result in more precise documents \r\n\t\tbeing made available to the user. \r\n\t\r\n\r\n\r\n\tRoccio algoritmen: \r\n\t\talfa = Original query weight \r\n\t\tbeta = related document weight\r\n\t\t\r\n\t\thigher alpha means that we give more focus to the original query terms\r\n\t\thigher beta means that we give more focus to the new search feedback. i.e new terms.\r\n\r\n\t\tTar en org query\r\n\t\tTar den gamla gånnger en viss vikt \r\n\t\tvikt är alfa + beta (entill vektor) plus att den kollar på original vektor, q0 \r\n\t\t\thögre alfa mer fokus på original queryn \r\n\t\t\thögra beta skiftar till mer fokus på de nya termerna. \r\n\t\tdvs utökas med ord/termer från dokument vektorerna som var relevanta. \r\n\r\n\tVanligtvis har man väldigt häg alfa och beta lite under för att det är standard. man tycker att den \r\n\tförsta queryn är väldigt bra.\r\n\r\n\t\r\n\t*/\r\n\r\n\tPostingsList related_doc_vector = new PostingsList();\r\n\tHashMap<String, Double> qm = new HashMap<String, Double>(); // spara termer och weights.\r\n\t// normalize weights\r\n\tfor(Double w : weights){\r\n\t\tw = w/weights.size();\r\n\t}\r\n\r\n\tIterator<PostingsEntry> it = results.iterator();\r\n\tfor(int i = 0; i < docIsRelevant.length; i++){\r\n\t\tif(docIsRelevant[i] == true){\r\n\t\t\trelated_doc_vector.list.add(results.get(i));\r\n\t\t} \r\n\t}\r\n\r\n\t// apply Rocchio algorithm.\r\n\tfor(int i = 0; i < terms.size(); i++){\r\n\t\tdouble new_weigt = weights.get(i) * alfa;\r\n\t\tqm.put(terms.get(i), new_weigt);\r\n\t}\r\n\r\n\tfor(int i = 0; i < related_doc_vector.size(); i++){\r\n\t\tIterator<PostingsEntry> ite = related_doc_vector.iterator();\r\n\t\twhile(ite.hasNext()){\r\n\t\t\tPostingsEntry postingsentry = ite.next();\r\n\t\t\tint docID = postingsentry.docID;\r\n\t\t\tString filename = indexer.index.docIDs.get(Integer.toString(docID)); // hämtar filnamnet\r\n\t\t\tString path = \"/Users/monadadoun/Desktop/ir/lab/davisWiki/\" + filename; \r\n\t\t\tFile file = new File(path);\r\n\t\t\tHashSet<String> hs = new HashSet<>();\r\n\t\t\t// lägger till alla ord som finns till mitt hashet\r\n\t\t\ttry (Reader reader = new InputStreamReader( new FileInputStream(file), StandardCharsets.UTF_8 )){\r\n\t\t\t\tTokenizer tok = new Tokenizer( reader, true, false, true, indexer.patterns_file );\r\n\t\t\t\twhile (tok.hasMoreTokens()) {\r\n\t\t\t\t\ths.add(tok.nextToken());\r\n\t\t\t\t}\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tIterator<String> iter = hs.iterator();\r\n\t\t\twhile(iter.hasNext()){\r\n\t\t\t\tString s = iter.next();\r\n\t\t\t\tif(qm.containsKey(s)){\r\n\t\t\t\t\tDouble tmp = qm.get(s);\r\n\t\t\t\t\tqm.put(s, tmp + beta * postingsentry.score);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tqm.put(s, beta * postingsentry.score);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tLinkedList<String> term = new LinkedList<>();\r\n\tLinkedList<Double> weight = new LinkedList<>();\r\n\tList<Map.Entry<String,Double>> answer = new ArrayList<Map.Entry<String,Double>>(qm.entrySet());\r\n\tanswer.sort((e1,e2) -> e2.getValue().compareTo(e1.getValue())); // sorterar efter värde så att orden med högst score ligger först\r\n\tfor (int i = 0; i < answer.size(); i++) {\r\n\t\tterm.add(answer.get(i).getKey());\r\n\t\tweight.add(answer.get(i).getValue()/answer.size());\r\n\t}\r\n\r\n\tterms = term;\r\n\tweights = weight;\r\n\t}",
"boolean allHits();",
"private void printingSearchResults() {\n HashMap<Integer, Double> resultsMap = new HashMap<>();\n for (DocCollector collector : resultsCollector) {\n if (resultsMap.containsKey(collector.getDocId())) {\n double score = resultsMap.get(collector.getDocId()) + collector.getTermScore();\n resultsMap.put(collector.getDocId(), score);\n } else {\n resultsMap.put(collector.getDocId(), collector.getTermScore());\n }\n }\n List<Map.Entry<Integer, Double>> list = new LinkedList<>(resultsMap.entrySet());\n Collections.sort(list, new Comparator<Map.Entry<Integer, Double>>() {\n public int compare(Map.Entry<Integer, Double> o1,\n Map.Entry<Integer, Double> o2) {\n return (o2.getValue()).compareTo(o1.getValue());\n }\n });\n if (list.isEmpty())\n System.out.println(\"no match\");\n else {\n DecimalFormat df = new DecimalFormat(\".##\");\n for (Map.Entry<Integer, Double> each : list)\n System.out.println(\"docId: \" + each.getKey() + \" score: \" + df.format(each.getValue()));\n }\n\n }",
"public HashMap<Integer, Float> rescore(IndexSearcher searcher, TopDocs firstPassTopDocs, Query query, QueryRescoreContext ctx)\n throws IOException {\n ScoreDoc[] hits = firstPassTopDocs.scoreDocs.clone();\n Arrays.sort(hits, new Comparator<ScoreDoc>() {\n @Override\n public int compare(ScoreDoc a, ScoreDoc b) {\n return a.doc - b.doc;\n }\n });\n\n HashMap<Integer, Float> rescoreHits = new HashMap<Integer, Float>();\n List<LeafReaderContext> leaves = searcher.getIndexReader().leaves();\n\n Weight weight = searcher.createNormalizedWeight(query, true);\n\n // Now merge sort docIDs from hits, with reader's leaves:\n int hitUpto = 0;\n int readerUpto = -1;\n int endDoc = 0;\n int docBase = 0;\n boolean firstMatch = true;\n\n // Scorer returns results by document ID, when looping through, there is no Random Access so scorer.advance(int)\n // has to be the next ID in the TopDocs\n for(Scorer scorer = null; hitUpto < hits.length; ++hitUpto) {\n ScoreDoc hit = hits[hitUpto];\n int docID = hit.doc;\n\n LeafReaderContext readerContext = null;\n while (docID >= endDoc) {\n readerUpto++;\n readerContext = leaves.get(readerUpto);\n endDoc = readerContext.docBase + readerContext.reader().maxDoc();\n }\n\n if(readerContext != null) {\n // We advanced to another segment:\n docBase = readerContext.docBase;\n\n scorer = weight.scorer(readerContext);\n }\n\n if(scorer != null) {\n int targetDoc = docID - docBase;\n int actualDoc = scorer.docID();\n if(actualDoc < targetDoc) {\n actualDoc = scorer.iterator().advance(targetDoc);\n }\n\n if(actualDoc == targetDoc) {\n float score = scorer.score();\n\n if (firstMatch) {\n topScore = score;\n bottomScore = score;\n firstMatch = false;\n }\n\n if (topScore < score)\n topScore = score;\n if (bottomScore > score)\n bottomScore = score;\n\n // Query did match this doc:\n rescoreHits.put(docID, score);\n } else {\n // Query did not match this doc:\n assert actualDoc > targetDoc;\n }\n }\n }\n\n // Moved Arrays.sort() from Lucene engine into our local .combine() method to sort\n // after calculations are defined. This is to prevent sorting unnecessarily\n return rescoreHits;\n }",
"public void hitAlienScore() {\r\n //Add 5 to the score\r\n score += 5;\r\n System.out.println(\"Current Score = \"+score);\r\n }",
"Float getScore();",
"public void setScore(int score) { this.score = score; }",
"public int getScore() { return score; }",
"public float getScore(){return score;}",
"public int getScore() {return score;}",
"public abstract float getScore();",
"protected abstract double relevantScore(Tweet tweet);",
"double getHitRate();",
"double getHitRate();",
"int score();",
"int score();",
"int hit();",
"public void addScore(){\n\n // ong nuoc 1\n if(birdS.getX() == waterPipeS.getX1() +50){\n bl = true;\n }\n if (bl == true && birdS.getX() > waterPipeS.getX1() + 50){\n score++;\n bl = false;\n }\n\n //ong nuoc 2\n if(birdS.getX() == waterPipeS.getX2() +50){\n bl = true;\n }\n if (bl == true && birdS.getX() > waterPipeS.getX2() + 50){\n score++;\n bl = false;\n }\n\n // ong nuoc 3\n if(birdS.getX() == waterPipeS.getX3() +50){\n bl = true;\n }\n if (bl == true && birdS.getX() > waterPipeS.getX3() + 50){\n score++;\n bl = false;\n }\n\n }",
"@Override\n\tpublic void inputScore() {\n\n\t}",
"public int getWrapperHits();",
"@Override\n\tpublic void checkScore() {\n\t\t\n\t}",
"int getScore();",
"public void score(){\n\t\tscores=new float[3];\n\t\ttop3=new String[3];\n\t\tfor(int i=0;i<3;i++){\n\t\t\ttop3[i]=new String();\n\t\t\tscores[i]=(float)0;\n\t\t}\n\t\t//System.out.println(doclist.size());\n\t\tfor(int i=0;i<doclist.size();i++){\n\t\t\ttry{\n\t\t\t\tDocProcessor dp=new DocProcessor(doclist.get(i));\n\t\t\t\tdp.tokenizing();\n\t\t\t\tdp.stem();\n\t\t\t\t//System.out.println(dp.getContent());\n\t\t\t\t/*for(int j=2;j>=0;j--){\n\t\t\t\t\tSystem.out.println(\"top\"+(3-j)+\": \"+scores[j]);\n\t\t\t\t\tSystem.out.println(top3[j]);\n\t\t\t\t}*/\n\t\t\t\tfloat score=dp.score(this.keywords);\n\t\t\t\tfor(int j=2;j>=0;j--){\n\t\t\t\t\tif(score>scores[j]){\n\t\t\t\t\t\tfor(int k=0;k<j;k++){\n\t\t\t\t\t\t\tscores[k]=scores[k+1];\n\t\t\t\t\t\t\ttop3[k]=top3[k+1];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tscores[j]=score;\n\t\t\t\t\t\ttop3[j]=dp.getContent();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t/*for(int j=2;j>=0;j--){\n\t\t\t\t\tSystem.out.println(\"top\"+(3-j)+\": \"+scores[j]);\n\t\t\t\t\tSystem.out.println(top3[j]);\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"*******************************\");*/\n\t\t\t}catch(NullPointerException f){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t}",
"@Override\n public int getScore() {\n return score;\n }",
"public void setHitCount(int count) {\nthis.hitpoints = count;\n}",
"public void queryRecommended(Query query, float score, String original);",
"public synchronized void filtered() {\n filteredCountStat.received();\n filteredCount++;\n }",
"public int getScore(){ return this.score; }",
"long getScore();",
"long getScore();",
"long getScore();",
"long getScore();",
"int getScoreValue();",
"public int getHomeScore();",
"public void rankMatches();",
"@Override\r\n public boolean accept (ScoreVisitor visitor)\r\n {\r\n return visitor.visit(this);\r\n }",
"public void setHits(Hits hits) {\n this.hits = hits;\n }",
"public void setScore(int score) {this.score = score;}",
"public void setScore(float value) {\n this.score = value;\n }",
"public int getScore ()\r\n {\r\n\treturn score;\r\n }",
"private void scoring(NameInfo name1Info, NameInfo name2Info, int flag) {\n\t\tString name1 = name1Info.getName();\n\t\tString name2 = name2Info.getName();\n\t\tString type1 = name1Info.getType();\n\t\tString type2 = name2Info.getType();\n\t\tif (name1.length() == 0 || name2.length() == 0) {\n\t\t\tscore = 0.0f;\n\t\t\tscoreShingle = 0.0f;\n\t\t\treason = \"There is an empty name.\";\n\t\t\treturn;\n\t\t}\n\t\tswitch (flag) {\n\t\t\n\t\tcase 1: // PER\n\t\t\tscoreShingle = (float)LSHUtils.dice(name1, name2);\n\t\t\tfloat scorePER = getPERScore(name1Info, name2Info);\n\t\t\treason = \"Type: \" + name1Info.getType() + \". metric\";\n\t\t\tif (score < scorePER) {\n\t\t\t\tscore = scorePER;\n\t\t\t}\n\t\t\tbreak;\n\t\t\t\n\t\tcase 2: // LOC\n\t\t\tscoreShingle = (float)LSHUtils.dice(name1, name2);\n\t\t\tscore = shortMan.scoring(name1, name2);\n\t\t\treason = \"Type: \" + name1Info.getType() + \". metric; Scored by JaroWinkler metric with Shortcut.\";\n\t\t\tfloat countryLangScore = countryMan.scoring(name1, name2);\n\t\t\tif (score < countryLangScore) {\n\t\t\t\tscore = countryLangScore;\n\t\t\t\treason = \"Type: \" + name1Info.getType() + \". metric; Scored by JaroWinkler metric with Country-Language list.\";\n\t\t\t\tif (score < scoreShingle) {\n\t\t\t\t\tscore = scoreShingle;\n\t\t\t\t\treason = \"Type: \" + name1Info.getType() + \". metric; Scored by Shingling\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t\t\n\t\tcase 3: // ORG\n\t\t\tscoreShingle = (float)LSHUtils.dice(name1, name2);\n\t\t\tscore = acroMan.scoring(name1Info, name2Info);\n\t\t\treason = \"Type: \" + name1Info.getType() + \". metric; Scored by JaroWinkler metric with Acronym.\";\n\t\t\tif (scoreShingle > score) {\n\t\t\t\tscore = scoreShingle;\n\t\t\t\treason = \"Type: \" + name1Info.getType() + \". metric; Scored by Shingling\";\n\t\t\t}\n\t\t\tbreak;\n\t\t\t\n\t\tcase 4: // GEN\n\t\t\tscoreShingle = (float)LSHUtils.dice(name1, name2);\n\t\t\tfloat scorePer = getPERScore(name1Info, name2Info);\n\t\t\tfloat scoreShort = shortMan.scoring(name1, name2);\n\t\t\tfloat scoreCL = countryMan.scoring(name1, name2);\n\t\t\tfloat scoreAcro = acroMan.scoring(name1Info, name2Info);\n\t\t\tif (scoreAcro > score) {\n\t\t\t\tscore = scoreAcro;\n\t\t\t\treason = \"Type: \" + name1Info.getType() + \". metric; Scored by JaroWinkler metric with Acronym.\";\n\t\t\t}\n\t\t\tif (scoreCL > score) {\n\t\t\t\tscore = scoreCL;\n\t\t\t\treason = \"Type: \" + name1Info.getType() + \". metric; Scored by JaroWinkler metric with Country-Language list.\";\n\t\t\t}\n\t\t\tif (scoreShort > score) {\n\t\t\t\tscore = scoreShort;\n\t\t\t\treason = \"Type: \" + name1Info.getType() + \". metric; Scored by JaroWinkler metric with Shortcut.\";\n\t\t\t}\n\t\t\tif (scorePer > score) {\n\t\t\t\tscore = scorePer;\n\t\t\t\treason = \"Type: \" + name1Info.getType() + \". metric\";\n\t\t\t}\n\t\t\tif (scoreShingle > score) {\n\t\t\t\tscore = scoreShingle;\n\t\t\t\treason = \"Type: \" + name1Info.getType() + \". metric; Scored by Shingling\";\n\t\t\t}\n\t\t\tif (acroMan.isSpecificCase()) {\n\t\t\t\tscore = scoreAcro;\n\t\t\t\treason = \"Type: \" + name1Info.getType() + \". metric; Scored by JaroWinkler metric with Acronym.\";\n\t\t\t}\n\t\t\tbreak;\n\t\t\t\n\t\tcase 5: // Two different types\n\t\t\tif (type1.equals(\"PER\") || type2.equals(\"PER\")) {\n\t\t\t\tscore = 0.0f;\n\t\t\t\treason = \"Type: \" + type1 + \". and \" + type2 + \". cannot be compared\";\n\t\t\t} else if (type1.equals(\"LOC\") || type2.equals(\"LOC\")) {\n\t\t\t\tscore = shortMan.scoring(name1, name2);\n\t\t\t\treason = \"Type: LOC. metric; Scored by JaroWinkler metric with Shortcut.\";\n\t\t\t} else if (type1.equals(\"ORG\") || type2.equals(\"ORG\")) {\n\t\t\t\tfloat orgScore = acroMan.scoring(name1Info, name2Info);\n\t\t\t\tif (score < orgScore) {\n\t\t\t\t\tscore = orgScore;\n\t\t\t\t\treason = \"Type: ORG. metric; Scored by JaroWinkler metric with Acronym.\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tscore = 0.0f;\n\t\t\t\treason = \"Type: \" + type1 + \". and \" + type2 + \". cannot be compared\";\n\t\t\t}\n\t\t\tbreak;\n\t\t\t\n\t\tdefault:\n\t\t\tscore = 0.0f;\n\t\t\treason = \"#######SHOULD NOT HAPPEN#######\";\n\t\t}\n\t\tif (name1.equalsIgnoreCase(name2))\n\t\t\tscore = 1.0f;\n\t\tif (!name1Info.getType().equals(\"PER\") && !name2Info.getType().equals(\"PER\"))\n\t\t\thandleLargeRatio(name1, name2);\n\t}",
"public void ruleOutPos(){\n for(int i=0;i<scores.length;i++) {\n for(int j=0;j<scores[i].length;j++) {\n scores[i][j][13] = 0;//0=pass, >0 is fail, set to pass initially\n\n //check Ns - bit crude - what to discount regions with high N\n double ns = (double) scores[i][j][14] / (double) pLens[j];\n if (ns >= minPb | ns >= minPm)//\n scores[i][j][13] += 4;\n\n //probe\n if (hasProbe){\n if (j == 1 | j == 4) {\n double perc = (double) scores[i][j][0] / (double) primers[j].length();\n if (perc >= minPb) {\n scores[i][j][12] = 1;//flag for failed % test\n scores[i][j][13] += 2;\n }\n }\n }\n //primer\n else {\n //if more than 2 mismatches in 1-4nt at 3'\n if(scores[i][j][11]>max14nt) {\n scores[i][j][13]+=1;\n }\n //use mLen (combined F and R length) initially to find initial candidates - filter later\n double perc=(double)scores[i][j][0]/(double)mLen;\n double percI=(double)scores[i][j][0]/(double)pLens[j];\n\n if(perc>=minPm | percI>=minPmI) {\n scores[i][j][12]=1;//flag for failed % test\n scores[i][j][13]+=2;\n }\n }\n }\n }//end of finding positions that prime loop\n }",
"@Override\n public float customScore(int doc, float subQueryScore, float[] valSrcScores) throws IOException {\n // subQueryScore is term frequency of the term\n float newScore = 1f;\n if (this.config.getQueryType().equals(ConvertConfig.DICE_QUERY)) {\n newScore = this.diceCustomScore(doc, subQueryScore, valSrcScores);\n } else if (this.config.getQueryType().equals(ConvertConfig.BM25TP_QUERY)) {\n newScore = this.bm25tpCustomScore(doc, subQueryScore, valSrcScores);\n } else if (this.config.getQueryType().equals(ConvertConfig.BM25_DISTANCE_QUERY)) {\n newScore = this.bm25DistanceCustomScore(doc, subQueryScore, valSrcScores);\n } else if (this.config.getQueryType().equals(ConvertConfig.TERM_QUERY)) {\n newScore = subQueryScore;\n } else {\n // default scoring to use\n newScore = subQueryScore;\n }\n return newScore; // New Score\n }",
"@Override\n\tpublic void readScore() {\n\t\t\n\t}",
"@Override\n\tpublic void readScore() {\n\t\t\n\t}",
"private int getSearchHitCount()\r\n {\r\n return ( mFilteringSearchTerm != null ) ? mFilteringSearchTerm.getHitCount() : 0;\r\n }",
"public void setScore(float score) {\n this.score = score;\n }",
"public int getScore(){return score;}",
"public int getScore(){return score;}",
"@Override\n public float customScore(int doc, float subQueryScore, float[] valSrcScores) throws IOException {\n\n Document document =context.reader().document(doc);\n IndexableField availabilityIf= document.getField(FieldConstants.AVAILABILITY);// the field I wanted to extract\n float availabilityScore = availabilityIf.numericValue().floatValue();\n\n IndexableField accuracyIf= document.getField(FieldConstants.AVAILABILITY);// the field I wanted to extract\n float accuracyScore = accuracyIf.numericValue().floatValue();\n\n IndexableField acceptRateIf= document.getField(FieldConstants.AVAILABILITY);// the field I wanted to extract\n float acceptRate = acceptRateIf.numericValue().floatValue();\n\n return (1 + availabilityScore * AVAILABILITY_MULTIPLIER\n + accuracyScore * ACCURACY_MULTIPLIER\n + ACCEPT_RATE_MULTIPLIER * acceptRate)\n * subQueryScore;\n\n }",
"public void setScore(int score) {\n this.score = score;\n }",
"public int getHitsLeft(){\n return hitsLeft;\n }",
"default void hit() {\n\t\tcount(1);\n\t}",
"@Override\n public float customScore(int doc,\n float subQueryScore,\n float[] valSrcScores)\n throws IOException {\n float dl = this.context.reader().getNumericDocValues(\"TotalTerms\").get(doc);\n float dvl = this.context.reader().getNumericDocValues(\"UniqueTerms\").get(doc);\n float ent = this.context.reader().getNumericDocValues(\"Entropy\").get(doc);\n \n float qvl = QuerySearch.currentQuery.numTypes();\n\n \n float lmnorm = 0;\n \n if (SPUDLMSimilarity.method == SPUDLMSimilarity.dir){\n //LM Dirichlet \n \n lmnorm = (float) (Math.log(SPUDLMSimilarity.dir_mu / (dl + SPUDLMSimilarity.dir_mu)));\n }else if (SPUDLMSimilarity.method == SPUDLMSimilarity.spud){\n //spud\n double spud_mu = SPUDLMSimilarity.b0*SPUDLMSimilarity.omega/(1-SPUDLMSimilarity.omega);\n lmnorm = (float) (Math.log(spud_mu / (dvl + spud_mu)));\n \n }else{\n //default spud\n double spud_mu = SPUDLMSimilarity.b0*SPUDLMSimilarity.omega/(1-SPUDLMSimilarity.omega);\n lmnorm = (float) (Math.log(spud_mu / (dvl + spud_mu)));\n \n }\n \n \n return (subQueryScore + lmnorm );\n \n }",
"public float bm25DistanceCustomScore(int doc, float subQueryScore, float[] valSrcScores)\n throws IOException {\n float newScore = subQueryScore;\n // comment one out if you want to switch the distance measurement used\n final float measurement = this.minSpan(doc);\n // float measurement = this.minDistancePair(doc);\n newScore = (float) (newScore + Math.log(MathScoreQueryProvider.ALPHA + Math.exp(-measurement)));\n return newScore;\n }",
"public void setScore(int score)\n {\n this.score = score;\n }",
"public abstract Collection<T> getMatchesAboveThreshold(T first,\n double similarityThreshold);",
"public Float getScore() {\n return score;\n }",
"public void calculateHighscores(){\n if((newPlayer.getScore() > (getRecord())) && (newPlayer.getScore() > getRecord2()) && (newPlayer.getScore() > getRecord3())){\n setRecord3(getRecord2());\n setRecord2(getRecord());\n setRecord(newPlayer.getScore());\n newPlayer.resetScore();\n }\n if((newPlayer.getScore() > getRecord2()) && (newPlayer.getScore() > getRecord3()) && (newPlayer.getScore() < getRecord())){\n setRecord3(getRecord2());\n setRecord2(newPlayer.getScore());\n newPlayer.resetScore();\n }\n if((newPlayer.getScore() > getRecord3()) && newPlayer.getScore() < getRecord2()){\n setRecord3(newPlayer.getScore());\n newPlayer.resetScore();\n }else{\n newPlayer.resetScore();\n\n }\n }",
"public int getHits(int timestamp) {\n int sum = 0;\n for(int i = 0; i < 300; i++){\n if(timestamp - times[i] < 300){\n sum += hits[i];\n }\n }\n\n return sum;\n }",
"public void setScore(int score) {\n this.score = score;\n }",
"public void setScore(int score) {\n this.score = score;\n }",
"public void setScore(int score) {\n this.score = score;\n }",
"public void setScore(int score) {\n this.score = score;\n }",
"public void setScore(Float score) {\n this.score = score;\n }",
"public void setScore(int score) {\r\n this.score = score;\r\n }",
"public void setScore(int score) {\r\n this.score = score;\r\n }",
"@Override\r\n public void hitEvent(Block beingHit, Ball hitter) {\n this.currentScore.increase(5);\r\n if (beingHit.getHitPoints() == 1) {\r\n this.currentScore.increase(10);\r\n }\r\n }",
"public int getScore(){\r\n\t\treturn score;\r\n\t}",
"public int getScore(){\r\n\t\treturn score;\r\n\t}",
"@Override\r\n\tpublic double getScore() {\n\t\treturn score;\r\n\t}",
"public interface Hit {\r\n\t\r\n\t/** @return ID of the search result (post ID, topic ID,...). */\r\n\tlong getResultId();\r\n\t\r\n\t/** @return Score of the search result. */\r\n\tfloat getScore();\r\n\r\n}",
"@Override\n\tpublic int getScore(int target) {\n\t\tdouble d = toBound(target);\n\t\tif (d < 0 && d + height > 0){\n\t\t\treturn -50;\n\t\t} else {\n\t\t\treturn 5;\n\t\t}\n\t}",
"public float getScore() {\n return score;\n }",
"public double getScore() {\r\n return score;\r\n }",
"public void setScore(int score)\n\t{\n\t\tthis.score=score;\n\t}",
"private Hit getLevelHit(final Ray r, final TestCounter c) {\n double minDist = Double.POSITIVE_INFINITY;\n Triangle curBest = null;\n for(final Triangle t : tri) {\n final double dist = t.hit(r, c);\n if(r.isValidDistance(dist) && dist < minDist) {\n minDist = dist;\n curBest = t;\n }\n }\n return new Hit(r, curBest, minDist, c);\n }",
"public int getAwayScore();",
"@Override\npublic void update(int score) {\n\t\n}",
"@Override\n public double score(Document document) {\n Set<String> allDocTerms = documentsTerms.termsExtractedFromDocument(document).allTerms();\n\n //keeping only the query terms that are in the document\n Collection<String> relevantTerms = new LinkedHashSet<>(query);\n relevantTerms.retainAll(allDocTerms);\n\n //compute score using a sum formula on each query term\n int docLength = termsOccurences.get(document).totalNumberOfOccurences();\n double score = 0.0;\n for (String term : relevantTerms) {\n double termIDF = idf.weight(term);\n double termTF = tf.weight(term, document);\n\n score += termIDF * (termTF * (k1 + 1)) / (termTF + k1 * (1 - b + b * (docLength / averageDocLength)));\n }\n\n return score;\n }",
"boolean score(String lineItemId, Score score);",
"void onScoresChanged(int scores);",
"private void histogramScore() {\r\n View.histogram(score, 0, this.getSize().width + 15, 0);\r\n }",
"private synchronized void evaluate(int indexOfInterest) {\r\n\r\n switch (indexOfInterest) {\r\n case 0: //evaluating values on the X axis\r\n if ((Math.abs(peakValue) >= 1.3) && (Math.abs(peakValue) <= 3.2) && !goodScoreUpdated && !mediumScoreUpdated && !badScoreUpdated) {\r\n scoreListener.onScoreTypeChangeForEvent(ScoreType.GOOD, event.getEventType());\r\n goodScoreUpdated = true;\r\n }\r\n if ((Math.abs(peakValue) > 3.2) && (Math.abs(peakValue) <= 4.2) && !mediumScoreUpdated && !badScoreUpdated) {\r\n\r\n event.setScoreToMedium();\r\n scoreListener.onScoreTypeChangeForEvent(ScoreType.MEDIUM, event.getEventType());\r\n currentScoreTypeForEvent = ScoreType.MEDIUM;\r\n mediumScoreUpdated = true;\r\n }\r\n if ((Math.abs(peakValue) > 4.2) && !badScoreUpdated) {\r\n\r\n event.setScoreToBad();\r\n scoreListener.onScoreTypeChangeForEvent(ScoreType.BAD, event.getEventType());\r\n currentScoreTypeForEvent = ScoreType.BAD;\r\n badScoreUpdated = true;\r\n }\r\n\r\n case 1: //evaluating values on the Y axis\r\n if (event.getEventType().equals(DrivingEventType.BRAKE)) {\r\n if ((Math.abs(peakValue) >= 1.75) && (Math.abs(peakValue) <= 3.3) && !goodScoreUpdated && !mediumScoreUpdated && !badScoreUpdated) {\r\n scoreListener.onScoreTypeChangeForEvent(ScoreType.GOOD, event.getEventType());\r\n goodScoreUpdated = true;\r\n }\r\n if ((Math.abs(peakValue) > 3.3) && (Math.abs(peakValue) <= 5.5) && !mediumScoreUpdated && !badScoreUpdated) {\r\n\r\n event.setScoreToMedium();\r\n scoreListener.onScoreTypeChangeForEvent(ScoreType.MEDIUM, event.getEventType());\r\n currentScoreTypeForEvent = ScoreType.MEDIUM;\r\n mediumScoreUpdated = true;\r\n }\r\n if ((Math.abs(peakValue) > 5.5) && !badScoreUpdated) {\r\n\r\n event.setScoreToBad();\r\n scoreListener.onScoreTypeChangeForEvent(ScoreType.BAD, event.getEventType());\r\n currentScoreTypeForEvent = ScoreType.BAD;\r\n badScoreUpdated = true;\r\n }\r\n } else if (event.getEventType().equals(DrivingEventType.ACCELERATION)) {\r\n if ((Math.abs(peakValue) >= 0.9) && (Math.abs(peakValue) <= 2.5) && !goodScoreUpdated && !mediumScoreUpdated && !badScoreUpdated) {\r\n\r\n scoreListener.onScoreTypeChangeForEvent(ScoreType.GOOD, event.getEventType());\r\n goodScoreUpdated = true;\r\n }\r\n if ((Math.abs(peakValue) > 2.5) && (Math.abs(peakValue) <= 3.3) && !mediumScoreUpdated && !badScoreUpdated) {\r\n\r\n event.setScoreToMedium();\r\n scoreListener.onScoreTypeChangeForEvent(ScoreType.MEDIUM, event.getEventType());\r\n currentScoreTypeForEvent = ScoreType.MEDIUM;\r\n mediumScoreUpdated = true;\r\n }\r\n if ((Math.abs(peakValue) > 3.3) && !badScoreUpdated) {\r\n\r\n event.setScoreToBad();\r\n scoreListener.onScoreTypeChangeForEvent(ScoreType.BAD, event.getEventType());\r\n currentScoreTypeForEvent = ScoreType.BAD;\r\n badScoreUpdated = true;\r\n }\r\n }\r\n }\r\n }",
"public int getScore(){\n return this.score;\n }",
"public void calcMatch() {\n if (leftResult == null || rightResult == null) {\n match_score = 0.0f;\n } else {\n match_score = FaceLockHelper.Similarity(leftResult.getFeature(), rightResult.getFeature(), rightResult.getFeature().length);\n match_score *= 100.0f;\n tvFaceMatchScore1.setText(Float.toString(match_score));\n llFaceMatchScore.setVisibility(View.VISIBLE);\n\n }\n }",
"public int getScore()\n {\n return points + extras;\n }",
"public void setScore(int score){\n\t\tthis.score = score;\n\t}"
] | [
"0.61310077",
"0.59040946",
"0.5841003",
"0.5828477",
"0.5719088",
"0.570476",
"0.5695058",
"0.56789285",
"0.56641376",
"0.56600857",
"0.56600857",
"0.5608419",
"0.5561263",
"0.5540565",
"0.5528612",
"0.5526681",
"0.55057025",
"0.5501914",
"0.54976344",
"0.5492277",
"0.5474607",
"0.5458728",
"0.5448112",
"0.5430483",
"0.54267406",
"0.54267406",
"0.54008585",
"0.54008585",
"0.5394043",
"0.53830254",
"0.5380877",
"0.53749096",
"0.5371267",
"0.5346662",
"0.5340784",
"0.5331606",
"0.53046584",
"0.5297481",
"0.52965665",
"0.52906585",
"0.52884704",
"0.52884704",
"0.52884704",
"0.52884704",
"0.52874154",
"0.5272934",
"0.5258257",
"0.52347976",
"0.5233741",
"0.5228668",
"0.5228518",
"0.52277625",
"0.5222658",
"0.5222423",
"0.521845",
"0.5195975",
"0.5195975",
"0.51886994",
"0.51832104",
"0.51830256",
"0.51830256",
"0.5167942",
"0.516727",
"0.5165111",
"0.5159383",
"0.51474047",
"0.5144866",
"0.5133887",
"0.51333994",
"0.5126234",
"0.511836",
"0.51062423",
"0.5104972",
"0.5104972",
"0.5104972",
"0.5104972",
"0.51019365",
"0.51002765",
"0.51002765",
"0.50997406",
"0.50984836",
"0.50984836",
"0.5097303",
"0.50970966",
"0.5089184",
"0.508317",
"0.50792927",
"0.5076188",
"0.5075692",
"0.5074552",
"0.5070988",
"0.50698113",
"0.50687",
"0.5062838",
"0.50595164",
"0.50577426",
"0.50563544",
"0.50535536",
"0.5051281",
"0.5043423"
] | 0.55173033 | 16 |
At which RMSD are hits filtered? Only relevant when scored by alignment. | public double getRmsdCutoff() {
return rmsdCutoff;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Boolean filterHits(int queryL, int alignL){\n return this.getResults().filter(queryL, alignL);\n }",
"@Override\n public boolean sampleDistance(Ray ray, Sampler sampler, MediumQueryRecord mRec) {\n Ray localRay = new Ray();\n worldToMedium.m.transform(ray.o, localRay.o);\n worldToMedium.m.transform(ray.d, localRay.d);\n //System.out.println(ray);\n\n double[] nearFar = new double[2];\n boolean hit = bbox.rayIntersect(localRay, nearFar);\n double near = nearFar[0];\n double far = nearFar[1];\n if (!hit) {\n mRec.weight.set(1,1,1);\n return false;\n }\n\n localRay.mint = Math.max(ray.mint, near);\n localRay.maxt = Math.min(ray.maxt, far);\n\n //System.out.println(\"localRay = \" + localRay);\n\n mRec.t = localRay.mint;\n Point3d p = new Point3d();\n // Sample distance by Woodcock tracking.\n while (true) {\n if (mRec.t > localRay.maxt) {\n mRec.weight.set(1,1,1);\n break;\n }\n\n mRec.t += -Math.log(1 - sampler.next1D()) / densityMultiplier;\n localRay.project(mRec.t, p);\n double sigmaT = data.lookupFloat(p) * densityMultiplier;\n if (sampler.next1D() * densityMultiplier < sigmaT) {\n mRec.weight.set(albedo);\n return true;\n }\n }\n return false;\n }",
"private static native void amFilter_0(long joint_nativeObj, long src_nativeObj, long dst_nativeObj, double sigma_s, double sigma_r, boolean adjust_outliers);",
"public List<OWLObject> search(OWLObject queryObj) {\n\t\tList<OWLObject> hits = new ArrayList<OWLObject>(maxHits);\n\t\tSystem.out.println(\"gettings atts for \"+queryObj+\" -- \"+simEngine.comparisonProperty);\n\t\tSet<OWLObject> atts = simEngine.getAttributeClosureFor(queryObj);\n\t\tSystem.out.println(\"all atts: \"+atts.size());\n\t\tif (atts.size() == 0)\n\t\t\treturn hits;\n\t\t\n\t\t// only compare using significant atts;\n\t\t// we don't do the same test on candidates as these will be removed by the\n\t\t// intersection operation. they will have a small effect on the score, as\n\t\t// we don't divide by the union, but instead the sum of sizes\n\t\tatts = filterNonSignificantAttributes(atts);\n\t\tSystem.out.println(\"filtered atts: \"+atts.size());\n\n\t\t//bloomFilter = new BloomFilter<OWLObject>(0.05, atts.size());\n\t\t//bloomFilter.addAll(atts);\n\t\t\t\t\n\t\tSortedMap<Integer,Set<OWLObject>> scoreCandidateMap = new TreeMap<Integer,Set<OWLObject>>();\n\t\t\n\t\tfor (OWLObject candidate : getCandidates()) {\n\t\t\tif (candidate.equals(queryObj))\n\t\t\t\tcontinue;\n\t\t\tSet<OWLObject> iAtts = simEngine.getAttributeClosureFor(candidate);\n\t\t\t//Set<OWLObject> iAtts = simEngine.getGraph().getAncestors(candidate);\n\n\t\t\tif (iAtts.size() == 0)\n\t\t\t\tcontinue;\n\t\t\tint cAttsSize = iAtts.size();\n\t\n\t\t\tiAtts.retainAll(atts);\n\t\t\t//Collection<OWLObject> iAtts = bloomFilter.intersection(cAtts);\n\t\t\t\n\t\t\t// simJ, one-sided, scaled by 1000\n\t\t\t// negate to ensure largest first\n\t\t\t//Integer score = - (iAtts.size() * 1000 / cAttsSize);\n\t\t\t\n\t\t\t// this biases us towards genes with large numbers of annotations,\n\t\t\t// but it is better at finding the models that share all features\n\t\t\tInteger score = - iAtts.size();\n\t\t\tif (!scoreCandidateMap.containsKey(score)) \n\t\t\t\tscoreCandidateMap.put(score, new HashSet<OWLObject>());\n\t\t\tscoreCandidateMap.get(score).add(candidate);\n\t\t\treporter.report(this,\"query_candidate_overlap_total\",queryObj,candidate,iAtts.size(),cAttsSize);\n\t\t}\n\t\t\n\t\tint n = 0;\n\t\tfor (Set<OWLObject> cs : scoreCandidateMap.values()) {\n\t\t\tn += cs.size();\n\t\t\thits.addAll(cs);\n\t\t}\n\t\t\n\t\tn = 0;\n\t\tfor (OWLObject hit : hits) {\n\t\t\tn++;\n\t\t\treporter.report(this,\"query_hit_rank_threshold\",queryObj,hit,n,maxHits);\n\t\t}\n\t\tif (hits.size() > maxHits)\n\t\t\thits = hits.subList(0, maxHits);\n\t\t\n\n\n\t\treturn hits;\n\t}",
"public void relevanceFeedback(PostingsList results, boolean[] docIsRelevant, Indexer indexer ) {\r\n// results contain the ranked list from the current search\r\n// docIsRelevant contains the users feedback on which of the 10 first hits are relevant\r\n\tdouble gamma = 0.0; // används ej, de orelevanta dokumenterna. städa upp queryn. Vad innehller de orelevanta dokumenterna för termer\r\n// dess termer tar vi bort från den relebanta.)\r\n\r\n\tdouble alfa = 0.8; // hur mycket litar på det gamla sökning innan feedback\r\n\tdouble beta = 0.6; // hur mycket hänsyn du ska ta till nya sökningen efter feedback \r\n\r\n\r\n\t/* \r\n\r\n\tAlgorithm: \r\n\tThe Rocchio algorithm is based on a method of relevance \r\n\tfeedback found in information retrieval systems\r\n\tThe algorithm is based on the assumption that most users \r\n\thave a general conception of which documents should be denoted \r\n\tas relevant or non-relevant.[1] Therefore, the user's search \r\n\tquery is revised to include an arbitrary percentage of relevant \r\n\tand non-relevant documents as a means of increasing the search \r\n\tengine's recall, and possibly the precision as well. The number \r\n\tof relevant and non-relevant documents allowed to enter a query \r\n\tis dictated by the weights of the a, b.\r\n\tthe associated weights (a, b) are responsible for shaping the \r\n\tmodified vector in a direction closer, or farther away, from the \r\n\toriginal query, related documents, and non-related documents.\r\n\r\n\r\n\r\n\tLimitations of rocchio:\r\n\t\tTherefore the two queries of \"Burma\" and \"Myanmar\" will \r\n\t\tappear much farther apart in the vector space model, \r\n\t\tthough they both contain similar origins\r\n\tWhy not use non-relevant documents:\r\n\t\tThough there are benefits to ranking documents as not-relevant, \r\n\t\ta relevant document ranking will result in more precise documents \r\n\t\tbeing made available to the user. \r\n\t\r\n\r\n\r\n\tRoccio algoritmen: \r\n\t\talfa = Original query weight \r\n\t\tbeta = related document weight\r\n\t\t\r\n\t\thigher alpha means that we give more focus to the original query terms\r\n\t\thigher beta means that we give more focus to the new search feedback. i.e new terms.\r\n\r\n\t\tTar en org query\r\n\t\tTar den gamla gånnger en viss vikt \r\n\t\tvikt är alfa + beta (entill vektor) plus att den kollar på original vektor, q0 \r\n\t\t\thögre alfa mer fokus på original queryn \r\n\t\t\thögra beta skiftar till mer fokus på de nya termerna. \r\n\t\tdvs utökas med ord/termer från dokument vektorerna som var relevanta. \r\n\r\n\tVanligtvis har man väldigt häg alfa och beta lite under för att det är standard. man tycker att den \r\n\tförsta queryn är väldigt bra.\r\n\r\n\t\r\n\t*/\r\n\r\n\tPostingsList related_doc_vector = new PostingsList();\r\n\tHashMap<String, Double> qm = new HashMap<String, Double>(); // spara termer och weights.\r\n\t// normalize weights\r\n\tfor(Double w : weights){\r\n\t\tw = w/weights.size();\r\n\t}\r\n\r\n\tIterator<PostingsEntry> it = results.iterator();\r\n\tfor(int i = 0; i < docIsRelevant.length; i++){\r\n\t\tif(docIsRelevant[i] == true){\r\n\t\t\trelated_doc_vector.list.add(results.get(i));\r\n\t\t} \r\n\t}\r\n\r\n\t// apply Rocchio algorithm.\r\n\tfor(int i = 0; i < terms.size(); i++){\r\n\t\tdouble new_weigt = weights.get(i) * alfa;\r\n\t\tqm.put(terms.get(i), new_weigt);\r\n\t}\r\n\r\n\tfor(int i = 0; i < related_doc_vector.size(); i++){\r\n\t\tIterator<PostingsEntry> ite = related_doc_vector.iterator();\r\n\t\twhile(ite.hasNext()){\r\n\t\t\tPostingsEntry postingsentry = ite.next();\r\n\t\t\tint docID = postingsentry.docID;\r\n\t\t\tString filename = indexer.index.docIDs.get(Integer.toString(docID)); // hämtar filnamnet\r\n\t\t\tString path = \"/Users/monadadoun/Desktop/ir/lab/davisWiki/\" + filename; \r\n\t\t\tFile file = new File(path);\r\n\t\t\tHashSet<String> hs = new HashSet<>();\r\n\t\t\t// lägger till alla ord som finns till mitt hashet\r\n\t\t\ttry (Reader reader = new InputStreamReader( new FileInputStream(file), StandardCharsets.UTF_8 )){\r\n\t\t\t\tTokenizer tok = new Tokenizer( reader, true, false, true, indexer.patterns_file );\r\n\t\t\t\twhile (tok.hasMoreTokens()) {\r\n\t\t\t\t\ths.add(tok.nextToken());\r\n\t\t\t\t}\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tIterator<String> iter = hs.iterator();\r\n\t\t\twhile(iter.hasNext()){\r\n\t\t\t\tString s = iter.next();\r\n\t\t\t\tif(qm.containsKey(s)){\r\n\t\t\t\t\tDouble tmp = qm.get(s);\r\n\t\t\t\t\tqm.put(s, tmp + beta * postingsentry.score);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tqm.put(s, beta * postingsentry.score);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tLinkedList<String> term = new LinkedList<>();\r\n\tLinkedList<Double> weight = new LinkedList<>();\r\n\tList<Map.Entry<String,Double>> answer = new ArrayList<Map.Entry<String,Double>>(qm.entrySet());\r\n\tanswer.sort((e1,e2) -> e2.getValue().compareTo(e1.getValue())); // sorterar efter värde så att orden med högst score ligger först\r\n\tfor (int i = 0; i < answer.size(); i++) {\r\n\t\tterm.add(answer.get(i).getKey());\r\n\t\tweight.add(answer.get(i).getValue()/answer.size());\r\n\t}\r\n\r\n\tterms = term;\r\n\tweights = weight;\r\n\t}",
"public boolean filter(LocusContext context, SAMRecord read) {\n return (read.getCigar().numCigarElements() == 1);\n }",
"@Override\n public Integer map(ReferenceContext ref, SAMRecord read, ReadMetaDataTracker metaDataTracker) {\n //logger.info(String.format(\"examining read %s\", read.getReadName()));\n\n byte[] bases = read.getReadBases();\n if(read.getReadNegativeStrandFlag()) bases = BaseUtils.simpleReverseComplement(bases);\n\n boolean matches = true;\n Iterable<Alignment[]> alignments = aligner.getAllAlignments(bases);\n Iterator<Alignment[]> alignmentIterator = alignments.iterator();\n\n if(!alignmentIterator.hasNext()) {\n matches = read.getReadUnmappedFlag();\n }\n else {\n Alignment[] alignmentsOfBestQuality = alignmentIterator.next();\n for(Alignment alignment: alignmentsOfBestQuality) {\n matches = (alignment.getContigIndex() == read.getReferenceIndex());\n matches &= (alignment.getAlignmentStart() == read.getAlignmentStart());\n matches &= (alignment.isNegativeStrand() == read.getReadNegativeStrandFlag());\n matches &= (alignment.getCigar().equals(read.getCigar()));\n matches &= (alignment.getMappingQuality() == read.getMappingQuality());\n if(matches) break;\n }\n }\n\n if(!matches) {\n logger.error(\"Found mismatch!\");\n logger.error(String.format(\"Read %s:\",read.getReadName()));\n logger.error(String.format(\" Contig index: %d\",read.getReferenceIndex()));\n logger.error(String.format(\" Alignment start: %d\", read.getAlignmentStart()));\n logger.error(String.format(\" Negative strand: %b\", read.getReadNegativeStrandFlag()));\n logger.error(String.format(\" Cigar: %s%n\", read.getCigarString()));\n logger.error(String.format(\" Mapping quality: %s%n\", read.getMappingQuality()));\n for(Alignment[] alignmentsByScore: alignments) {\n for(int i = 0; i < alignmentsByScore.length; i++) {\n logger.error(String.format(\"Alignment %d:\",i));\n logger.error(String.format(\" Contig index: %d\",alignmentsByScore[i].getContigIndex()));\n logger.error(String.format(\" Alignment start: %d\", alignmentsByScore[i].getAlignmentStart()));\n logger.error(String.format(\" Negative strand: %b\", alignmentsByScore[i].isNegativeStrand()));\n logger.error(String.format(\" Cigar: %s\", alignmentsByScore[i].getCigarString()));\n logger.error(String.format(\" Mapping quality: %s%n\", alignmentsByScore[i].getMappingQuality()));\n }\n }\n throw new ReviewedStingException(String.format(\"Read %s mismatches!\", read.getReadName()));\n }\n\n return 1;\n }",
"public boolean fitsCriteria(Map<String, String> filter){\n return mutableSegmentController.fitsFilterCriteria(filter);\n }",
"@Test\n \tpublic void testSimpleFilterAlignments()\n \t{\n \t\tString searchTerm = \"hobbys\";\n \t\tString searchText = \"hobbies\";\n \t\tPDL.init(searchTerm, searchText, true, true);\n \t\talignments.clear();\n \t\tPseudoDamerauLevenshtein.Alignment ali1 = PDL.new Alignment(searchTerm, searchText, 1.0, 0, 5, 0, 0);\n \t\tPseudoDamerauLevenshtein.Alignment ali2 = PDL.new Alignment(searchTerm, searchText, 0.5, 0, 5, 0, 0);\n \t\talignments.add(ali1);\n \t\talignments.add(ali2);\n \t\talignments = PseudoDamerauLevenshtein.filterAlignments(alignments);\n \t\tAssert.assertEquals(1, alignments.size());\n \t\tAssert.assertEquals(ali1, alignments.get(0));\n \t}",
"public byte filter(Manager m, SearchRequest q, ResultSet rs, int DocAtNumber, int DocNo)\n\t{\t\t\n\t\tString originalQuery = q.getOriginalQuery();\n\t\t//highlight query terms only for the queries, \n\t\t//which are not about finding related documents\n\t\t//this check may be removed, because the preparation of the \n\t\t//query terms for highlighting takes into account\n\t\t//the related: operator\n\t\tboolean highlightQueryTerms = true;\n\t\tif (originalQuery.matches(\"\\\\brelated:\\\\d+\\\\b\") || //check if the query uses the related: operator \n\t\t\t!enableQueryTermsHighlight || //check if the highlighting of terms is enabled\n\t\t\thighlight.pattern().equals(\"(\\\\b)()(\\\\b)\")) //check if there are no query terms to highlight\n\t\t\thighlightQueryTerms = false;\n\t\t\n\t\tString[] qTerms = q.getOriginalQuery().replaceAll(\" \\\\w+\\\\p{Punct}\\\\w+ \",\" \").toLowerCase().split(\" \");\n\t\t\n\t\tString[] metadata = null;\n\t\tint tmpSentence;\n\t\tdouble tmpScore;\n\t\tsynchronized(metaCache) {\n\t\t\ttry {\n\t\t\t\tInteger DocNoObject = new Integer(DocNo);\n\t\t\t\tif (metaCache.containsKey(DocNoObject))\n\t\t\t\t\t\tmetadata = (String[]) metaCache.get(DocNoObject);\n\t\t\t\telse {\n\t\t\t\t\tmetadata = metaIndex.getItems(keys, DocNo);\n\t\t\t\t\tmetaCache.put(DocNoObject,metadata);\n\t\t\t\t}\n\t\t\t} catch(IOException ioe) {} \n\t\t}\n\t\n\t\tif (show_snippet)\n\t\t{\n\t\t\tString extract = metadata[1];\n\t\t\tString[] sentences = sentencePattern.split(extract, 50); //use 50 sentences at most\n\t\t\tdouble[] sentenceScores = new double[sentences.length]; \n\t\t\tint frsSentence = -1;\n\t\t\tint sndSentence = -1;\n\t\t\tint top1Sentence = 0;\n\t\t\tint top2Sentence = 0;\n\t\t\tdouble max1Score = -1;\n\t\t\tdouble max2Score = 0;\n\t\t\tfinal int qTermsLength = qTerms.length;\n\t\t\tfor (int i=0; i<qTermsLength; i++) {\n\t\t\t\tqTerms[i] = removeEndings.matcher(qTerms[i]).replaceAll(\"\");\n\t\t\t}\n\t\t\tString lowerCaseSentence;\n\t\t\tint sentenceLength;\n\t\t\tfinal int sentencesLength = sentences.length;\n\n\t\t\tfor (int i=0; i<sentencesLength; i++) {\n\t\t\t\t\n\t\t\t\tlowerCaseSentence = sentences[i].toLowerCase();\n\t\t\t\tsentenceLength=sentences[i].length();\n\t\t\t\tif (sentenceLength < 20 || sentenceLength > 250) {\n\t\t\t\t\tfor (int j=0; j<qTermsLength; j++) {\n\t\t\t\t\t\tif (lowerCaseSentence.indexOf(qTerms[j])>=0) {\n\t\t\t\t\t\t\tsentenceScores[i]+=1.0d + sentenceLength / (20.0d + sentenceLength);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tfor (int j=0; j<qTermsLength; j++) {\n\t\t\t\t\t\tif (lowerCaseSentence.indexOf(qTerms[j])>=0) {\n\t\t\t\t\t\t\tsentenceScores[i]+=qTerms[j].length() + sentenceLength / (1.0d + sentenceLength);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t//do your best to get at least a second sentence for the snippet, \n\t\t\t\t//after having found the first one\n\t\t\t\tif (frsSentence > -1 && sndSentence == -1 && sentenceLength > 5) {\n\t\t\t\t\tsndSentence = i;\n\t\t\t\t}\n\n\t\t\t\t//do your best to get at least one sentence for the snippet\n\t\t\t\tif (frsSentence == -1 && sentenceLength > 5) { \n\t\t\t\t\tfrsSentence = i;\n\t\t\t\t}\n\n\t\t\t\tif (max2Score < sentenceScores[i]) {\n\t\t\t\t\tmax2Score = sentenceScores[i];\n\t\t\t\t\ttop2Sentence = i;\n\t\t\t\t\t//logger.debug(\"top 2 sentence is \" + i);\n\t\t\t\t\tif (max2Score > max1Score) {\n\t\t\t\t\t\ttmpScore = max1Score; max1Score = max2Score; max2Score = tmpScore;\n\t\t\t\t\t\ttmpSentence = top1Sentence; top1Sentence = top2Sentence; top2Sentence = tmpSentence;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tint lastIndexOfSpace = -1;\n\t\t\tString sentence=\"\";\n\t\t\tString secondSentence=\"\";\n\t\t\tString snippet = \"\";\n\t\t\tif (max1Score == -1) {\n\t\t\t\tif (frsSentence>=0) {\n\t\t\t\t\tsentence = sentences[frsSentence];\n\t\t\t\t\tif (sentence.length() > 100) {\n\t\t\t\t\t\tlastIndexOfSpace = sentence.substring(0, 100).lastIndexOf(\" \");\n\t\t\t\t\t\tsentence = sentence.substring(0, lastIndexOfSpace > 0 ? lastIndexOfSpace : 100);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (sndSentence>=0) {\n\t\t\t\t\tsecondSentence = sentences[sndSentence];\n\t\t\t\t\tif (secondSentence.length() > 100) {\n\t\t\t\t\t\tlastIndexOfSpace = secondSentence.substring(0, 100).lastIndexOf(\" \");\n\t\t\t\t\t\tsecondSentence = secondSentence.substring(0, lastIndexOfSpace>0 ? lastIndexOfSpace : 100);\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (frsSentence >=0 && sndSentence >= 0) \n\t\t\t\t\tsnippet = sentence.trim() + \"...\" + secondSentence.trim();\n\t\t\t\telse if (frsSentence >= 0 && sndSentence<0) \n\t\t\t\t\tsnippet = sentence.trim();\n\t\t\t\t\n\t\t\t} else if (sentences[top1Sentence].length()<100 && top1Sentence!=top2Sentence) {\n\t\t\t\tsentence = sentences[top1Sentence];\n\t\t\t\tif (sentence.length() > 100) {\n\t\t\t\t\tlastIndexOfSpace = sentence.substring(0, 100).lastIndexOf(\" \");\n\t\t\t\t\tsentence = sentence.substring(0, lastIndexOfSpace > 0 ? lastIndexOfSpace : 100);\n\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\tsecondSentence = sentences[top2Sentence];\n\t\t\t\tif (secondSentence.length() > 100) {\n\t\t\t\t\tlastIndexOfSpace = secondSentence.substring(0, 100).lastIndexOf(\" \");\n\t\t\t\t\tsecondSentence = secondSentence.substring(0, lastIndexOfSpace>0 ? lastIndexOfSpace : 100);\n\t\t\t\t}\n\t\t\t\tsnippet = sentence.trim() + \"...\" + secondSentence.trim();\n\t\t\t} else {\n\t\t\t\tsentence = sentences[top1Sentence];\n\t\t\t\tif (sentence.length()>200) {\n\t\t\t\t\tlastIndexOfSpace = sentence.substring(0, 200).lastIndexOf(\" \");\n\t\t\t\t\tsentence = sentence.substring(0, lastIndexOfSpace > 0 ? lastIndexOfSpace : 200);\n\t\t\t\t}\n\t\t\t\tsnippet = sentence.trim();\n\t\t\t}\n\t\t\t\n\t\t\t//checking and removing any control characters\n\t\t\tcontrolNonVisibleCharactersMatcher.reset(snippet);\n\t\t\tsnippet = controlNonVisibleCharactersMatcher.replaceAll(\"\");\n\t\t\t\n\t\t\t//String escapedSnippet = StringEscapeUtils.escapeHtml(snippet);\n\t\t\t//if (highlightQueryTerms)\n\t\t\t//\tescapedSnippet = highlight.matcher(escapedSnippet).replaceAll(\"$1<b>$2</b>$3\");\n\t\t\tif (highlightQueryTerms)\n\t\t\t\tsnippet = highlight.matcher(snippet).replaceAll(\"$1<b>$2</b>$3\");\n\t\t\t//else \n\t\t\t//\tsnippet = StringEscapeUtils.escapeHtml(snippet);\n\t\t\t\n\t\t\t//change by Vassilis, 20/09/2006\n\t\t\t//disabling the xml escaping in order to move the data into ![CDATA[ ]]\n\t\t\t//the code was:\n\t\t\t//rs.addMetaItem(\"snippet\", DocAtNumber, StringEscapeUtils.escapeXml(snippet));\n\t\t\t//and now it is:\n\t\t\t//snippet.replaceAll(\"[^\\\\u0009\\\\u000A\\\\u000D\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\u10000-\\\\u10FFFF]\",\"\");\n\t\t\trs.addMetaItem(\"snippet\", DocAtNumber, snippet);\n\t\t\t\n\t\t}\n\t\tif (show_title)\n\t\t{\n\t\t\tString title = metadata[2];\n\t\t\t\n\t\t\t//checking and removing any control characters\n\t\t\tcontrolNonVisibleCharactersMatcher.reset(title);\n\t\t\ttitle = controlNonVisibleCharactersMatcher.replaceAll(\"\");\n\t\t\ttitle = (highlightQueryTerms)\n\t\t\t\t ? highlight.matcher(metadata[2]).replaceAll(\"$1<b>$2</b>$3\") \n\t\t\t\t : metadata[2];\n\t\t\t\n\t\t\t\n\t\t\t//String escapedTitle = StringEscapeUtils.escapeHtml(metadata[2]);\n\t\t\t//String title = (highlightQueryTerms)\n\t\t\t//\t\t\t ? highlight.matcher(escapedTitle).replaceAll(\"$1<b>$2</b>$3\") \n\t\t\t//\t\t\t : escapedTitle;\n\t\t\t//String title = (highlightQueryTerms) \n\t\t\t//\t\t? highlight.matcher(metadata[2]).replaceAll(\"$1<b>$2</b>$3\") \n\t\t\t//\t\t: metadata[2];\n\n\t\t\t//change by Vassilis, 20/09/2006\n\t\t\t//disabling the xml escaping in order to move the data into ![CDATA[ ]]\n\t\t\t//the code was:\n\t\t\t//rs.addMetaItem(\"title\", DocAtNumber, StringEscapeUtils.escapeXml(title));\n\t\t\t//and now is:\n\t\t\t//title.replaceAll(\"[^\\\\u0009\\\\u000A\\\\u000D\\\\u0020-\\\\uD7FF\\\\uE000-\\\\uFFFD\\\\u10000-\\\\u10FFFF]\",\"\");\n\t\t\trs.addMetaItem(\"title\", DocAtNumber, title);\n\t\t\t\n\t\t}\n\t\tif (!show_docid_early && show_docid)\n\t\t{\n\t\t\trs.addMetaItem(\"docid\", DocAtNumber, docIndex.getDocumentNumber(DocNo));\n\t\t}\n\t\tif (!show_url_early && show_url)\n\t\t{\n\n\t\t\trs.addMetaItem(\"url\", DocAtNumber, StringEscapeUtils.escapeXml(metadata[0]));\n\t\t}\n\t\t\n\t\treturn FILTER_OK;\n\t}",
"public java.lang.Object[] getFilterParams() {\n\treturn new Object[] { new LeaseDocPositionKey(getDocpositioncode()) };\n}",
"boolean filter(List<ReferenceOrderedDatum> rodData, char ref, LocusContext context);",
"public void rgs() {\n\t\tArrayList<int[]> front = this.unknown;\n\t\tRandom rand = new Random();\n\t\tint index = rand.nextInt(front.size());\n\t\tint loc[] = front.get(index);\n\t\tprobe(loc[0], loc[1]);\n\t\trgsCount++;\n\t\tSystem.out.println(\"RGS: probe[\" +loc[0] + \",\" + loc[1] + \"]\");\n\t\tshowMap();\n\t}",
"protected int hit() {\r\n\t\treturn hits;\r\n\t}",
"boolean isPreFiltered();",
"boolean JoiningCriteriaMet() {\n\t\tfor(int i = timeService.getCurrentYear()-1; i > timeService.getCurrentYear() - KyotoEntryYears; i--) {\n\t\t\tif (carbonOutputMap.get(i) > emissionsTargetMap.get(i)) {\n\t\t\t\treturn(false);\n\t\t\t}\n\t\t}\n\t\treturn(true); // \n\t}",
"protected int matches(Alignment alignment) {\n\t\treturn 1;\n\t}",
"void randomProjection(int R, double percent_mask, int sax_len) {\r\n\t\tHashMap<Integer, HashSet<Integer>> Hash_Mark = new HashMap<>();\r\n\t\tint word, mask_word, new_word;\r\n\t\tHashSet<Integer> obj_set, ptr;\r\n\r\n\t\tint num_mask = (int) Math.ceil(percent_mask * sax_len);\r\n\r\n\t\tfor (int r = 0; r < R; r++) {\r\n\t\t\tmask_word = createMaskWord(num_mask, sax_len);\r\n\r\n\t\t\t// / random projection and mark non-duplicate object\r\n\t\t\tfor (Map.Entry<Integer, USAX_elm_type> entry : USAX_Map.entrySet()) {\r\n\t\t\t\tword = entry.getKey();\r\n\t\t\t\tobj_set = entry.getValue().obj_set;\r\n\r\n\t\t\t\t// put the new word and set combo in the hash_mark\r\n\t\t\t\tnew_word = word | mask_word;\r\n\r\n\t\t\t\tptr = Hash_Mark.get(new_word);\r\n\r\n\t\t\t\tif (ptr == null) {\r\n\t\t\t\t\tHash_Mark.put(new_word, new HashSet<>(obj_set));\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// add onto our ptr, rather than overwrite.\r\n\t\t\t\t\tptr.addAll(obj_set);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// / hash again for keep the count\r\n\t\t\tfor (Map.Entry<Integer, USAX_elm_type> entry : USAX_Map.entrySet()) {\r\n\t\t\t\tword = entry.getKey();\r\n\t\t\t\tnew_word = word | mask_word;\r\n\t\t\t\tobj_set = Hash_Mark.get(new_word);\r\n\t\t\t\t// increase the histogram\r\n\t\t\t\tfor (Integer o_it : obj_set) {\r\n\t\t\t\t\tInteger count = entry.getValue().obj_count.get(o_it);\r\n\t\t\t\t\tcount = count == null ? 1 : count + 1;\r\n\t\t\t\t\tentry.getValue().obj_count.put(o_it, count);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tHash_Mark.clear();\r\n\t\t}\r\n\t}",
"public static void amFilter(Mat joint, Mat src, Mat dst, double sigma_s, double sigma_r)\r\n {\r\n \r\n amFilter_1(joint.nativeObj, src.nativeObj, dst.nativeObj, sigma_s, sigma_r);\r\n \r\n return;\r\n }",
"public static void amFilter(Mat joint, Mat src, Mat dst, double sigma_s, double sigma_r, boolean adjust_outliers)\r\n {\r\n \r\n amFilter_0(joint.nativeObj, src.nativeObj, dst.nativeObj, sigma_s, sigma_r, adjust_outliers);\r\n \r\n return;\r\n }",
"@Override\n public void init(SearchHits hits) { \n\n \tint numFbDocs = 50;\n \tint numFbTerms = 20;\n \tdouble lambda = 1.0;\n \tdouble alpha = 5.0;\n \t\n if (paramTable.get(FB_DOCS) != null ) \n \tnumFbDocs = paramTable.get(FB_DOCS).intValue();\n if (paramTable.get(FB_TERMS) != null ) \n \tnumFbTerms = paramTable.get(FB_TERMS).intValue();\n if (paramTable.get(LAMBDA) != null ) \n \tlambda = paramTable.get(LAMBDA).doubleValue();\n if (paramTable.get(ALPHA) != null ) \n \talpha = paramTable.get(ALPHA).doubleValue(); \n \n if (hits.size() < numFbDocs) \n \tnumFbDocs = hits.size();\n \n SearchHits fbDocs = new SearchHits(hits.hits().subList(0, numFbDocs));\n FeedbackRelevanceModel rm = new FeedbackRelevanceModel();\n rm.setDocCount(numFbDocs);\n rm.setTermCount(numFbTerms);\n rm.setIndex(index);\n rm.setStopper(null);\n rm.setRes(fbDocs);\n rm.build(); \n \n FeatureVector rmVector = rm.asFeatureVector();\n rmVector.clip(numFbTerms);\n rmVector.normalize();\n \n TermTimeSeries ts = new TermTimeSeries(startTime, endTime, interval, \n \t\trm.asFeatureVector().getFeatures());\n \n for (SearchHit hit: hits.hits()) {\n \t\tlong docTime = TemporalScorer.getTime(hit);\n \t\tdouble score = hit.getScore();\n \t\tts.addDocument(docTime, score, hit.getFeatureVector());\n }\n \n RUtil rutil = new RUtil();\n \n double sdps =0;\n for (String term: rmVector.getFeatures()) {\n \tdouble[] tsw = ts.getTermFrequencies(term);\n \tif (sum(tsw) > 0) {\n \t\ttry {\n \t\t\tsdps += rutil.dps(tsw);\n \t\t} catch (Exception e) {\n \t\t\te.printStackTrace();\n \t\t}\n \t}\n } \n \n FeatureVector tsfv = new FeatureVector(null);\n for (String term: rmVector.getFeatures()) {\n \tdouble[] termts = ts.getTermFrequencies(term);\n \ttry {\n \t\tdouble dps = rutil.dps(termts)/sdps;\n \t\t\n \tdouble weight = Math.pow(dps, alpha) * Math.pow(rmVector.getFeatureWeight(term), (1-alpha));\n tsfv.addTerm(term, weight);\n \n \t} catch (Exception e) {\n \t\te.printStackTrace();\n \t}\n }\n tsfv.normalize();\n\n gQuery.getFeatureVector().normalize();\n FeatureVector fv =\n \t\tFeatureVector.interpolate(gQuery.getFeatureVector(), tsfv, lambda);\n gQuery.setFeatureVector(fv);\n \n System.out.println(rmVector.toString(10));\n System.out.println(tsfv.toString(10));\n System.out.println(fv.toString(10));\n rutil.close();\n \n }",
"public void ruleOutPos(){\n for(int i=0;i<scores.length;i++) {\n for(int j=0;j<scores[i].length;j++) {\n scores[i][j][13] = 0;//0=pass, >0 is fail, set to pass initially\n\n //check Ns - bit crude - what to discount regions with high N\n double ns = (double) scores[i][j][14] / (double) pLens[j];\n if (ns >= minPb | ns >= minPm)//\n scores[i][j][13] += 4;\n\n //probe\n if (hasProbe){\n if (j == 1 | j == 4) {\n double perc = (double) scores[i][j][0] / (double) primers[j].length();\n if (perc >= minPb) {\n scores[i][j][12] = 1;//flag for failed % test\n scores[i][j][13] += 2;\n }\n }\n }\n //primer\n else {\n //if more than 2 mismatches in 1-4nt at 3'\n if(scores[i][j][11]>max14nt) {\n scores[i][j][13]+=1;\n }\n //use mLen (combined F and R length) initially to find initial candidates - filter later\n double perc=(double)scores[i][j][0]/(double)mLen;\n double percI=(double)scores[i][j][0]/(double)pLens[j];\n\n if(perc>=minPm | percI>=minPmI) {\n scores[i][j][12]=1;//flag for failed % test\n scores[i][j][13]+=2;\n }\n }\n }\n }//end of finding positions that prime loop\n }",
"@Override\n public void adjustFilter(int key_min, int key_max) {\n //do nothing\n }",
"public boolean isInRangeToRenderDist(double distance) {\n/* 38 */ return (distance < 4096.0D);\n/* */ }",
"public synchronized void filtered() {\n filteredCountStat.received();\n filteredCount++;\n }",
"@Override\n public void filter(BoundingBox3d bounds) {\n filter = new boolean[points.size()];\n for (int i = 0; i < filter.length; i++)\n filter[i] = bounds.contains(points.get(i).xyz);\n }",
"@Override\r\n\t\t\tpublic double matchingItems(Query query, Set<Document> documents,\r\n\t\t\t\t\tint docsPerQuery) {\n\t\t\t\treturn 0;\r\n\t\t\t}",
"void setSampleFiltering(boolean filterFlag, float cutoffFreq) {\n }",
"private boolean updateFilter() {\n \tList<Rankable> items = rankings.getRankings();\n \tHashSet<String> hashtags = new HashSet<String>();\n \t\n \tfor (Rankable item: items) {\n \thashtags.add((String)item.getObject());\n }\n \t\n \n \t\n \tfor(String word: initialWords){\n \t\thashtags.add(word);\n \t}\n \n \tif(filter.equals(hashtags)){\n \t\treturn false;\n \t} else {\n \t\tfilter = hashtags;\n \t\treturn true;\n \t}\n \n\t\t\n\t}",
"@Override\n\tpublic boolean shouldFilter() {\n\t\treturn true;\n\t}",
"public void setIncludeMagDistCutoff(boolean include);",
"public boolean docIteratorHasMatch (RetrievalModel r) {\n // For Indri model, calc #WAND scores for documents that have at least 1 query term\n if ( r instanceof RetrievalModelIndri )\n return this.docIteratorHasMatchMin(r);\n else\n throw new IllegalArgumentException\n (r.getClass().getName() + \" doesn't support the WAND operator.\");\n }",
"@Override\n public int filterOrder() {\n return 1;\n }",
"@Override\n public int filterOrder() {\n return 1;\n }",
"private int threshFind(int[] ray){\n int min = 0;\n int max = 0;\n for(int i = 0; i < ray.length; i++){\n if(min > ray[i]) min = ray[i];\n else if(max < ray[i]) max = ray[i];\n }\n\n return (min + max) / 2;\n }",
"public void execFuzzySearchRangeFunc(){\n\n Map map = new HashMap();\n\n if(this.searchParam != null && this.searchParam.length()> 0 ){\n if(this.searchParam.contains(\":\")==true || this.searchParam.startsWith(\"chr\") == true){\n String chrom = \"\";\n int pstart = -1;\n int pend = -1;\n if(this.searchParam.indexOf(\":\") > -1 ){\n int idex = this.searchParam.indexOf(\":\");\n chrom = this.searchParam.substring(0,idex );\n System.out.println(\"chrom=\"+chrom);\n map.put(\"chrom\",chrom);\n if(this.searchParam.indexOf(\"-\") > -1 ){\n int idex1 = this.searchParam.indexOf(\"-\");\n pstart = Integer.parseInt(this.searchParam.substring(idex+1, idex1));\n pend = Integer.parseInt(this.searchParam.substring(idex1+1, this.searchParam.length()));\n map.put(\"startpos\",pstart);\n map.put(\"endpos\",pend);\n }else {\n pstart = Integer.parseInt(this.searchParam.substring(idex+1, this.searchParam.length()));\n map.put(\"startpos\",pstart);\n }\n\n }else if(this.searchParam.startsWith(\"chr\") == true){\n map.put(\"chrom\",this.searchParam);\n\n\n }\n }\n }\n\n int idenfilter = 0;\n if(this.searchSpecies!= null && this.searchSpecies.equals(\"all\") == false){\n idenfilter =1;\n map.put(\"gwas\",\"gwas\") ;\n map.put(\"gwasend\",\"gwasend\") ;\n map.put(\"species\",this.searchSpecies);\n }\n\n if(this.searchTrait != null&& this.searchTrait.equals(\"null\")==false && this.searchTrait.length()>0){\n idenfilter =1;\n map.put(\"gwas\",\"gwas\") ;\n map.put(\"gwasend\",\"gwasend\") ;\n map.put(\"searchTrait\", this.searchTrait) ;\n }\n\n if(this.pvalue != null&& this.pvalue.equals(\"null\")==false && this.pvalue.length()>0){\n idenfilter =1;\n map.put(\"gwas\",\"gwas\") ;\n map.put(\"gwasend\",\"gwasend\") ;\n map.put(\"psitu\", this.psitu);\n map.put(\"pval\", this.pvalue) ;\n }\n\n List<SearchItemBean> searchlist = (List<SearchItemBean>) baseService.findResultList(\"cn.big.gvk.dm.Search.selectRangeBySearch\",map);\n if( searchlist != null ){\n genotypeBeanList = new ArrayList<GenotypeBean>();\n mapGeneBeanList = new ArrayList<MapGeneBean>();\n for(SearchItemBean tmpbean : searchlist){\n if(tmpbean.getItemType() == 1){ //variant\n Map cmp = new HashMap();\n cmp.put(\"genotypeid\",tmpbean.getItemId());\n GenotypeBean tbean = (GenotypeBean) baseService.findObjectByObject(\"cn.big.gvk.dm.Genotype.selectGenotypeByPos\",cmp);\n if(tbean != null ){\n List genotypelist = new ArrayList();\n genotypelist.add(tbean.getGenotypeId()) ;\n\n Map t = new HashMap();\n t.put(\"genotypelist\",genotypelist);\n List<GenotypeAnnotateGeneView> annotateview = baseService.findResultList(\"cn.big.gvk.dm.Genotype.selectGenotypeByList\",t);\n if(annotateview != null && annotateview.size()>0 ){\n //here we need to filter the result\n Map filtermap = new HashMap();\n for(GenotypeAnnotateGeneView tview : annotateview){\n String fkey = tview.getMapGeneId()+\"_\"+tview.getConseqtype();\n if(filtermap.containsKey(fkey) == false){\n filtermap.put(fkey,tview);\n }\n }\n\n if(filtermap.size()>0){\n List<GenotypeAnnotateGeneView> alist = new ArrayList<GenotypeAnnotateGeneView>();\n Iterator it = filtermap.entrySet().iterator();\n while(it.hasNext()){\n Map.Entry entry = (Map.Entry) it.next();\n GenotypeAnnotateGeneView val = (GenotypeAnnotateGeneView) entry.getValue();\n alist.add(val);\n }\n\n tbean.setGenotypeAnnotateGeneView(alist);\n }\n\n\n }\n\n //find association count\n GwasAssociationBean gwas = (GwasAssociationBean) baseService.findObjectByObject(\"cn.big.gvk.dm.GwasAssociation.selectAssociationCountByGenotypeid\",tbean.getGenotypeId());\n if(gwas != null){\n tbean.setTraitCount(gwas.getGwasCount());\n }\n\n //find studycount\n Map cmap = new HashMap();\n cmap.put(\"genotypeId\",tbean.getGenotypeId());\n if(this.searchSpecies!= null && this.searchSpecies.equals(\"all\") == false){\n cmap.put(\"species\",this.searchSpecies);\n }\n\n\n GwasAssociationBean tg_bean1 = (GwasAssociationBean)baseService.findObjectByObject(\"cn.big.gvk.dm.GwasAssociation.selectStudyCountByGenotypeid\",cmap);\n if(tg_bean1 != null ){\n tbean.setStudyCount(tg_bean1.getGwasCount());\n }\n\n genotypeBeanList.add(tbean) ;\n }\n\n\n\n\n }else if(tmpbean.getItemType() == 2){//gene\n\n Map cmp = new HashMap();\n cmp.put(\"gid\",tmpbean.getItemId()) ;\n MapGeneBean mgb = (MapGeneBean) baseService.findObjectByObject(\"cn.big.gvk.dm.MapGene.selectMapGeneCount\",cmp);\n if(mgb != null ){\n Map t = new HashMap();\n t.put(\"gId\",mgb.getGid()) ;\n t.put(\"count\",\"count\");\n\n //trait count\n GwasAssociationView gwas = (GwasAssociationView) baseService.findObjectByObject(\"cn.big.gvk.dm.GwasAssociation.selectGwasViewByGeneInfo\",t);\n if(gwas != null){\n mgb.setTraitCount(gwas.getTraitCount());\n }\n\n //study count\n StudyBean study = (StudyBean) baseService.findObjectByObject(\"cn.big.gvk.dm.study.selectStudyByMapGeneId\",t);\n if(study != null ){\n mgb.setStudyCount(study.getStudyCount());\n }\n\n //publication count\n PublicationBean publication = (PublicationBean)baseService.findObjectByObject(\"cn.big.gvk.dm.publication.selectPubByGeneId\",t);\n if (publication != null ){\n mgb.setPublicationCount(publication.getPublicationCount());\n }\n mapGeneBeanList.add(mgb) ;\n\n }\n\n\n }\n }\n }\n StringBuffer sb = new StringBuffer();\n //generate hidden html table and then use tableExport.js export\n if(genotypeBeanList != null && genotypeBeanList.size()>0){\n for(GenotypeBean genotype: genotypeBeanList){\n sb.append(genotype.getVarId()).append(\"\\t\").append(genotype.getChrom()).append(\":\")\n .append(genotype.getStartPos()).append(\"\\t\").append(genotype.getTraitCount())\n .append(\"\\t\").append(genotype.getStudyCount()).append(\"\\n\");\n }\n }\n\n if(mapGeneBeanList != null && mapGeneBeanList.size()>0){\n for(MapGeneBean mapgene: mapGeneBeanList){\n sb.append(mapgene.getMapGeneId()).append(\"\\t\").append(mapgene.getMapGeneChrom()).append(\":\")\n .append(mapgene.getMapGeneStart()).append(\"-\").append(mapgene.getMapGeneEnd()).append(\"\\t\").append(mapgene.getTraitCount()).append(\"\\t\")\n .append(mapgene.getStudyCount()).append(\"\\n\");\n }\n }\n\n\n if(format == 1 ){ //export txt\n this.response.reset();\n this.response.setHeader(\"Content-Disposition\",\n \"attachment;filename=export.txt\");\n this.response.setContentType(\"application/ms-txt\");\n try {\n PrintWriter pr = this.response.getWriter();\n pr.print(sb.toString());\n pr.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n }",
"public void mergeAlignment() {\n \n SAMFileReader unmappedSam = null;\n if (this.unmappedBamFile != null) {\n unmappedSam = new SAMFileReader(IoUtil.openFileForReading(this.unmappedBamFile));\n }\n \n // Write the read groups to the header\n if (unmappedSam != null) header.setReadGroups(unmappedSam.getFileHeader().getReadGroups());\n \n int aligned = 0;\n int unmapped = 0;\n \n final PeekableIterator<SAMRecord> alignedIterator = \n new PeekableIterator(getQuerynameSortedAlignedRecords());\n final SortingCollection<SAMRecord> alignmentSorted = SortingCollection.newInstance(\n SAMRecord.class, new BAMRecordCodec(header), new SAMRecordCoordinateComparator(),\n MAX_RECORDS_IN_RAM);\n final ClippedPairFixer pairFixer = new ClippedPairFixer(alignmentSorted, header);\n \n final CloseableIterator<SAMRecord> unmappedIterator = unmappedSam.iterator();\n SAMRecord nextAligned = alignedIterator.hasNext() ? alignedIterator.next() : null;\n SAMRecord lastAligned = null;\n \n final UnmappedReadSorter unmappedSorter = new UnmappedReadSorter(unmappedIterator);\n while (unmappedSorter.hasNext()) {\n final SAMRecord rec = unmappedSorter.next();\n rec.setReadName(cleanReadName(rec.getReadName()));\n if (nextAligned != null && rec.getReadName().compareTo(nextAligned.getReadName()) > 0) {\n throw new PicardException(\"Aligned Record iterator (\" + nextAligned.getReadName() +\n \") is behind the umapped reads (\" + rec.getReadName() + \")\");\n }\n rec.setHeader(header);\n \n if (isMatch(rec, nextAligned)) {\n if (!ignoreAlignment(nextAligned)) {\n setValuesFromAlignment(rec, nextAligned);\n if (programRecord != null) {\n rec.setAttribute(ReservedTagConstants.PROGRAM_GROUP_ID,\n programRecord.getProgramGroupId());\n }\n aligned++;\n }\n nextAligned = alignedIterator.hasNext() ? alignedIterator.next() : null;\n }\n else {\n unmapped++;\n }\n \n // Add it if either the read or its mate are mapped, unless we are adding aligned reads only\n final boolean eitherReadMapped = !rec.getReadUnmappedFlag() || (rec.getReadPairedFlag() && !rec.getMateUnmappedFlag());\n \n if (eitherReadMapped || !alignedReadsOnly) {\n pairFixer.add(rec);\n }\n }\n unmappedIterator.close();\n alignedIterator.close();\n \n final SAMFileWriter writer =\n new SAMFileWriterFactory().makeBAMWriter(header, true, this.targetBamFile);\n int count = 0;\n CloseableIterator<SAMRecord> it = alignmentSorted.iterator();\n while (it.hasNext()) {\n SAMRecord rec = it.next();\n if (!rec.getReadUnmappedFlag()) {\n if (refSeq != null) {\n byte referenceBases[] = refSeq.get(rec.getReferenceIndex()).getBases();\n rec.setAttribute(SAMTag.NM.name(),\n SequenceUtil.calculateSamNmTag(rec, referenceBases, 0, bisulfiteSequence));\n rec.setAttribute(SAMTag.UQ.name(),\n SequenceUtil.sumQualitiesOfMismatches(rec, referenceBases, 0, bisulfiteSequence));\n }\n }\n writer.addAlignment(rec);\n if (++count % 1000000 == 0) {\n log.info(count + \" SAMRecords written to \" + targetBamFile.getName());\n }\n }\n writer.close();\n \n \n log.info(\"Wrote \" + aligned + \" alignment records and \" + unmapped + \" unmapped reads.\");\n }",
"@Override\n public boolean shouldFilter() {\n return true;\n }",
"void searchConstraintHit (Search search);",
"static int filter(int distance) {\n if (distance >= MAX_SENSOR_DIST && invalidSampleCount < INVALID_SAMPLE_LIMIT) {\n // bad value, increment the filter value and return the distance remembered from before\n invalidSampleCount++;\n return prevDistance;\n } else {\n if (distance < MAX_SENSOR_DIST) {\n invalidSampleCount = 0; // reset filter and remember the input distance.\n }\n prevDistance = distance;\n return distance;\n }\n }",
"public boolean shouldFilter() {\n return true;\n }",
"@Test\n\tpublic void testSearchIteratorDenormalizedFilter(){\n\t\t\n\t\tRegionQueryPart regionQueryPart = new RegionQueryPart();\n\t\tregionQueryPart.setRegion(new String[]{\"AB\",\"bc\"});\n\t\t//allof should be read : give me all the native and ephemere of AB and BC\n\t\tregionQueryPart.setRegionSelector(RegionSelector.ALL_OF);\n\t\t\n\t\tIterator<Map<String,Object>> taxonIt = taxonDAO.searchIteratorDenormalized(-1, null, null, regionQueryPart, NATIVE_EPHEMERE_STATUSES, null, false, null);\n\t\tassertTrue(taxonIt.hasNext());\n\t\t\n\t\tList<String> mockTaxonNameList = extractMockTaxonNameFromMap(taxonIt);\n\t\tassertTrue(mockTaxonNameList.containsAll(Arrays.asList(new String[]{MOCK1_AUTHOR,MOCK3_AUTHOR})));\n\t\tassertFalse(mockTaxonNameList.contains(MOCK2_AUTHOR));\n\t\t\n\t\t//anyof should be read : give me any of the native and ephemere of AB or BC\n\t\tregionQueryPart.setRegionSelector(RegionSelector.ANY_OF);\n\t\ttaxonIt = taxonDAO.searchIteratorDenormalized(-1, null, -1, regionQueryPart, NATIVE_EPHEMERE_STATUSES, null, false, null);\n\t\tassertTrue(extractMockTaxonNameFromMap(taxonIt).containsAll(Arrays.asList(new String[]{MOCK1_AUTHOR,MOCK2_AUTHOR,MOCK3_AUTHOR})));\n\t\t\n\t\t//only_in should be read : give me the native and ephemere that are only native or ephemere in AB or BC\n\t\tregionQueryPart.setRegionSelector(RegionSelector.ONLY_IN);\n\t\ttaxonIt = taxonDAO.searchIteratorDenormalized(-1, null, -1, regionQueryPart, NATIVE_EPHEMERE_STATUSES, null, false, null);\n\t\tmockTaxonNameList = extractMockTaxonNameFromMap(taxonIt);\n\t\tassertTrue(mockTaxonNameList.containsAll(Arrays.asList(new String[]{MOCK3_AUTHOR, MOCK5_AUTHOR})));\n\t\tassertEquals(2, mockTaxonNameList.size());\n\t\t\n\t\t//only_in and setSearchOnlyInCanada should be read : give me the native and ephemere that are only native or ephemere in AB or BC (ignoring Greenland and St-Pierre)\n\t\tregionQueryPart.setRegionSelector(RegionSelector.ONLY_IN);\n\t\tregionQueryPart.setSearchOnlyInCanada(true);\n\t\ttaxonIt = taxonDAO.searchIteratorDenormalized(-1, null, -1, regionQueryPart, NATIVE_EPHEMERE_STATUSES, null, false, null);\n\t\tmockTaxonNameList = extractMockTaxonNameFromMap(taxonIt);\n\t\tassertTrue(mockTaxonNameList.containsAll(Arrays.asList(new String[]{MOCK3_AUTHOR, MOCK4_AUTHOR, MOCK5_AUTHOR, MOCK6_AUTHOR, MOCK7_AUTHOR})));\n\t\tassertEquals(5, mockTaxonNameList.size());\n\t\t\n\t\t//all of, only in and setSearchOnlyInCanada should be read : give me the native,ephemere that are only native or ephemere in AB and BC (ignoring Greenland and St-Pierre status)\n\t\tregionQueryPart.setRegionSelector(RegionSelector.ALL_OF_ONLY_IN);\n\t\tregionQueryPart.setSearchOnlyInCanada(true);\n\t\ttaxonIt = taxonDAO.searchIteratorDenormalized(-1, null, -1, regionQueryPart, NATIVE_EPHEMERE_STATUSES, null, false, null);\n\t\tmockTaxonNameList = extractMockTaxonNameFromMap(taxonIt);\n\t\tassertTrue(mockTaxonNameList.containsAll(Arrays.asList(new String[]{MOCK3_AUTHOR, MOCK4_AUTHOR, MOCK5_AUTHOR})));\n\t\tassertEquals(3, mockTaxonNameList.size());\n\t\t\n\t\t//all of, only in should be read : give me the native,ephemere that are only native or ephemere in AB and BC (including Greenland and St-Pierre status)\n\t\tregionQueryPart.setRegionSelector(RegionSelector.ALL_OF_ONLY_IN);\n\t\tregionQueryPart.setSearchOnlyInCanada(false);\n\t\ttaxonIt = taxonDAO.searchIteratorDenormalized(-1, null, -1, regionQueryPart, NATIVE_EPHEMERE_STATUSES, null, false, null);\n\t\tmockTaxonNameList = extractMockTaxonNameFromMap(taxonIt);\n\t\tassertTrue(mockTaxonNameList.containsAll(Arrays.asList(new String[]{MOCK3_AUTHOR, MOCK5_AUTHOR})));\n\t\tassertEquals(2, mockTaxonNameList.size());\n\t\t\n\t\t//test taxonid filter\n\t\tregionQueryPart.setRegionSelector(RegionSelector.ALL_OF);\n\t\ttaxonIt = taxonDAO.searchIteratorDenormalized(-1, null, 1, regionQueryPart, NATIVE_EPHEMERE_STATUSES, null, false, null);\n\t\tmockTaxonNameList = extractMockTaxonNameFromMap(taxonIt);\n\t\tassertTrue(mockTaxonNameList.containsAll(Arrays.asList(new String[]{MOCK1_AUTHOR})));\n\t}",
"public ElgendiFastQrsDetector(Ecg ecg, boolean applyPostProcessing) {\n super(ecg);\n\n bpFilter = BandpassButterworth8To21.newEcgFilter(mEcg.getSamplingRate());\n\n // set first moving average filter (QRS complex)\n w1 = (int) Math.round(0.0972222 * mEcg.getSamplingRate());\n double[] ma1_a = {1};\n double[] ma1_b = new double[w1];\n for (int i = 0; i < w1; i++) {\n ma1_b[i] = 1.0 / ((double) w1);\n }\n ma1Filter = new DigitalFilter(ma1_b, ma1_a, w1 / 2);\n // set second moving average filter (heart beat)\n w2 = (int) Math.round(0.6111 * mEcg.getSamplingRate());\n double[] ma2_a = {1};\n double[] ma2_b = new double[w2];\n for (int i = 0; i < w2; i++) {\n ma2_b[i] = 1.0 / ((double) w2);\n }\n ma2Filter = new DigitalFilter(ma2_b, ma2_a, w2 / 2);\n // set third moving average filter (threshold)\n w3 = (int) Math.round(2 * mEcg.getSamplingRate());\n double[] ma3_a = {1};\n double[] ma3_b = new double[w3];\n for (int i = 0; i < w3; i++) {\n ma3_b[i] = 1.0 / ((double) w3);\n }\n ma3Filter = new DigitalFilter(ma3_b, ma3_a, w3 / 2);\n ArrayList<DigitalFilter> filterArray = new ArrayList<DigitalFilter>();\n filterArray.add(ma1Filter);\n filterArray.add(ma2Filter);\n filterArray.add(ma3Filter);\n maFilters = new TimeDelayedFilterArray(filterArray);\n // init thresholds\n thr1Flag = false;\n thr2 = w1;\n blankingInterval = (int) Math.round(0.1 * mEcg.getSamplingRate());\n // init QRS detection\n counter = 0;\n\n originalValues = new ArrayList<Double>();\n squaredValues = new ArrayList<Double>();\n currentQrsComplex = null;\n previousQrsComplex = null;\n // QrsComplexes = new ArrayList<QrsComplex>();\n mQrsList = new ShiftListObject(30);\n numberOfValuesLeftToRPeak = (int) Math.round(0.12 * mEcg.getSamplingRate());\n numberOfValuesRightToRPeak = (int) Math.round(0.28 * mEcg.getSamplingRate());\n\n int t1 = (int) Math.round(0.2 * mEcg.getSamplingRate());\n\n delayToOriginalSignal = bpFilter.getGroupDelay() + maFilters.getMaxGroupDelay();\n // delayToOriginalSignal = maFilters.getMaxGroupDelay();\n bufferSize = Math.round(t1 / 2) + numberOfValuesLeftToRPeak + delayToOriginalSignal;\n\n currentQrsBuffer = new ShiftListDouble(numberOfValuesLeftToRPeak + numberOfValuesRightToRPeak);\n\n if (applyPostProcessing) {\n // if we have a lead II available, we can use a simple\n // max-refinement,\n // if not, we need to use a more sophisticated refinement\n if (ecg.hasLead(EcgLead.II))\n addPostProcessor(new RPeakMaxRefinement(mEcg.getSamplingRate()));\n else\n addPostProcessor(new RPeakSlacknessReduction(mEcg.getSamplingRate()));\n }\n\n }",
"@Override\n\tpublic Object[] advSearchCondition() {\n\t\treturn null;\n\t}",
"@Override\r\n\t\t\tpublic double matchingItems(Query query) {\n\t\t\t\treturn 0;\r\n\t\t\t}",
"private void setup_search_region (RJGUIController.XferCatalogMod xfer) {\n\n\t\t// Time range for aftershock search\n\t\t\n\t\tdouble minDays = xfer.x_dataStartTimeParam;\n\t\tdouble maxDays = xfer.x_dataEndTimeParam;\n\t\t\n\t\tlong startTime = fcmain.mainshock_time + Math.round(minDays*ComcatOAFAccessor.day_millis);\n\t\tlong endTime = fcmain.mainshock_time + Math.round(maxDays*ComcatOAFAccessor.day_millis);\n\n\t\t// Check that start date is before current time\n\n\t\tlong time_now = System.currentTimeMillis();\t\t// must be the actual system time, not ServerClock\n\t\t\n\t\tPreconditions.checkState(startTime < time_now, \"Start time is after now!\");\n\n\t\t// Check that end date is before current time, shrink the time range if not\n\t\t\n\t\tif (endTime > time_now) {\n\t\t\tdouble calcMaxDays = (time_now - startTime)/ComcatOAFAccessor.day_millis;\n\t\t\tSystem.out.println(\"WARNING: End time after current time. Setting max days to: \" + calcMaxDays);\n\t\t\txfer.modify_dataEndTimeParam(calcMaxDays);\n\t\t\tmaxDays = xfer.x_dataEndTimeParam;\n\t\t}\n\n\t\t// The magnitude-of-completeness parameters\n\n\t\tdouble magCat = fetch_fcparams.mag_comp_params.get_magCat();\n\t\tMagCompFn magCompFn = fetch_fcparams.mag_comp_params.get_magCompFn();\n\t\tSearchMagFn magSample = fetch_fcparams.mag_comp_params.get_fcn_magSample();\n\t\tSearchRadiusFn radiusSample = fetch_fcparams.mag_comp_params.get_fcn_radiusSample();\n\t\tSearchMagFn magCentroid = fetch_fcparams.mag_comp_params.get_fcn_magCentroid();\n\t\tSearchRadiusFn radiusCentroid = fetch_fcparams.mag_comp_params.get_fcn_radiusCentroid();\n\n\t\t// No custom region\n\n\t\tcustom_search_region = null;\n\n\t\t// Depth range for aftershock search, assume default\n\t\t\n\t\tdouble minDepth = ForecastParameters.SEARCH_PARAM_OMIT;\n\t\tdouble maxDepth = ForecastParameters.SEARCH_PARAM_OMIT;\n\n\t\t// Minimum magnitude is default, set from the mag-of-comp parameters\n\n\t\tdouble min_mag = ForecastParameters.SEARCH_PARAM_OMIT;\n\n\t\t// Switch on region type\n\n\t\tswitch (xfer.x_regionTypeParam) {\n\n\t\tcase STANDARD:\n\n\t\t\t// Standard region, just change to no minimum magnitude\n\n\t\t\tmagSample = magSample.makeRemovedMinMag();\n\t\t\tmagCentroid = magCentroid.makeRemovedMinMag();\n\t\t\tbreak;\n\n\t\tcase CENTROID_WC_CIRCLE:\n\n\t\t\t// WC circle around centroid, set multiplier and limits, and no minimum magnitude\n\n\t\t\tmagSample = SearchMagFn.makeNoMinMag();\n\t\t\tradiusSample = SearchRadiusFn.makeWCClip (\n\t\t\t\txfer.x_wcMultiplierParam,\n\t\t\t\txfer.x_minRadiusParam,\n\t\t\t\txfer.x_maxRadiusParam\n\t\t\t);\n\t\t\tmagCentroid = SearchMagFn.makeNoMinMag();\n\t\t\tradiusCentroid = SearchRadiusFn.makeWCClip (\n\t\t\t\txfer.x_wcMultiplierParam,\n\t\t\t\txfer.x_minRadiusParam,\n\t\t\t\txfer.x_maxRadiusParam\n\t\t\t);\n\t\t\tminDepth = xfer.x_minDepthParam;\n\t\t\tmaxDepth = xfer.x_maxDepthParam;\n\t\t\tbreak;\n\n\t\tcase CENTROID_CIRCLE:\n\n\t\t\t// Circle around centroid, set constant radius, and no minimum magnitude\n\n\t\t\tmagSample = SearchMagFn.makeNoMinMag();\n\t\t\tradiusSample = SearchRadiusFn.makeConstant (xfer.x_radiusParam);\n\t\t\tmagCentroid = SearchMagFn.makeNoMinMag();\n\t\t\tradiusCentroid = SearchRadiusFn.makeConstant (xfer.x_radiusParam);\n\t\t\tminDepth = xfer.x_minDepthParam;\n\t\t\tmaxDepth = xfer.x_maxDepthParam;\n\t\t\tbreak;\n\n\t\tcase EPICENTER_WC_CIRCLE:\n\n\t\t\t// WC circle around epicenter, set multiplier and limits, and no minimum magnitude\n\n\t\t\tmagSample = SearchMagFn.makeNoMinMag();\n\t\t\tradiusSample = SearchRadiusFn.makeWCClip (\n\t\t\t\txfer.x_wcMultiplierParam,\n\t\t\t\txfer.x_minRadiusParam,\n\t\t\t\txfer.x_maxRadiusParam\n\t\t\t);\n\t\t\tmagCentroid = SearchMagFn.makeSkipCentroid();\n\t\t\tradiusCentroid = SearchRadiusFn.makeConstant (0.0);\n\t\t\tminDepth = xfer.x_minDepthParam;\n\t\t\tmaxDepth = xfer.x_maxDepthParam;\n\t\t\tbreak;\n\n\t\tcase EPICENTER_CIRCLE:\n\n\t\t\t// Circle around epicenter, set constant radius, and no minimum magnitude\n\n\t\t\tmagSample = SearchMagFn.makeNoMinMag();\n\t\t\tradiusSample = SearchRadiusFn.makeConstant (xfer.x_radiusParam);\n\t\t\tmagCentroid = SearchMagFn.makeSkipCentroid();\n\t\t\tradiusCentroid = SearchRadiusFn.makeConstant (0.0);\n\t\t\tminDepth = xfer.x_minDepthParam;\n\t\t\tmaxDepth = xfer.x_maxDepthParam;\n\t\t\tbreak;\n\n\t\tcase CUSTOM_CIRCLE:\n\n\t\t\t// Custom circle, and no minimum magnitude\n\n\t\t\tmagSample = SearchMagFn.makeNoMinMag();\n\t\t\tmagCentroid = SearchMagFn.makeSkipCentroid();\n\t\t\tcustom_search_region = SphRegion.makeCircle (\n\t\t\t\tnew SphLatLon(xfer.x_centerLatParam, xfer.x_centerLonParam),\n\t\t\t\txfer.x_radiusParam\n\t\t\t);\n\t\t\tminDepth = xfer.x_minDepthParam;\n\t\t\tmaxDepth = xfer.x_maxDepthParam;\n\t\t\tbreak;\n\n\t\tcase CUSTOM_RECTANGLE:\n\n\t\t\t// Custom rectangle, and no minimum magnitude\n\n\t\t\tmagSample = SearchMagFn.makeNoMinMag();\n\t\t\tmagCentroid = SearchMagFn.makeSkipCentroid();\n\t\t\tcustom_search_region = SphRegion.makeMercRectangle (\n\t\t\t\tnew SphLatLon(xfer.x_minLatParam, xfer.x_minLonParam),\n\t\t\t\tnew SphLatLon(xfer.x_maxLatParam, xfer.x_maxLonParam)\n\t\t\t);\n\t\t\tminDepth = xfer.x_minDepthParam;\n\t\t\tmaxDepth = xfer.x_maxDepthParam;\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tthrow new IllegalStateException(\"Unknown region type: \" + xfer.x_regionTypeParam);\n\t\t}\n\n\t\t// Make revised magnitude-of-completeness parameters\n\n\t\tfetch_fcparams.mag_comp_params = new MagCompPage_Parameters (\n\t\t\tmagCat,\n\t\t\tmagCompFn,\n\t\t\tmagSample,\n\t\t\tradiusSample,\n\t\t\tmagCentroid,\n\t\t\tradiusCentroid\n\t\t);\n\n\t\t// Make the search region\n\n\t\tfetch_fcparams.set_aftershock_search_region (\n\t\t\tfcmain,\t\t\t\t\t// ForecastMainshock fcmain,\n\t\t\t0L,\t\t\t\t\t\t// long the_start_lag,\n\t\t\t0L,\t\t\t\t\t\t// long the_forecast_lag,\n\t\t\tcustom_search_region,\t// SphRegion the_aftershock_search_region,\n\t\t\tminDays,\t\t\t\t// double the_min_days,\n\t\t\tmaxDays,\t\t\t\t// double the_max_days,\n\t\t\tminDepth,\t\t\t\t// double the_min_depth,\n\t\t\tmaxDepth,\t\t\t\t// double the_max_depth,\n\t\t\tmin_mag\t\t\t\t\t// double the_min_mag\n\t\t);\n\n\t\tif (!( fetch_fcparams.aftershock_search_avail )) {\n\t\t\tthrow new IllegalStateException(\"Failed to build aftershock search region\");\n\t\t}\n\n\t\t// If the event (i.e. cur_mainshock) is outside the plotting domain, change its\n\t\t// hypocenter so it is inside the plotting domain\n\n\t\tLocation hypo = cur_mainshock.getHypocenterLocation();\n\t\tif (fetch_fcparams.aftershock_search_region.getPlotWrap()) {\n\t\t\tif (hypo.getLongitude() < 0.0) {\n\t\t\t\tcur_mainshock.setHypocenterLocation (new Location (\n\t\t\t\t\thypo.getLatitude(), hypo.getLongitude() + 360.0, hypo.getDepth() ));\n\t\t\t}\n\t\t} else {\n\t\t\tif (hypo.getLongitude() > 180.0) {\n\t\t\t\tcur_mainshock.setHypocenterLocation (new Location (\n\t\t\t\t\thypo.getLatitude(), hypo.getLongitude() - 360.0, hypo.getDepth() ));\n\t\t\t}\n\t\t}\n\n\t\treturn;\n\t}",
"private int getSearchHitCount()\r\n {\r\n return ( mFilteringSearchTerm != null ) ? mFilteringSearchTerm.getHitCount() : 0;\r\n }",
"@Override\n\tpublic int filterOrder() {\n\t\treturn 1;\n\t}",
"private void locateBestMatch(int queryStartIdx){\n \n double dist;\n double bsfDist = Double.MAX_VALUE;\n int bsfIdx = -1;\n\n double[] query = zNormalise(series, queryStartIdx, this.windowSize, false);\n double[] comparison;\n\n for(int comparisonStartIdx = 0; comparisonStartIdx <= seriesLength-windowSize; comparisonStartIdx+=stride){\n \n // exclusion zone +/- windowSize/2 around the window\n if(comparisonStartIdx >= queryStartIdx-windowSize*1.5 && comparisonStartIdx <= queryStartIdx+windowSize*1.5){\n continue;\n }\n \n // using a bespoke version of this, rather than the shapelet version, for efficiency - see notes with method\n comparison = zNormalise(series, comparisonStartIdx, windowSize, false);\n dist = 0;\n\n for(int j = 0; j < windowSize;j++){\n dist += (query[j]-comparison[j])*(query[j]-comparison[j]);\n if(dist > bsfDist){\n dist = Double.MAX_VALUE;\n break;\n }\n }\n\n if(dist < bsfDist){\n bsfDist = dist;\n bsfIdx = comparisonStartIdx;\n }\n\n }\n \n this.distances[queryStartIdx] = bsfDist;\n this.indices[queryStartIdx] = bsfIdx;\n }",
"private void runFilters() {\n \tif (currentPoint * itp < time1) {\r\n \t\t//Accelerating filter 1\r\n \t\tfilterSum1 = currentPoint / filterLength1;\r\n \t}\r\n \telse if (currentPoint >= totalPoints - filterLength2) {\r\n \t\tfilterSum1 = 0;\r\n \t}\r\n \telse if (currentPoint * itp >= timeToDeccel) {\r\n \t\t//Deccelerating filter 1\r\n \t\tfilterSum1 = (totalPoints - filterLength2 - currentPoint) / filterLength1;\r\n \t}\r\n \telse {\r\n \t\tfilterSum1 = 1;\r\n \t}\r\n \t\r\n \t//Creating filterSum2 from the sum of the last filterLength2 values of filterSum1(Boxcar filter)\r\n \tfilterSums1[currentPoint] = filterSum1;\r\n \tint filter2Start = (int) ((currentPoint > filterLength2) ? currentPoint - filterLength2 + 1 : 0);\r\n \tfilterSum2 = 0;\r\n \tfor(int i = filter2Start; i <= currentPoint; i++) {\r\n \t\tfilterSum2 += filterSums1[i];\r\n \t}\r\n \t\r\n\t}",
"@Override\n protected void onResume() {\n super.onResume();\n if (rad == 50000) {\n filterLocations(50000, mSelectedLat, mSelectedLng); //Filter to show locations in 50 km radi\n }\n }",
"boolean allHits();",
"public String filterAndReport(int queryL, int alignL){\n return this.getResults().filterAndReport(queryL, alignL);\n }",
"@java.lang.Override\n public boolean hasSearch() {\n return inputSourceCase_ == 10;\n }",
"@java.lang.Override\n public boolean hasSearch() {\n return inputSourceCase_ == 10;\n }",
"public HashMap<Integer, Float> rescore(IndexSearcher searcher, TopDocs firstPassTopDocs, Query query, QueryRescoreContext ctx)\n throws IOException {\n ScoreDoc[] hits = firstPassTopDocs.scoreDocs.clone();\n Arrays.sort(hits, new Comparator<ScoreDoc>() {\n @Override\n public int compare(ScoreDoc a, ScoreDoc b) {\n return a.doc - b.doc;\n }\n });\n\n HashMap<Integer, Float> rescoreHits = new HashMap<Integer, Float>();\n List<LeafReaderContext> leaves = searcher.getIndexReader().leaves();\n\n Weight weight = searcher.createNormalizedWeight(query, true);\n\n // Now merge sort docIDs from hits, with reader's leaves:\n int hitUpto = 0;\n int readerUpto = -1;\n int endDoc = 0;\n int docBase = 0;\n boolean firstMatch = true;\n\n // Scorer returns results by document ID, when looping through, there is no Random Access so scorer.advance(int)\n // has to be the next ID in the TopDocs\n for(Scorer scorer = null; hitUpto < hits.length; ++hitUpto) {\n ScoreDoc hit = hits[hitUpto];\n int docID = hit.doc;\n\n LeafReaderContext readerContext = null;\n while (docID >= endDoc) {\n readerUpto++;\n readerContext = leaves.get(readerUpto);\n endDoc = readerContext.docBase + readerContext.reader().maxDoc();\n }\n\n if(readerContext != null) {\n // We advanced to another segment:\n docBase = readerContext.docBase;\n\n scorer = weight.scorer(readerContext);\n }\n\n if(scorer != null) {\n int targetDoc = docID - docBase;\n int actualDoc = scorer.docID();\n if(actualDoc < targetDoc) {\n actualDoc = scorer.iterator().advance(targetDoc);\n }\n\n if(actualDoc == targetDoc) {\n float score = scorer.score();\n\n if (firstMatch) {\n topScore = score;\n bottomScore = score;\n firstMatch = false;\n }\n\n if (topScore < score)\n topScore = score;\n if (bottomScore > score)\n bottomScore = score;\n\n // Query did match this doc:\n rescoreHits.put(docID, score);\n } else {\n // Query did not match this doc:\n assert actualDoc > targetDoc;\n }\n }\n }\n\n // Moved Arrays.sort() from Lucene engine into our local .combine() method to sort\n // after calculations are defined. This is to prevent sorting unnecessarily\n return rescoreHits;\n }",
"private void analyze() {\n\t\tdouble org = 0;\n\t\tdouble avgIndPerDoc = 0;\n\t\tdouble avgTotalPerDoc = 0;\n\n\t\tfor (Instance instance : instanceProvider.getInstances()) {\n\n\t\t\tint g = 0;\n\t\t\tSet<AbstractAnnotation> orgM = new HashSet<>();\n\n//\t\t\torgM.addAll(instance.getGoldAnnotations().getAnnotations());\n//\t\t\tg += instance.getGoldAnnotations().getAnnotations().size();\n\n\t\t\tfor (AbstractAnnotation instance2 : instance.getGoldAnnotations().getAnnotations()) {\n\n\t\t\t\tResult r = new Result(instance2);\n\n\t\t\t\t{\n////\t\t\t\t\tList<AbstractAnnotation> aa = Arrays.asList(r.getTrend());\n//\t\t\t\t\tList<AbstractAnnotation> aa = Arrays.asList(r.getInvestigationMethod());\n////\t\t\t\t\tList<AbstractAnnotation> aa = new ArrayList<>(\n////\t\t\t\t\t\t\tr.getDefinedExperimentalGroups().stream().map(a -> a.get()).collect(Collectors.toList()));\n//\n//\t\t\t\t\torgM.addAll(aa);\n//\t\t\t\t\tg += aa.size();\n\t\t\t\t}\n\n\t\t\t\t{\n\t\t\t\t\t/**\n\t\t\t\t\t * props of exp\n\t\t\t\t\t */\n\t\t\t\t\tfor (DefinedExperimentalGroup instance3 : r.getDefinedExperimentalGroups()) {\n\n//\t\t\t\t\tList<AbstractAnnotation> aa = Arrays.asList(instance3.getOrganismModel());\n//\t\t\t\t\tList<AbstractAnnotation> aa = new ArrayList<>(instance3.getTreatments());\n//\t\t\t\t\t\tList<AbstractAnnotation> aa = Arrays.asList(instance3.getInjury());\n\n\t\t\t\t\t\tList<AbstractAnnotation> ab = Arrays.asList(instance3.getInjury());\n\n\t\t\t\t\t\tList<AbstractAnnotation> aa = ab.stream().filter(i -> i != null)\n\t\t\t\t\t\t\t\t.map(et -> et.asInstanceOfEntityTemplate()).map(et -> new Injury(et))\n\t\t\t\t\t\t\t\t.filter(i -> i != null).flatMap(i -> i.getDeliveryMethods().stream())\n\t\t\t\t\t\t\t\t.filter(i -> i != null).collect(Collectors.toList());\n\n\t\t\t\t\t\taa.addAll(instance3.getTreatments().stream().filter(i -> i != null)\n\t\t\t\t\t\t\t\t.map(et -> et.asInstanceOfEntityTemplate()).map(et -> new Treatment(et))\n\t\t\t\t\t\t\t\t.filter(i -> i != null).map(i -> i.getDeliveryMethod()).filter(i -> i != null)\n\t\t\t\t\t\t\t\t.collect(Collectors.toList()));\n\n//\t\t\t\t\t\tList<AbstractAnnotation> aa = ab.stream().filter(i -> i != null)\n//\t\t\t\t\t\t\t\t.map(et -> et.asInstanceOfEntityTemplate()).map(et -> new Injury(et))\n//\t\t\t\t\t\t\t\t.filter(i -> i != null).flatMap(i -> i.getAnaesthetics().stream())\n//\t\t\t\t\t\t\t\t.filter(i -> i != null).collect(Collectors.toList());\n\n//\t\t\t\t\t\tList<AbstractAnnotation> aa = ab.stream().filter(i -> i != null)\n//\t\t\t\t\t\t\t\t.map(et -> et.asInstanceOfEntityTemplate()).map(et -> new Injury(et))\n//\t\t\t\t\t\t\t\t.filter(i -> i != null).map(i -> i.getInjuryDevice()).filter(i -> i != null)\n//\t\t\t\t\t\t\t\t.collect(Collectors.toList());\n\n\t\t\t\t\t\t// List<AbstractAnnotation> aa = ab.stream().filter(i -> i != null)\n//\t\t\t\t\t\t\t\t.map(et -> et.asInstanceOfEntityTemplate()).map(et -> new Injury(et))\n//\t\t\t\t\t\t\t\t.filter(i -> i != null).map(i -> i.getInjuryLocation()).filter(i -> i != null)\n//\t\t\t\t\t\t\t\t.collect(Collectors.toList());\n\n\t\t\t\t\t\torgM.addAll(aa);\n\t\t\t\t\t\tg += aa.size();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tavgIndPerDoc += orgM.size();\n\t\t\tavgTotalPerDoc += g;\n\n\t\t\torg += ((double) orgM.size()) / (g == 0 ? 1 : g);\n//\t\t\tSystem.out.println(((double) orgM.size()) / g);\n\n\t\t}\n\t\tSystem.out.println(\"avgTotalPerDoc = \" + avgTotalPerDoc / instanceProvider.getInstances().size());\n\t\tSystem.out.println(\"avgIndPerDoc = \" + avgIndPerDoc / instanceProvider.getInstances().size());\n\t\tSystem.out.println(\"org = \" + org);\n\t\tSystem.out.println(\"avg. org = \" + (org / instanceProvider.getInstances().size()));\n\t\tSystem.out.println(new DecimalFormat(\"0.00\").format(avgTotalPerDoc / instanceProvider.getInstances().size())\n\t\t\t\t+ \" & \" + new DecimalFormat(\"0.00\").format(avgIndPerDoc / instanceProvider.getInstances().size())\n\t\t\t\t+ \" & \" + new DecimalFormat(\"0.00\").format(org / instanceProvider.getInstances().size()));\n\t\tSystem.exit(1);\n\n\t\tStats.countVariables(0, instanceProvider.getInstances());\n\n\t\tint count = 0;\n\t\tfor (SlotType slotType : EntityType.get(\"Result\").getSlots()) {\n\n\t\t\tif (slotType.isExcluded())\n\t\t\t\tcontinue;\n\t\t\tcount++;\n\t\t\tSystem.out.println(slotType.name);\n\n\t\t}\n\t\tSystem.out.println(count);\n\t\tSystem.exit(1);\n\t}",
"public RangeFilter(Envelope queryWindow,boolean considerBoundaryIntersection)\n\t{\n\t\tthis.considerBoundaryIntersection=considerBoundaryIntersection;\n\t\tthis.queryWindow=queryWindow;\n\t}",
"private static native long createAMFilter_0(double sigma_s, double sigma_r, boolean adjust_outliers);",
"@Override\n public void modifyTimeMatching(D2DTimeMatcher d2dTimeMatcher,\n AbstractVizResource<?, ?> rsc, TimeMatcher timeMatcher) {\n /*\n * In order to use the radar customizations, the time match basis must\n * be an AbstractRadarResource for the same icao. If it is not, return\n * early.\n */\n AbstractVizResource<?, ?> basis = d2dTimeMatcher.getTimeMatchBasis();\n if (!(basis instanceof AbstractRadarResource)) {\n return;\n }\n AbstractRadarResource<?> radarBasis = (AbstractRadarResource<?>) basis;\n RequestConstraint icaoRC = getResourceData().getMetadataMap()\n .get(\"icao\");\n RequestConstraint basisIcaoRC = radarBasis.getResourceData()\n .getMetadataMap().get(\"icao\");\n if (icaoRC == null || !icaoRC.equals(basisIcaoRC)) {\n return;\n }\n /*\n * Gather all the frame times that we can, sorted by elevation number.\n * The time between two frames with the same elevation number is the\n * volume scan interval.\n */\n Set<RadarRecord> records = new HashSet<>();\n records.addAll(this.getRadarRecords().values());\n records.addAll(radarBasis.getRadarRecords().values());\n Map<Integer, SortedSet<Date>> elevationTimeMap = new HashMap<>();\n for (RadarRecord record : records) {\n Integer elevation = record.getElevationNumber();\n SortedSet<Date> times = elevationTimeMap.get(elevation);\n if (times == null) {\n times = new TreeSet<>();\n elevationTimeMap.put(elevation, times);\n }\n times.add(record.getDataTime().getRefTime());\n }\n long minInterval1 = getMinVolumeScanInterval(\n radarBasis.getRadarRecords().values());\n long minInterval2 = getMinVolumeScanInterval(\n this.getRadarRecords().values());\n long minInteval = Math.min(minInterval1, minInterval2);\n if (minInteval < TimeUtil.MILLIS_PER_HOUR) {\n /*\n * 1 second padding to ensure that consecutive volume scans do not\n * overlap\n */\n minInteval -= TimeUtil.MILLIS_PER_SECOND;\n timeMatcher.setRadarOnRadar(minInteval);\n } else {\n timeMatcher.setRadarOnRadar(5 * TimeUtil.MILLIS_PER_MINUTE);\n }\n }",
"@Override\n public float customScore(int doc,\n float subQueryScore,\n float[] valSrcScores)\n throws IOException {\n float dl = this.context.reader().getNumericDocValues(\"TotalTerms\").get(doc);\n float dvl = this.context.reader().getNumericDocValues(\"UniqueTerms\").get(doc);\n float ent = this.context.reader().getNumericDocValues(\"Entropy\").get(doc);\n \n float qvl = QuerySearch.currentQuery.numTypes();\n\n \n float lmnorm = 0;\n \n if (SPUDLMSimilarity.method == SPUDLMSimilarity.dir){\n //LM Dirichlet \n \n lmnorm = (float) (Math.log(SPUDLMSimilarity.dir_mu / (dl + SPUDLMSimilarity.dir_mu)));\n }else if (SPUDLMSimilarity.method == SPUDLMSimilarity.spud){\n //spud\n double spud_mu = SPUDLMSimilarity.b0*SPUDLMSimilarity.omega/(1-SPUDLMSimilarity.omega);\n lmnorm = (float) (Math.log(spud_mu / (dvl + spud_mu)));\n \n }else{\n //default spud\n double spud_mu = SPUDLMSimilarity.b0*SPUDLMSimilarity.omega/(1-SPUDLMSimilarity.omega);\n lmnorm = (float) (Math.log(spud_mu / (dvl + spud_mu)));\n \n }\n \n \n return (subQueryScore + lmnorm );\n \n }",
"public ArrayList<Sighting> filter(ArrayList<Sighting> rawSightings);",
"public void filterByMyMostRece() {\n // for each mood event in the list\n for (int i = 0; i < moodListBeforeFilterMy.getCount(); i++ ){\n // get the mood's date\n dateOfMood = moodListBeforeFilterMy.getMoodEvent(i).getDateOfRecord();\n // if it within the range, then add it to the new list\n if (dateOfMood.compareTo(lowerBoundDATE) >= 0 && dateOfMood.compareTo(currentDATE) <= 0) {\n moodListAfterFilter.add(moodListBeforeFilterMy.getMoodEvent(i));\n }\n }\n }",
"public Hashtable<T,ratingCoord<T>> processSamplesLandmarks_(long timer, List<T> landmarks,\n\t\t\tMatrix centralizedRatingMat) {\n\t\t// TODO Auto-generated method stub\n\t//\tMatrix mat=centralizedRatingMat.subMatrix(landmarks,landmarks);\n\t\t\n\t\tHashtable<T,ratingCoord<T>> coords = MyConvergeMMMF_bias.getInstance().compute_basicMMMF(landmarks, centralizedRatingMat, dim, level);\n\t\t//Iterator<ratingCoord<T>> ier = coords.iterator();\n\t\t\n\t\treturn coords;\t\t\n\t}",
"protected void setValuesFromAlignment(final SAMRecord rec, final SAMRecord alignment) {\n for (final SAMRecord.SAMTagAndValue attr : alignment.getAttributes()) {\n // Copy over any non-reserved attributes.\n if (RESERVED_ATTRIBUTE_STARTS.indexOf(attr.tag.charAt(0)) == -1) {\n rec.setAttribute(attr.tag, attr.value);\n }\n }\n rec.setReadUnmappedFlag(alignment.getReadUnmappedFlag());\n rec.setReferenceIndex(alignment.getReferenceIndex());\n rec.setAlignmentStart(alignment.getAlignmentStart());\n rec.setReadNegativeStrandFlag(alignment.getReadNegativeStrandFlag());\n if (!alignment.getReadUnmappedFlag()) {\n // only aligned reads should have cigar and mapping quality set\n rec.setCigar(alignment.getCigar()); // cigar may change when a\n // clipCigar called below\n rec.setMappingQuality(alignment.getMappingQuality());\n }\n if (rec.getReadPairedFlag()) {\n rec.setProperPairFlag(alignment.getProperPairFlag());\n rec.setInferredInsertSize(alignment.getInferredInsertSize());\n rec.setMateUnmappedFlag(alignment.getMateUnmappedFlag());\n rec.setMateReferenceIndex(alignment.getMateReferenceIndex());\n rec.setMateAlignmentStart(alignment.getMateAlignmentStart());\n rec.setMateNegativeStrandFlag(alignment.getMateNegativeStrandFlag());\n }\n \n // If it's on the negative strand, reverse complement the bases\n // and reverse the order of the qualities\n if (rec.getReadNegativeStrandFlag()) {\n SAMRecordUtil.reverseComplement(rec);\n }\n \n if (clipAdapters && rec.getAttribute(ReservedTagConstants.XT) != null){\n CigarUtil.softClip3PrimeEndOfRead(rec, rec.getIntegerAttribute(ReservedTagConstants.XT));\n }\n }",
"public void processData() {\n\t\t SamReader sfr = SamReaderFactory.makeDefault().validationStringency(ValidationStringency.LENIENT).open(this.inputFile);\n\t\t \n\t\t\t\n\t\t\t//Set up file writer\n\t\t SAMFileWriterFactory sfwf = new SAMFileWriterFactory();\n\t\t sfwf.setCreateIndex(true);\n\t\t SAMFileWriter sfw = sfwf.makeSAMOrBAMWriter(sfr.getFileHeader(), false, this.outputFile);\n\t\t \n\t\t \n\t\t\t\n\t\t\t\n\t\t\t//counters\n\t\t\tint totalReads = 0;\n\t\t\tint trimmedReads = 0;\n\t\t\tint droppedReads = 0;\n\t\t\tint dropTrimReads = 0;\n\t\t\tint dropMmReads = 0;\n\t\t\t\n\t\t\t//Containers\n\t\t\tHashSet<String> notFound = new HashSet<String>();\n\t\t\tHashMap<String, SAMRecord> mateList = new HashMap<String,SAMRecord>();\n\t\t\tHashSet<String> removedList = new HashSet<String>();\n\t\t\tHashMap<String,SAMRecord> editedList = new HashMap<String,SAMRecord>();\n\t\t\t\n\t\t\tfor (SAMRecord sr: sfr) {\n\t\t\t\t//Messaging\n\t\t\t\tif (totalReads % 1000000 == 0 && totalReads != 0) {\n\t\t\t\t\tSystem.out.println(String.format(\"Finished processing %d reads. %d were trimmed, %d were set as unmapped. Currently storing mates for %d reads.\",totalReads,trimmedReads,droppedReads,mateList.size()));\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\ttotalReads += 1;\n\t\t\t\t\n\t\t\t\tString keyToCheck = sr.getReadName() + \":\" + String.valueOf(sr.getIntegerAttribute(\"HI\"));\n\t\t\t\n\t\t\t\t//Make sure chromsome is available\n\t\t\t\tString chrom = sr.getReferenceName();\n\t\t\t\tif (!this.refHash.containsKey(chrom)) {\n\t\t\t\t\tif (!notFound.contains(chrom)) {\n\t\t\t\t\t\tnotFound.add(chrom);\n\t\t\t\t\t\tMisc.printErrAndExit(String.format(\"Chromosome %s not found in reference file, skipping trimming step\", chrom));\n\t\t\t\t\t}\n\t\t\t\t} else if (!sr.getReadUnmappedFlag()) {\n\t\t\t\t\tString refSeq = null;\n\t\t\t\t\tString obsSeq = null;\n\t\t\t\t\tList<CigarElement> cigar = null;\n\t\t\t\t\t\n\t\t\t\t\t//Get necessary sequence information depending on orientation\n\t\t\t\t\tif (sr.getReadNegativeStrandFlag()) {\n\t\t\t\t\t\trefSeq = this.revComp(this.refHash.get(chrom).substring(sr.getAlignmentStart()-1,sr.getAlignmentEnd()));\n\t\t\t\t\t\tobsSeq = this.revComp(sr.getReadString());\n\t\t\t\t\t\tcigar = this.reverseCigar(sr.getCigar().getCigarElements());\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\trefSeq = this.refHash.get(chrom).substring(sr.getAlignmentStart()-1,sr.getAlignmentEnd());\n\t\t\t\t\t\tobsSeq = sr.getReadString();\n\t\t\t\t\t\tcigar = sr.getCigar().getCigarElements();\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//Get alignments\n\t\t\t\t\tString[] alns = this.createAlignmentStrings(cigar, refSeq, obsSeq, totalReads);\n\t\t\t\t\t\n\t\t\t\t\t//Identify Trim Point\n\t\t\t\t\tint idx = this.identifyTrimPoint(alns,sr.getReadNegativeStrandFlag());\n\t\t\t\t\t\n\t\t\t\t\t//Check error rate\n\t\t\t\t\tboolean mmPassed = false;\n\t\t\t\t\tif (mmMode) {\n\t\t\t\t\t\tmmPassed = this.isPoorQuality(alns, sr.getReadNegativeStrandFlag(), idx);\n\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\t//Create new cigar string\n\t\t\t\t\tif (idx < minLength || mmPassed) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tsr.setAlignmentStart(0);\n\t\t\t\t\t\tsr.setReadUnmappedFlag(true);\n\t\t\t\t\t\tsr.setProperPairFlag(false);\n\t\t\t\t\t\tsr.setReferenceIndex(-1);\n\t\t\t\t\t\tsr.setMappingQuality(0);\n\t\t\t\t\t\tsr.setNotPrimaryAlignmentFlag(false);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (sr.getReadPairedFlag() && !sr.getMateUnmappedFlag()) {\n\t\t\t\t\t\t\tif (mateList.containsKey(keyToCheck)) {\n\t\t\t\t\t\t\t\tmateList.put(keyToCheck, this.changeMateUnmapped(mateList.get(keyToCheck)));\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tremovedList.add(keyToCheck);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} \n\t\t\t\t\t\tdroppedReads += 1;\n\t\t\t\t\t\tif (idx < minLength) {\n\t\t\t\t\t\t\tdropTrimReads += 1;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdropMmReads += 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (idx+1 != alns[0].length()) {\n\t\t\t\t\t\ttrimmedReads++;\n\t\t\t\t\t\tCigar oldCig = sr.getCigar();\n\t\t\t\t\t\tCigar newCig = this.createNewCigar(alns, cigar, idx, sr.getReadNegativeStrandFlag());\n\t\t\t\t\t\tsr.setCigar(newCig);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (sr.getReadNegativeStrandFlag()) {\n\t\t\t\t\t\t\tint newStart = this.determineStart(oldCig, newCig, sr.getAlignmentStart());\n\t\t\t\t\t\t\tsr.setAlignmentStart(newStart);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (this.verbose) {\n\t\t\t\t\t\t\tthis.printAlignments(sr, oldCig, alns, idx);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (sr.getReadPairedFlag() && !sr.getMateUnmappedFlag()) {\n\t\t\t\t\t\t\tif (mateList.containsKey(keyToCheck)) {\n\t\t\t\t\t\t\t\tmateList.put(keyToCheck, this.changeMatePos(mateList.get(keyToCheck),sr.getAlignmentStart()));\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\teditedList.put(keyToCheck,sr);\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//System.out.println(sr.getReadName());\n\t\t\t\tif (sr.getReadPairedFlag() && !sr.getMateUnmappedFlag()) {\n\t\t\t\t\t//String rn = sr.getReadName();\n\t\t\t\t\tif (mateList.containsKey(keyToCheck)) {\n\t\t\t\t\t\tif (editedList.containsKey(keyToCheck)) {\n\t\t\t\t\t\t\tsr = this.changeMatePos(sr,editedList.get(keyToCheck).getAlignmentStart());\n\t\t\t\t\t\t\teditedList.remove(keyToCheck);\n\t\t\t\t\t\t} else if (removedList.contains(keyToCheck)) {\n\t\t\t\t\t\t\tsr = this.changeMateUnmapped(sr);\n\t\t\t\t\t\t\tremovedList.remove(keyToCheck);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsfw.addAlignment(sr);\n\t\t\t\t\t\tsfw.addAlignment(mateList.get(keyToCheck));\n\t\t\t\t\t\tmateList.remove(keyToCheck);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmateList.put(keyToCheck, sr);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tsfw.addAlignment(sr);\n\t\t\t\t\tif (mateList.containsKey(keyToCheck)) {\n\t\t\t\t\t\tmateList.remove(keyToCheck);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(String.format(\"Finished processing %d reads. %d were trimmed, %d were set as unmapped. Of the unmapped, %d were too short and %d had too many mismatches. Currently storing mates for %d reads.\",\n\t\t\t\t\ttotalReads,trimmedReads,droppedReads,dropTrimReads, dropMmReads, mateList.size()));\n\t\t\tSystem.out.println(String.format(\"Reads left in hash: %d. Writing to disk.\",mateList.size()));\n\t\t\tfor (SAMRecord sr2: mateList.values()) {\n\t\t\t\tsfw.addAlignment(sr2);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tsfw.close();\n\t\t\ttry {\n\t\t\t\tsfr.close();\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}\t\t\n\t}",
"protected int extraHits(Conveyer info, Combatant striker, Combatant victim) {\n return 0;\n }",
"final void updateMsdtFilterMap() {\r\n\r\n logger.entering(this.getClass().getName(), \"updateMsdtFilterMap\");\r\n\r\n String filterExpression = \"\";\r\n\t\t\r\n\t\tfor (MicroSensorDataType msdt : this.chkMsdtSelection.keySet()) {\r\n JCheckBox chkBox = this.chkMsdtSelection.get(msdt);\r\n\r\n this.msdtFilterMap.remove(msdt);\r\n\r\n if (chkBox.isSelected()) {\r\n\r\n\t\t\t\tthis.msdtFilterMap.put(msdt, Boolean.FALSE);\r\n\t\t\t\t// Compile new filter property string\r\n\t\t\t\tfilterExpression += (filterExpression.length() == 0 ? \"\" : \",\") + msdt.getName();\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\tthis.msdtFilterMap.put(msdt, Boolean.TRUE);\r\n\r\n\t\t\t}\r\n }\r\n\t\t\r\n\t\t// set the new value of the filter property\r\n\t\ttry {\r\n\t\t\tthis.getModuleProperty(BLOCKER_PROPERTY).setValue(filterExpression);\r\n\t\t} catch (ModulePropertyException e) {\r\n\t\t\tlogger.log(Level.WARNING, \"The filter module is supposed to support the property \" + BLOCKER_PROPERTY);\r\n\t\t}\r\n\t\t\t\r\n\r\n logger.exiting(this.getClass().getName(), \"updateMsdtFilterMap\");\r\n }",
"public /*TreeMap<String, Float>*/void getTopnTermsOverlapWithQuery() throws IOException, ParseException{\n\t\tString outputfile = \"./output/score/test3.txt\";\n\n\t\tFileOutputStream out = new FileOutputStream(outputfile);\n\t\tPrintStream ps = new PrintStream(out);\n\t\t/*-------------------------------------------------------------------------------*/\n\n\t\tTreeMap<String,Float> termsscoressorted = null;\n\t\tCollectionReader reader = new CollectionReader(indexDir); \n\t\tIndexReader ir = reader.getIndexReader();\t\t\n\n\t\tTopicsInMemory topics = new TopicsInMemory(\"data/CLEF-IP-2010/PAC_test/topics/PAC_topics-test2.xml\"/*omit-PAC-1094.xml\"*/);\n\t\tfor(Map.Entry<String, PatentDocument> topic : topics.getTopics().entrySet()){\n\t\t\tString qUcid = topic.getValue().getUcid();\n\t\t\tString queryid = topic.getKey();\n\t\t\tString queryName = topic.getKey() + \"_\" + topic.getValue().getUcid();\n\t\t\tString queryfile = topic.getKey() + \"_\" + topic.getValue().getUcid() + \".xml\";\n\n\t\t\t/*System.out.println(\"=========================================\");\n\t\t\tSystem.out.println(queryName);\n\t\t\tSystem.out.println(\"=========================================\");*/\n\t\t\t/*int docid = reader.getDocId(\"UN-EP-0663270\", PatentDocument.FileName);\n\t\t\tir.getTermVector(docid, field) getTermVectors(b);*/\n\n\t\t\tEvaluateResults er = new EvaluateResults();\n\t\t\tArrayList<String> tps = er.evaluatePatents(queryid, \"TP\");\n\t\t\tArrayList<String> fps = er.evaluatePatents(queryid, \"FP\");\n\t\t\tHashMap<String, Float> /*TFreqs*/ termsscores = new HashMap<>();\n\n\n\t\t\t/*--------------------------------- Query Words -------------------------------*/\n\t\t\t//\t\t\tHashMap<String, Integer> query_termsfreqspair = reader.gettermfreqpair(qUcid, PatentDocument.Description);\n\t\t\tHashSet<String> query_terms = reader.getDocTerms(qUcid, PatentDocument.Description);\n\t\t\t//\t\t\tSystem.out.println(query_termsfreqspair.size() +\"\\t\"+ query_termsfreqspair);\n//\t\t\tSystem.out.println(query_terms.size() + \"\\t\" + query_terms);\n\t\t\t/*-----------------------------------------------------------------------------*/\t\t\t\n\n\n\t\t\t//\t\t\tSystem.out.println(\"-----TPs----\");\n\t\t\tfor (String tp : tps) {\n\t\t\t\t/*System.out.println(\"---------\");\n\t\t\t\tSystem.out.println(tp);*/\n\t\t\t\tHashMap<String, Integer> termsfreqsTP = reader.gettermfreqpairAllsecs(\"UN-\" + tp);\n\n\t\t\t\tfor(Entry<String, Integer> tfTP:termsfreqsTP.entrySet()){\n\t\t\t\t\tif(termsscores.containsKey(tfTP.getKey())){\n\t\t\t\t\t\ttermsscores.put(tfTP.getKey(), termsscores.get(tfTP.getKey()) + (float)tfTP.getValue()/tps.size());\n\t\t\t\t\t}else{\n\t\t\t\t\t\t//\t\t\t\t\t\tfloat test = (float)t.getValue()/tps.size();\n\t\t\t\t\t\t//\t\t\t\t\t\tSystem.out.println(test);\n\t\t\t\t\t\ttermsscores.put(tfTP.getKey(), (float)tfTP.getValue()/tps.size());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//\t\t\t\tSystem.out.println(termsscores.size() + \" \" + termsscores);\t\t\t\t\t\n\t\t\t}\n\n\t\t\t/*System.out.println();\n\t\t\tSystem.out.println(\"-----FNs----\");*/\n\t\t\tfor (String fp : fps) {\n\t\t\t\t/*System.out.println(\"---------\");\n\t\t\t\tSystem.out.println(fp);*/\n\t\t\t\tHashMap<String, Integer> termsfreqsFP = reader.gettermfreqpairAllsecs(\"UN-\" + fp);\n\n\t\t\t\tfor(Entry<String, Integer> t:termsfreqsFP.entrySet()){\n\t\t\t\t\tif(termsscores.containsKey(t.getKey())){\n\t\t\t\t\t\ttermsscores.put(t.getKey(), termsscores.get(t.getKey()) - (float)t.getValue()/fps.size());\n\t\t\t\t\t}else{\t\t\t\t\t\t\n\t\t\t\t\t\ttermsscores.put(t.getKey(), -(float)t.getValue()/fps.size());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//\t\t\t\tSystem.out.println(TFreqs.size() + \" \" + TFreqs);\n\t\t\t}\n\t\t\t//\t\t\tSystem.out.println(termsscores.size() + \" \" + termsscores);\n\t\t\tValueComparator bvc = new ValueComparator(termsscores);\n\t\t\ttermsscoressorted = new TreeMap<String,Float>(bvc);\t\t\t\n\t\t\ttermsscoressorted.putAll(termsscores);\n\t\t\tSystem.out.println(queryid + \"\\t\"+ termsscoressorted.size() + \"\\t\" + termsscoressorted/*.keySet()*/);\n\t\t\tint overlap = 0;\n\t\t\tint i = 0;\n\t\t\tfor(Entry<String, Float> scoresorted:termsscoressorted.entrySet()){\n\t\t\t\ti++;\n\t\t\t\tif(i<=100){\n\t\t\t\t\tif(query_terms.contains(scoresorted.getKey())){\n\t\t\t\t\t\toverlap++;\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\t\n\t\t\tSystem.out.println(queryName + \"\\t\"+overlap);\n//\t\t\tps.println(queryName + \"\\t\"+overlap);\n\t\t}\n\t}",
"private double rayMarch(Vec3 ro, Vec3 rd){\n double dO = 0.0;\n for (int i = 0;i< MAX_STEPS;i++){\n Vec3 p = Vec3.add(ro,Vec3.multiply(rd,dO));\n double ds = getDist(p);\n dO += ds;\n if(dO > MAX_DIST || ds < SURF_DIST){\n break;\n }\n }\n return dO;\n }",
"public Hit hit (final Ray r) {\n\n final double a;\n final double b;\n final double cNor;\n final double t1;\n final double t2;\n final double d;\n final Point3 p;\n\n b = r.d.dot((r.o.sub(c)).mul(2));\n a = r.d.dot(r.d);\n cNor = r.o.sub(c).dot(r.o.sub(c))-(this.r*this.r);\n d = (b * b) - (4 * a * cNor);\n\n if(d > 0) {\n\n t1 = (-b + Math.sqrt(d)) / (2 * a);\n t2 = (-b - Math.sqrt(d)) / (2 * a);\n\n if (t1 >= 0 & t2 >= 0) {\n\n p = r.at(Math.min(t1, t2));\n\n return new Hit(Math.min(t1, t2), r, this,p.sub(c).normalized().asNormal(),texFor(p) );\n\n }else if (t1 >= 0){\n\n return new Hit(t1,r,this, r.at(t1).sub(c).normalized().asNormal(),texFor(r.at(t1)));\n\n }else if(t2 >= 0) {\n\n return new Hit(t2, r, this, r.at(t2).sub(c).normalized().asNormal(),texFor(r.at(t2)));\n }\n }else if (d == 0){\n\n final double t3;\n t3 = -b / (2 * a);\n\n if (t3 >= 0){\n\n return new Hit(t3, r, this, r.at(t3).sub(c).normalized().asNormal(), texFor(r.at(t3)));\n\n }\n }\n\n return null;\n }",
"private static native void guidedFilter_0(long guide_nativeObj, long src_nativeObj, long dst_nativeObj, int radius, double eps, int dDepth);",
"public void obtainFinalRecs(){\n\n //Step 1 - obtain all scores and put in a data structure\n //Step 1a - get movie ID from commonRec\n //Step 1b - initialise data structure\n //Step 1c - search originalList for movie ID and get score\n //Step 1d - search ... recMap for movie ID and get scores?\n //pull each list out and search that\n //put each score into a list\n\n for (ScoredId aCommonRec : commonRec) {\n Long mID = aCommonRec.getId();\n Double score1 = aCommonRec.getScore();\n\n ArrayList<Double> scores = new ArrayList<>();\n scores.add(score1);\n\n for (Map.Entry<Long, List<ScoredId>> entry : recMap.entrySet()) {\n\n List<ScoredId> tempList = entry.getValue();\n\n for (ScoredId aTempList : tempList) {\n\n if (aTempList.getId() == mID) {\n Double tempscore = aTempList.getScore();\n scores.add(tempscore);\n }\n }\n\n }\n\n\n //Step 2 - average all scores\n\n Double averageScore;\n Double total = 0.0;\n\n for (Double score : scores) {\n total += score;\n }\n\n\n averageScore = total / scores.size();\n\n //Step 3 - put into finalRecs - Long = movie ID, Double = average predicted score\n\n finalRecs.put(mID, averageScore);\n }\n\n }",
"public Boolean isSearchengineMainScore() {\n return false;\n }",
"private static native void dtFilter_0(long guide_nativeObj, long src_nativeObj, long dst_nativeObj, double sigmaSpatial, double sigmaColor, int mode, int numIters);",
"private void setMatchingSegmentReaders() {\n int numReaders = mergeState.readers.size();\n mergeState.matchingSegmentReaders = new SegmentReader[numReaders];\n\n // If this reader is a SegmentReader, and all of its\n // field name -> number mappings match the \"merged\"\n // FieldInfos, then we can do a bulk copy of the\n // stored fields:\n for (int i = 0; i < numReaders; i++) {\n AtomicReader reader = mergeState.readers.get(i);\n // TODO: we may be able to broaden this to\n // non-SegmentReaders, since FieldInfos is now\n // required? But... this'd also require exposing\n // bulk-copy (TVs and stored fields) API in foreign\n // readers..\n if (reader instanceof SegmentReader) {\n SegmentReader segmentReader = (SegmentReader) reader;\n boolean same = true;\n FieldInfos segmentFieldInfos = segmentReader.getFieldInfos();\n for (FieldInfo fi : segmentFieldInfos) {\n FieldInfo other = mergeState.fieldInfos.fieldInfo(fi.number);\n if (other == null || !other.name.equals(fi.name)) {\n same = false;\n break;\n }\n }\n if (same) {\n mergeState.matchingSegmentReaders[i] = segmentReader;\n mergeState.matchedCount++;\n }\n }\n }\n\n if (mergeState.infoStream.isEnabled(\"SM\")) {\n mergeState.infoStream.message(\"SM\", \"merge store matchedCount=\" + mergeState.matchedCount + \" vs \" + mergeState.readers.size());\n if (mergeState.matchedCount != mergeState.readers.size()) {\n mergeState.infoStream.message(\"SM\", \"\" + (mergeState.readers.size() - mergeState.matchedCount) + \" non-bulk merges\");\n }\n }\n }",
"private HashSet<Position> getInRange(int p_r, Distance p_d)\n {\n HashSet<Position> s = new HashSet<Position>();\n\n for (int x = 0; x <= p_r; x++)\n {\n int y = 0;\n Position p = new Position(this.x + x, this.y + y);\n\n while (p_d.inside(this, p, p_r))\n {\n s.add(p);\n s.add(new Position(this.x - x, this.y + y));\n s.add(new Position(this.x + x, this.y - y));\n s.add(new Position(this.x - x, this.y - y));\n p = new Position(this.x + x, this.y + ++y);\n }\n }\n return s;\n }",
"protected boolean isMatch(final SAMRecord unaligned, final SAMRecord aligned) {\n return (aligned != null &&\n aligned.getReadName().equals(unaligned.getReadName()) &&\n (unaligned.getReadPairedFlag() == false ||\n aligned.getFirstOfPairFlag() == unaligned.getFirstOfPairFlag()));\n }",
"public boolean hasRelevantRegions() {\n return fieldSetFlags()[6];\n }",
"abstract protected void passHitQueryContextToClauses(HitQueryContext context);",
"private void applyFilters() {\r\n\t\t// create the new filters\r\n\t\tViewerFilter[] filters = new ViewerFilter[] { new TransportStateViewFilter(IProgramStatus.PROGRAM_STATUS_PREBOOKING),\r\n\t\t\t\tnew TransportDirectnessFilter(IDirectness.TOWARDS_BRUCK), transportDateFilter, transportViewFilter };\r\n\t\t// set up the filters for the view\r\n\t\tviewerBruck.setFilters(filters);\r\n\t\tviewerGraz.setFilters(filters);\r\n\t\tviewerWien.setFilters(filters);\r\n\t\tviewerMariazell.setFilters(filters);\r\n\t\tviewerKapfenberg.setFilters(filters);\r\n\t\tviewerLeoben.setFilters(filters);\r\n\t}",
"boolean doFilter() { return false; }",
"public static void main(String args[]) throws Exception {\n\n String sourceFile = args[0]; //source file has supervised SRL tags\n String targetFile = args[1]; //target file has supervised SRL tags\n String alignmentFile = args[2];\n String sourceClusterFilePath = args[3];\n String targetClusterFilePath = args[4];\n String projectionFilters = args[5];\n double sparsityThresholdStart = Double.parseDouble(args[6]);\n double sparsityThresholdEnd = Double.parseDouble(args[6]);\n\n\n Alignment alignment = new Alignment(alignmentFile);\n HashMap<Integer, HashMap<Integer, Integer>> alignmentDic = alignment.getSourceTargetAlignmentDic();\n\n final IndexMap sourceIndexMap = new IndexMap(sourceFile, sourceClusterFilePath);\n final IndexMap targetIndexMap = new IndexMap(targetFile, targetClusterFilePath);\n ArrayList<String> sourceSents = IO.readCoNLLFile(sourceFile);\n ArrayList<String> targetSents = IO.readCoNLLFile(targetFile);\n\n System.out.println(\"Projection started...\");\n DependencyLabelsAnalyser dla = new DependencyLabelsAnalyser();\n for (int senId = 0; senId < sourceSents.size(); senId++) {\n if (senId % 100000 == 0)\n System.out.print(senId);\n else if (senId % 10000 == 0)\n System.out.print(\".\");\n\n Sentence sourceSen = new Sentence(sourceSents.get(senId), sourceIndexMap);\n Sentence targetSen = new Sentence(targetSents.get(senId), targetIndexMap);\n int maxNumOfProjectedLabels = dla.getNumOfProjectedLabels(sourceSen, alignmentDic.get(senId));\n double trainGainPerWord = (double) maxNumOfProjectedLabels/targetSen.getLength();\n\n if (trainGainPerWord >= sparsityThresholdStart && trainGainPerWord< sparsityThresholdEnd) {\n dla.analysSourceTargetDependencyMatch(sourceSen, targetSen, alignmentDic.get(senId),\n sourceIndexMap, targetIndexMap, projectionFilters);\n }\n }\n System.out.print(sourceSents.size() + \"\\n\");\n dla.writeConfusionMatrix(\"confusion_\"+sparsityThresholdStart+\"_\"+sparsityThresholdEnd+\".out\", sourceIndexMap, targetIndexMap);\n }",
"@Override\n protected FilterResults performFiltering(CharSequence arg0) {\n String[] tmp = API.it().getKeywords(arg0.toString());\n FilterResults results = new FilterResults();\n results.values = tmp;\n results.count = tmp.length;\n return results;\n }",
"private void printingSearchResults() {\n HashMap<Integer, Double> resultsMap = new HashMap<>();\n for (DocCollector collector : resultsCollector) {\n if (resultsMap.containsKey(collector.getDocId())) {\n double score = resultsMap.get(collector.getDocId()) + collector.getTermScore();\n resultsMap.put(collector.getDocId(), score);\n } else {\n resultsMap.put(collector.getDocId(), collector.getTermScore());\n }\n }\n List<Map.Entry<Integer, Double>> list = new LinkedList<>(resultsMap.entrySet());\n Collections.sort(list, new Comparator<Map.Entry<Integer, Double>>() {\n public int compare(Map.Entry<Integer, Double> o1,\n Map.Entry<Integer, Double> o2) {\n return (o2.getValue()).compareTo(o1.getValue());\n }\n });\n if (list.isEmpty())\n System.out.println(\"no match\");\n else {\n DecimalFormat df = new DecimalFormat(\".##\");\n for (Map.Entry<Integer, Double> each : list)\n System.out.println(\"docId: \" + each.getKey() + \" score: \" + df.format(each.getValue()));\n }\n\n }",
"@Test\n public void testCase4 () throws IOException {\n //\t\tlog.trace(\"Testcase4\");\n\n ki = new KrillIndex();\n ki.addDoc(createFieldDoc0());\n ki.commit();\n ki.addDoc(createFieldDoc1());\n ki.addDoc(createFieldDoc2());\n ki.commit();\n\n sq = new SpanSegmentQuery(new SpanElementQuery(\"base\", \"e\"),\n new SpanNextQuery(new SpanTermQuery(new Term(\"base\", \"s:a\")),\n new SpanTermQuery(new Term(\"base\", \"s:b\"))));\n\n kr = ki.search(sq, (short) 10);\n ki.close();\n\n assertEquals(\"totalResults\", kr.getTotalResults(), 2);\n // Match #0\n assertEquals(\"doc-number\", 0, kr.getMatch(0).getLocalDocID());\n assertEquals(\"StartPos\", 3, kr.getMatch(0).startPos);\n assertEquals(\"EndPos\", 5, kr.getMatch(0).endPos);\n // Match #1\n assertEquals(\"doc-number\", 0, kr.getMatch(1).getLocalDocID());\n assertEquals(\"StartPos\", 1, kr.getMatch(1).startPos);\n assertEquals(\"EndPos\", 3, kr.getMatch(1).endPos);\n }",
"public Map<StrandedRegion,double[][]> strandedRegionSampleCounts(ControlledExperiment rep){\n\t\tif (fivePrimeShift > 0){edge=40;}\t\n\t\t\n\t\tList<StrandedRegion> regionList = new ArrayList<StrandedRegion>();\n\t\tfor(Point p: strandedPoints){\t\t\n\t\t\tint start = Math.max(1, p.getLocation() - (windowSize+edge)/2 );\n\t\t\tint end = Math.min(p.getLocation() + (windowSize+edge)/2, p.getGenome().getChromLength(p.getChrom()));\t\t\t\t\n\t\t\tStrandedRegion strandedReg = new StrandedRegion(p.getGenome(), p.getChrom(), start, end, p.getStrand());\t\t\t\t\t\n\t\t\tregionList.add(strandedReg);\n\t\t}\n\t\tsetStrandedRegions(regionList);\n\t\t\t\t\t\n\t\tMap<StrandedRegion,List<StrandedBaseCount>> sampleCountsMap = new HashMap<StrandedRegion,List<StrandedBaseCount>>();\n\t\tMap<StrandedRegion,List<StrandedBaseCount>> controlCountsMap = new HashMap<StrandedRegion,List<StrandedBaseCount>>();\t\n\t\tfor (StrandedRegion reg : strandedRegions){\n\t\t\tsampleCountsMap.put(reg, rep.getSignal().getBases(reg));\n\t\t\tif (rep.hasControl()){\n\t\t\t\tcontrolCountsMap.put(reg, rep.getControl().getBases(reg));\n\t\t\t}\n\t\t}\n\t\t\n\t\t//StrandedBasedCount object contains positive and negative strand separately\n\t\t// Reverse the array depending of strand of features\t\t\t\n\t\tMap<StrandedRegion,double[][]> sampleRegionCounts = new HashMap<StrandedRegion,double[][]>();\t\t\t\n\t\tfor (StrandedRegion reg : sampleCountsMap.keySet()){\t\t\t\n\t\t\tdouble[][] sampleCounts = new double[windowSize+edge+1][2];\n\t\t\tdouble[][] controlCounts = new double[windowSize+edge+1][2];\n\t\t\tfor (int i = 0;i <= windowSize+edge;i++){\n\t\t\t\tfor (int s = 0; s<2; s++){\n\t\t\t\t\tsampleCounts[i][s] = 0;\n\t\t\t\t\tcontrolCounts[i][s] = 0;\n\t\t\t\t}\n\t\t\t}\t\n\t\t\tif (reg.getStrand() == '+'){ // regions(features) are positive strand\t\t\t\t\t\n\t\t\t\tfor (StrandedBaseCount hits: sampleCountsMap.get(reg)){\t\n\t\t\t\t\tif (hits.getStrand()=='+'){\n\t\t\t\t\t\tsampleCounts[hits.getCoordinate()-reg.getMidpoint().getLocation()+(windowSize+edge)/2][0] = hits.getCount();\n\t\t\t\t\t}else{\n\t\t\t\t\t\tsampleCounts[hits.getCoordinate()-reg.getMidpoint().getLocation()+(windowSize+edge)/2][1] = hits.getCount();\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}else{ // if regions (features) are reverse strand, I need to flip the strands and locations\n\t\t\t\tfor (StrandedBaseCount hits: sampleCountsMap.get(reg)){\t\n\t\t\t\t\tif (hits.getStrand()=='+'){\n\t\t\t\t\t\tsampleCounts[reg.getMidpoint().getLocation()-hits.getCoordinate()+(windowSize+edge)/2][1] = hits.getCount();\n\t\t\t\t\t}else{\n\t\t\t\t\t\tsampleCounts[reg.getMidpoint().getLocation()-hits.getCoordinate()+(windowSize+edge)/2][0] = hits.getCount();\t\n\t\t\t\t\t}\t\t\t\n\t\t\t\t}\t\n\t\t\t}\n\t\t\t\t\n\t\t\t// only execute if controls are loaded\n\t\t\tif (rep.hasControl()){\n\t\t\t\tif (reg.getStrand() == '+'){ \t\t\t\t\n\t\t\t\t\tfor (StrandedBaseCount hits: controlCountsMap.get(reg)){\t\n\t\t\t\t\t\tif (hits.getStrand()=='+'){\n\t\t\t\t\t\t\tcontrolCounts[hits.getCoordinate()-reg.getMidpoint().getLocation()+(windowSize+edge)/2][0] = hits.getCount();\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tcontrolCounts[hits.getCoordinate()-reg.getMidpoint().getLocation()+(windowSize+edge)/2][1] = hits.getCount();\n\t\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\t}\t\n\t\t\t\t}else{\n\t\t\t\t\tfor (StrandedBaseCount hits: controlCountsMap.get(reg)){\t\n\t\t\t\t\t\tif (hits.getStrand()=='+'){\n\t\t\t\t\t\t\tcontrolCounts[reg.getMidpoint().getLocation()-hits.getCoordinate()+(windowSize+edge)/2][1] = hits.getCount();\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tcontrolCounts[reg.getMidpoint().getLocation()-hits.getCoordinate()+(windowSize+edge)/2][0] = hits.getCount();\t\n\t\t\t\t\t\t}\t\t\t\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t} // end of control\t\t\t\t\n\t\t\tsampleRegionCounts.put(reg, sampleCounts);\n\t\t\tcontrolRegionCounts.put(reg, controlCounts);\n\t\t}\n\t\treturn sampleRegionCounts;\n\t}",
"private boolean setUpForRunScore()\n\t{\n\t\tint maxMarkersLine=0;\n\t\tint maxMarkers=-1;\n\t\tString maxMarkersString=\"\";\n\t\tchar marker='=';\n\t\tint j=0;\n\t\t\t\t\n\t\t// loop through all lines\n\t\tfor (String s:text)\n\t\t{\n\t\t\t\n\t\t\tint counter = 0;\n\t\t\t\n\t\t\t// count the number of markers\n\t\t\tfor( int i=0; i<s.length(); i++ ) \n\t\t\t{\n\t\t\t if( s.charAt(i) == marker ) \n\t\t\t {\n\t\t\t counter++;\n\t\t\t } \n\t\t\t}\n\t\t\t\t\t\n\t\t\tSystem.out.println(counter);\n\t\t\t\t\t\n\t\t\tif (counter>maxMarkers)\n\t\t\t{\n\t\t\t\tmaxMarkers=counter;\n\t\t\t\tmaxMarkersLine=j;\n\t\t\t\tmaxMarkersString=s;\n\t\t\t}\n\t\t\t\n\t\t\tj++;\n\t\t}\n\t\t\n\t\tif (maxMarkers>15)\n\t\t{\n\t\t\t// make sure the maxMarkersString can be split\n\t\t\tString[] split=maxMarkersString.split(\"\\\\s+\");\n\t\t\t\n\t\t\tif (split.length==1)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\t\n\t\t\t// the header names will be just above the \"maxMarkersLine\"\n\t\t\tString headerLine=text.get(maxMarkersLine-1);\n\t\t\t\n\t\t\tresultParser=new RunScoreResultParser();\n\t\t\tRunScoreResultParser rsParser=(RunScoreResultParser)(this.resultParser);\n\t\t\t\n\t\t\trsParser.parseHeader(maxMarkersString, headerLine);\n\t\t\t\n\t\t\toverallExtractor=new RunScoreOverallExtractor(maxMarkersLine);\n\t\t \n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}",
"void find_it () {\n xt = 210; yt = 105; fact = 50.0;\n if (viewflg != VIEW_FORCES) zoom_slider_pos_y = 50;\n current_part.spanfac = (int)(2.0*fact*current_part.aspect_rat*.3535);\n xt1 = xt + current_part.spanfac;\n yt1 = yt - current_part.spanfac;\n xt2 = xt - current_part.spanfac;\n yt2 = yt + current_part.spanfac;\n \n }",
"public static void processFilterComparison(Tensor control, int index, int radius, SmoothingKernel smoothingKernel) {\n TensorUnaryOperator geodesicLeftSeeded = GeodesicCenter.of(Se2Geodesic.INSTANCE, smoothingKernel);\n Tensor groupSmoothedGCL = CenterFilter.of(geodesicLeftSeeded, radius).apply(control);\n // ==================== GeodesicCenter(MidSeeded) ====================\n TensorUnaryOperator geodesicMidSeeded = GeodesicCenterMidSeeded.of(Se2Geodesic.INSTANCE, smoothingKernel);\n Tensor groupSmoothedGCM = CenterFilter.of(geodesicMidSeeded, radius).apply(control);\n // ==================== TangentSpaceFiltering ====================\n // TensorUnaryOperator geodesicCenterTangentSpace = GeodesicCenterTangentSpace.of( //\n // Se2CoveringGroup.INSTANCE, Se2CoveringExponential.INSTANCE, smoothingKernel);\n // Tensor groupSmoothedGCTS = GeodesicCenterFilter.of(geodesicCenterTangentSpace, radius).apply(control);\n // // ==================== BiinvariantMeanFilter =================\n // TensorUnaryOperator geodesicBiinvariantMean = Se2BiinvariantMeanCenter.of(smoothingKernel);\n // Tensor groupSmoothedGBM = Se2BiinvariantMeanFilter.of(geodesicBiinvariantMean, radius).apply(control);\n try {\n export(groupSmoothedGCL, \"GCLeftSeeded\", index, radius, smoothingKernel);\n export(groupSmoothedGCM, \"GCMidSeeded\", index, radius, smoothingKernel);\n // export(groupSmoothedGCTS, \"TangentSpace\", index, radius, smoothingKernel);\n // export(groupSmoothedGBM, \"Biinvariant\", index, radius, smoothingKernel);\n // export(control, \"GroupRaw\", index, radius, smoothingKernel);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public void setHitQueryContext(HitQueryContext context) {\n int before = context.getCaptureRegisterNumber();\n passHitQueryContextToClauses(context);\n if (context.getCaptureRegisterNumber() == before) {\n // Our clauses don't capture any groups; optimize\n childClausesCaptureGroups = false;\n }\n }",
"public /* synthetic */ boolean m76077a(MatchResult awVar) {\n GrowthGobalFilterInterface growthGobalFilterInterface;\n GrowthGobalFilterInterface growthGobalFilterInterface2;\n if (awVar == null) {\n return true;\n }\n if (awVar.f104113b != null && (TextUtils.equals(awVar.f104113b.getString(C6969H.m41409d(\"G6C9BC108BE0FAC26E40F9C77F4ECCFC36C91EA13B83EA43BE3\")), C6969H.m41409d(\"G7D91C01F\")) || awVar.f104113b.getBoolean(C6969H.m41409d(\"G6C9BC108BE0FAC26E40F9C77F4ECCFC36C91EA13B83EA43BE3\")))) {\n return true;\n }\n if (NewUserLaunchManager.f44705a.mo67994a()) {\n String d = C6969H.m41409d(\"G6786C225AA23AE3BD902915DFCE6CB\");\n Log.d(d, \"addFilter 不拦截,是场景还原逻辑 url = \" + awVar.f104112a);\n return true;\n }\n if (ZHActivity.getActivityStack() != null && ZHActivity.getActivityStack().size() > 0) {\n Iterator<ZHActivity> it = ZHActivity.getActivityStack().iterator();\n while (it.hasNext()) {\n if (TextUtils.equals(AppBuildConfig.MAIN_ACTIVITY_NAME(), it.next().getClass().getName())) {\n return true;\n }\n }\n }\n if (awVar.f104112a.startsWith(C6969H.m41409d(\"G738BDC12AA6AE466EA0F8546F1EDFCD66D\")) && (growthGobalFilterInterface2 = (GrowthGobalFilterInterface) InstanceProvider.m107964b(GrowthGobalFilterInterface.class)) != null) {\n return !growthGobalFilterInterface2.isFilterIntercept();\n }\n if (!m76078a(awVar.f104112a) && !awVar.f104112a.startsWith(C6969H.m41409d(\"G738BDC12AA6AE466EA0F8546F1EDC6C5\")) && (growthGobalFilterInterface = (GrowthGobalFilterInterface) InstanceProvider.m107964b(GrowthGobalFilterInterface.class)) != null) {\n return !growthGobalFilterInterface.isFilterInterceptAndCallback(awVar.f104112a);\n }\n return true;\n }",
"private final void clearTRFilter() {\r\n\t\tadvanceFilterTRModel.setObjIdFilter(\"\");\r\n\t\tadvanceFilterTRModel.setAirplaneModelFilter(\"\");\r\n\t\tadvanceFilterTRModel.setObjTypeFilter(\"\");\r\n\t\tadvanceFilterTRModel.setObjNoFilter(\"\");\r\n\t\tadvanceFilterTRModel.setObjHeadingFilter(\"\");\r\n\t\tadvanceFilterTRModel.setObjTextFilter(\"\");\r\n\t\tadvanceFilterTRModel.setAssumptionFilter(\"\");\r\n\t\tadvanceFilterTRModel.setOwnerFilter(\"\");\r\n\t\tadvanceFilterTRModel.setDeviationsFilter(\"\");\r\n\t\tadvanceFilterTRModel.setModifiedAplicableFilter(\"\");\r\n\t\tadvanceFilterTRModel.setExpReqMtPhaseFilter(\"\");\r\n\t\tadvanceFilterTRModel.setAssgndToAssyPhaseFilter(\"\");\r\n\t\tadvanceFilterTRModel.setAssgndToFTPhaseFilter(\"\");\r\n\t\tadvanceFilterTRModel.setFocalFilter(\"\");\r\n\t\tadvanceFilterTRModel.setStsAssmblyPhaseFilter(\"\");\r\n\t\tadvanceFilterTRModel.setReqFirstFlightFilter(\"\");\r\n\t\tadvanceFilterTRModel.setRationaleForFunctionFilter(\"\");\r\n\t\tadvanceFilterTRModel.setFuncExcepFilter(\"\");\r\n\t\tadvanceFilterTRModel.setFunctionFilter(\"\");\r\n\t\tadvanceFilterTRModel.setApplicableDAASystemsFilter(\"\");\r\n\t\tadvanceFilterTRModel.setDevAssurApplicableFilter(\"\");\r\n\t\tadvanceFilterTRModel.setAllocationsFilter(\"\");\r\n\t\tadvanceFilterTRModel.setTraceReqmtsIDFilter(\"\");\r\n\t\tadvanceFilterTRModel.setDervdReqmtsFilter(\"\");\r\n\t\tadvanceFilterTRModel.setScdChildFilter(\"\");\r\n\t\tadvanceFilterTRModel.setRationaleforDerivedreqmtsFilter(\"\");\r\n\t\tadvanceFilterTRModel.setReqmt8reqdFilter(\"\");\r\n\t\tadvanceFilterTRModel.setReqmt8verfCloseOutFilter(\"\");\r\n\t\tadvanceFilterTRModel.setReqmt9reqdFilter(\"\");\r\n\t\tadvanceFilterTRModel.setReqmt9verfCloseOutFilter(\"\");\r\n\t\tadvanceFilterTRModel.setReqmt7reqdFilter(\"\");\r\n\t\tadvanceFilterTRModel.setReqmt7verfCloseOutFilter(\"\");\r\n\t\tadvanceFilterTRModel.setEstWorkFilter(\"\");\r\n\t\tadvanceFilterTRModel.setStatusWithSEFilter(\"\");\r\n\t\tadvanceFilterTRModel.setLinkStatusTRFilter(\"\");\r\n\t\tadvanceFilterTRModel.setMinorModFilter(\"\");\r\n\t\twsrdUtilController.pageSize((long) 0);\r\n\t\twsrdUtilController.getPageNumberByList();\r\n\t}",
"private G readSearchHit(T scanResult,\n List<MsResidueModificationIn> searchDynaResidueMods) \n throws XMLStreamException, DataProviderException {\n\n\n G hit = initNewPeptideProphetResult();\n \n int numMatchingProteins = 0;\n \n String peptideSeq = null;\n char preResidue = 0;\n char postResidue = 0;\n String prAcc = null;\n String prDescr = null;\n\n \n int numEnzymaticTermini = 0;\n\n R searchResult = initNewSearchResult();\n searchResult.setScanNumber(scanResult.getScanNumber());\n searchResult.setCharge(scanResult.getCharge());\n searchResult.setObservedMass(scanResult.getObservedMass());\n\n // read the attributes\n for (int i = 0; i < reader.getAttributeCount(); i++) {\n\n String attrib = reader.getAttributeLocalName(i);\n String val = reader.getAttributeValue(i);\n if (attrib.equalsIgnoreCase(\"peptide\"))\n peptideSeq = val;\n else if (attrib.equalsIgnoreCase(\"peptide_prev_aa\"))\n preResidue = Character.valueOf(val.charAt(0));\n else if (attrib.equalsIgnoreCase(\"peptide_next_aa\"))\n postResidue = Character.valueOf(val.charAt(0));\n else if (attrib.equalsIgnoreCase(\"protein\"))\n prAcc = val;\n else if (attrib.equalsIgnoreCase(\"protein_descr\"))\n prDescr = val;\n else if (attrib.equalsIgnoreCase(\"num_tot_proteins\"))\n numMatchingProteins = Integer.parseInt(val);\n else if(attrib.equalsIgnoreCase(\"num_tol_term\")) \n numEnzymaticTermini = Integer.parseInt(val);\n }\n \n readProgramSpecificResult(searchResult); // read in Sequest or Mascot specific scores\n \n DbLocus locus1 = new DbLocus(prAcc, prDescr);\n locus1.setNtermResidue(preResidue);\n locus1.setCtermResidue(postResidue);\n locus1.setNumEnzymaticTermini(numEnzymaticTermini);\n searchResult.addMatchingProteinMatch(locus1);\n \n \n List<Modification> resultModifications = new ArrayList<Modification>();\n \n // read other interesting nested elements\n while(reader.hasNext()) {\n int evtType = reader.next();\n if (evtType == XMLStreamReader.END_ELEMENT && reader.getLocalName().equalsIgnoreCase(\"search_hit\"))\n break;\n\n if (evtType == XMLStreamReader.START_ELEMENT) {\n\n // read the modification information\n if(reader.getLocalName().equalsIgnoreCase(\"modification_info\")) {\n resultModifications = readModifications(peptideSeq, reader);\n }\n\n // read the <alternative_protein> elements\n else if (reader.getLocalName().equalsIgnoreCase(\"alternative_protein\")) {\n DbLocus locus = readAlternativeProtein();\n searchResult.addMatchingProteinMatch(locus);\n }\n // read the <search_score> elements\n else if (reader.getLocalName().equalsIgnoreCase(\"search_score\")) {\n String scoreType = reader.getAttributeValue(null, \"name\");\n String scoreVal = reader.getAttributeValue(null, \"value\");\n readProgramSpecificScore(searchResult, scoreType, scoreVal);\n }\n // read the <analysis_result> elemets\n else if (reader.getLocalName().equalsIgnoreCase(\"analysis_result\")) {\n String analysisProgram = reader.getAttributeValue(null, \"analysis\");\n if(analysisProgram.equalsIgnoreCase(\"peptideprophet\")) {\n PeptideProphetResultDataIn ppRes = readPeptideProphetHitAnalysis(reader);\n hit.setPeptideProphetResult(ppRes);\n }\n }\n }\n\n } // end of parsing\n\n // set the result peptide\n MsSearchResultPeptide resultPeptide = peptideResultBuilder.buildResultPeptide(\n peptideSeq, preResidue, postResidue, resultModifications);\n searchResult.setResultPeptide(resultPeptide);\n \n\n if (numMatchingProteins != searchResult.getProteinMatchList().size()) {\n// log.warn(\"value of attribute num_tot_proteins(\"+numMatchingProteins+\n// \") does not match number of proteins(\"+searchResult.getProteinMatchList().size()+\") found for this hit. \"\n// +\"Scan# \"+scanResult.getScanNumber()+\"; sequence: \"+peptideSeq);\n// throw new DataProviderException(\"value of attribute num_tot_proteins(\"+numMatchingProteins+\n// \") does not match number of proteins(\"+seqRes.getProteinMatchList().size()+\") found for this hit. \"\n// +\"Scan# \"+scan.getScanNumber()+\"; hit rank: \"+seqRes.getSequestResultData().getxCorrRank());\n\n }\n\n hit.setSearchResult(searchResult);\n return hit;\n }",
"boolean isSetDSTSavings();",
"boolean hasDynamicSearchAdsSearchTermView();",
"public KeyProbability(double segmentTime) { \n filters.add(new SingleKeyProbabilityFilter(true, \"ionian\", \t\t\t\tnew double[] { 0.2, 0.0, 0.12, 0.0, 0.16, 0.12, 0.0, 0.16, 0.0, 0.12, 0.0, 0.12 } ));\n filters.add(new SingleKeyProbabilityFilter(true, \"lydian\",\t\t\t\tnew double[] { 0.2, 0.0, 0.12, 0.0, 0.16, 0.0, 0.12, 0.16, 0.0, 0.12, 0.0, 0.12 } ));\n filters.add(new SingleKeyProbabilityFilter(true, \"mixolydian\",\t\t\tnew double[] { 0.2, 0.0, 0.12, 0.0, 0.16, 0.12, 0.0, 0.16, 0.0, 0.12, 0.12, 0.0 } ));\n filters.add(new MultiKeyProbabilityFilter(false, \"aeolian\",\t\t\t\tnew double[][] {\n new double[] { 0.2, 0.0, 0.12, 0.16, 0.0, 0.12, 0.0, 0.16, 0.12, 0.0, 0.12, 0.0 },\n new double[] { 0.2, 0.0, 0.12, 0.16, 0.0, 0.12, 0.0, 0.16, 0.12, 0.0, 0.0, 0.12 } // harmonic\n } )); \n filters.add(new MultiKeyProbabilityFilter(false, \"dorian\",\t\t\t\tnew double[][] {\n new double[] { 0.2, 0.0, 0.12, 0.16, 0.0, 0.12, 0.0, 0.16, 0.0, 0.12, 0.12, 0.0 },\n new double[] { 0.2, 0.0, 0.12, 0.16, 0.0, 0.12, 0.0, 0.16, 0.0, 0.12, 0.0, 0.12 } // augmented\n } )); \n filters.add(new SingleKeyProbabilityFilter(false, \"phrygian\",\t\t\tnew double[] { 0.2, 0.12, 0.0, 0.16, 0.0, 0.12, 0.0, 0.16, 0.12, 0.0, 0.12, 0.0 } ));\n }",
"protected void analyzeMark() {\n \t\tLog.e(\"MYT\", \"Maxedmoisture was \"+maxedmoisturelevel+\"Shift Amount= \" + (100-maxedmoisturelevel)/100);\n \n \t\t//Rate the mark\n \t\trating = 0;\n \t\talpharating=\"F\";\n \t\tcheckinmessage=\"I have no ownership of anything\";\n \n \t\t\t\n \tif(maxedmoisturelevel>50){\n \t\trating = 1;\n \t\talpharating=\"D\";\n \t\tcheckinmessage=\"I am so lame.\\nMYT score = \"+alpharating;\n \t}\n \tif(maxedmoisturelevel>200){\n \t\trating = 2;\n \t\talpharating=\"C\";\n \t\tcheckinmessage=\"I wasn't really here, just pretending.\\nMYT score = \"+alpharating;\n \n \t}\n \tif(maxedmoisturelevel>600){\n \t\trating = 3;\n \t\talpharating=\"B\";\n \t\tcheckinmessage=\"Yeah, look for me, IM HERE!\\nMYT score = \"+alpharating;\n \n \t}\n \tif(maxedmoisturelevel>850){\n \t\trating = 4;\n \t\talpharating=\"A\";\n \t\tcheckinmessage=\"THIS IS MY PLACE! PHYSICAL CHECK-IN!\\nMYT score = \"+alpharating;\n \n \t}\n \tif(maxedmoisturelevel>950){\n \t\trating = 5;\n \t\talpharating=\"AA\";\n \t\tcheckinmessage=\"I AM THE SUPREME RULER HERE! CLAIMED SO HARD! THE DIGITAL AND PHSYICAL REALMS ARE MINE!\\nMYT score = \"+alpharating;\n \n \t}\n \t\t\n \tLog.e(\"MYT\", \"rating= \"+rating+\" \" +alpharating);\n \n \t\tif(rating>0){\n \t\tString latitude = tvLatitude.getText().toString();\n \t\tString longitude = tvLongitude.getText().toString();\n \n \t\tdouble manipulatedlat = Double.valueOf(latitude)+(100-maxedmoisturelevel)/100;\n \t\tdouble manipulatedlon = Double.valueOf(longitude)+(100.00-maxedmoisturelevel)/100.00;\n \t\tLog.e(\"MYT\", \"Trying to physically check into= \" + currentVenue);\n \t\tcheckinmessage=URLEncoder.encode(checkinmessage);\n \t\tCheckIntoVenue(manipulatedlat, manipulatedlon, rating, alpharating, checkinmessage, currentVenueID);\n \t\tToast.makeText(BaseActivity.this, URLDecoder.decode(checkinmessage)+\" @\"+currentVenue, Toast.LENGTH_LONG).show();\n \n \t\t}\n \t\telse{\n \t\t\tToast.makeText(BaseActivity.this, URLDecoder.decode(checkinmessage)+\" @\"+currentVenue, Toast.LENGTH_LONG).show();\n \t\t}\n \t\t\n \t\t\n \t\t\n \t\t//Reset all the values for next check in\n \t\trating=-1;\n \t\talpharating=\"NA\";\n \t\tmaxedmoisturelevel=-1;\n \t\t\n \t}",
"private void analyzeData(){\n input1 = ihd1.getOutput();\n input2 = ihd2.getOutput();\n\n output1 = (input1 > IHD_limit);\n output2 = (input2 > IHD_limit);\n }",
"boolean hasPaidOrganicSearchTermView();",
"@Override\n public boolean onSearchRequested() {\n return !isSearchResultView && super.onSearchRequested();\n }"
] | [
"0.539731",
"0.539549",
"0.53396",
"0.5281883",
"0.51247185",
"0.5117174",
"0.5080053",
"0.49722168",
"0.49616796",
"0.49151632",
"0.4909388",
"0.4831373",
"0.48100787",
"0.48080894",
"0.4781737",
"0.4763436",
"0.47620994",
"0.47586143",
"0.4748292",
"0.47443917",
"0.47259074",
"0.47106543",
"0.47004637",
"0.4691457",
"0.46772504",
"0.46761647",
"0.46755195",
"0.46680716",
"0.46679032",
"0.46677822",
"0.46618563",
"0.4655752",
"0.4651558",
"0.4651558",
"0.46424678",
"0.46408334",
"0.46356764",
"0.46317458",
"0.46220273",
"0.4613207",
"0.46040374",
"0.45989072",
"0.45982552",
"0.4597059",
"0.45844817",
"0.4572824",
"0.4569993",
"0.45682272",
"0.4567473",
"0.45655832",
"0.4552734",
"0.45482436",
"0.4546529",
"0.4533808",
"0.45314878",
"0.45255762",
"0.45238224",
"0.45119464",
"0.45090392",
"0.4507252",
"0.45034945",
"0.45021644",
"0.4497212",
"0.44888994",
"0.44851682",
"0.4470858",
"0.44535217",
"0.44379133",
"0.4436738",
"0.44286874",
"0.44257027",
"0.44208792",
"0.4417519",
"0.44138718",
"0.44086072",
"0.44030795",
"0.43983218",
"0.43977797",
"0.4394167",
"0.43891984",
"0.43887728",
"0.43790802",
"0.4375775",
"0.4365338",
"0.43584144",
"0.4357146",
"0.43414637",
"0.43331254",
"0.43329793",
"0.43323296",
"0.4332282",
"0.43274087",
"0.43181846",
"0.43177974",
"0.43177107",
"0.43173325",
"0.4315999",
"0.4309402",
"0.43085003",
"0.43063745",
"0.43031868"
] | 0.0 | -1 |
How should hits be scored. | public ScoringStrategy getScoringStrategy() {
return scoringStrategy;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected int hit() {\r\n\t\treturn hits;\r\n\t}",
"long getHits();",
"public int getTotalHits() { return totalHits; }",
"Map<String, Long> hits();",
"public HitStatus hit() {\r\n\t\tnumHits++;\r\n\t\tif (type.length() <= numHits) {\r\n\t\t\treturn HitStatus.SUNK;\r\n\t\t}\r\n\t\treturn HitStatus.HIT;\r\n\t}",
"public void setHits(Hits hits) {\n this.hits = hits;\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 }",
"protected long hit() {\n return numHits.incrementAndGet();\n }",
"boolean allHits();",
"public void countHits() {\nif (this.hitpoints <= 0) {\nreturn;\n}\nthis.hitpoints = this.hitpoints - 1;\n}",
"default void hit() {\n\t\tcount(1);\n\t}",
"void forceStats(long operations, long hits);",
"public void increaseNumHits() {\n\t\tthis.numHits += 1;\n\t}",
"private static void calculateTotalHitsRequired()\n {\n totalHitsRequired = 0;\n \n // add all the ship lengths together to get\n // the total number of hits required\n for (int length : SHIP_LENGTHS)\n {\n totalHitsRequired += length;\n }\n }",
"public void setHits(String hits) {\n\t\tthis.hits = hits;\n\t}",
"private static void updateHitrate(String s) {\n long _missCountSum = getCounterResult(\"missCount\");\n long _opCountSum = getCounterResult(\"opCount\");\n if (_opCountSum == 0L) {\n return;\n }\n double _hitRate = 100.0 - _missCountSum * 100.0 / _opCountSum;\n System.err.println(Thread.currentThread() + \" \" + s + \", opSum=\" + _opCountSum + \", missSum=\" + _missCountSum + \", hitRate=\" + _hitRate);\n setResult(\"hitrate\", _hitRate, \"percent\", AggregationPolicy.AVG);\n }",
"final int numHits() {\n return numHits;\n }",
"public int getSoftHits(){\n\t\treturn softhit;\n\t}",
"public int getHitsLeft(){\n return hitsLeft;\n }",
"public String getHits() {\n\t\treturn hits;\n\t}",
"public int getWrapperHits();",
"public int numHits() {\r\n\t\treturn hits;\r\n\t}",
"public void hitAlienScore() {\r\n //Add 5 to the score\r\n score += 5;\r\n System.out.println(\"Current Score = \"+score);\r\n }",
"int getScoresCount();",
"double getHitRate();",
"double getHitRate();",
"public interface Hit {\r\n\t\r\n\t/** @return ID of the search result (post ID, topic ID,...). */\r\n\tlong getResultId();\r\n\t\r\n\t/** @return Score of the search result. */\r\n\tfloat getScore();\r\n\r\n}",
"public Hits getHits() {\n return this.hits;\n }",
"protected abstract double relevantScore(Tweet tweet);",
"public double getHitsPercentual()\n\t{\n\t\t//Convert int to double values\n\t\tdouble doubleHits = hits;\n\t\tdouble doubleTotalProcessedStops = totalProcessedStops;\n\t\t\n\t\t//Hits percentual obtained by Jsprit algorithm\n\t\treturn Math.round(100 * (doubleHits / doubleTotalProcessedStops));\n\t}",
"protected int extraHits(Conveyer info, Combatant striker, Combatant victim) {\n return 0;\n }",
"public interface IHitQuery {\n long getHitCount();\n}",
"public long getTotalHits()\r\n\t{\r\n\t\treturn this.totalHits;\r\n\t}",
"public List<OWLObject> search(OWLObject queryObj) {\n\t\tList<OWLObject> hits = new ArrayList<OWLObject>(maxHits);\n\t\tSystem.out.println(\"gettings atts for \"+queryObj+\" -- \"+simEngine.comparisonProperty);\n\t\tSet<OWLObject> atts = simEngine.getAttributeClosureFor(queryObj);\n\t\tSystem.out.println(\"all atts: \"+atts.size());\n\t\tif (atts.size() == 0)\n\t\t\treturn hits;\n\t\t\n\t\t// only compare using significant atts;\n\t\t// we don't do the same test on candidates as these will be removed by the\n\t\t// intersection operation. they will have a small effect on the score, as\n\t\t// we don't divide by the union, but instead the sum of sizes\n\t\tatts = filterNonSignificantAttributes(atts);\n\t\tSystem.out.println(\"filtered atts: \"+atts.size());\n\n\t\t//bloomFilter = new BloomFilter<OWLObject>(0.05, atts.size());\n\t\t//bloomFilter.addAll(atts);\n\t\t\t\t\n\t\tSortedMap<Integer,Set<OWLObject>> scoreCandidateMap = new TreeMap<Integer,Set<OWLObject>>();\n\t\t\n\t\tfor (OWLObject candidate : getCandidates()) {\n\t\t\tif (candidate.equals(queryObj))\n\t\t\t\tcontinue;\n\t\t\tSet<OWLObject> iAtts = simEngine.getAttributeClosureFor(candidate);\n\t\t\t//Set<OWLObject> iAtts = simEngine.getGraph().getAncestors(candidate);\n\n\t\t\tif (iAtts.size() == 0)\n\t\t\t\tcontinue;\n\t\t\tint cAttsSize = iAtts.size();\n\t\n\t\t\tiAtts.retainAll(atts);\n\t\t\t//Collection<OWLObject> iAtts = bloomFilter.intersection(cAtts);\n\t\t\t\n\t\t\t// simJ, one-sided, scaled by 1000\n\t\t\t// negate to ensure largest first\n\t\t\t//Integer score = - (iAtts.size() * 1000 / cAttsSize);\n\t\t\t\n\t\t\t// this biases us towards genes with large numbers of annotations,\n\t\t\t// but it is better at finding the models that share all features\n\t\t\tInteger score = - iAtts.size();\n\t\t\tif (!scoreCandidateMap.containsKey(score)) \n\t\t\t\tscoreCandidateMap.put(score, new HashSet<OWLObject>());\n\t\t\tscoreCandidateMap.get(score).add(candidate);\n\t\t\treporter.report(this,\"query_candidate_overlap_total\",queryObj,candidate,iAtts.size(),cAttsSize);\n\t\t}\n\t\t\n\t\tint n = 0;\n\t\tfor (Set<OWLObject> cs : scoreCandidateMap.values()) {\n\t\t\tn += cs.size();\n\t\t\thits.addAll(cs);\n\t\t}\n\t\t\n\t\tn = 0;\n\t\tfor (OWLObject hit : hits) {\n\t\t\tn++;\n\t\t\treporter.report(this,\"query_hit_rank_threshold\",queryObj,hit,n,maxHits);\n\t\t}\n\t\tif (hits.size() > maxHits)\n\t\t\thits = hits.subList(0, maxHits);\n\t\t\n\n\n\t\treturn hits;\n\t}",
"public int getScore(){\n \treturn 100;\n }",
"public static void keywordHit()\r\n\t{\r\n\t\tkeywordHits++;\r\n\t}",
"@Override\n public int getScore() {\n return totalScore;\n }",
"public int getHomeScore();",
"@Override\n public double score(Document document) {\n Set<String> allDocTerms = documentsTerms.termsExtractedFromDocument(document).allTerms();\n\n //keeping only the query terms that are in the document\n Collection<String> relevantTerms = new LinkedHashSet<>(query);\n relevantTerms.retainAll(allDocTerms);\n\n //compute score using a sum formula on each query term\n int docLength = termsOccurences.get(document).totalNumberOfOccurences();\n double score = 0.0;\n for (String term : relevantTerms) {\n double termIDF = idf.weight(term);\n double termTF = tf.weight(term, document);\n\n score += termIDF * (termTF * (k1 + 1)) / (termTF + k1 * (1 - b + b * (docLength / averageDocLength)));\n }\n\n return score;\n }",
"int getScore();",
"private void scoring(NameInfo name1Info, NameInfo name2Info, int flag) {\n\t\tString name1 = name1Info.getName();\n\t\tString name2 = name2Info.getName();\n\t\tString type1 = name1Info.getType();\n\t\tString type2 = name2Info.getType();\n\t\tif (name1.length() == 0 || name2.length() == 0) {\n\t\t\tscore = 0.0f;\n\t\t\tscoreShingle = 0.0f;\n\t\t\treason = \"There is an empty name.\";\n\t\t\treturn;\n\t\t}\n\t\tswitch (flag) {\n\t\t\n\t\tcase 1: // PER\n\t\t\tscoreShingle = (float)LSHUtils.dice(name1, name2);\n\t\t\tfloat scorePER = getPERScore(name1Info, name2Info);\n\t\t\treason = \"Type: \" + name1Info.getType() + \". metric\";\n\t\t\tif (score < scorePER) {\n\t\t\t\tscore = scorePER;\n\t\t\t}\n\t\t\tbreak;\n\t\t\t\n\t\tcase 2: // LOC\n\t\t\tscoreShingle = (float)LSHUtils.dice(name1, name2);\n\t\t\tscore = shortMan.scoring(name1, name2);\n\t\t\treason = \"Type: \" + name1Info.getType() + \". metric; Scored by JaroWinkler metric with Shortcut.\";\n\t\t\tfloat countryLangScore = countryMan.scoring(name1, name2);\n\t\t\tif (score < countryLangScore) {\n\t\t\t\tscore = countryLangScore;\n\t\t\t\treason = \"Type: \" + name1Info.getType() + \". metric; Scored by JaroWinkler metric with Country-Language list.\";\n\t\t\t\tif (score < scoreShingle) {\n\t\t\t\t\tscore = scoreShingle;\n\t\t\t\t\treason = \"Type: \" + name1Info.getType() + \". metric; Scored by Shingling\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t\t\n\t\tcase 3: // ORG\n\t\t\tscoreShingle = (float)LSHUtils.dice(name1, name2);\n\t\t\tscore = acroMan.scoring(name1Info, name2Info);\n\t\t\treason = \"Type: \" + name1Info.getType() + \". metric; Scored by JaroWinkler metric with Acronym.\";\n\t\t\tif (scoreShingle > score) {\n\t\t\t\tscore = scoreShingle;\n\t\t\t\treason = \"Type: \" + name1Info.getType() + \". metric; Scored by Shingling\";\n\t\t\t}\n\t\t\tbreak;\n\t\t\t\n\t\tcase 4: // GEN\n\t\t\tscoreShingle = (float)LSHUtils.dice(name1, name2);\n\t\t\tfloat scorePer = getPERScore(name1Info, name2Info);\n\t\t\tfloat scoreShort = shortMan.scoring(name1, name2);\n\t\t\tfloat scoreCL = countryMan.scoring(name1, name2);\n\t\t\tfloat scoreAcro = acroMan.scoring(name1Info, name2Info);\n\t\t\tif (scoreAcro > score) {\n\t\t\t\tscore = scoreAcro;\n\t\t\t\treason = \"Type: \" + name1Info.getType() + \". metric; Scored by JaroWinkler metric with Acronym.\";\n\t\t\t}\n\t\t\tif (scoreCL > score) {\n\t\t\t\tscore = scoreCL;\n\t\t\t\treason = \"Type: \" + name1Info.getType() + \". metric; Scored by JaroWinkler metric with Country-Language list.\";\n\t\t\t}\n\t\t\tif (scoreShort > score) {\n\t\t\t\tscore = scoreShort;\n\t\t\t\treason = \"Type: \" + name1Info.getType() + \". metric; Scored by JaroWinkler metric with Shortcut.\";\n\t\t\t}\n\t\t\tif (scorePer > score) {\n\t\t\t\tscore = scorePer;\n\t\t\t\treason = \"Type: \" + name1Info.getType() + \". metric\";\n\t\t\t}\n\t\t\tif (scoreShingle > score) {\n\t\t\t\tscore = scoreShingle;\n\t\t\t\treason = \"Type: \" + name1Info.getType() + \". metric; Scored by Shingling\";\n\t\t\t}\n\t\t\tif (acroMan.isSpecificCase()) {\n\t\t\t\tscore = scoreAcro;\n\t\t\t\treason = \"Type: \" + name1Info.getType() + \". metric; Scored by JaroWinkler metric with Acronym.\";\n\t\t\t}\n\t\t\tbreak;\n\t\t\t\n\t\tcase 5: // Two different types\n\t\t\tif (type1.equals(\"PER\") || type2.equals(\"PER\")) {\n\t\t\t\tscore = 0.0f;\n\t\t\t\treason = \"Type: \" + type1 + \". and \" + type2 + \". cannot be compared\";\n\t\t\t} else if (type1.equals(\"LOC\") || type2.equals(\"LOC\")) {\n\t\t\t\tscore = shortMan.scoring(name1, name2);\n\t\t\t\treason = \"Type: LOC. metric; Scored by JaroWinkler metric with Shortcut.\";\n\t\t\t} else if (type1.equals(\"ORG\") || type2.equals(\"ORG\")) {\n\t\t\t\tfloat orgScore = acroMan.scoring(name1Info, name2Info);\n\t\t\t\tif (score < orgScore) {\n\t\t\t\t\tscore = orgScore;\n\t\t\t\t\treason = \"Type: ORG. metric; Scored by JaroWinkler metric with Acronym.\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tscore = 0.0f;\n\t\t\t\treason = \"Type: \" + type1 + \". and \" + type2 + \". cannot be compared\";\n\t\t\t}\n\t\t\tbreak;\n\t\t\t\n\t\tdefault:\n\t\t\tscore = 0.0f;\n\t\t\treason = \"#######SHOULD NOT HAPPEN#######\";\n\t\t}\n\t\tif (name1.equalsIgnoreCase(name2))\n\t\t\tscore = 1.0f;\n\t\tif (!name1Info.getType().equals(\"PER\") && !name2Info.getType().equals(\"PER\"))\n\t\t\thandleLargeRatio(name1, name2);\n\t}",
"float getScore();",
"float getScore();",
"protected final void calcScore()\n {\n\n m_score = SCORE_OTHER;\n\n if (null == m_targetString)\n calcTargetString();\n }",
"public int getHardHits(){\n\t\treturn hardhit;\n\t}",
"public interface Score {\n\t\t\n\t/**\n\t * For a given location, score all the local entities \n\t * Return a map representation of local entities and their scores\n\t * @param location\n\t * @return\n\t */\n\tpublic Map<String,Double> scoreLocalEntity(String location);\n}",
"protected abstract void calcScores();",
"@Override\n\tpublic void checkScore() {\n\t\t\n\t}",
"public int score(){\r\n\t\t\r\n\t\tint score = 0;\r\n\t\t\r\n\t\tif( this.isStrike() ) {\r\n\t\t\tif(this.getSubSequent() != null)\r\n\t\t\t\tscore += this.getSubSequent().score();\r\n\t\t}\r\n\t\t\r\n\t\tscore += this.firstThrow + this.secondThrow;\r\n\t\t\r\n\t\treturn score;\r\n\t\t\r\n\t}",
"public int getScore() { return score; }",
"public void increseHitCount() {\n\r\n\t}",
"public void getHitPercent(double hitPer) {\r\n\t\thitPercent = hitPer;\r\n\t}",
"@Override\n\tpublic double getTotalScore() {\n\t\treturn score;\n\t}",
"long getScore();",
"long getScore();",
"long getScore();",
"long getScore();",
"int hit();",
"public int getNumHits() {\n\t\treturn numHits;\n\t}",
"public void setHitsLeft(int hits){\n hitsLeft = hits;\n }",
"private Double calculateMatchScore(String query, ConceptMap matchedMapping) {\n return 10000d;\n }",
"public int totalScore() {\n return 0;\n }",
"int score();",
"int score();",
"@Override\n protected float score(BasicStats stats, float termFreq, float docLength) {\n double s = 0.75;\n\n long N = stats.getNumberOfDocuments();\n long df = stats.getDocFreq();\n float cwd = termFreq;\n float cwq = 1; //assume that the query term frequency is always one\n float n = docLength;\n float navg = stats.getAvgFieldLength();\n\n double p1 = (1+Math.log(1+Math.log(cwd)))/(1-s+s*n/navg);\n float ans = (float) (p1 * cwq * Math.log((N+1)/df));\n\n return ans;\n }",
"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}",
"@Override\n public int getScore() {\n return score;\n }",
"public void rightScored()\n\t{\n\t\tscoreR++;\n\t}",
"double calculateScore(String documentId);",
"public int getScore() {return score;}",
"public HashMap<Integer, Float> rescore(IndexSearcher searcher, TopDocs firstPassTopDocs, Query query, QueryRescoreContext ctx)\n throws IOException {\n ScoreDoc[] hits = firstPassTopDocs.scoreDocs.clone();\n Arrays.sort(hits, new Comparator<ScoreDoc>() {\n @Override\n public int compare(ScoreDoc a, ScoreDoc b) {\n return a.doc - b.doc;\n }\n });\n\n HashMap<Integer, Float> rescoreHits = new HashMap<Integer, Float>();\n List<LeafReaderContext> leaves = searcher.getIndexReader().leaves();\n\n Weight weight = searcher.createNormalizedWeight(query, true);\n\n // Now merge sort docIDs from hits, with reader's leaves:\n int hitUpto = 0;\n int readerUpto = -1;\n int endDoc = 0;\n int docBase = 0;\n boolean firstMatch = true;\n\n // Scorer returns results by document ID, when looping through, there is no Random Access so scorer.advance(int)\n // has to be the next ID in the TopDocs\n for(Scorer scorer = null; hitUpto < hits.length; ++hitUpto) {\n ScoreDoc hit = hits[hitUpto];\n int docID = hit.doc;\n\n LeafReaderContext readerContext = null;\n while (docID >= endDoc) {\n readerUpto++;\n readerContext = leaves.get(readerUpto);\n endDoc = readerContext.docBase + readerContext.reader().maxDoc();\n }\n\n if(readerContext != null) {\n // We advanced to another segment:\n docBase = readerContext.docBase;\n\n scorer = weight.scorer(readerContext);\n }\n\n if(scorer != null) {\n int targetDoc = docID - docBase;\n int actualDoc = scorer.docID();\n if(actualDoc < targetDoc) {\n actualDoc = scorer.iterator().advance(targetDoc);\n }\n\n if(actualDoc == targetDoc) {\n float score = scorer.score();\n\n if (firstMatch) {\n topScore = score;\n bottomScore = score;\n firstMatch = false;\n }\n\n if (topScore < score)\n topScore = score;\n if (bottomScore > score)\n bottomScore = score;\n\n // Query did match this doc:\n rescoreHits.put(docID, score);\n } else {\n // Query did not match this doc:\n assert actualDoc > targetDoc;\n }\n }\n }\n\n // Moved Arrays.sort() from Lucene engine into our local .combine() method to sort\n // after calculations are defined. This is to prevent sorting unnecessarily\n return rescoreHits;\n }",
"private int scoreCalc(HousingLocation h) {\n\t\tint score = 0;\n\t\tscore += managementScore*h.managementScore;\n\t\tscore += amenitiesScore*h.amenitiesScore;\n\t\tscore += locationScore*h.locationScore;\n\t\tscore += communityChillFactorScore*h.communityChillFactorScore;\n\t\t\n\t\treturn score;\n\t\t\n\t}",
"public static void incrementScore() {\n\t\tscore++;\n\t}",
"@Override\r\n public void hitEvent(Block beingHit, Ball hitter) {\n this.currentScore.increase(5);\r\n if (beingHit.getHitPoints() == 1) {\r\n this.currentScore.increase(10);\r\n }\r\n }",
"private void weeklyScores(RoutingContext context) {\n\t}",
"private void printingSearchResults() {\n HashMap<Integer, Double> resultsMap = new HashMap<>();\n for (DocCollector collector : resultsCollector) {\n if (resultsMap.containsKey(collector.getDocId())) {\n double score = resultsMap.get(collector.getDocId()) + collector.getTermScore();\n resultsMap.put(collector.getDocId(), score);\n } else {\n resultsMap.put(collector.getDocId(), collector.getTermScore());\n }\n }\n List<Map.Entry<Integer, Double>> list = new LinkedList<>(resultsMap.entrySet());\n Collections.sort(list, new Comparator<Map.Entry<Integer, Double>>() {\n public int compare(Map.Entry<Integer, Double> o1,\n Map.Entry<Integer, Double> o2) {\n return (o2.getValue()).compareTo(o1.getValue());\n }\n });\n if (list.isEmpty())\n System.out.println(\"no match\");\n else {\n DecimalFormat df = new DecimalFormat(\".##\");\n for (Map.Entry<Integer, Double> each : list)\n System.out.println(\"docId: \" + each.getKey() + \" score: \" + df.format(each.getValue()));\n }\n\n }",
"public HitCounter() {\n q = new ArrayDeque();\n map = new HashMap();\n PERIOD = 300;\n hits = 0;\n }",
"public int getScore ()\r\n {\r\n\treturn score;\r\n }",
"@Override\n public final void onHit(final K key) {\n if (!freqHitMap.containsKey(key)) {\n freqHitMap.put(key, 1);\n return;\n }\n\n // Add 1 to times used in map\n freqHitMap.put(key, freqHitMap.get(key) + 1);\n }",
"@Override\n public void hit(int atk) {\n hp = hp - atk;\n }",
"@Override\n public void computeSatisfaction() {\n\n }",
"public int getHits(int timestamp) {\n int count = 0;\n for(int i = 0; i < 300; i++){\n if(timestamp - times[i] < 300) count += hits[i];\n }\n return count;\n }",
"double getCritChance();",
"@Override\n\tpublic void printScore() {\n\n\t}",
"public void calcAvg(){\n\t\taverage = hits/atbat;\n\t\t\n\t}",
"public void setHitCount(int count) {\nthis.hitpoints = count;\n}",
"public void rankMatches();",
"@Override\r\n\tpublic double getScore() \r\n\t{\r\n\t\treturn this._totalScore;\r\n\t}",
"public void getHits(int newHits) {\r\n\t\thits = newHits;\r\n\t\t\r\n\t\t//set achievement number\r\n\t\tif(hits >=25 && hits<50) {\r\n\t\t\tachievement = 1;\r\n\t\t}\r\n\t\telse if(hits >=50 && hits<100) {\r\n\t\t\tachievement = 2;\r\n\t\t}\r\n\t\telse if(hits >=100 && hits<200) {\r\n\t\t\tachievement = 3;\r\n\t\t}\r\n\t\telse if(hits > 200) {\r\n\t\t\tachievement = 4;\r\n\t\t}\r\n\t}",
"long getCacheHits();",
"@Override\r\n public List<Score> scofindAll() {\n return userMapper.scofindAll();\r\n }",
"@Override\n\tpublic void inputScore() {\n\n\t}",
"@Override\n protected float score(BasicStats stats, float termFreq, float docLength) {\n float k1 = (float)1.2;\n float k2 = 750;\n float b = (float)0.75;\n float N = stats.getNumberOfDocuments();\n float df = stats.getDocFreq();\n float qtermFreq = 1;\n float score = (float)Math.log((N - df + 0.5)/df+0.5);\n score*=((k1+1)*termFreq)/(k1*(1-b+b*(docLength/stats.getAvgFieldLength()))+termFreq);\n score*=((k2+1)*qtermFreq)/(k2+qtermFreq);\n return score; }",
"public int getScore() {\n return getStat(score);\n }",
"@Override\r\n\tpublic double getScore() {\n\t\treturn score;\r\n\t}",
"Float getScore();",
"public int getTotalScore(){\r\n return totalScore;\r\n }",
"private void calculateStPointScore() {\n\t\tint total = 0;\n\t\tint maxAnswerSize = 0;\n\t\tfor (QueryInfo oneQ : this.maxQueries) {\n\t\t\ttotal += oneQ.getFrequency() * oneQ.getGapCount();\n\t\t\tint tempSize = oneQ.getSupport() * oneQ.getGapCount();\n\t\t\tif (tempSize > maxAnswerSize)\n\t\t\t\tmaxAnswerSize = tempSize;\n\t\t}\n\t\ttotal += maxAnswerSize;\n\t\tthis.stPointScore = total;\n\t}",
"@Override\n\t\t\tpublic double computeScore(Shop arg0, Shop arg1) {\n\t\t\t\treturn 0;\n\t\t\t}",
"@Override\n\t\t\tpublic double computeScore(Shop arg0, Shop arg1) {\n\t\t\t\treturn 0;\n\t\t\t}",
"public int getScore(){ return this.score; }"
] | [
"0.6999251",
"0.67569953",
"0.6539816",
"0.6167769",
"0.61538357",
"0.61092",
"0.6044094",
"0.6039419",
"0.6023338",
"0.6017192",
"0.59727335",
"0.5908428",
"0.59049845",
"0.58952886",
"0.58864164",
"0.58787787",
"0.58752066",
"0.58302796",
"0.58127",
"0.57961637",
"0.5795205",
"0.5758595",
"0.57565343",
"0.5753174",
"0.57453305",
"0.57453305",
"0.57389027",
"0.57341844",
"0.56762016",
"0.56598836",
"0.56457925",
"0.56339145",
"0.5627098",
"0.5616007",
"0.5612328",
"0.56043625",
"0.55712044",
"0.5564821",
"0.5561822",
"0.5556566",
"0.5553405",
"0.55493486",
"0.55493486",
"0.55258286",
"0.5502173",
"0.5500149",
"0.5499873",
"0.54855865",
"0.5483355",
"0.5482683",
"0.54798",
"0.54796255",
"0.54671323",
"0.5457323",
"0.5457323",
"0.5457323",
"0.5457323",
"0.5449188",
"0.54142624",
"0.5411147",
"0.54051614",
"0.5403922",
"0.53989327",
"0.53989327",
"0.5385246",
"0.5376637",
"0.53693724",
"0.5364211",
"0.5362785",
"0.5360626",
"0.53540057",
"0.53490275",
"0.53371775",
"0.5336266",
"0.53285253",
"0.5327161",
"0.53244704",
"0.53141296",
"0.5308785",
"0.5301871",
"0.529893",
"0.5295025",
"0.5293144",
"0.5291682",
"0.5290944",
"0.52878684",
"0.52859855",
"0.52784014",
"0.52768916",
"0.5258704",
"0.5252757",
"0.5246539",
"0.5243811",
"0.5241072",
"0.5234996",
"0.523469",
"0.52321",
"0.5228109",
"0.52226293",
"0.52226293",
"0.52190995"
] | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.